wasm-ast-types 0.11.3 → 0.13.0
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/main/client/test/ts-client.issue-71.test.js +103 -0
- package/main/context/context.js +2 -1
- package/main/utils/types.js +20 -7
- package/module/client/test/ts-client.issue-71.test.js +21 -0
- package/module/context/context.js +2 -1
- package/module/utils/types.js +20 -7
- package/package.json +5 -3
- package/src/client/client.ts +665 -0
- package/src/client/index.ts +1 -0
- package/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +497 -0
- package/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +452 -0
- package/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +101 -0
- package/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +141 -0
- package/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +341 -0
- package/src/client/test/__snapshots__/ts-client.empty-enums.spec.ts.snap +20 -0
- package/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +432 -0
- package/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +984 -0
- package/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +350 -0
- package/src/client/test/__snapshots__/ts-client.spec.ts.snap +723 -0
- package/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +337 -0
- package/src/client/test/ts-client.account-nfts.spec.ts +55 -0
- package/src/client/test/ts-client.arrays-ref.spec.ts +48 -0
- package/src/client/test/ts-client.arrays.spec.ts +58 -0
- package/src/client/test/ts-client.cw-named-groups.test.ts +48 -0
- package/src/client/test/ts-client.cw-proposal-single.test.ts +50 -0
- package/src/client/test/ts-client.empty-enums.spec.ts +28 -0
- package/src/client/test/ts-client.issue-71.test.ts +51 -0
- package/src/client/test/ts-client.issues.test.ts +52 -0
- package/src/client/test/ts-client.sg721.spec.ts +46 -0
- package/src/client/test/ts-client.spec.ts +166 -0
- package/src/client/test/ts-client.vectis.spec.ts +97 -0
- package/src/context/context.ts +134 -0
- package/src/context/imports.ts +126 -0
- package/src/context/index.ts +2 -0
- package/src/index.ts +7 -0
- package/src/message-composer/__snapshots__/message-composer.spec.ts.snap +271 -0
- package/src/message-composer/index.ts +1 -0
- package/src/message-composer/message-composer.spec.ts +25 -0
- package/src/message-composer/message-composer.ts +305 -0
- package/src/react-query/__snapshots__/react-query.spec.ts.snap +913 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/react-query.spec.ts +75 -0
- package/src/react-query/react-query.ts +913 -0
- package/src/recoil/__snapshots__/recoil.spec.ts.snap +203 -0
- package/src/recoil/index.ts +1 -0
- package/src/recoil/recoil.spec.ts +38 -0
- package/src/recoil/recoil.ts +307 -0
- package/src/types.ts +44 -0
- package/src/utils/__snapshots__/babel.spec.ts.snap +75 -0
- package/src/utils/babel.spec.ts +511 -0
- package/src/utils/babel.ts +315 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/types.ts +459 -0
- package/types/client/client.d.ts +1 -1
- package/types/context/context.d.ts +1 -0
@@ -0,0 +1,350 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`execute classes array types 1`] = `
|
4
|
+
"export class SG721Client implements SG721Instance {
|
5
|
+
client: SigningCosmWasmClient;
|
6
|
+
sender: string;
|
7
|
+
contractAddress: string;
|
8
|
+
|
9
|
+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
|
10
|
+
this.client = client;
|
11
|
+
this.sender = sender;
|
12
|
+
this.contractAddress = contractAddress;
|
13
|
+
this.transferNft = this.transferNft.bind(this);
|
14
|
+
this.sendNft = this.sendNft.bind(this);
|
15
|
+
this.approve = this.approve.bind(this);
|
16
|
+
this.revoke = this.revoke.bind(this);
|
17
|
+
this.approveAll = this.approveAll.bind(this);
|
18
|
+
this.revokeAll = this.revokeAll.bind(this);
|
19
|
+
this.mint = this.mint.bind(this);
|
20
|
+
this.burn = this.burn.bind(this);
|
21
|
+
}
|
22
|
+
|
23
|
+
transferNft = async ({
|
24
|
+
recipient,
|
25
|
+
tokenId
|
26
|
+
}: {
|
27
|
+
recipient: string;
|
28
|
+
tokenId: string;
|
29
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
30
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
31
|
+
transfer_nft: {
|
32
|
+
recipient,
|
33
|
+
token_id: tokenId
|
34
|
+
}
|
35
|
+
}, fee, memo, funds);
|
36
|
+
};
|
37
|
+
sendNft = async ({
|
38
|
+
contract,
|
39
|
+
msg,
|
40
|
+
tokenId
|
41
|
+
}: {
|
42
|
+
contract: string;
|
43
|
+
msg: Binary;
|
44
|
+
tokenId: string;
|
45
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
46
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
47
|
+
send_nft: {
|
48
|
+
contract,
|
49
|
+
msg,
|
50
|
+
token_id: tokenId
|
51
|
+
}
|
52
|
+
}, fee, memo, funds);
|
53
|
+
};
|
54
|
+
approve = async ({
|
55
|
+
expires,
|
56
|
+
spender,
|
57
|
+
tokenId
|
58
|
+
}: {
|
59
|
+
expires?: Expiration;
|
60
|
+
spender: string;
|
61
|
+
tokenId: string;
|
62
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
63
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
64
|
+
approve: {
|
65
|
+
expires,
|
66
|
+
spender,
|
67
|
+
token_id: tokenId
|
68
|
+
}
|
69
|
+
}, fee, memo, funds);
|
70
|
+
};
|
71
|
+
revoke = async ({
|
72
|
+
spender,
|
73
|
+
tokenId
|
74
|
+
}: {
|
75
|
+
spender: string;
|
76
|
+
tokenId: string;
|
77
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
78
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
79
|
+
revoke: {
|
80
|
+
spender,
|
81
|
+
token_id: tokenId
|
82
|
+
}
|
83
|
+
}, fee, memo, funds);
|
84
|
+
};
|
85
|
+
approveAll = async ({
|
86
|
+
expires,
|
87
|
+
operator
|
88
|
+
}: {
|
89
|
+
expires?: Expiration;
|
90
|
+
operator: string;
|
91
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
92
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
93
|
+
approve_all: {
|
94
|
+
expires,
|
95
|
+
operator
|
96
|
+
}
|
97
|
+
}, fee, memo, funds);
|
98
|
+
};
|
99
|
+
revokeAll = async ({
|
100
|
+
operator
|
101
|
+
}: {
|
102
|
+
operator: string;
|
103
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
104
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
105
|
+
revoke_all: {
|
106
|
+
operator
|
107
|
+
}
|
108
|
+
}, fee, memo, funds);
|
109
|
+
};
|
110
|
+
mint = async ({
|
111
|
+
extension,
|
112
|
+
owner,
|
113
|
+
tokenId,
|
114
|
+
tokenUri
|
115
|
+
}: {
|
116
|
+
extension: Empty;
|
117
|
+
owner: string;
|
118
|
+
tokenId: string;
|
119
|
+
tokenUri?: string;
|
120
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
121
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
122
|
+
mint: {
|
123
|
+
extension,
|
124
|
+
owner,
|
125
|
+
token_id: tokenId,
|
126
|
+
token_uri: tokenUri
|
127
|
+
}
|
128
|
+
}, fee, memo, funds);
|
129
|
+
};
|
130
|
+
burn = async ({
|
131
|
+
tokenId
|
132
|
+
}: {
|
133
|
+
tokenId: string;
|
134
|
+
}, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
|
135
|
+
return await this.client.execute(this.sender, this.contractAddress, {
|
136
|
+
burn: {
|
137
|
+
token_id: tokenId
|
138
|
+
}
|
139
|
+
}, fee, memo, funds);
|
140
|
+
};
|
141
|
+
}"
|
142
|
+
`;
|
143
|
+
|
144
|
+
exports[`execute interfaces no extends 1`] = `
|
145
|
+
"export interface SG721Instance {
|
146
|
+
contractAddress: string;
|
147
|
+
sender: string;
|
148
|
+
transferNft: ({
|
149
|
+
recipient,
|
150
|
+
tokenId
|
151
|
+
}: {
|
152
|
+
recipient: string;
|
153
|
+
tokenId: string;
|
154
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
155
|
+
sendNft: ({
|
156
|
+
contract,
|
157
|
+
msg,
|
158
|
+
tokenId
|
159
|
+
}: {
|
160
|
+
contract: string;
|
161
|
+
msg: Binary;
|
162
|
+
tokenId: string;
|
163
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
164
|
+
approve: ({
|
165
|
+
expires,
|
166
|
+
spender,
|
167
|
+
tokenId
|
168
|
+
}: {
|
169
|
+
expires?: Expiration;
|
170
|
+
spender: string;
|
171
|
+
tokenId: string;
|
172
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
173
|
+
revoke: ({
|
174
|
+
spender,
|
175
|
+
tokenId
|
176
|
+
}: {
|
177
|
+
spender: string;
|
178
|
+
tokenId: string;
|
179
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
180
|
+
approveAll: ({
|
181
|
+
expires,
|
182
|
+
operator
|
183
|
+
}: {
|
184
|
+
expires?: Expiration;
|
185
|
+
operator: string;
|
186
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
187
|
+
revokeAll: ({
|
188
|
+
operator
|
189
|
+
}: {
|
190
|
+
operator: string;
|
191
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
192
|
+
mint: ({
|
193
|
+
extension,
|
194
|
+
owner,
|
195
|
+
tokenId,
|
196
|
+
tokenUri
|
197
|
+
}: {
|
198
|
+
extension: Empty;
|
199
|
+
owner: string;
|
200
|
+
tokenId: string;
|
201
|
+
tokenUri?: string;
|
202
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
203
|
+
burn: ({
|
204
|
+
tokenId
|
205
|
+
}: {
|
206
|
+
tokenId: string;
|
207
|
+
}, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
|
208
|
+
}"
|
209
|
+
`;
|
210
|
+
|
211
|
+
exports[`execute_msg_for__empty 1`] = `"export type ExecuteMsg_for_Empty = ExecuteMsg_for_Empty;"`;
|
212
|
+
|
213
|
+
exports[`query classes 1`] = `
|
214
|
+
"export class SG721QueryClient implements SG721ReadOnlyInstance {
|
215
|
+
client: CosmWasmClient;
|
216
|
+
contractAddress: string;
|
217
|
+
|
218
|
+
constructor(client: CosmWasmClient, contractAddress: string) {
|
219
|
+
this.client = client;
|
220
|
+
this.contractAddress = contractAddress;
|
221
|
+
this.transferNft = this.transferNft.bind(this);
|
222
|
+
this.sendNft = this.sendNft.bind(this);
|
223
|
+
this.approve = this.approve.bind(this);
|
224
|
+
this.revoke = this.revoke.bind(this);
|
225
|
+
this.approveAll = this.approveAll.bind(this);
|
226
|
+
this.revokeAll = this.revokeAll.bind(this);
|
227
|
+
this.mint = this.mint.bind(this);
|
228
|
+
this.burn = this.burn.bind(this);
|
229
|
+
}
|
230
|
+
|
231
|
+
transferNft = async ({
|
232
|
+
recipient,
|
233
|
+
tokenId
|
234
|
+
}: {
|
235
|
+
recipient: string;
|
236
|
+
tokenId: string;
|
237
|
+
}): Promise<TransferNftResponse> => {
|
238
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
239
|
+
transfer_nft: {
|
240
|
+
recipient,
|
241
|
+
token_id: tokenId
|
242
|
+
}
|
243
|
+
});
|
244
|
+
};
|
245
|
+
sendNft = async ({
|
246
|
+
contract,
|
247
|
+
msg,
|
248
|
+
tokenId
|
249
|
+
}: {
|
250
|
+
contract: string;
|
251
|
+
msg: Binary;
|
252
|
+
tokenId: string;
|
253
|
+
}): Promise<SendNftResponse> => {
|
254
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
255
|
+
send_nft: {
|
256
|
+
contract,
|
257
|
+
msg,
|
258
|
+
token_id: tokenId
|
259
|
+
}
|
260
|
+
});
|
261
|
+
};
|
262
|
+
approve = async ({
|
263
|
+
expires,
|
264
|
+
spender,
|
265
|
+
tokenId
|
266
|
+
}: {
|
267
|
+
expires?: Expiration;
|
268
|
+
spender: string;
|
269
|
+
tokenId: string;
|
270
|
+
}): Promise<ApproveResponse> => {
|
271
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
272
|
+
approve: {
|
273
|
+
expires,
|
274
|
+
spender,
|
275
|
+
token_id: tokenId
|
276
|
+
}
|
277
|
+
});
|
278
|
+
};
|
279
|
+
revoke = async ({
|
280
|
+
spender,
|
281
|
+
tokenId
|
282
|
+
}: {
|
283
|
+
spender: string;
|
284
|
+
tokenId: string;
|
285
|
+
}): Promise<RevokeResponse> => {
|
286
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
287
|
+
revoke: {
|
288
|
+
spender,
|
289
|
+
token_id: tokenId
|
290
|
+
}
|
291
|
+
});
|
292
|
+
};
|
293
|
+
approveAll = async ({
|
294
|
+
expires,
|
295
|
+
operator
|
296
|
+
}: {
|
297
|
+
expires?: Expiration;
|
298
|
+
operator: string;
|
299
|
+
}): Promise<ApproveAllResponse> => {
|
300
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
301
|
+
approve_all: {
|
302
|
+
expires,
|
303
|
+
operator
|
304
|
+
}
|
305
|
+
});
|
306
|
+
};
|
307
|
+
revokeAll = async ({
|
308
|
+
operator
|
309
|
+
}: {
|
310
|
+
operator: string;
|
311
|
+
}): Promise<RevokeAllResponse> => {
|
312
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
313
|
+
revoke_all: {
|
314
|
+
operator
|
315
|
+
}
|
316
|
+
});
|
317
|
+
};
|
318
|
+
mint = async ({
|
319
|
+
extension,
|
320
|
+
owner,
|
321
|
+
tokenId,
|
322
|
+
tokenUri
|
323
|
+
}: {
|
324
|
+
extension: Empty;
|
325
|
+
owner: string;
|
326
|
+
tokenId: string;
|
327
|
+
tokenUri?: string;
|
328
|
+
}): Promise<MintResponse> => {
|
329
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
330
|
+
mint: {
|
331
|
+
extension,
|
332
|
+
owner,
|
333
|
+
token_id: tokenId,
|
334
|
+
token_uri: tokenUri
|
335
|
+
}
|
336
|
+
});
|
337
|
+
};
|
338
|
+
burn = async ({
|
339
|
+
tokenId
|
340
|
+
}: {
|
341
|
+
tokenId: string;
|
342
|
+
}): Promise<BurnResponse> => {
|
343
|
+
return this.client.queryContractSmart(this.contractAddress, {
|
344
|
+
burn: {
|
345
|
+
token_id: tokenId
|
346
|
+
}
|
347
|
+
});
|
348
|
+
};
|
349
|
+
}"
|
350
|
+
`;
|