You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i
126
126
|`types.aliasExecuteMsg`| generate a type alias based on the contract name |
127
127
|`types.aliasEntryPoints`| generate type aliases for the entry points based on the contract name |
128
128
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
+
129
167
### Client
130
168
131
169
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
173
211
174
212
### Message Composer
175
213
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.
177
215
178
216
[see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts)
Copy file name to clipboardExpand all lines: packages/ts-codegen/README.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i
126
126
|`types.aliasExecuteMsg`| generate a type alias based on the contract name |
127
127
|`types.aliasEntryPoints`| generate type aliases for the entry points based on the contract name |
128
128
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
+
129
167
### Client
130
168
131
169
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
173
211
174
212
### Message Composer
175
213
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.
177
215
178
216
[see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts)
0 commit comments