@cosmwasm/ts-codegen 0.31.0 → 0.31.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +31 -28
- package/package.json +2 -2
package/README.md
CHANGED
@@ -36,7 +36,6 @@ The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts-
|
|
36
36
|
- [React Query](#react-query)
|
37
37
|
- [Recoil](#recoil)
|
38
38
|
- [Message Composer](#message-composer)
|
39
|
-
- [Msg Builder](#msg-builder)
|
40
39
|
- [Bundles](#bundles)
|
41
40
|
- [CLI Usage and Examples](#cli-usage-and-examples)
|
42
41
|
- [Advanced Usage](#advanced-usage)
|
@@ -121,7 +120,7 @@ codegen({
|
|
121
120
|
messageComposer: {
|
122
121
|
enabled: false
|
123
122
|
},
|
124
|
-
msgBuilder: {
|
123
|
+
msgBuilder: {
|
125
124
|
enabled: false
|
126
125
|
}
|
127
126
|
}
|
@@ -137,11 +136,11 @@ Typescript types and interfaces are generated in separate files so they can be i
|
|
137
136
|
|
138
137
|
#### Types Options
|
139
138
|
|
140
|
-
| option
|
141
|
-
|
|
142
|
-
| `types.enabled`
|
143
|
-
| `types.aliasExecuteMsg`
|
144
|
-
| `types.aliasEntryPoints`
|
139
|
+
| option | description |
|
140
|
+
| ------------------------ | ---------------------------------------------------- |
|
141
|
+
| `types.enabled` | enable type generation |
|
142
|
+
| `types.aliasExecuteMsg` | generate a type alias based on the contract name |
|
143
|
+
| `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name |
|
145
144
|
|
146
145
|
### Client
|
147
146
|
|
@@ -174,15 +173,15 @@ Generate [react-query v3](https://react-query-v3.tanstack.com/) or [react-query
|
|
174
173
|
|
175
174
|
#### React Query Options
|
176
175
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
176
|
+
| option | description |
|
177
|
+
| --------------------------- | --------------------------------------------------------------------------- |
|
178
|
+
| `reactQuery.enabled` | enable the react-query plugin |
|
179
|
+
| `reactQuery.optionalClient` | allows contract client to be undefined as the component renders |
|
180
|
+
| `reactQuery.queryKeys` | generates a const queryKeys object for use with invalidations and set values |
|
181
|
+
| `reactQuery.queryFactory` | generates a const queryFactory object for useQueries and prefetchQueries use |
|
182
|
+
| `reactQuery.version` | `v4` uses `@tanstack/react-query` and `v3` uses `react-query` |
|
183
|
+
| `reactQuery.mutations` | also generate mutations |
|
184
|
+
| `reactQuery.camelize` | use camelCase style for property names |
|
186
185
|
|
187
186
|
|
188
187
|
#### React Query via CLI
|
@@ -232,9 +231,9 @@ cosmwasm-ts-codegen generate \
|
|
232
231
|
|
233
232
|
#### Recoil Options
|
234
233
|
|
235
|
-
|
236
|
-
|
237
|
-
|
234
|
+
| option | description |
|
235
|
+
| ------------------------------ | ------------------------------------------------------------------- |
|
236
|
+
| `recoil.enabled` | enable the recoil plugin |
|
238
237
|
|
239
238
|
### Message Composer
|
240
239
|
|
@@ -253,9 +252,9 @@ cosmwasm-ts-codegen generate \
|
|
253
252
|
```
|
254
253
|
#### Message Composer Options
|
255
254
|
|
256
|
-
|
257
|
-
|
258
|
-
|
255
|
+
| option | description |
|
256
|
+
| ------------------------------ | ------------------------------------------------------------------- |
|
257
|
+
| `messageComposer.enabled` | enable the messageComposer plugin |
|
259
258
|
|
260
259
|
### Msg Builder
|
261
260
|
|
@@ -275,7 +274,7 @@ cosmwasm-ts-codegen generate \
|
|
275
274
|
#### Message Composer Options
|
276
275
|
|
277
276
|
| option | description |
|
278
|
-
|
277
|
+
|------------ | ------------------------------ | ------------------------------------------------------------------- |
|
279
278
|
| `msgBuilder.enabled` | enable the msgBilder plugin |
|
280
279
|
|
281
280
|
|
@@ -293,11 +292,11 @@ const { CwAdminFactoryClient } = contracts.CwAdminFactory;
|
|
293
292
|
```
|
294
293
|
#### Bundler Options
|
295
294
|
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
295
|
+
| option | description |
|
296
|
+
| --------------------- | -------------------------------------------------------------------------------- |
|
297
|
+
| `bundle.enabled` | enable the bundler plugin |
|
298
|
+
| `bundle.scope` | name of the scope, defaults to `contracts` (you can use `.` to make more scopes) |
|
299
|
+
| `bundle.bundleFile` | name of the bundle file |
|
301
300
|
|
302
301
|
### CLI Usage and Examples
|
303
302
|
|
@@ -416,6 +415,10 @@ https://gist.github.com/pyramation/a9520ccf131177b1841e02a97d7d3731
|
|
416
415
|
|
417
416
|
https://gist.github.com/pyramation/43320e8b952751a0bd5a77dbc5b601f4
|
418
417
|
|
418
|
+
- `cosmwasm-ts-codegen generate --plugin msg-builder`
|
419
|
+
|
420
|
+
https://gist.github.com/adairrr/b394e62beb9856b0351883f776650f26
|
421
|
+
|
419
422
|
|
420
423
|
### JSON Schema
|
421
424
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cosmwasm/ts-codegen",
|
3
|
-
"version": "0.31.
|
3
|
+
"version": "0.31.1",
|
4
4
|
"description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/cosmwasm/ts-codegen",
|
@@ -98,5 +98,5 @@
|
|
98
98
|
"shelljs": "0.8.5",
|
99
99
|
"wasm-ast-types": "^0.24.0"
|
100
100
|
},
|
101
|
-
"gitHead": "
|
101
|
+
"gitHead": "da2692beb683c20c5f8804eba44d6d4db002bdb2"
|
102
102
|
}
|