Skip to content

Commit a8dc5fc

Browse files
committed
document types
1 parent 475bc65 commit a8dc5fc

File tree

3 files changed

+661
-16
lines changed

3 files changed

+661
-16
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ The following blockchain libraries (generated by Telescope) are available via np
5454
- [Usage](#usage)
5555
- [Programmatic Usage](#programmatic-usage)
5656
- [Options](#options)
57+
- [General Options](#general-options)
5758
- [Amino Encoding](#amino-encoding)
5859
- [Implemented Interface Options](#implemented-interface-options)
5960
- [Prototypes Options](#prototypes-options)
6061
- [Prototypes Methods](#prototypes-methods)
6162
- [Enums Options](#enums-options)
6263
- [LCD Client Options](#lcd-client-options)
64+
- [Aggregated LCD](#aggregated-lcd)
6365
- [RPC Client Options](#rpc-client-options)
6466
- [Helper Functions](#helper-functions)
6567
- [Stargate Client Options](#stargate-client-options)
@@ -496,12 +498,26 @@ telescope({
496498

497499
## Options
498500

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+
499514
### Amino Encoding
500515

501516
| option | description | defaults |
502517
| ------------------------------ | -------------------------------------------------------------- | ---------- |
503518
| `aminoEncoding.enabled` | Generate amino types and amino converters | `true` |
504519
| `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` |
505521
| `aminoEncoding.disableMsgTypes` | Disable generating AminoMsg types | `false` |
506522
| `aminoEncoding.casingFn` | Set the amino-casing function for a project | `snake()` |
507523
| `aminoEncoding.exceptions` | Set specific aminoType name exceptions | see code |
@@ -517,6 +533,7 @@ telescope({
517533
| ----------------------------------------- | -------------------------------------------------------------- | ---------- |
518534
| `interfaces.enabled` | Enable converters between Any type and specific implemented interfaces | `true` |
519535
| `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` |
520537
| `interfaces.useUseInterfacesParams` | Add `useInterfaces` argument to `decode` and `toAmino` functions | `false` |
521538
| `interfaces.useByDefault` | Use interface decoders by default (default for `useInterfaces` argument to `decode` and `toAmino` functions) | `true` |
522539
| `interfaces.useByDefaultRpc` | Use interface decoders by default in RPC clients | `true` |
@@ -544,6 +561,8 @@ telescope({
544561
| `prototypes.addTypeUrlToDecoders` | Add $typeUrl field to generated interfaces | `true` |
545562
| `prototypes.addAminoTypeToObjects` | Add aminoType field to generated Decoders | `false` |
546563
| `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` |
547566
| `prototypes.enableRegistryLoader` | Generate Registry loader in *.registry.ts files | `true` |
548567
| `prototypes.enableMessageComposer` | Generate MessageComposer in *.registry.ts files | `true` |
549568
| `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` |
@@ -578,13 +597,25 @@ telescope({
578597

579598
See [LCD Clients](#lcd-clients) for more info.
580599

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+
581610
### RPC Client Options
582611

583612
| option | description | defaults |
584613
| ------------------------------ | ---------------------------------------------------------------------- | ----------------------------- |
585614
| `rpcClients.type` | Generate this type of RPC client (`tendermint`, `gRPC-web`, `gRPC`)| `tendermint` |
586615
| `rpcClients.enabled` | Generate RPC clients that can interact with proto messages | `true` |
587616
| `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` |
588619
| `rpcClients.camelCase` | Use camel-case for RPC methods when generating RPC clients | `true` |
589620
| `rpcClients.scoped` | Generate factory of scoped RPC Clients | `undefined` |
590621
| `rpcClients.scopedIsExclusive` | Allow both scoped bundles and all RPC Clients | `true` |
@@ -607,6 +638,7 @@ See [RPC Clients](#rpc-clients) for more info.
607638
| Option | Description | Defaults |
608639
| --------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------- |
609640
| `helperFunctions.enabled` | Enable the generation of helper function files `.func.ts` | `false` |
641+
| `helperFunctions.useGlobalDecoderRegistry` | Use global decoder registry in helper functions | `false` |
610642
| `helperFunctions.hooks` | Generates hooks selected alongside helper functions | `{ react: false, vue: false }` |
611643
| `helperFunctions.include.serviceTypes`| Specifies which types of services to include (`Query`, `Msg`). `undefined` includes all types. | `undefined` |
612644
| `helperFunctions.include.patterns` | Array of glob patterns patterns (e.g., `"**"`, `"cosmos.bank.v1beta1.bala*"`, etc.) to match specific proto services. | `undefined` |
@@ -680,6 +712,7 @@ See [Helper Functions Configuration](#helper-functions-configuration) for more i
680712
| `prototypes.typingsFormat.toJsonUnknown` | Use `any` for `toJSON` methods instead of `JsonSafe` | `true` |
681713
| `prototypes.typingsFormat.timestamp` | Use either `date` or `timestamp` for `Timestamp` proto type | "date" |
682714
| `prototypes.typingsFormat.duration` | Use either `duration` or `string` for `Duration` proto type | "duration"|
715+
| `prototypes.typingsFormat.updatedDuration` | temporary field to avoid breaking changes | `false` |
683716
| `prototypes.typingsFormat.setDefaultEnumToUnrecognized` | false: enum empty value would be 0, true: -1 (value for enum unrecognized) |`true`|
684717
| `prototypes.typingsFormat.setDefaultCustomTypesToUndefined` | true: Timestamp, Duration, Any, Coin empty value would be undefined. false: use fromPartial to get an empty object |`false`|
685718
| `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`|
@@ -713,6 +746,7 @@ See [Helper Functions Configuration](#helper-functions-configuration) for more i
713746
| option | description | defaults |
714747
| ------------------------------ | -------------------------------------------------------------- | ---------- |
715748
| `bundle.enabled` | Bundle all files into a scoped index file | `true` |
749+
| `bundle.type` | Bundle type: "namespace" or "module" | `"namespace"` |
716750
> **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.
717751
718752
### MCP Server

0 commit comments

Comments
 (0)