Skip to content

Commit ae3a1c7

Browse files
committed
Fixed Readme missing quotes
1 parent 56dcf16 commit ae3a1c7

File tree

2 files changed

+120
-13
lines changed

2 files changed

+120
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Use the [`create-interchain-app`](https://github.com/hyperweb-io/create-intercha
123123

124124
```sh
125125
cia --boilerplate telescope
126-
126+
```
127127

128128
Then, you'll navigate into `./your-project/packages/telescope` package for the next steps.
129129

packages/telescope/README.md

Lines changed: 119 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Use the [`create-interchain-app`](https://github.com/hyperweb-io/create-intercha
123123

124124
```sh
125125
cia --boilerplate telescope
126-
126+
```
127127

128128
Then, you'll navigate into `./your-project/packages/telescope` package for the next steps.
129129

@@ -212,6 +212,29 @@ Download with a config file:
212212
telescope download --config ./protod.config.json --out ./git-modules
213213
```
214214

215+
protod.config.json example:
216+
```json
217+
{
218+
"repos": [
219+
{ "owner": "cosmos", "repo": "cosmos-sdk", "branch": "release/v0.50.x" },
220+
{ "owner": "cosmos", "repo": "ibc-go" },
221+
],
222+
"protoDirMapping": {
223+
"gogo/protobuf/master": ".",
224+
"googleapis/googleapis/master": ".",
225+
"protocolbuffers/protobuf/main": "src"
226+
},
227+
"outDir": "protos",
228+
"ssh": true,
229+
"tempRepoDir": "git-modules",
230+
"targets": [
231+
"cosmos/**/*.proto",
232+
"cosmwasm/**/*.proto",
233+
"ibc/**/*.proto",
234+
]
235+
}
236+
```
237+
215238
Download from a specific repo:
216239
```sh
217240
telescope download --git-repo owner/repository --targets cosmos/auth/v1beta1/auth.proto
@@ -225,7 +248,97 @@ telescope transpile
225248

226249
Use customized telescope option:
227250
```sh
228-
telescope transpile --config your-config.json
251+
telescope transpile --config telescope-config.json
252+
```
253+
254+
telescope-config.json exmaple:
255+
```json
256+
{
257+
"protoDirs": [
258+
"./protos/"
259+
],
260+
"outPath": "./codegen/",
261+
"options": {
262+
"classesUseArrowFunctions": true,
263+
"env": "v-next",
264+
"useInterchainJs": true,
265+
"useSDKTypes": false,
266+
"prototypes": {
267+
"enableRegistryLoader": false,
268+
"enableMessageComposer": false,
269+
"enabled": true,
270+
"parser": {
271+
"keepCase": false
272+
},
273+
"methods": {
274+
"fromJSON": false,
275+
"toJSON": false,
276+
"encode": true,
277+
"decode": true,
278+
"fromPartial": true,
279+
"toAmino": true,
280+
"fromAmino": true,
281+
"fromProto": false,
282+
"toProto": false,
283+
"fromProtoMsg": false,
284+
"toProtoMsg": false,
285+
"toAminoMsg": true,
286+
"fromAminoMsg": true
287+
},
288+
"addTypeUrlToDecoders": false,
289+
"addTypeUrlToObjects": true,
290+
"addAminoTypeToObjects": true,
291+
"typingsFormat": {
292+
"duration": "duration",
293+
"timestamp": "date",
294+
"useExact": false,
295+
"useDeepPartial": true,
296+
"num64": "bigint",
297+
"customTypes": {
298+
"useCosmosSDKDec": true,
299+
"useEnhancedDecimal": false
300+
},
301+
"useTelescopeGeneratedType": true,
302+
"autoFixUndefinedEnumDefault": true
303+
}
304+
},
305+
"bundle": {
306+
"enabled": false
307+
},
308+
"stargateClients": {
309+
"enabled": false
310+
},
311+
"lcdClients": {
312+
"enabled": false
313+
},
314+
"rpcClients": {
315+
"enabled": false
316+
},
317+
"helperFunctions": {
318+
"enabled": true,
319+
"useGlobalDecoderRegistry": true,
320+
"hooks": {
321+
"react": true,
322+
"vue": false
323+
}
324+
},
325+
"interfaces": {
326+
"enabled": true,
327+
"useGlobalDecoderRegistry": true,
328+
"registerAllDecodersToGlobal": false,
329+
"useUnionTypes": true
330+
},
331+
"aminoEncoding": {
332+
"enabled": true,
333+
"useLegacyInlineEncoding": false,
334+
"disableMsgTypes": false,
335+
"useProtoOptionality": true,
336+
"customTypes": {
337+
"useCosmosSDKDec": true
338+
}
339+
}
340+
}
341+
}
229342
```
230343

231344
### CIA
@@ -1274,7 +1387,7 @@ The nameMappers object supports three service types: All, Query, and Msg. Each p
12741387
```js
12751388
{
12761389
"pattern": {
1277-
funcBody: (name: string) => string, // Function to transform the method name
1390+
funcBody: (ctx: AliasNameMappersContext) => string, // Function to transform the method name
12781391
hookPrefix?: string // Prefix for the hook function (default: "use")
12791392
}
12801393
}
@@ -1294,24 +1407,18 @@ const options: TelescopeOptions = {
12941407
nameMappers: {
12951408
All: {
12961409
"cosmos.gov.v1beta1.*Vote*": {
1297-
funcBody: (ctx: AliasNameMappersContext) => {
1298-
return `helper${ctx.name}`;
1299-
},
1410+
funcBody: (ctx) => `helper${ctx.name}`,
13001411
hookPrefix: "use",
13011412
},
13021413
},
13031414
Query: {
13041415
"cosmos.gov.v1beta1.*Deposits*": {
1305-
funcBody: (ctx: AliasNameMappersContext) => {
1306-
return `goOver${ctx.name}`;
1307-
},
1416+
funcBody: (ctx) => `goOver${ctx.name}`,
13081417
},
13091418
},
13101419
Msg: {
13111420
"cosmos.gov.v1beta1.*VoteWeighted*": {
1312-
funcBody: (ctx: AliasNameMappersContext) => {
1313-
return `lets${ctx.name}`;
1314-
},
1421+
funcBody: (ctx) => `lets${ctx.name}`,
13151422
hookPrefix: "useTx",
13161423
},
13171424
},

0 commit comments

Comments
 (0)