Skip to content

Commit d4e1f61

Browse files
Gefei HouGefei Hou
authored andcommitted
Updated docs
1 parent aa36a62 commit d4e1f61

File tree

2 files changed

+78
-2
lines changed

2 files changed

+78
-2
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i
126126
| `types.aliasExecuteMsg` | generate a type alias based on the contract name |
127127
| `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name |
128128

129+
### BaseClient
130+
The `baseClient.ts` will be generated as dependency for most files. It includes the base client for interchainjs.
131+
132+
#### Gas Configuration
133+
134+
The generated client provides flexible gas fee configuration options to handle different blockchain networks and fee settings.
135+
136+
##### Default Gas Settings
137+
138+
By default, the client uses a gas limit of `200000` for all transactions. You can customize this behavior through the `setDefaultGasAmount`.
139+
140+
##### ChainConfig Options
141+
142+
The `ChainConfig` interface supports two approaches for gas configuration:
143+
144+
1. Chain Registry Integration (Recommended)
145+
146+
When you provide chain information, the client automatically fetches gas prices from the chain registry:
147+
148+
```typescript
149+
import { useChain } from '@interchain-kit/react';
150+
151+
const { chain } = useChain('osmosistestnet');
152+
const chainConfig: ChainConfig = { chain: chain };
153+
```
154+
155+
2. Manual Gas Price Configuration
156+
You can explicitly set gas prices for more control:
157+
158+
```typescript
159+
const chainConfig: ChainConfig = {
160+
gasPrice: {
161+
denom: 'uosmo',
162+
amount: '0.025'
163+
}
164+
};
165+
```
166+
129167
### Client
130168

131169
The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations.
@@ -173,7 +211,7 @@ Generate [recoil](https://recoiljs.org/) bindings for your contracts with the `r
173211

174212
### Message Composer
175213

176-
Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `cosmjs` with the `message-composer` command.
214+
Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `interchainjs` with the `message-composer` command.
177215

178216
[see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts)
179217

packages/ts-codegen/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i
126126
| `types.aliasExecuteMsg` | generate a type alias based on the contract name |
127127
| `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name |
128128

129+
### BaseClient
130+
The `baseClient.ts` will be generated as dependency for most files. It includes the base client for interchainjs.
131+
132+
#### Gas Configuration
133+
134+
The generated client provides flexible gas fee configuration options to handle different blockchain networks and fee settings.
135+
136+
##### Default Gas Settings
137+
138+
By default, the client uses a gas limit of `200000` for all transactions. You can customize this behavior through the `setDefaultGasAmount`.
139+
140+
##### ChainConfig Options
141+
142+
The `ChainConfig` interface supports two approaches for gas configuration:
143+
144+
1. Chain Registry Integration (Recommended)
145+
146+
When you provide chain information, the client automatically fetches gas prices from the chain registry:
147+
148+
```typescript
149+
import { useChain } from '@interchain-kit/react';
150+
151+
const { chain } = useChain('osmosistestnet');
152+
const chainConfig: ChainConfig = { chain: chain };
153+
```
154+
155+
2. Manual Gas Price Configuration
156+
You can explicitly set gas prices for more control:
157+
158+
```typescript
159+
const chainConfig: ChainConfig = {
160+
gasPrice: {
161+
denom: 'uosmo',
162+
amount: '0.025'
163+
}
164+
};
165+
```
166+
129167
### Client
130168

131169
The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations.
@@ -173,7 +211,7 @@ Generate [recoil](https://recoiljs.org/) bindings for your contracts with the `r
173211

174212
### Message Composer
175213

176-
Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `cosmjs` with the `message-composer` command.
214+
Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `interchainjs` with the `message-composer` command.
177215

178216
[see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts)
179217

0 commit comments

Comments
 (0)