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.
Files changed (55) hide show
  1. package/main/client/test/ts-client.issue-71.test.js +103 -0
  2. package/main/context/context.js +2 -1
  3. package/main/utils/types.js +20 -7
  4. package/module/client/test/ts-client.issue-71.test.js +21 -0
  5. package/module/context/context.js +2 -1
  6. package/module/utils/types.js +20 -7
  7. package/package.json +5 -3
  8. package/src/client/client.ts +665 -0
  9. package/src/client/index.ts +1 -0
  10. package/src/client/test/__snapshots__/ts-client.account-nfts.spec.ts.snap +497 -0
  11. package/src/client/test/__snapshots__/ts-client.arrays-ref.spec.ts.snap +452 -0
  12. package/src/client/test/__snapshots__/ts-client.arrays.spec.ts.snap +101 -0
  13. package/src/client/test/__snapshots__/ts-client.cw-named-groups.test.ts.snap +141 -0
  14. package/src/client/test/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +341 -0
  15. package/src/client/test/__snapshots__/ts-client.empty-enums.spec.ts.snap +20 -0
  16. package/src/client/test/__snapshots__/ts-client.issue-71.test.ts.snap +432 -0
  17. package/src/client/test/__snapshots__/ts-client.issues.test.ts.snap +984 -0
  18. package/src/client/test/__snapshots__/ts-client.sg721.spec.ts.snap +350 -0
  19. package/src/client/test/__snapshots__/ts-client.spec.ts.snap +723 -0
  20. package/src/client/test/__snapshots__/ts-client.vectis.spec.ts.snap +337 -0
  21. package/src/client/test/ts-client.account-nfts.spec.ts +55 -0
  22. package/src/client/test/ts-client.arrays-ref.spec.ts +48 -0
  23. package/src/client/test/ts-client.arrays.spec.ts +58 -0
  24. package/src/client/test/ts-client.cw-named-groups.test.ts +48 -0
  25. package/src/client/test/ts-client.cw-proposal-single.test.ts +50 -0
  26. package/src/client/test/ts-client.empty-enums.spec.ts +28 -0
  27. package/src/client/test/ts-client.issue-71.test.ts +51 -0
  28. package/src/client/test/ts-client.issues.test.ts +52 -0
  29. package/src/client/test/ts-client.sg721.spec.ts +46 -0
  30. package/src/client/test/ts-client.spec.ts +166 -0
  31. package/src/client/test/ts-client.vectis.spec.ts +97 -0
  32. package/src/context/context.ts +134 -0
  33. package/src/context/imports.ts +126 -0
  34. package/src/context/index.ts +2 -0
  35. package/src/index.ts +7 -0
  36. package/src/message-composer/__snapshots__/message-composer.spec.ts.snap +271 -0
  37. package/src/message-composer/index.ts +1 -0
  38. package/src/message-composer/message-composer.spec.ts +25 -0
  39. package/src/message-composer/message-composer.ts +305 -0
  40. package/src/react-query/__snapshots__/react-query.spec.ts.snap +913 -0
  41. package/src/react-query/index.ts +1 -0
  42. package/src/react-query/react-query.spec.ts +75 -0
  43. package/src/react-query/react-query.ts +913 -0
  44. package/src/recoil/__snapshots__/recoil.spec.ts.snap +203 -0
  45. package/src/recoil/index.ts +1 -0
  46. package/src/recoil/recoil.spec.ts +38 -0
  47. package/src/recoil/recoil.ts +307 -0
  48. package/src/types.ts +44 -0
  49. package/src/utils/__snapshots__/babel.spec.ts.snap +75 -0
  50. package/src/utils/babel.spec.ts +511 -0
  51. package/src/utils/babel.ts +315 -0
  52. package/src/utils/index.ts +2 -0
  53. package/src/utils/types.ts +459 -0
  54. package/types/client/client.d.ts +1 -1
  55. package/types/context/context.d.ts +1 -0
@@ -0,0 +1,913 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`createReactQueryHooks 1`] = `
4
+ "export interface Sg721ReactQuery<TResponse, TData = TResponse> {
5
+ client: Sg721QueryClient;
6
+ options?: UseQueryOptions<TResponse, Error, TData>;
7
+ }
8
+ export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
9
+ export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
10
+ client,
11
+ options
12
+ }: Sg721CollectionInfoQuery<TData>) {
13
+ return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options);
14
+ }
15
+ export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
16
+ export function useSg721MinterQuery<TData = MinterResponse>({
17
+ client,
18
+ options
19
+ }: Sg721MinterQuery<TData>) {
20
+ return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options);
21
+ }
22
+ export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
23
+ args: {
24
+ limit?: number;
25
+ startAfter?: string;
26
+ };
27
+ }
28
+ export function useSg721AllTokensQuery<TData = AllTokensResponse>({
29
+ client,
30
+ args,
31
+ options
32
+ }: Sg721AllTokensQuery<TData>) {
33
+ return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({
34
+ limit: args.limit,
35
+ startAfter: args.startAfter
36
+ }), options);
37
+ }
38
+ export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
39
+ args: {
40
+ limit?: number;
41
+ owner: string;
42
+ startAfter?: string;
43
+ };
44
+ }
45
+ export function useSg721TokensQuery<TData = TokensResponse>({
46
+ client,
47
+ args,
48
+ options
49
+ }: Sg721TokensQuery<TData>) {
50
+ return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({
51
+ limit: args.limit,
52
+ owner: args.owner,
53
+ startAfter: args.startAfter
54
+ }), options);
55
+ }
56
+ export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
57
+ args: {
58
+ includeExpired?: boolean;
59
+ tokenId: string;
60
+ };
61
+ }
62
+ export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
63
+ client,
64
+ args,
65
+ options
66
+ }: Sg721AllNftInfoQuery<TData>) {
67
+ return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({
68
+ includeExpired: args.includeExpired,
69
+ tokenId: args.tokenId
70
+ }), options);
71
+ }
72
+ export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
73
+ args: {
74
+ tokenId: string;
75
+ };
76
+ }
77
+ export function useSg721NftInfoQuery<TData = NftInfoResponse>({
78
+ client,
79
+ args,
80
+ options
81
+ }: Sg721NftInfoQuery<TData>) {
82
+ return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({
83
+ tokenId: args.tokenId
84
+ }), options);
85
+ }
86
+ export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
87
+ export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
88
+ client,
89
+ options
90
+ }: Sg721ContractInfoQuery<TData>) {
91
+ return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options);
92
+ }
93
+ export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
94
+ export function useSg721NumTokensQuery<TData = NumTokensResponse>({
95
+ client,
96
+ options
97
+ }: Sg721NumTokensQuery<TData>) {
98
+ return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options);
99
+ }
100
+ export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
101
+ args: {
102
+ includeExpired?: boolean;
103
+ limit?: number;
104
+ owner: string;
105
+ startAfter?: string;
106
+ };
107
+ }
108
+ export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
109
+ client,
110
+ args,
111
+ options
112
+ }: Sg721AllOperatorsQuery<TData>) {
113
+ return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({
114
+ includeExpired: args.includeExpired,
115
+ limit: args.limit,
116
+ owner: args.owner,
117
+ startAfter: args.startAfter
118
+ }), options);
119
+ }
120
+ export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
121
+ args: {
122
+ includeExpired?: boolean;
123
+ tokenId: string;
124
+ };
125
+ }
126
+ export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
127
+ client,
128
+ args,
129
+ options
130
+ }: Sg721ApprovalsQuery<TData>) {
131
+ return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({
132
+ includeExpired: args.includeExpired,
133
+ tokenId: args.tokenId
134
+ }), options);
135
+ }
136
+ export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
137
+ args: {
138
+ includeExpired?: boolean;
139
+ spender: string;
140
+ tokenId: string;
141
+ };
142
+ }
143
+ export function useSg721ApprovalQuery<TData = ApprovalResponse>({
144
+ client,
145
+ args,
146
+ options
147
+ }: Sg721ApprovalQuery<TData>) {
148
+ return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({
149
+ includeExpired: args.includeExpired,
150
+ spender: args.spender,
151
+ tokenId: args.tokenId
152
+ }), options);
153
+ }
154
+ export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
155
+ args: {
156
+ includeExpired?: boolean;
157
+ tokenId: string;
158
+ };
159
+ }
160
+ export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
161
+ client,
162
+ args,
163
+ options
164
+ }: Sg721OwnerOfQuery<TData>) {
165
+ return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({
166
+ includeExpired: args.includeExpired,
167
+ tokenId: args.tokenId
168
+ }), options);
169
+ }"
170
+ `;
171
+
172
+ exports[`createReactQueryHooks 2`] = `
173
+ "export interface Sg721ReactQuery<TResponse, TData = TResponse> {
174
+ client: Sg721QueryClient | undefined;
175
+ options?: UseQueryOptions<TResponse, Error, TData>;
176
+ }
177
+ export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
178
+ export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
179
+ client,
180
+ options
181
+ }: Sg721CollectionInfoQuery<TData>) {
182
+ return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
183
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
184
+ });
185
+ }
186
+ export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
187
+ export function useSg721MinterQuery<TData = MinterResponse>({
188
+ client,
189
+ options
190
+ }: Sg721MinterQuery<TData>) {
191
+ return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
192
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
193
+ });
194
+ }
195
+ export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
196
+ args: {
197
+ limit?: number;
198
+ startAfter?: string;
199
+ };
200
+ }
201
+ export function useSg721AllTokensQuery<TData = AllTokensResponse>({
202
+ client,
203
+ args,
204
+ options
205
+ }: Sg721AllTokensQuery<TData>) {
206
+ return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({
207
+ limit: args.limit,
208
+ startAfter: args.startAfter
209
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
210
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
211
+ });
212
+ }
213
+ export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
214
+ args: {
215
+ limit?: number;
216
+ owner: string;
217
+ startAfter?: string;
218
+ };
219
+ }
220
+ export function useSg721TokensQuery<TData = TokensResponse>({
221
+ client,
222
+ args,
223
+ options
224
+ }: Sg721TokensQuery<TData>) {
225
+ return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({
226
+ limit: args.limit,
227
+ owner: args.owner,
228
+ startAfter: args.startAfter
229
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
230
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
231
+ });
232
+ }
233
+ export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
234
+ args: {
235
+ includeExpired?: boolean;
236
+ tokenId: string;
237
+ };
238
+ }
239
+ export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
240
+ client,
241
+ args,
242
+ options
243
+ }: Sg721AllNftInfoQuery<TData>) {
244
+ return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({
245
+ includeExpired: args.includeExpired,
246
+ tokenId: args.tokenId
247
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
248
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
249
+ });
250
+ }
251
+ export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
252
+ args: {
253
+ tokenId: string;
254
+ };
255
+ }
256
+ export function useSg721NftInfoQuery<TData = NftInfoResponse>({
257
+ client,
258
+ args,
259
+ options
260
+ }: Sg721NftInfoQuery<TData>) {
261
+ return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({
262
+ tokenId: args.tokenId
263
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
264
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
265
+ });
266
+ }
267
+ export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
268
+ export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
269
+ client,
270
+ options
271
+ }: Sg721ContractInfoQuery<TData>) {
272
+ return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
273
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
274
+ });
275
+ }
276
+ export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
277
+ export function useSg721NumTokensQuery<TData = NumTokensResponse>({
278
+ client,
279
+ options
280
+ }: Sg721NumTokensQuery<TData>) {
281
+ return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
282
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
283
+ });
284
+ }
285
+ export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
286
+ args: {
287
+ includeExpired?: boolean;
288
+ limit?: number;
289
+ owner: string;
290
+ startAfter?: string;
291
+ };
292
+ }
293
+ export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
294
+ client,
295
+ args,
296
+ options
297
+ }: Sg721AllOperatorsQuery<TData>) {
298
+ return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({
299
+ includeExpired: args.includeExpired,
300
+ limit: args.limit,
301
+ owner: args.owner,
302
+ startAfter: args.startAfter
303
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
304
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
305
+ });
306
+ }
307
+ export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
308
+ args: {
309
+ includeExpired?: boolean;
310
+ tokenId: string;
311
+ };
312
+ }
313
+ export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
314
+ client,
315
+ args,
316
+ options
317
+ }: Sg721ApprovalsQuery<TData>) {
318
+ return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({
319
+ includeExpired: args.includeExpired,
320
+ tokenId: args.tokenId
321
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
322
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
323
+ });
324
+ }
325
+ export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
326
+ args: {
327
+ includeExpired?: boolean;
328
+ spender: string;
329
+ tokenId: string;
330
+ };
331
+ }
332
+ export function useSg721ApprovalQuery<TData = ApprovalResponse>({
333
+ client,
334
+ args,
335
+ options
336
+ }: Sg721ApprovalQuery<TData>) {
337
+ return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({
338
+ includeExpired: args.includeExpired,
339
+ spender: args.spender,
340
+ tokenId: args.tokenId
341
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
342
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
343
+ });
344
+ }
345
+ export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
346
+ args: {
347
+ includeExpired?: boolean;
348
+ tokenId: string;
349
+ };
350
+ }
351
+ export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
352
+ client,
353
+ args,
354
+ options
355
+ }: Sg721OwnerOfQuery<TData>) {
356
+ return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({
357
+ includeExpired: args.includeExpired,
358
+ tokenId: args.tokenId
359
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
360
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
361
+ });
362
+ }"
363
+ `;
364
+
365
+ exports[`createReactQueryHooks 3`] = `
366
+ "export interface Sg721ReactQuery<TResponse, TData = TResponse> {
367
+ client: Sg721QueryClient;
368
+ options?: Omit<UseQueryOptions<TResponse, Error, TData>, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & {
369
+ initialData?: undefined;
370
+ };
371
+ }
372
+ export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
373
+ export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
374
+ client,
375
+ options
376
+ }: Sg721CollectionInfoQuery<TData>) {
377
+ return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client.contractAddress], () => client.collectionInfo(), options);
378
+ }
379
+ export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
380
+ export function useSg721MinterQuery<TData = MinterResponse>({
381
+ client,
382
+ options
383
+ }: Sg721MinterQuery<TData>) {
384
+ return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client.contractAddress], () => client.minter(), options);
385
+ }
386
+ export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
387
+ args: {
388
+ limit?: number;
389
+ startAfter?: string;
390
+ };
391
+ }
392
+ export function useSg721AllTokensQuery<TData = AllTokensResponse>({
393
+ client,
394
+ args,
395
+ options
396
+ }: Sg721AllTokensQuery<TData>) {
397
+ return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client.contractAddress, JSON.stringify(args)], () => client.allTokens({
398
+ limit: args.limit,
399
+ startAfter: args.startAfter
400
+ }), options);
401
+ }
402
+ export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
403
+ args: {
404
+ limit?: number;
405
+ owner: string;
406
+ startAfter?: string;
407
+ };
408
+ }
409
+ export function useSg721TokensQuery<TData = TokensResponse>({
410
+ client,
411
+ args,
412
+ options
413
+ }: Sg721TokensQuery<TData>) {
414
+ return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client.contractAddress, JSON.stringify(args)], () => client.tokens({
415
+ limit: args.limit,
416
+ owner: args.owner,
417
+ startAfter: args.startAfter
418
+ }), options);
419
+ }
420
+ export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
421
+ args: {
422
+ includeExpired?: boolean;
423
+ tokenId: string;
424
+ };
425
+ }
426
+ export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
427
+ client,
428
+ args,
429
+ options
430
+ }: Sg721AllNftInfoQuery<TData>) {
431
+ return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.allNftInfo({
432
+ includeExpired: args.includeExpired,
433
+ tokenId: args.tokenId
434
+ }), options);
435
+ }
436
+ export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
437
+ args: {
438
+ tokenId: string;
439
+ };
440
+ }
441
+ export function useSg721NftInfoQuery<TData = NftInfoResponse>({
442
+ client,
443
+ args,
444
+ options
445
+ }: Sg721NftInfoQuery<TData>) {
446
+ return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client.contractAddress, JSON.stringify(args)], () => client.nftInfo({
447
+ tokenId: args.tokenId
448
+ }), options);
449
+ }
450
+ export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
451
+ export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
452
+ client,
453
+ options
454
+ }: Sg721ContractInfoQuery<TData>) {
455
+ return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client.contractAddress], () => client.contractInfo(), options);
456
+ }
457
+ export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
458
+ export function useSg721NumTokensQuery<TData = NumTokensResponse>({
459
+ client,
460
+ options
461
+ }: Sg721NumTokensQuery<TData>) {
462
+ return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client.contractAddress], () => client.numTokens(), options);
463
+ }
464
+ export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
465
+ args: {
466
+ includeExpired?: boolean;
467
+ limit?: number;
468
+ owner: string;
469
+ startAfter?: string;
470
+ };
471
+ }
472
+ export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
473
+ client,
474
+ args,
475
+ options
476
+ }: Sg721AllOperatorsQuery<TData>) {
477
+ return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client.contractAddress, JSON.stringify(args)], () => client.allOperators({
478
+ includeExpired: args.includeExpired,
479
+ limit: args.limit,
480
+ owner: args.owner,
481
+ startAfter: args.startAfter
482
+ }), options);
483
+ }
484
+ export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
485
+ args: {
486
+ includeExpired?: boolean;
487
+ tokenId: string;
488
+ };
489
+ }
490
+ export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
491
+ client,
492
+ args,
493
+ options
494
+ }: Sg721ApprovalsQuery<TData>) {
495
+ return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client.contractAddress, JSON.stringify(args)], () => client.approvals({
496
+ includeExpired: args.includeExpired,
497
+ tokenId: args.tokenId
498
+ }), options);
499
+ }
500
+ export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
501
+ args: {
502
+ includeExpired?: boolean;
503
+ spender: string;
504
+ tokenId: string;
505
+ };
506
+ }
507
+ export function useSg721ApprovalQuery<TData = ApprovalResponse>({
508
+ client,
509
+ args,
510
+ options
511
+ }: Sg721ApprovalQuery<TData>) {
512
+ return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client.contractAddress, JSON.stringify(args)], () => client.approval({
513
+ includeExpired: args.includeExpired,
514
+ spender: args.spender,
515
+ tokenId: args.tokenId
516
+ }), options);
517
+ }
518
+ export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
519
+ args: {
520
+ includeExpired?: boolean;
521
+ tokenId: string;
522
+ };
523
+ }
524
+ export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
525
+ client,
526
+ args,
527
+ options
528
+ }: Sg721OwnerOfQuery<TData>) {
529
+ return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client.contractAddress, JSON.stringify(args)], () => client.ownerOf({
530
+ includeExpired: args.includeExpired,
531
+ tokenId: args.tokenId
532
+ }), options);
533
+ }"
534
+ `;
535
+
536
+ exports[`createReactQueryHooks 4`] = `
537
+ "export interface Sg721ReactQuery<TResponse, TData = TResponse> {
538
+ client: Sg721QueryClient | undefined;
539
+ options?: Omit<UseQueryOptions<TResponse, Error, TData>, \\"'queryKey' | 'queryFn' | 'initialData'\\"> & {
540
+ initialData?: undefined;
541
+ };
542
+ }
543
+ export interface Sg721CollectionInfoQuery<TData> extends Sg721ReactQuery<CollectionInfoResponse, TData> {}
544
+ export function useSg721CollectionInfoQuery<TData = CollectionInfoResponse>({
545
+ client,
546
+ options
547
+ }: Sg721CollectionInfoQuery<TData>) {
548
+ return useQuery<CollectionInfoResponse, Error, TData>([\\"sg721CollectionInfo\\", client?.contractAddress], () => client ? client.collectionInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
549
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
550
+ });
551
+ }
552
+ export interface Sg721MinterQuery<TData> extends Sg721ReactQuery<MinterResponse, TData> {}
553
+ export function useSg721MinterQuery<TData = MinterResponse>({
554
+ client,
555
+ options
556
+ }: Sg721MinterQuery<TData>) {
557
+ return useQuery<MinterResponse, Error, TData>([\\"sg721Minter\\", client?.contractAddress], () => client ? client.minter() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
558
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
559
+ });
560
+ }
561
+ export interface Sg721AllTokensQuery<TData> extends Sg721ReactQuery<AllTokensResponse, TData> {
562
+ args: {
563
+ limit?: number;
564
+ startAfter?: string;
565
+ };
566
+ }
567
+ export function useSg721AllTokensQuery<TData = AllTokensResponse>({
568
+ client,
569
+ args,
570
+ options
571
+ }: Sg721AllTokensQuery<TData>) {
572
+ return useQuery<AllTokensResponse, Error, TData>([\\"sg721AllTokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allTokens({
573
+ limit: args.limit,
574
+ startAfter: args.startAfter
575
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
576
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
577
+ });
578
+ }
579
+ export interface Sg721TokensQuery<TData> extends Sg721ReactQuery<TokensResponse, TData> {
580
+ args: {
581
+ limit?: number;
582
+ owner: string;
583
+ startAfter?: string;
584
+ };
585
+ }
586
+ export function useSg721TokensQuery<TData = TokensResponse>({
587
+ client,
588
+ args,
589
+ options
590
+ }: Sg721TokensQuery<TData>) {
591
+ return useQuery<TokensResponse, Error, TData>([\\"sg721Tokens\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.tokens({
592
+ limit: args.limit,
593
+ owner: args.owner,
594
+ startAfter: args.startAfter
595
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
596
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
597
+ });
598
+ }
599
+ export interface Sg721AllNftInfoQuery<TData> extends Sg721ReactQuery<AllNftInfoResponse, TData> {
600
+ args: {
601
+ includeExpired?: boolean;
602
+ tokenId: string;
603
+ };
604
+ }
605
+ export function useSg721AllNftInfoQuery<TData = AllNftInfoResponse>({
606
+ client,
607
+ args,
608
+ options
609
+ }: Sg721AllNftInfoQuery<TData>) {
610
+ return useQuery<AllNftInfoResponse, Error, TData>([\\"sg721AllNftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allNftInfo({
611
+ includeExpired: args.includeExpired,
612
+ tokenId: args.tokenId
613
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
614
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
615
+ });
616
+ }
617
+ export interface Sg721NftInfoQuery<TData> extends Sg721ReactQuery<NftInfoResponse, TData> {
618
+ args: {
619
+ tokenId: string;
620
+ };
621
+ }
622
+ export function useSg721NftInfoQuery<TData = NftInfoResponse>({
623
+ client,
624
+ args,
625
+ options
626
+ }: Sg721NftInfoQuery<TData>) {
627
+ return useQuery<NftInfoResponse, Error, TData>([\\"sg721NftInfo\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.nftInfo({
628
+ tokenId: args.tokenId
629
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
630
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
631
+ });
632
+ }
633
+ export interface Sg721ContractInfoQuery<TData> extends Sg721ReactQuery<ContractInfoResponse, TData> {}
634
+ export function useSg721ContractInfoQuery<TData = ContractInfoResponse>({
635
+ client,
636
+ options
637
+ }: Sg721ContractInfoQuery<TData>) {
638
+ return useQuery<ContractInfoResponse, Error, TData>([\\"sg721ContractInfo\\", client?.contractAddress], () => client ? client.contractInfo() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
639
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
640
+ });
641
+ }
642
+ export interface Sg721NumTokensQuery<TData> extends Sg721ReactQuery<NumTokensResponse, TData> {}
643
+ export function useSg721NumTokensQuery<TData = NumTokensResponse>({
644
+ client,
645
+ options
646
+ }: Sg721NumTokensQuery<TData>) {
647
+ return useQuery<NumTokensResponse, Error, TData>([\\"sg721NumTokens\\", client?.contractAddress], () => client ? client.numTokens() : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
648
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
649
+ });
650
+ }
651
+ export interface Sg721AllOperatorsQuery<TData> extends Sg721ReactQuery<AllOperatorsResponse, TData> {
652
+ args: {
653
+ includeExpired?: boolean;
654
+ limit?: number;
655
+ owner: string;
656
+ startAfter?: string;
657
+ };
658
+ }
659
+ export function useSg721AllOperatorsQuery<TData = AllOperatorsResponse>({
660
+ client,
661
+ args,
662
+ options
663
+ }: Sg721AllOperatorsQuery<TData>) {
664
+ return useQuery<AllOperatorsResponse, Error, TData>([\\"sg721AllOperators\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.allOperators({
665
+ includeExpired: args.includeExpired,
666
+ limit: args.limit,
667
+ owner: args.owner,
668
+ startAfter: args.startAfter
669
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
670
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
671
+ });
672
+ }
673
+ export interface Sg721ApprovalsQuery<TData> extends Sg721ReactQuery<ApprovalsResponse, TData> {
674
+ args: {
675
+ includeExpired?: boolean;
676
+ tokenId: string;
677
+ };
678
+ }
679
+ export function useSg721ApprovalsQuery<TData = ApprovalsResponse>({
680
+ client,
681
+ args,
682
+ options
683
+ }: Sg721ApprovalsQuery<TData>) {
684
+ return useQuery<ApprovalsResponse, Error, TData>([\\"sg721Approvals\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approvals({
685
+ includeExpired: args.includeExpired,
686
+ tokenId: args.tokenId
687
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
688
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
689
+ });
690
+ }
691
+ export interface Sg721ApprovalQuery<TData> extends Sg721ReactQuery<ApprovalResponse, TData> {
692
+ args: {
693
+ includeExpired?: boolean;
694
+ spender: string;
695
+ tokenId: string;
696
+ };
697
+ }
698
+ export function useSg721ApprovalQuery<TData = ApprovalResponse>({
699
+ client,
700
+ args,
701
+ options
702
+ }: Sg721ApprovalQuery<TData>) {
703
+ return useQuery<ApprovalResponse, Error, TData>([\\"sg721Approval\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.approval({
704
+ includeExpired: args.includeExpired,
705
+ spender: args.spender,
706
+ tokenId: args.tokenId
707
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
708
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
709
+ });
710
+ }
711
+ export interface Sg721OwnerOfQuery<TData> extends Sg721ReactQuery<OwnerOfResponse, TData> {
712
+ args: {
713
+ includeExpired?: boolean;
714
+ tokenId: string;
715
+ };
716
+ }
717
+ export function useSg721OwnerOfQuery<TData = OwnerOfResponse>({
718
+ client,
719
+ args,
720
+ options
721
+ }: Sg721OwnerOfQuery<TData>) {
722
+ return useQuery<OwnerOfResponse, Error, TData>([\\"sg721OwnerOf\\", client?.contractAddress, JSON.stringify(args)], () => client ? client.ownerOf({
723
+ includeExpired: args.includeExpired,
724
+ tokenId: args.tokenId
725
+ }) : Promise.reject(new Error(\\"Invalid client\\")), { ...options,
726
+ enabled: !!client && (options?.enabled != undefined ? options.enabled : true)
727
+ });
728
+ }"
729
+ `;
730
+
731
+ exports[`createReactQueryHooks 5`] = `
732
+ "export interface Sg721BurnMutation {
733
+ client: Sg721Client;
734
+ msg: {
735
+ tokenId: string;
736
+ };
737
+ args?: {
738
+ fee?: number | StdFee | \\"auto\\";
739
+ memo?: string;
740
+ funds?: Coin[];
741
+ };
742
+ }
743
+ export function useSg721BurnMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721BurnMutation>, \\"mutationFn\\">) {
744
+ return useMutation<ExecuteResult, Error, Sg721BurnMutation>(({
745
+ client,
746
+ msg,
747
+ args: {
748
+ fee,
749
+ memo,
750
+ funds
751
+ } = {}
752
+ }) => client.burn(msg, fee, memo, funds), options);
753
+ }
754
+ export interface Sg721MintMutation {
755
+ client: Sg721Client;
756
+ msg: MintMsg_for_Empty;
757
+ args?: {
758
+ fee?: number | StdFee | \\"auto\\";
759
+ memo?: string;
760
+ funds?: Coin[];
761
+ };
762
+ }
763
+ export function useSg721MintMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721MintMutation>, \\"mutationFn\\">) {
764
+ return useMutation<ExecuteResult, Error, Sg721MintMutation>(({
765
+ client,
766
+ msg,
767
+ args: {
768
+ fee,
769
+ memo,
770
+ funds
771
+ } = {}
772
+ }) => client.mint(msg, fee, memo, funds), options);
773
+ }
774
+ export interface Sg721RevokeAllMutation {
775
+ client: Sg721Client;
776
+ msg: {
777
+ operator: string;
778
+ };
779
+ args?: {
780
+ fee?: number | StdFee | \\"auto\\";
781
+ memo?: string;
782
+ funds?: Coin[];
783
+ };
784
+ }
785
+ export function useSg721RevokeAllMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721RevokeAllMutation>, \\"mutationFn\\">) {
786
+ return useMutation<ExecuteResult, Error, Sg721RevokeAllMutation>(({
787
+ client,
788
+ msg,
789
+ args: {
790
+ fee,
791
+ memo,
792
+ funds
793
+ } = {}
794
+ }) => client.revokeAll(msg, fee, memo, funds), options);
795
+ }
796
+ export interface Sg721ApproveAllMutation {
797
+ client: Sg721Client;
798
+ msg: {
799
+ expires?: Expiration;
800
+ operator: string;
801
+ };
802
+ args?: {
803
+ fee?: number | StdFee | \\"auto\\";
804
+ memo?: string;
805
+ funds?: Coin[];
806
+ };
807
+ }
808
+ export function useSg721ApproveAllMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721ApproveAllMutation>, \\"mutationFn\\">) {
809
+ return useMutation<ExecuteResult, Error, Sg721ApproveAllMutation>(({
810
+ client,
811
+ msg,
812
+ args: {
813
+ fee,
814
+ memo,
815
+ funds
816
+ } = {}
817
+ }) => client.approveAll(msg, fee, memo, funds), options);
818
+ }
819
+ export interface Sg721RevokeMutation {
820
+ client: Sg721Client;
821
+ msg: {
822
+ spender: string;
823
+ tokenId: string;
824
+ };
825
+ args?: {
826
+ fee?: number | StdFee | \\"auto\\";
827
+ memo?: string;
828
+ funds?: Coin[];
829
+ };
830
+ }
831
+ export function useSg721RevokeMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721RevokeMutation>, \\"mutationFn\\">) {
832
+ return useMutation<ExecuteResult, Error, Sg721RevokeMutation>(({
833
+ client,
834
+ msg,
835
+ args: {
836
+ fee,
837
+ memo,
838
+ funds
839
+ } = {}
840
+ }) => client.revoke(msg, fee, memo, funds), options);
841
+ }
842
+ export interface Sg721ApproveMutation {
843
+ client: Sg721Client;
844
+ msg: {
845
+ expires?: Expiration;
846
+ spender: string;
847
+ tokenId: string;
848
+ };
849
+ args?: {
850
+ fee?: number | StdFee | \\"auto\\";
851
+ memo?: string;
852
+ funds?: Coin[];
853
+ };
854
+ }
855
+ export function useSg721ApproveMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721ApproveMutation>, \\"mutationFn\\">) {
856
+ return useMutation<ExecuteResult, Error, Sg721ApproveMutation>(({
857
+ client,
858
+ msg,
859
+ args: {
860
+ fee,
861
+ memo,
862
+ funds
863
+ } = {}
864
+ }) => client.approve(msg, fee, memo, funds), options);
865
+ }
866
+ export interface Sg721SendNftMutation {
867
+ client: Sg721Client;
868
+ msg: {
869
+ contract: string;
870
+ msg: Binary;
871
+ tokenId: string;
872
+ };
873
+ args?: {
874
+ fee?: number | StdFee | \\"auto\\";
875
+ memo?: string;
876
+ funds?: Coin[];
877
+ };
878
+ }
879
+ export function useSg721SendNftMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721SendNftMutation>, \\"mutationFn\\">) {
880
+ return useMutation<ExecuteResult, Error, Sg721SendNftMutation>(({
881
+ client,
882
+ msg,
883
+ args: {
884
+ fee,
885
+ memo,
886
+ funds
887
+ } = {}
888
+ }) => client.sendNft(msg, fee, memo, funds), options);
889
+ }
890
+ export interface Sg721TransferNftMutation {
891
+ client: Sg721Client;
892
+ msg: {
893
+ recipient: string;
894
+ tokenId: string;
895
+ };
896
+ args?: {
897
+ fee?: number | StdFee | \\"auto\\";
898
+ memo?: string;
899
+ funds?: Coin[];
900
+ };
901
+ }
902
+ export function useSg721TransferNftMutation(options?: Omit<UseMutationOptions<ExecuteResult, Error, Sg721TransferNftMutation>, \\"mutationFn\\">) {
903
+ return useMutation<ExecuteResult, Error, Sg721TransferNftMutation>(({
904
+ client,
905
+ msg,
906
+ args: {
907
+ fee,
908
+ memo,
909
+ funds
910
+ } = {}
911
+ }) => client.transferNft(msg, fee, memo, funds), options);
912
+ }"
913
+ `;