@hyperweb/telescope 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +242 -181
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Telescope 🔭
|
|
2
2
|
|
|
3
|
+
> ⚠️ **Important**: Please upgrade to `@hyperweb/telescope` to leverage new features like generating MCP servers and agents for AI-powered blockchain interactions!
|
|
4
|
+
|
|
3
5
|
<p align="center">
|
|
4
6
|
<img width="280" src="https://user-images.githubusercontent.com/545047/175660665-5cbde84b-0928-4e59-ab56-be6adb2f3a7e.png"/>
|
|
5
7
|
</p>
|
|
@@ -24,9 +26,9 @@
|
|
|
24
26
|
<img src="https://user-images.githubusercontent.com/545047/178129981-5a7d18ed-d2b5-4d85-b828-ca084d38501e.png"/>
|
|
25
27
|
</p>
|
|
26
28
|
|
|
27
|
-
Telescope
|
|
29
|
+
Telescope is a TypeScript Transpiler for Cosmos Protobufs. It generates strongly-typed TypeScript libraries for Cosmos blockchains, providing developers with type-safe interfaces to build applications. Think of Telescope as "Babel for the Cosmos" - simply point to your protobuf files and generate fully-typed libraries for building dApps.
|
|
28
30
|
|
|
29
|
-
The following blockchain libraries (generated by Telescope) are available via npm
|
|
31
|
+
The following blockchain libraries (generated by Telescope) are available via npm:
|
|
30
32
|
|
|
31
33
|
* [osmojs](https://www.npmjs.com/package/osmojs)
|
|
32
34
|
* [dydx](https://www.npmjs.com/package/@dydxprotocol/v4-client-js)
|
|
@@ -36,7 +38,7 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
36
38
|
* [injectivejs](https://www.npmjs.com/package/injectivejs)
|
|
37
39
|
* [quicksilverjs](https://www.npmjs.com/package/quicksilverjs)
|
|
38
40
|
|
|
39
|
-
🎥 [
|
|
41
|
+
🎥 [Check out our video course](https://cosmology.zone/learn/telescope) to learn how to use `telescope`!
|
|
40
42
|
|
|
41
43
|
## Table of contents
|
|
42
44
|
|
|
@@ -50,14 +52,16 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
50
52
|
- [Build](#build)
|
|
51
53
|
- [Publishing](#publishing)
|
|
52
54
|
- [Usage](#usage)
|
|
53
|
-
- [
|
|
55
|
+
- [Programmatic Usage](#programmatic-usage)
|
|
54
56
|
- [Options](#options)
|
|
57
|
+
- [General Options](#general-options)
|
|
55
58
|
- [Amino Encoding](#amino-encoding)
|
|
56
59
|
- [Implemented Interface Options](#implemented-interface-options)
|
|
57
60
|
- [Prototypes Options](#prototypes-options)
|
|
58
61
|
- [Prototypes Methods](#prototypes-methods)
|
|
59
62
|
- [Enums Options](#enums-options)
|
|
60
63
|
- [LCD Client Options](#lcd-client-options)
|
|
64
|
+
- [Aggregated LCD](#aggregated-lcd)
|
|
61
65
|
- [RPC Client Options](#rpc-client-options)
|
|
62
66
|
- [Helper Functions](#helper-functions)
|
|
63
67
|
- [Stargate Client Options](#stargate-client-options)
|
|
@@ -66,11 +70,12 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
66
70
|
- [Mobx](#mobx)
|
|
67
71
|
- [Pinia](#pinia)
|
|
68
72
|
- [Vue Query](#vue-query)
|
|
69
|
-
- [Typings and
|
|
73
|
+
- [Typings and Formatting](#typings-and-formatting)
|
|
70
74
|
- [Protobuf parser](#protobuf-parser)
|
|
71
75
|
- [Typescript Disabling](#typescript-disabling)
|
|
72
76
|
- [ESLint Disabling](#eslint-disabling)
|
|
73
77
|
- [Bundle](#bundle)
|
|
78
|
+
- [MCP Server](#mcp-server)
|
|
74
79
|
- [Output](#output)
|
|
75
80
|
- [Types](#types)
|
|
76
81
|
- [Timestamp](#timestamp)
|
|
@@ -81,7 +86,7 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
81
86
|
- [Creating Signers](#creating-signers)
|
|
82
87
|
- [Amino Signer](#amino-signer)
|
|
83
88
|
- [Proto Signer](#proto-signer)
|
|
84
|
-
- [Broadcasting
|
|
89
|
+
- [Broadcasting Messages](#broadcasting-messages)
|
|
85
90
|
- [LCD Clients](#lcd-clients)
|
|
86
91
|
- [LCD Clients Classes](#lcd-clients-classes)
|
|
87
92
|
- [RPC Clients](#rpc-clients)
|
|
@@ -90,7 +95,7 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
90
95
|
- [gRPC-gateway Client](#grpc-gateway-client)
|
|
91
96
|
- [RPC Client Classes](#rpc-client-classes)
|
|
92
97
|
- [Instant RPC Methods](#instant-rpc-methods)
|
|
93
|
-
- [Manually
|
|
98
|
+
- [Manually Registering Types](#manually-registering-types)
|
|
94
99
|
- [JSON Patch Protos](#json-patch-protos)
|
|
95
100
|
- [CosmWasm](#cosmwasm)
|
|
96
101
|
- [Helper Functions Configuration](#helper-functions-configuration)
|
|
@@ -109,7 +114,7 @@ The following blockchain libraries (generated by Telescope) are available via np
|
|
|
109
114
|
|
|
110
115
|
## Quickstart
|
|
111
116
|
|
|
112
|
-
Follow the instructions below to generate a new
|
|
117
|
+
Follow the instructions below to generate a new TypeScript package that you can publish to npm. You can also follow the video tutorial: https://youtu.be/iQf6p65fbdY
|
|
113
118
|
|
|
114
119
|
`create-interchain-app`
|
|
115
120
|
```sh
|
|
@@ -125,66 +130,69 @@ Use the [`create-interchain-app`](https://github.com/hyperweb-io/create-intercha
|
|
|
125
130
|
cia --boilerplate telescope
|
|
126
131
|
```
|
|
127
132
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
If some required options are missing, it will prompt to ask for the info.
|
|
133
|
+
Next, navigate to the `./your-project/packages/telescope` directory to continue.
|
|
131
134
|
|
|
132
|
-
|
|
135
|
+
If any required options are missing, the CLI will prompt you for the necessary information.
|
|
133
136
|
|
|
134
|
-
|
|
137
|
+
For detailed CLI `generate` commands, please refer to our documentation.
|
|
135
138
|
|
|
136
|
-
|
|
139
|
+
### Download Protos
|
|
137
140
|
|
|
138
|
-
You can
|
|
141
|
+
You can download proto files using the `download-protos` command provided in the boilerplate:
|
|
139
142
|
|
|
140
143
|
```sh
|
|
141
144
|
yarn download-protos
|
|
142
145
|
```
|
|
143
146
|
|
|
144
|
-
|
|
147
|
+
After running this command, you'll see:
|
|
148
|
+
- Cloned repositories in `./git-modules`
|
|
149
|
+
- Proto files in `./protos`
|
|
145
150
|
|
|
146
|
-
For detailed
|
|
151
|
+
These proto files are downloaded based on your configuration. For detailed CLI `download` commands, please refer to our documentation.
|
|
147
152
|
|
|
148
153
|
### Transpile
|
|
149
154
|
|
|
150
|
-
To
|
|
155
|
+
To generate TypeScript files for your chain, run the `yarn codegen` command:
|
|
151
156
|
|
|
152
|
-
```
|
|
157
|
+
```sh
|
|
153
158
|
yarn codegen
|
|
154
159
|
```
|
|
155
160
|
|
|
156
161
|
### Build
|
|
157
162
|
|
|
158
|
-
Finally,
|
|
163
|
+
Finally, build your package to generate JavaScript files and TypeScript definitions:
|
|
159
164
|
|
|
160
165
|
```sh
|
|
166
|
+
yarn install
|
|
161
167
|
yarn build
|
|
162
168
|
```
|
|
163
169
|
|
|
164
170
|
### Publishing
|
|
165
171
|
|
|
166
|
-
|
|
172
|
+
Your generated code is now in the `./src` folder, ready for publishing. If you used the `create-interchain-app` boilerplate, use `lerna` to publish (refer to the boilerplate's README for detailed instructions). Alternatively, run `npm publish` from your repository.
|
|
167
173
|
|
|
168
174
|
# Usage
|
|
169
175
|
|
|
170
176
|
## Advanced Install
|
|
171
|
-
|
|
177
|
+
|
|
178
|
+
The following sections describe various methods to install and use Telescope.
|
|
172
179
|
|
|
173
180
|
### Telescope CLI
|
|
174
|
-
|
|
181
|
+
|
|
182
|
+
Install Telescope globally:
|
|
175
183
|
```sh
|
|
176
184
|
npm install -g @hyperweb/telescope
|
|
177
185
|
```
|
|
178
|
-
The
|
|
186
|
+
The workflow consists of three steps: generate, download, and transpile.
|
|
179
187
|
|
|
180
|
-
1.Generate a package with the
|
|
188
|
+
#### 1. Generate a package with the Telescope CLI
|
|
181
189
|
|
|
182
|
-
Use
|
|
190
|
+
Use the interactive prompt:
|
|
183
191
|
```sh
|
|
184
192
|
telescope generate
|
|
185
193
|
```
|
|
186
194
|
|
|
187
|
-
Or
|
|
195
|
+
Or use command-line options for non-interactive setup:
|
|
188
196
|
```sh
|
|
189
197
|
telescope generate --access public --userfullname "Your Name" --useremail "your@email.com" --module-desc "Your module description" --username "your-username" --license MIT --module-name "your-module" --chain-name cosmos --use-npm-scoped
|
|
190
198
|
```
|
|
@@ -200,7 +208,7 @@ Available options:
|
|
|
200
208
|
- `--use-npm-scoped`: Use npm scoped package (only works with `--access public`)
|
|
201
209
|
- `--license`: License type
|
|
202
210
|
|
|
203
|
-
2.Download protocol buffer files
|
|
211
|
+
#### 2. Download protocol buffer files
|
|
204
212
|
```sh
|
|
205
213
|
telescope download
|
|
206
214
|
```
|
|
@@ -235,23 +243,24 @@ protod.config.json example:
|
|
|
235
243
|
}
|
|
236
244
|
```
|
|
237
245
|
|
|
238
|
-
Download from a specific
|
|
246
|
+
Download from a specific repository:
|
|
239
247
|
```sh
|
|
240
248
|
telescope download --git-repo owner/repository --targets cosmos/auth/v1beta1/auth.proto
|
|
241
249
|
```
|
|
242
250
|
|
|
243
|
-
3. Transpile (Generate TypeScript code from proto files)
|
|
244
|
-
|
|
251
|
+
#### 3. Transpile (Generate TypeScript code from proto files)
|
|
252
|
+
|
|
253
|
+
Use default Telescope options:
|
|
245
254
|
```sh
|
|
246
255
|
telescope transpile
|
|
247
256
|
```
|
|
248
257
|
|
|
249
|
-
Use
|
|
258
|
+
Use a custom configuration file:
|
|
250
259
|
```sh
|
|
251
260
|
telescope transpile --config telescope-config.json
|
|
252
261
|
```
|
|
253
262
|
|
|
254
|
-
telescope-config.json
|
|
263
|
+
Example `telescope-config.json`:
|
|
255
264
|
```json
|
|
256
265
|
{
|
|
257
266
|
"protoDirs": [
|
|
@@ -341,12 +350,14 @@ telescope-config.json exmaple:
|
|
|
341
350
|
}
|
|
342
351
|
```
|
|
343
352
|
|
|
344
|
-
### CIA
|
|
345
|
-
Please follow the video: https://youtu.be/iQf6p65fbdY
|
|
346
|
-
Or [Go to Quickstart](#quickstart)
|
|
353
|
+
### Create Interchain App (CIA)
|
|
347
354
|
|
|
348
|
-
|
|
349
|
-
|
|
355
|
+
Please follow the video tutorial: https://youtu.be/iQf6p65fbdY
|
|
356
|
+
Or see the [Quickstart](#quickstart) section.
|
|
357
|
+
|
|
358
|
+
### Create Cosmos App (CCA)
|
|
359
|
+
|
|
360
|
+
First, install `create-cosmos-app`:
|
|
350
361
|
|
|
351
362
|
```sh
|
|
352
363
|
npm install -g create-cosmos-app
|
|
@@ -358,35 +369,35 @@ Use the [`create-cosmos-app`](https://github.com/hyperweb-io/create-cosmos-app/)
|
|
|
358
369
|
cca --boilerplate telescope
|
|
359
370
|
```
|
|
360
371
|
|
|
361
|
-
|
|
372
|
+
Next, navigate to the `./your-project/packages/telescope` directory.
|
|
362
373
|
|
|
363
|
-
Install
|
|
374
|
+
Install dependencies and download the proto files you need:
|
|
364
375
|
```sh
|
|
365
376
|
yarn install
|
|
366
377
|
telescope download --config ./your.config.json
|
|
367
378
|
```
|
|
368
379
|
|
|
369
|
-
|
|
380
|
+
Generate TypeScript files for your chain:
|
|
370
381
|
|
|
371
382
|
```sh
|
|
372
383
|
yarn codegen
|
|
373
384
|
```
|
|
374
385
|
|
|
375
|
-
### Manual
|
|
376
|
-
If you want to use telescope in your own project.
|
|
386
|
+
### Manual Install
|
|
377
387
|
|
|
378
|
-
|
|
388
|
+
To use Telescope in an existing project, run the following command in your project directory:
|
|
379
389
|
```sh
|
|
380
390
|
yarn add --dev @hyperweb/telescope
|
|
381
391
|
```
|
|
382
|
-
|
|
392
|
+
Also install the required helpers and CosmJS [dependencies listed here](#dependencies).
|
|
383
393
|
|
|
384
|
-
We
|
|
394
|
+
We recommend using [Programmatic Usage](#programmatic-usage) for better integration.
|
|
385
395
|
|
|
386
|
-
You can also use [
|
|
387
|
-
|
|
396
|
+
You can also use the [Telescope CLI](#telescope-cli). When using CLI commands within your project, prefix them with `npx` or `yarn`. For example:
|
|
397
|
+
- `yarn telescope generate`
|
|
398
|
+
- `npx telescope download`
|
|
388
399
|
|
|
389
|
-
###
|
|
400
|
+
### Programmatic Usage
|
|
390
401
|
|
|
391
402
|
First add telescope to your `devDependencies`:
|
|
392
403
|
|
|
@@ -394,9 +405,9 @@ First add telescope to your `devDependencies`:
|
|
|
394
405
|
yarn add --dev @hyperweb/telescope
|
|
395
406
|
```
|
|
396
407
|
|
|
397
|
-
Install helpers and
|
|
408
|
+
Install the required helpers and CosmJS [dependencies listed here](#dependencies).
|
|
398
409
|
|
|
399
|
-
Download
|
|
410
|
+
#### Download Command Example
|
|
400
411
|
```js
|
|
401
412
|
import downloadProtos from '@hyperweb/telescope/main/commands/download'
|
|
402
413
|
|
|
@@ -428,7 +439,7 @@ downloadProtos(config)
|
|
|
428
439
|
});
|
|
429
440
|
```
|
|
430
441
|
|
|
431
|
-
Transpile
|
|
442
|
+
#### Transpile Command Example
|
|
432
443
|
```js
|
|
433
444
|
import { join } from 'path';
|
|
434
445
|
import telescope from '@hyperweb/telescope';
|
|
@@ -487,108 +498,137 @@ telescope({
|
|
|
487
498
|
|
|
488
499
|
## Options
|
|
489
500
|
|
|
501
|
+
### General Options
|
|
502
|
+
|
|
503
|
+
| option | description | defaults |
|
|
504
|
+
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
505
|
+
| `useInterchainJs` | Use InterchainJS for signing clients instead of CosmJS | `false` |
|
|
506
|
+
| `removeUnusedImports` | Remove unused imports from generated files | `true` |
|
|
507
|
+
| `classesUseArrowFunctions` | Use arrow functions for class methods | `false` |
|
|
508
|
+
| `useSDKTypes` | Use Cosmos SDK types (like Dec) instead of native types | `true` |
|
|
509
|
+
| `includeExternalHelpers` | Include external helper functions | `false` |
|
|
510
|
+
| `restoreImportExtension` | Restore extensions of imported paths (e.g., '.js'). null means no extension | `null` |
|
|
511
|
+
| `readme.enabled` | Generate README files | `false` |
|
|
512
|
+
| `logLevel` | Logging level (0=None, 1=Info, 2=Warn, 3=Error, 4=Debug) | `0` |
|
|
513
|
+
|
|
490
514
|
### Amino Encoding
|
|
491
515
|
|
|
492
516
|
| option | description | defaults |
|
|
493
517
|
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
494
|
-
| `aminoEncoding.enabled` |
|
|
495
|
-
| `aminoEncoding.omitEmptyTags`
|
|
496
|
-
| `aminoEncoding.
|
|
497
|
-
| `aminoEncoding.
|
|
498
|
-
| `aminoEncoding.
|
|
499
|
-
| `aminoEncoding.
|
|
500
|
-
| `aminoEncoding.
|
|
501
|
-
| `aminoEncoding.
|
|
502
|
-
| `aminoEncoding.
|
|
503
|
-
| `aminoEncoding.legacy.
|
|
518
|
+
| `aminoEncoding.enabled` | Generate amino types and amino converters | `true` |
|
|
519
|
+
| `aminoEncoding.omitEmptyTags` | Array of strings that determines whether a field should be omitted when serialized to JSON. If the array includes "omitempty", any field with the "omitempty" option in either gogoproto.jsontag or cosmos_proto.json_tag will be omitted. If the array includes "dont_omitempty", the field will be omitted or not based on the value of "(amino.dont_omitempty)": if it's null or false, the field will be omitted; if it's true, the field will not be omitted. | `["omitempty", "dont_omitempty"]` |
|
|
520
|
+
| `aminoEncoding.useProtoOptionality` | Use proto optionality for determining required fields | `false` |
|
|
521
|
+
| `aminoEncoding.disableMsgTypes` | Disable generating AminoMsg types | `false` |
|
|
522
|
+
| `aminoEncoding.casingFn` | Set the amino-casing function for a project | `snake()` |
|
|
523
|
+
| `aminoEncoding.exceptions` | Set specific aminoType name exceptions | see code |
|
|
524
|
+
| `aminoEncoding.typeUrlToAmino` | Create functions for aminoType name exceptions | `undefined`|
|
|
525
|
+
| `aminoEncoding.useLegacyInlineEncoding` | @deprecated. Use legacy inline encoding instead of v2 recursive encoding | `false`|
|
|
526
|
+
| `aminoEncoding.useRecursiveV2encoding` | This option has been removed. See `useLegacyInlineEncoding` instead. | |
|
|
527
|
+
| `aminoEncoding.legacy.useNullHandling` | Handle null cases when generating legacy amino converters (those in tx.amino.ts) | |
|
|
528
|
+
| `aminoEncoding.legacy.useOmitEmpty` | Handle omit empty behavior when generating legacy amino converters (those in tx.amino.ts) | |
|
|
504
529
|
|
|
505
530
|
### Implemented Interface Options
|
|
506
531
|
|
|
507
532
|
| option | description | defaults |
|
|
508
533
|
| ----------------------------------------- | -------------------------------------------------------------- | ---------- |
|
|
509
|
-
| `interfaces.enabled` |
|
|
510
|
-
| `interfaces.useGlobalDecoderRegistry`
|
|
511
|
-
| `interfaces.
|
|
512
|
-
| `interfaces.
|
|
513
|
-
| `interfaces.
|
|
514
|
-
| `interfaces.
|
|
534
|
+
| `interfaces.enabled` | Enable converters between Any type and specific implemented interfaces | `true` |
|
|
535
|
+
| `interfaces.useGlobalDecoderRegistry` | Enable GlobalDecoderRegistry and related functions. Highly recommended when dealing with fields with 'accepted_interface' option. See 'packages/telescope/__tests__/impl-interfaces.test.ts' for usage. | `false` |
|
|
536
|
+
| `interfaces.registerAllDecodersToGlobal` | Automatically register all decoders to the global registry | `true` |
|
|
537
|
+
| `interfaces.useUseInterfacesParams` | Add `useInterfaces` argument to `decode` and `toAmino` functions | `false` |
|
|
538
|
+
| `interfaces.useByDefault` | Use interface decoders by default (default for `useInterfaces` argument to `decode` and `toAmino` functions) | `true` |
|
|
539
|
+
| `interfaces.useByDefaultRpc` | Use interface decoders by default in RPC clients | `true` |
|
|
540
|
+
| `interfaces.useUnionTypes` | Generate Any type as union types (TextProposal \| RegisterIncentiveProposal) instead of intersection types (TextProposal & RegisterIncentiveProposal) | `false` |
|
|
515
541
|
|
|
516
542
|
### Prototypes Options
|
|
517
543
|
|
|
518
544
|
| option | description | defaults |
|
|
519
545
|
| ----------------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
|
|
520
|
-
| `prototypes.enabled` |
|
|
521
|
-
| `prototypes.includePackageVar` |
|
|
522
|
-
| `prototypes.includes.packages` |
|
|
523
|
-
| `prototypes.includes.protos` |
|
|
524
|
-
| `prototypes.excluded.packages` |
|
|
525
|
-
| `prototypes.excluded.protos` |
|
|
526
|
-
| `prototypes.excluded.hardProtos`
|
|
527
|
-
| `prototypes.fieldDefaultIsOptional` |
|
|
528
|
-
| `prototypes.useOptionalNullable` |
|
|
529
|
-
| `prototypes.allowUndefinedTypes` |
|
|
530
|
-
| `prototypes.allowEncodeDefaultScalars`
|
|
531
|
-
| `prototypes.isScalarDefaultToNullable`
|
|
532
|
-
| `prototypes.enforceNullCheck`
|
|
533
|
-
| `prototypes.optionalQueryParams` |
|
|
534
|
-
| `prototypes.optionalPageRequests` |
|
|
535
|
-
| `prototypes.addTypeUrlToDecoders` |
|
|
536
|
-
| `prototypes.addAminoTypeToObjects`
|
|
537
|
-
| `prototypes.addTypeUrlToObjects`
|
|
538
|
-
| `prototypes.
|
|
539
|
-
| `prototypes.
|
|
540
|
-
| `prototypes.
|
|
546
|
+
| `prototypes.enabled` | Enable generation of proto encoding methods | `true` |
|
|
547
|
+
| `prototypes.includePackageVar` | Export a `protoPackage` variable to indicate package name | `false` |
|
|
548
|
+
| `prototypes.includes.packages` | Include a set of packages during transpilation (if a package meets both include and exclude, it will be excluded) | `undefined` |
|
|
549
|
+
| `prototypes.includes.protos` | Include a set of proto files during transpilation (if a proto meets both include and exclude, it will be excluded) | `undefined` |
|
|
550
|
+
| `prototypes.excluded.packages` | Exclude a set of packages from transpilation | `undefined` |
|
|
551
|
+
| `prototypes.excluded.protos` | Try to exclude a set of proto files from transpilation. If files in the list are dependencies to other files, they will still be transpiled. | `undefined` |
|
|
552
|
+
| `prototypes.excluded.hardProtos` | Exclude a set of proto files from transpilation. Files in this list will be excluded regardless of dependencies. | `undefined` |
|
|
553
|
+
| `prototypes.fieldDefaultIsOptional` | Set default optionality of fields | `false` |
|
|
554
|
+
| `prototypes.useOptionalNullable` | Use `(gogoproto.nullable)` values in determining optionality | `true` |
|
|
555
|
+
| `prototypes.allowUndefinedTypes` | Allow `Type`s to be `undefined` | `false` |
|
|
556
|
+
| `prototypes.allowEncodeDefaultScalars` | Allow encoders to encode default values of scalar types (e.g., empty string, 0, or false) | `false` |
|
|
557
|
+
| `prototypes.isScalarDefaultToNullable` | Determine whether scalar types are nullable by default when gogoproto.nullable is not specified. If true, scalar types will be nullable; if false, they will be required | `false` |
|
|
558
|
+
| `prototypes.enforceNullCheck` | Enforce checking that required scalar fields are not null or undefined during encoding | `false` |
|
|
559
|
+
| `prototypes.optionalQueryParams` | Make queryParams optional | `false` |
|
|
560
|
+
| `prototypes.optionalPageRequests` | Make `PageRequest` fields optional | `false` |
|
|
561
|
+
| `prototypes.addTypeUrlToDecoders` | Add $typeUrl field to generated interfaces | `true` |
|
|
562
|
+
| `prototypes.addAminoTypeToObjects` | Add aminoType field to generated Decoders | `false` |
|
|
563
|
+
| `prototypes.addTypeUrlToObjects` | Add typeUrl field to generated Decoders | `true` |
|
|
564
|
+
| `prototypes.strictNullCheckForPrototypeMethods` | Enable strict null checks for prototype methods | `false` |
|
|
565
|
+
| `prototypes.paginationDefaultFromPartial` | Set default values for pagination in fromPartial methods | `false` |
|
|
566
|
+
| `prototypes.enableRegistryLoader` | Generate Registry loader in *.registry.ts files | `true` |
|
|
567
|
+
| `prototypes.enableMessageComposer` | Generate MessageComposer in *.registry.ts files | `true` |
|
|
568
|
+
| `prototypes.patch` | Object mapping filenames to an array of `Operation` to be applied as patches to proto files during generation. See [JSON Patch Protos](#json-patch-protos) | `undefined` |
|
|
541
569
|
|
|
542
570
|
### Prototypes Methods
|
|
543
571
|
|
|
544
572
|
| option | description | defaults|
|
|
545
573
|
| ---------------------------------- | ----------------------------------------------------------------- | ------- |
|
|
546
|
-
| `prototypes.methods.encode` |
|
|
547
|
-
| `prototypes.methods.decode` |
|
|
548
|
-
| `prototypes.methods.fromJSON` |
|
|
549
|
-
| `prototypes.methods.toJSON` |
|
|
550
|
-
| `prototypes.methods.fromPartial` |
|
|
551
|
-
| `prototypes.methods.fromSDK` |
|
|
552
|
-
| `prototypes.methods.toSDK` |
|
|
574
|
+
| `prototypes.methods.encode` | Enable `encode` method on proto objects | `true` |
|
|
575
|
+
| `prototypes.methods.decode` | Enable `decode` method on proto objects | `true` |
|
|
576
|
+
| `prototypes.methods.fromJSON` | Enable `fromJSON` method on proto objects | `true` |
|
|
577
|
+
| `prototypes.methods.toJSON` | Enable `toJSON` method on proto objects | `true` |
|
|
578
|
+
| `prototypes.methods.fromPartial` | Enable `fromPartial` method on proto objects | `true` |
|
|
579
|
+
| `prototypes.methods.fromSDK` | Enable `fromSDK` method on proto objects | `false` |
|
|
580
|
+
| `prototypes.methods.toSDK` | Enable `toSDK` method on proto objects | `false` |
|
|
553
581
|
|
|
554
582
|
### Enums Options
|
|
555
583
|
|
|
556
584
|
| option | description | defaults |
|
|
557
585
|
| ------------------------------------- | --------------------------------------------------------------- | ---------- |
|
|
558
|
-
| `enums.useCustomNames` |
|
|
586
|
+
| `enums.useCustomNames` | Enable usage of custom names for enums if specified through proto options or annotations, allowing for more descriptive or project-specific naming conventions | `false` |
|
|
559
587
|
|
|
560
588
|
|
|
561
589
|
### LCD Client Options
|
|
562
590
|
|
|
563
591
|
| option | description | defaults |
|
|
564
592
|
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
565
|
-
| `lcdClients.enabled` |
|
|
566
|
-
| `lcdClients.bundle` |
|
|
567
|
-
| `lcdClients.scoped` |
|
|
568
|
-
| `lcdClients.scopedIsExclusive` |
|
|
593
|
+
| `lcdClients.enabled` | Generate LCD clients that can query proto `Query` messages | `true` |
|
|
594
|
+
| `lcdClients.bundle` | Generate factory bundle aggregate of all LCD Clients | `true` |
|
|
595
|
+
| `lcdClients.scoped` | Generate factory of scoped LCD Clients | `undefined`|
|
|
596
|
+
| `lcdClients.scopedIsExclusive` | Allow both scoped bundles and all RPC Clients | `true` |
|
|
569
597
|
|
|
570
598
|
See [LCD Clients](#lcd-clients) for more info.
|
|
571
599
|
|
|
600
|
+
### Aggregated LCD
|
|
601
|
+
|
|
602
|
+
| option | description | defaults |
|
|
603
|
+
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
604
|
+
| `aggregatedLCD.dir` | Directory to place aggregated LCD client file | `undefined`|
|
|
605
|
+
| `aggregatedLCD.filename` | Filename for aggregated LCD client | `undefined`|
|
|
606
|
+
| `aggregatedLCD.packages` | Packages to include in aggregated LCD client | `[]` |
|
|
607
|
+
| `aggregatedLCD.protos` | Proto files to include in aggregated LCD client | `[]` |
|
|
608
|
+
| `aggregatedLCD.addToBundle` | Add aggregated LCD client to bundle | `false` |
|
|
609
|
+
|
|
572
610
|
### RPC Client Options
|
|
573
611
|
|
|
574
612
|
| option | description | defaults |
|
|
575
613
|
| ------------------------------ | ---------------------------------------------------------------------- | ----------------------------- |
|
|
576
|
-
| `rpcClients.type` |
|
|
577
|
-
| `rpcClients.enabled` |
|
|
578
|
-
| `rpcClients.bundle` |
|
|
579
|
-
| `rpcClients.
|
|
580
|
-
| `rpcClients.
|
|
581
|
-
| `rpcClients.
|
|
582
|
-
| `rpcClients.
|
|
583
|
-
| `rpcClients.
|
|
584
|
-
| `rpcClients.
|
|
585
|
-
| `rpcClients.
|
|
586
|
-
| `rpcClients.
|
|
587
|
-
|
|
614
|
+
| `rpcClients.type` | Generate this type of RPC client (`tendermint`, `gRPC-web`, `gRPC`)| `tendermint` |
|
|
615
|
+
| `rpcClients.enabled` | Generate RPC clients that can interact with proto messages | `true` |
|
|
616
|
+
| `rpcClients.bundle` | Generate factory bundle aggregate of all RPC Clients | `true` |
|
|
617
|
+
| `rpcClients.inline` | Inline all RPC client methods into a single file | `false` |
|
|
618
|
+
| `rpcClients.extensions` | Enable extensions for RPC clients | `true` |
|
|
619
|
+
| `rpcClients.camelCase` | Use camel-case for RPC methods when generating RPC clients | `true` |
|
|
620
|
+
| `rpcClients.scoped` | Generate factory of scoped RPC Clients | `undefined` |
|
|
621
|
+
| `rpcClients.scopedIsExclusive` | Allow both scoped bundles and all RPC Clients | `true` |
|
|
622
|
+
| `rpcClients.enabledServices` | Which services to enable | [`Msg`,`Query`,`Service`] |
|
|
623
|
+
| `rpcClients.instantOps` | Generate instant RPC operations in the file `service-ops.ts` under root folder, which contains customized classes having selected RPC methods | `undefined` |
|
|
624
|
+
| `rpcClients.useConnectComet` | Use connectComet function to get a tendermint client | `undefined` |
|
|
625
|
+
| `rpcClients.useMakeClient` | Allow user to pass a query client resolver to create query client in createRPCQueryClient function | `undefined` |
|
|
626
|
+
| `rpcClients.serviceImplement` | Assign implement type of RPC methods, `Query` or `Tx`, by setting patterns under service types | `undefined` |
|
|
627
|
+
| `rpcClients.clientStyle.useUpdatedClientStyle` | The default value is `false`, which sets the generated client to use the legacy style. Setting it to `true` applies the updated style and activates the remaining options in clientStyle. | `false`
|
|
588
628
|
| `rpcClients.clientStyle.type` | A string array containing possible values: `all-client`, `sdk-module-client`, and `custom-client`. The value `all-client` generates an all-module-client file. The value `sdk-module-client` generates a client for the module specified by the `sdkModuleClientOption`. The value `custom-client` generates a customized client as specified by `customClientOption` | `undefined`
|
|
589
|
-
`rpcClients.clientStyle.customClientOption.name` |
|
|
590
|
-
| `rpcClients.clientStyle.customClientOption.fileName` |
|
|
591
|
-
| `rpcClients.clientStyle.customClientOption.include.patterns` |
|
|
629
|
+
| `rpcClients.clientStyle.customClientOption.name` | Assign the client name like `{name}AminoConverters`, `get{name}SigningClient` etc | `undefined`
|
|
630
|
+
| `rpcClients.clientStyle.customClientOption.fileName` | Assign the file name of generated client in root directory | `undefined`
|
|
631
|
+
| `rpcClients.clientStyle.customClientOption.include.patterns` | Determine which proto files will be imported for the current client such as `cosmos.gov.v1beta1.**` | `undefined`
|
|
592
632
|
|
|
593
633
|
See [RPC Clients](#rpc-clients) for more info.
|
|
594
634
|
|
|
@@ -598,6 +638,7 @@ See [RPC Clients](#rpc-clients) for more info.
|
|
|
598
638
|
| Option | Description | Defaults |
|
|
599
639
|
| --------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
600
640
|
| `helperFunctions.enabled` | Enable the generation of helper function files `.func.ts` | `false` |
|
|
641
|
+
| `helperFunctions.useGlobalDecoderRegistry` | Use global decoder registry in helper functions | `false` |
|
|
601
642
|
| `helperFunctions.hooks` | Generates hooks selected alongside helper functions | `{ react: false, vue: false }` |
|
|
602
643
|
| `helperFunctions.include.serviceTypes`| Specifies which types of services to include (`Query`, `Msg`). `undefined` includes all types. | `undefined` |
|
|
603
644
|
| `helperFunctions.include.patterns` | Array of glob patterns patterns (e.g., `"**"`, `"cosmos.bank.v1beta1.bala*"`, etc.) to match specific proto services. | `undefined` |
|
|
@@ -615,8 +656,8 @@ See [Helper Functions Configuration](#helper-functions-configuration) for more i
|
|
|
615
656
|
|
|
616
657
|
| option | description | defaults |
|
|
617
658
|
| -------------------------------------------- | -------------------------------------------------------------- | ---------|
|
|
618
|
-
| `stargateClients.includeCosmosDefaultTypes` |
|
|
619
|
-
| `stargateClients.addGetTxRpc` |
|
|
659
|
+
| `stargateClients.includeCosmosDefaultTypes` | Include the CosmJS defaults with stargate clients | `true` (except cosmos package) |
|
|
660
|
+
| `stargateClients.addGetTxRpc` | Add getSigningTxRpc to clients in namespaces | `false` |
|
|
620
661
|
|
|
621
662
|
### State Management
|
|
622
663
|
|
|
@@ -624,97 +665,113 @@ See [Helper Functions Configuration](#helper-functions-configuration) for more i
|
|
|
624
665
|
|
|
625
666
|
| option | description | defaults |
|
|
626
667
|
| -------------------------------- | ---------------------------------------------------------------------- | ---------|
|
|
627
|
-
| `reactQuery.enabled` |
|
|
628
|
-
| `reactQuery.needExtraQueryKey`
|
|
629
|
-
| `reactQuery.include.protos` |
|
|
630
|
-
| `reactQuery.include.packages` |
|
|
631
|
-
| `reactQuery.include.patterns` |
|
|
632
|
-
| `reactQuery.instantExport.include.patterns` |
|
|
633
|
-
| `reactQuery.instantExport.nameMapping` |
|
|
668
|
+
| `reactQuery.enabled` | Create React hooks that use `@tanstack/react-query` hooks | `false` |
|
|
669
|
+
| `reactQuery.needExtraQueryKey` | Allow users to input extra React Query key to customized hooks (e.g., ['rpcEndpoint', 'yourExtraKey']) | `false` |
|
|
670
|
+
| `reactQuery.include.protos` | Create hooks on matched proto filenames or patterns using minimatch | `[]` |
|
|
671
|
+
| `reactQuery.include.packages` | Create hooks on matched packages files using minimatch | `[]` |
|
|
672
|
+
| `reactQuery.include.patterns` | Create hooks on matched patterns of files using minimatch (deprecated in favor of packages and protos) | `[]` |
|
|
673
|
+
| `reactQuery.instantExport.include.patterns` | Expose instant hooks on matched patterns of packages + method (e.g., cosmos.bank.v1beta1.useBalance) using minimatch. If there are duplicated method names in multiple packages without setting `reactQuery.instantExport.nameMapping`, one duplicated name will be created like: useCosmosBankV1beta1Balance | `[]` |
|
|
674
|
+
| `reactQuery.instantExport.nameMapping` | Map an alias to a package + method for better naming of duplicated method names (e.g., useBankBalance: cosmos.bank.v1beta1.useBalance). Customized hook name is set in front of pkg+method to prevent duplicate aliases. | `{}` |
|
|
634
675
|
|
|
635
676
|
#### Mobx
|
|
636
677
|
|
|
637
678
|
| option | description | defaults |
|
|
638
679
|
| -------------------------------- | ---------------------------------------------------------------------- | ---------|
|
|
639
|
-
| `mobx.enabled` |
|
|
640
|
-
| `mobx.include.protos`
|
|
641
|
-
| `mobx.include.packages`
|
|
642
|
-
| `mobx.include.patterns`
|
|
680
|
+
| `mobx.enabled` | Create MobX stores that use `mobx` | `false` |
|
|
681
|
+
| `mobx.include.protos` | Create MobX stores on matched proto filenames or patterns using minimatch | `[]` |
|
|
682
|
+
| `mobx.include.packages` | Create MobX stores on matched packages files using minimatch | `[]` |
|
|
683
|
+
| `mobx.include.patterns` | Create MobX stores on matched patterns of proto files using minimatch (deprecated in favor of packages and protos) | `[]` |
|
|
643
684
|
|
|
644
685
|
#### Pinia
|
|
645
686
|
|
|
646
687
|
| option | description | defaults |
|
|
647
688
|
| -------------------------------- | ---------------------------------------------------------------------- | ---------|
|
|
648
|
-
| `pinia.enabled` |
|
|
649
|
-
| `
|
|
650
|
-
| `
|
|
651
|
-
| `
|
|
689
|
+
| `pinia.enabled` | Create Pinia stores that use `pinia` | `false` |
|
|
690
|
+
| `pinia.include.protos` | Create Pinia stores on matched proto filenames or patterns using minimatch | `[]` |
|
|
691
|
+
| `pinia.include.packages` | Create Pinia stores on matched packages files using minimatch | `[]` |
|
|
692
|
+
| `pinia.include.patterns` | Create Pinia stores on matched patterns of proto files using minimatch (deprecated in favor of packages and protos) | `[]` |
|
|
652
693
|
|
|
653
694
|
#### Vue Query
|
|
654
695
|
| option | description | defaults |
|
|
655
696
|
| -------------------------------- | ---------------------------------------------------------------------- | ---------|
|
|
656
|
-
| `vueQuery.enabled` |
|
|
657
|
-
| `vueQuery.include.protos` |
|
|
658
|
-
| `vueQuery.include.packages` |
|
|
697
|
+
| `vueQuery.enabled` | Create Vue composables that use `@tanstack/vue-query` composables | `false` |
|
|
698
|
+
| `vueQuery.include.protos` | Create composables on matched proto filenames or patterns using minimatch | `[]` |
|
|
699
|
+
| `vueQuery.include.packages` | Create composables on matched packages files using minimatch | `[]` |
|
|
659
700
|
|
|
660
|
-
### Typings and
|
|
701
|
+
### Typings and Formatting
|
|
661
702
|
|
|
662
703
|
| option | description | defaults |
|
|
663
704
|
| ----------------------------------------- | -------------------------------------------------------------- | --------- |
|
|
664
|
-
| `prototypes.typingsFormat.customTypes.useCosmosSDKDec` |
|
|
665
|
-
| `prototypes.typingsFormat.customTypes.useEnhancedDecimal` |
|
|
666
|
-
| `prototypes.typingsFormat.customTypes.base64Lib` |
|
|
667
|
-
| `prototypes.typingsFormat.num64` | 'long' or 'bigint', the way of generating int64 proto types
|
|
668
|
-
| `prototypes.typingsFormat.useTelescopeGeneratedType` |
|
|
669
|
-
| `prototypes.typingsFormat.useDeepPartial` |
|
|
670
|
-
| `prototypes.typingsFormat.useExact` |
|
|
671
|
-
| `prototypes.typingsFormat.toJsonUnknown` |
|
|
672
|
-
| `prototypes.typingsFormat.timestamp` |
|
|
673
|
-
| `prototypes.typingsFormat.duration` |
|
|
674
|
-
| `prototypes.typingsFormat.
|
|
675
|
-
| `prototypes.typingsFormat.
|
|
676
|
-
| `prototypes.typingsFormat.
|
|
705
|
+
| `prototypes.typingsFormat.customTypes.useCosmosSDKDec` | Enable handling of "cosmos.Dec" proto custom type. Used to show decimal fields with the custom type correctly. Highly recommended to set to true. | `true` |
|
|
706
|
+
| `prototypes.typingsFormat.customTypes.useEnhancedDecimal` | Use patched decimal instead of decimal from @cosmjs/math | `false` |
|
|
707
|
+
| `prototypes.typingsFormat.customTypes.base64Lib` | Use endo/base64 methods | `undefined` |
|
|
708
|
+
| `prototypes.typingsFormat.num64` | 'long' or 'bigint', the way of generating int64 proto types. Set to 'bigint' to use more stable built-in type | `bigint` |
|
|
709
|
+
| `prototypes.typingsFormat.useTelescopeGeneratedType` | Discard GeneratedType from CosmJS, use TelescopeGeneratedType instead inside *.registry.ts files | `false` |
|
|
710
|
+
| `prototypes.typingsFormat.useDeepPartial` | Use `DeepPartial` type instead of `Partial` TS type | `false` |
|
|
711
|
+
| `prototypes.typingsFormat.useExact` | Use the `Exact` TS type | `false` |
|
|
712
|
+
| `prototypes.typingsFormat.toJsonUnknown` | Use `any` for `toJSON` methods instead of `JsonSafe` | `true` |
|
|
713
|
+
| `prototypes.typingsFormat.timestamp` | Use either `date` or `timestamp` for `Timestamp` proto type | "date" |
|
|
714
|
+
| `prototypes.typingsFormat.duration` | Use either `duration` or `string` for `Duration` proto type | "duration"|
|
|
715
|
+
| `prototypes.typingsFormat.updatedDuration` | temporary field to avoid breaking changes | `false` |
|
|
716
|
+
| `prototypes.typingsFormat.setDefaultEnumToUnrecognized` | false: enum empty value would be 0, true: -1 (value for enum unrecognized) |`true`|
|
|
717
|
+
| `prototypes.typingsFormat.setDefaultCustomTypesToUndefined` | true: Timestamp, Duration, Any, Coin empty value would be undefined. false: use fromPartial to get an empty object |`false`|
|
|
718
|
+
| `prototypes.typingsFormat.autoFixUndefinedEnumDefault` | The default value of an enum field would be: 1 (proto2); 0 (proto3). But in some rare cases, those default values don't exist. By enabling this, the default value will be automatically fixed with the smallest value inside the enum. |`false`|
|
|
677
719
|
|
|
678
720
|
### Protobuf parser
|
|
679
721
|
|
|
680
722
|
| option | description | defaults |
|
|
681
723
|
| ----------------------------------------- | -------------------------------------------------------------- | --------- |
|
|
682
|
-
| `prototypes.parser.keepCase` |
|
|
683
|
-
| `prototypes.parser.alternateCommentMode` |
|
|
684
|
-
| `prototypes.parser.preferTrailingComment` |
|
|
724
|
+
| `prototypes.parser.keepCase` | Pass `keepCase` to protobuf `parse()` to keep original casing | `true` |
|
|
725
|
+
| `prototypes.parser.alternateCommentMode` | Pass `alternateCommentMode` to protobuf `parse()` method | `true` |
|
|
726
|
+
| `prototypes.parser.preferTrailingComment` | Pass `preferTrailingComment` to protobuf `parse()` method | `false` |
|
|
685
727
|
|
|
686
728
|
### Typescript Disabling
|
|
687
729
|
|
|
688
730
|
| option | description | defaults |
|
|
689
731
|
| -------------------------------------------- | -------------------------------------------------------------- | ---------|
|
|
690
|
-
| `tsDisable.disableAll` |
|
|
691
|
-
| `tsDisable.patterns` |
|
|
692
|
-
| `tsDisable.files` |
|
|
732
|
+
| `tsDisable.disableAll` | Include `//@ts-nocheck` on every output file | `false` |
|
|
733
|
+
| `tsDisable.patterns` | Include `//@ts-nocheck` on matched patterns | `[]` |
|
|
734
|
+
| `tsDisable.files` | Include `//@ts-nocheck` on matched files | `[]` |
|
|
693
735
|
|
|
694
736
|
### ESLint Disabling
|
|
695
737
|
|
|
696
738
|
| option | description | defaults |
|
|
697
739
|
| -------------------------------------------- | ---------------------------------------------------------------- | ---------|
|
|
698
|
-
| `eslintDisable.disableAll` |
|
|
699
|
-
| `eslintDisable.patterns` |
|
|
700
|
-
| `eslintDisable.files` |
|
|
740
|
+
| `eslintDisable.disableAll` | Include `/* eslint-disable */` on every output file | `false` |
|
|
741
|
+
| `eslintDisable.patterns` | Include `/* eslint-disable */` on matched patterns | `[]` |
|
|
742
|
+
| `eslintDisable.files` | Include `/* eslint-disable */` on matched files | `[]` |
|
|
701
743
|
|
|
702
744
|
### Bundle
|
|
703
745
|
|
|
704
746
|
| option | description | defaults |
|
|
705
747
|
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
706
|
-
| `bundle.enabled` |
|
|
748
|
+
| `bundle.enabled` | Bundle all files into a scoped index file | `true` |
|
|
749
|
+
| `bundle.type` | Bundle type: "namespace" or "module" | `"namespace"` |
|
|
707
750
|
> **Warning:** This option is not recommended. It will generate a bundle file that exports all the types and functions under one namespace. This will make the bundle file very large and hard to maintain. e.g. using `cosmos.bank.v1beta1.MsgSend` might be intuitive, but it will also include `cosmos.gov.v1beta1.*` and other types in the final bundle file. So use this option with caution.
|
|
708
751
|
|
|
752
|
+
### MCP Server
|
|
753
|
+
|
|
754
|
+
| option | description | defaults |
|
|
755
|
+
| ------------------------------ | -------------------------------------------------------------- | ---------- |
|
|
756
|
+
| `mcpServer.enabled` | generate MCP (Model Context Protocol) servers alongside TypeScript clients for AI agent integration | `false` |
|
|
757
|
+
|
|
758
|
+
When enabled, Telescope generates a complete MCP server package (`{packageName}-mcp`) that includes:
|
|
759
|
+
- Mock blockchain tools for demonstration and development
|
|
760
|
+
- Complete telescope codebase reference for AI agents
|
|
761
|
+
- Self-contained package with all necessary telescope code
|
|
762
|
+
- Ready-to-extend structure for implementing real blockchain functionality
|
|
763
|
+
|
|
764
|
+
See [MCP Integration](https://docs.hyperweb.io/telescope/developing/mcp-integration) for detailed documentation.
|
|
765
|
+
|
|
709
766
|
### Output
|
|
710
767
|
|
|
711
768
|
| option | description | defaults |
|
|
712
769
|
| ------------------------------ | ----------------------------------------------------------------- | ---------- |
|
|
713
|
-
| `env` | 'default' or 'v-next', set to 'v-next' to enable yet
|
|
714
|
-
| `removeUnusedImports` |
|
|
715
|
-
| `classesUseArrowFunctions` |
|
|
716
|
-
| `includeExternalHelpers` |
|
|
717
|
-
| `restoreImportExtension` |
|
|
770
|
+
| `env` | 'default' or 'v-next', set to 'v-next' to enable yet-to-be-released features | `default` |
|
|
771
|
+
| `removeUnusedImports` | Remove unused imports | `true` |
|
|
772
|
+
| `classesUseArrowFunctions` | Classes use arrow functions instead of `bind()`ing in constructors | `false` |
|
|
773
|
+
| `includeExternalHelpers` | Export helper functions in `extern.ts` | `false` |
|
|
774
|
+
| `restoreImportExtension` | Restore extensions of imported paths (e.g., '.js'). null means no extension | `null` |
|
|
718
775
|
|
|
719
776
|
## Types
|
|
720
777
|
|
|
@@ -742,7 +799,7 @@ The representation of `google.protobuf.Duration` is configurable by the `prototy
|
|
|
742
799
|
|
|
743
800
|
This example shows messages from the `osmojs`, which was built with Telescope.
|
|
744
801
|
|
|
745
|
-
Import the `osmosis` object from `osmojs`. In this case, we're
|
|
802
|
+
Import the `osmosis` object from `osmojs`. In this case, we're showing the messages available from the `osmosis.gamm.v1beta1` module:
|
|
746
803
|
|
|
747
804
|
```js
|
|
748
805
|
import { osmosis } from 'osmojs';
|
|
@@ -759,7 +816,7 @@ const {
|
|
|
759
816
|
} = osmosis.gamm.v1beta1.MessageComposer.withTypeUrl;
|
|
760
817
|
```
|
|
761
818
|
|
|
762
|
-
Now you can construct messages. If you use
|
|
819
|
+
Now you can construct messages. If you use VS Code or another TypeScript-enabled IDE, you should also be able to use `Ctrl+Space` to see auto-completion of the fields required for the message.
|
|
763
820
|
|
|
764
821
|
```js
|
|
765
822
|
import { coin } from '@cosmjs/amino';
|
|
@@ -785,7 +842,7 @@ const fee = {
|
|
|
785
842
|
}
|
|
786
843
|
```
|
|
787
844
|
|
|
788
|
-
|
|
845
|
+
If you are broadcasting multiple messages in a batch, you should `simulate` your transaction and estimate the fee
|
|
789
846
|
|
|
790
847
|
```js
|
|
791
848
|
import { Dec, IntPretty } from '@keplr-wallet/unit';
|
|
@@ -817,7 +874,7 @@ const client = await getSigningOsmosisClient({
|
|
|
817
874
|
|
|
818
875
|
## Creating Signers
|
|
819
876
|
|
|
820
|
-
To broadcast messages, you'll want to use either [
|
|
877
|
+
To broadcast messages, you'll want to use either [Keplr](https://docs.keplr.app/api/cosmjs.html) or an `OfflineSigner` from `cosmjs` using mnemonics.
|
|
821
878
|
|
|
822
879
|
### Amino Signer
|
|
823
880
|
|
|
@@ -833,7 +890,7 @@ import { getOfflineSigner as getOfflineSignerAmino } from 'cosmjs-utils';
|
|
|
833
890
|
import { getOfflineSigner as getOfflineSignerProto } from 'cosmjs-utils';
|
|
834
891
|
```
|
|
835
892
|
|
|
836
|
-
WARNING
|
|
893
|
+
**WARNING:** NOT RECOMMENDED TO USE PLAIN-TEXT MNEMONICS. Please take care of your security and use best practices such as AES encryption and/or methods from 12-factor applications.
|
|
837
894
|
|
|
838
895
|
```js
|
|
839
896
|
import { chains } from 'chain-registry';
|
|
@@ -1028,7 +1085,7 @@ const main = async () => {
|
|
|
1028
1085
|
|
|
1029
1086
|
### gRPC-gateway Client
|
|
1030
1087
|
|
|
1031
|
-
For querying data via gRPC-
|
|
1088
|
+
For querying data via gRPC-gateway endpoints, you can use gRPC-gateway Clients. For a better developer experience, you can generate a factory of scoped bundles of all gRPC-gateway Clients with the `rpcClients` option.
|
|
1032
1089
|
|
|
1033
1090
|
```ts
|
|
1034
1091
|
const options: TelescopeOptions = {
|
|
@@ -1055,7 +1112,7 @@ const main = async () => {
|
|
|
1055
1112
|
};
|
|
1056
1113
|
```
|
|
1057
1114
|
|
|
1058
|
-
Below
|
|
1115
|
+
Below is an example of scaffolding a `grant` Proto Msg for gRPC-web and gRPC-gateway and then broadcasting it.
|
|
1059
1116
|
|
|
1060
1117
|
```js
|
|
1061
1118
|
const { grant } = cosmos.authz.v1beta1.MessageComposer.withTypeUrl;
|
|
@@ -1122,7 +1179,7 @@ main().then(() => {
|
|
|
1122
1179
|
|
|
1123
1180
|
## Instant RPC Methods
|
|
1124
1181
|
|
|
1125
|
-
|
|
1182
|
+
Use the instantOps option to expose instant RPC methods.
|
|
1126
1183
|
|
|
1127
1184
|
For example, for this config:
|
|
1128
1185
|
```js
|
|
@@ -1162,7 +1219,7 @@ For example, for this config:
|
|
|
1162
1219
|
}
|
|
1163
1220
|
```
|
|
1164
1221
|
|
|
1165
|
-
There
|
|
1222
|
+
There will be an extra file generated in the root folder called service-ops.ts:
|
|
1166
1223
|
```js
|
|
1167
1224
|
export interface OsmosisClaim extends _OsmosisClaimV1beta1Queryrpc.OsmosisClaim {}
|
|
1168
1225
|
export class OsmosisClaim {
|
|
@@ -1200,7 +1257,7 @@ export class CosmosAuthAccount {
|
|
|
1200
1257
|
this.tallyResult = _CosmosGovV1beta1Queryrpc.createClientImpl(rpc).tallyResult;
|
|
1201
1258
|
this.submitProposal = _CosmosGovV1beta1Txrpc.createClientImpl(rpc).submitProposal;
|
|
1202
1259
|
|
|
1203
|
-
//same as
|
|
1260
|
+
// same as txDeposit for vote here.
|
|
1204
1261
|
this.txVote = _CosmosGovV1beta1Txrpc.createClientImpl(rpc).vote;
|
|
1205
1262
|
|
|
1206
1263
|
this.voteWeighted = _CosmosGovV1beta1Txrpc.createClientImpl(rpc).voteWeighted;
|
|
@@ -1241,11 +1298,15 @@ clientStyle: {
|
|
|
1241
1298
|
},
|
|
1242
1299
|
```
|
|
1243
1300
|
|
|
1244
|
-
There
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1301
|
+
There will be client files (`all-module-client.ts`, `akash-sdk-module-client.ts`, `osmosis-sdk-module-client.ts`, `cosmos-sdk-module-client.ts`, `custom-client.ts`) generated in the root directory according to the setting.
|
|
1302
|
+
|
|
1303
|
+
The `all-module-client.ts` file consolidates all proto imports into one file and exports them as a single client.
|
|
1304
|
+
|
|
1305
|
+
All SDK module client files will be identical to the legacy `client.ts` files generated in each module directory, except they will be located in the root directory.
|
|
1306
|
+
|
|
1307
|
+
The custom client imports proto files based on `include.patterns`, allowing protos to originate from different modules.
|
|
1308
|
+
|
|
1309
|
+
For example, the custom-client.ts will be like:
|
|
1249
1310
|
```ts
|
|
1250
1311
|
export const cosmosIbcAminoConverters = {
|
|
1251
1312
|
...cosmosGovV1TxAmino.AminoConverter,
|
|
@@ -1298,7 +1359,7 @@ export const getCustomSigningClient = async ({ rpcEndpoint, signer }: { rpcEndpo
|
|
|
1298
1359
|
...osmosis.superfluid.AminoConverter
|
|
1299
1360
|
});
|
|
1300
1361
|
|
|
1301
|
-
// load the
|
|
1362
|
+
// load the types
|
|
1302
1363
|
osmosis.gamm.v1beta1.load(registry);
|
|
1303
1364
|
osmosis.lockup.load(registry);
|
|
1304
1365
|
osmosis.superfluid.load(registry);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperweb/telescope",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"description": "A TypeScript Transpiler for Cosmos Protobufs",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/hyperweb-io/telescope/tree/master/packages/telescope#readme",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"@babel/parser": "^7.23.6",
|
|
91
91
|
"@babel/traverse": "7.23.6",
|
|
92
92
|
"@babel/types": "7.23.6",
|
|
93
|
-
"@cosmology/ast": "^1.11.
|
|
94
|
-
"@cosmology/proto-parser": "^1.10.
|
|
95
|
-
"@cosmology/types": "^1.12.
|
|
96
|
-
"@cosmology/utils": "^1.10.
|
|
93
|
+
"@cosmology/ast": "^1.11.2",
|
|
94
|
+
"@cosmology/proto-parser": "^1.10.10",
|
|
95
|
+
"@cosmology/types": "^1.12.6",
|
|
96
|
+
"@cosmology/utils": "^1.10.8",
|
|
97
97
|
"@cosmwasm/ts-codegen": "0.35.7",
|
|
98
98
|
"@types/parse-package-name": "0.1.0",
|
|
99
99
|
"case": "1.6.3",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"rimraf": "5.0.0",
|
|
112
112
|
"yaml": "^2.3.4"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "47f7e41efbcf1fed47d33fe22a105efc799cf91b"
|
|
115
115
|
}
|