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,723 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`all_nft_info_response 1`] = `
4
+ "export interface AllNftInfoResponse {
5
+ access: OwnerOfResponse;
6
+ info: NftInfoResponse_for_Empty;
7
+ }"
8
+ `;
9
+
10
+ exports[`approval_response 1`] = `
11
+ "export interface ApprovalResponse {
12
+ approval: Approval;
13
+ }"
14
+ `;
15
+
16
+ exports[`approvals_response 1`] = `
17
+ "export interface ApprovalsResponse {
18
+ approvals: Approval[];
19
+ }"
20
+ `;
21
+
22
+ exports[`collection_info_response 1`] = `
23
+ "export interface CollectionInfoResponse {
24
+ creator: string;
25
+ description: string;
26
+ externalLink?: string;
27
+ image: string;
28
+ royaltyInfo?: RoyaltyInfoResponse;
29
+ }"
30
+ `;
31
+
32
+ exports[`contract_info_response 1`] = `
33
+ "export interface ContractInfoResponse {
34
+ name: string;
35
+ symbol: string;
36
+ }"
37
+ `;
38
+
39
+ exports[`execute classes 1`] = `
40
+ "export class SG721Client extends SG721QueryClient implements SG721Instance {
41
+ client: SigningCosmWasmClient;
42
+ sender: string;
43
+ contractAddress: string;
44
+
45
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
46
+ super(client, contractAddress);
47
+ this.client = client;
48
+ this.sender = sender;
49
+ this.contractAddress = contractAddress;
50
+ this.transferNft = this.transferNft.bind(this);
51
+ this.sendNft = this.sendNft.bind(this);
52
+ this.approve = this.approve.bind(this);
53
+ this.revoke = this.revoke.bind(this);
54
+ this.approveAll = this.approveAll.bind(this);
55
+ this.revokeAll = this.revokeAll.bind(this);
56
+ this.mint = this.mint.bind(this);
57
+ this.burn = this.burn.bind(this);
58
+ }
59
+
60
+ transferNft = async ({
61
+ recipient,
62
+ tokenId
63
+ }: {
64
+ recipient: string;
65
+ tokenId: string;
66
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
67
+ return await this.client.execute(this.sender, this.contractAddress, {
68
+ transfer_nft: {
69
+ recipient,
70
+ token_id: tokenId
71
+ }
72
+ }, fee, memo, funds);
73
+ };
74
+ sendNft = async ({
75
+ contract,
76
+ msg,
77
+ tokenId
78
+ }: {
79
+ contract: string;
80
+ msg: Binary;
81
+ tokenId: string;
82
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
83
+ return await this.client.execute(this.sender, this.contractAddress, {
84
+ send_nft: {
85
+ contract,
86
+ msg,
87
+ token_id: tokenId
88
+ }
89
+ }, fee, memo, funds);
90
+ };
91
+ approve = async ({
92
+ expires,
93
+ spender,
94
+ tokenId
95
+ }: {
96
+ expires?: Expiration;
97
+ spender: string;
98
+ tokenId: string;
99
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
100
+ return await this.client.execute(this.sender, this.contractAddress, {
101
+ approve: {
102
+ expires,
103
+ spender,
104
+ token_id: tokenId
105
+ }
106
+ }, fee, memo, funds);
107
+ };
108
+ revoke = async ({
109
+ spender,
110
+ tokenId
111
+ }: {
112
+ spender: string;
113
+ tokenId: string;
114
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
115
+ return await this.client.execute(this.sender, this.contractAddress, {
116
+ revoke: {
117
+ spender,
118
+ token_id: tokenId
119
+ }
120
+ }, fee, memo, funds);
121
+ };
122
+ approveAll = async ({
123
+ expires,
124
+ operator
125
+ }: {
126
+ expires?: Expiration;
127
+ operator: string;
128
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
129
+ return await this.client.execute(this.sender, this.contractAddress, {
130
+ approve_all: {
131
+ expires,
132
+ operator
133
+ }
134
+ }, fee, memo, funds);
135
+ };
136
+ revokeAll = async ({
137
+ operator
138
+ }: {
139
+ operator: string;
140
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
141
+ return await this.client.execute(this.sender, this.contractAddress, {
142
+ revoke_all: {
143
+ operator
144
+ }
145
+ }, fee, memo, funds);
146
+ };
147
+ mint = async ({
148
+ extension,
149
+ owner,
150
+ tokenId,
151
+ tokenUri
152
+ }: {
153
+ extension: Empty;
154
+ owner: string;
155
+ tokenId: string;
156
+ tokenUri?: string;
157
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
158
+ return await this.client.execute(this.sender, this.contractAddress, {
159
+ mint: {
160
+ extension,
161
+ owner,
162
+ token_id: tokenId,
163
+ token_uri: tokenUri
164
+ }
165
+ }, fee, memo, funds);
166
+ };
167
+ burn = async ({
168
+ tokenId
169
+ }: {
170
+ tokenId: string;
171
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
172
+ return await this.client.execute(this.sender, this.contractAddress, {
173
+ burn: {
174
+ token_id: tokenId
175
+ }
176
+ }, fee, memo, funds);
177
+ };
178
+ }"
179
+ `;
180
+
181
+ exports[`execute classes array types 1`] = `
182
+ "export class SG721Client implements SG721Instance {
183
+ client: SigningCosmWasmClient;
184
+ sender: string;
185
+ contractAddress: string;
186
+
187
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
188
+ this.client = client;
189
+ this.sender = sender;
190
+ this.contractAddress = contractAddress;
191
+ this.update = this.update.bind(this);
192
+ this.removeGroup = this.removeGroup.bind(this);
193
+ this.updateOwner = this.updateOwner.bind(this);
194
+ }
195
+
196
+ update = async ({
197
+ addressesToAdd,
198
+ addressesToRemove,
199
+ group
200
+ }: {
201
+ addressesToAdd?: string[];
202
+ addressesToRemove?: string[];
203
+ group: string;
204
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
205
+ return await this.client.execute(this.sender, this.contractAddress, {
206
+ update: {
207
+ addresses_to_add: addressesToAdd,
208
+ addresses_to_remove: addressesToRemove,
209
+ group
210
+ }
211
+ }, fee, memo, funds);
212
+ };
213
+ removeGroup = async ({
214
+ group
215
+ }: {
216
+ group: string;
217
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
218
+ return await this.client.execute(this.sender, this.contractAddress, {
219
+ remove_group: {
220
+ group
221
+ }
222
+ }, fee, memo, funds);
223
+ };
224
+ updateOwner = async ({
225
+ owner
226
+ }: {
227
+ owner: string;
228
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
229
+ return await this.client.execute(this.sender, this.contractAddress, {
230
+ update_owner: {
231
+ owner
232
+ }
233
+ }, fee, memo, funds);
234
+ };
235
+ }"
236
+ `;
237
+
238
+ exports[`execute classes no extends 1`] = `
239
+ "export class SG721Client implements SG721Instance {
240
+ client: SigningCosmWasmClient;
241
+ sender: string;
242
+ contractAddress: string;
243
+
244
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
245
+ this.client = client;
246
+ this.sender = sender;
247
+ this.contractAddress = contractAddress;
248
+ this.transferNft = this.transferNft.bind(this);
249
+ this.sendNft = this.sendNft.bind(this);
250
+ this.approve = this.approve.bind(this);
251
+ this.revoke = this.revoke.bind(this);
252
+ this.approveAll = this.approveAll.bind(this);
253
+ this.revokeAll = this.revokeAll.bind(this);
254
+ this.mint = this.mint.bind(this);
255
+ this.burn = this.burn.bind(this);
256
+ }
257
+
258
+ transferNft = async ({
259
+ recipient,
260
+ tokenId
261
+ }: {
262
+ recipient: string;
263
+ tokenId: string;
264
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
265
+ return await this.client.execute(this.sender, this.contractAddress, {
266
+ transfer_nft: {
267
+ recipient,
268
+ token_id: tokenId
269
+ }
270
+ }, fee, memo, funds);
271
+ };
272
+ sendNft = async ({
273
+ contract,
274
+ msg,
275
+ tokenId
276
+ }: {
277
+ contract: string;
278
+ msg: Binary;
279
+ tokenId: string;
280
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
281
+ return await this.client.execute(this.sender, this.contractAddress, {
282
+ send_nft: {
283
+ contract,
284
+ msg,
285
+ token_id: tokenId
286
+ }
287
+ }, fee, memo, funds);
288
+ };
289
+ approve = async ({
290
+ expires,
291
+ spender,
292
+ tokenId
293
+ }: {
294
+ expires?: Expiration;
295
+ spender: string;
296
+ tokenId: string;
297
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
298
+ return await this.client.execute(this.sender, this.contractAddress, {
299
+ approve: {
300
+ expires,
301
+ spender,
302
+ token_id: tokenId
303
+ }
304
+ }, fee, memo, funds);
305
+ };
306
+ revoke = async ({
307
+ spender,
308
+ tokenId
309
+ }: {
310
+ spender: string;
311
+ tokenId: string;
312
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
313
+ return await this.client.execute(this.sender, this.contractAddress, {
314
+ revoke: {
315
+ spender,
316
+ token_id: tokenId
317
+ }
318
+ }, fee, memo, funds);
319
+ };
320
+ approveAll = async ({
321
+ expires,
322
+ operator
323
+ }: {
324
+ expires?: Expiration;
325
+ operator: string;
326
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
327
+ return await this.client.execute(this.sender, this.contractAddress, {
328
+ approve_all: {
329
+ expires,
330
+ operator
331
+ }
332
+ }, fee, memo, funds);
333
+ };
334
+ revokeAll = async ({
335
+ operator
336
+ }: {
337
+ operator: string;
338
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
339
+ return await this.client.execute(this.sender, this.contractAddress, {
340
+ revoke_all: {
341
+ operator
342
+ }
343
+ }, fee, memo, funds);
344
+ };
345
+ mint = async ({
346
+ extension,
347
+ owner,
348
+ tokenId,
349
+ tokenUri
350
+ }: {
351
+ extension: Empty;
352
+ owner: string;
353
+ tokenId: string;
354
+ tokenUri?: string;
355
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
356
+ return await this.client.execute(this.sender, this.contractAddress, {
357
+ mint: {
358
+ extension,
359
+ owner,
360
+ token_id: tokenId,
361
+ token_uri: tokenUri
362
+ }
363
+ }, fee, memo, funds);
364
+ };
365
+ burn = async ({
366
+ tokenId
367
+ }: {
368
+ tokenId: string;
369
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
370
+ return await this.client.execute(this.sender, this.contractAddress, {
371
+ burn: {
372
+ token_id: tokenId
373
+ }
374
+ }, fee, memo, funds);
375
+ };
376
+ }"
377
+ `;
378
+
379
+ exports[`execute interfaces no extends 1`] = `
380
+ "export interface SG721Instance {
381
+ contractAddress: string;
382
+ sender: string;
383
+ transferNft: ({
384
+ recipient,
385
+ tokenId
386
+ }: {
387
+ recipient: string;
388
+ tokenId: string;
389
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
390
+ sendNft: ({
391
+ contract,
392
+ msg,
393
+ tokenId
394
+ }: {
395
+ contract: string;
396
+ msg: Binary;
397
+ tokenId: string;
398
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
399
+ approve: ({
400
+ expires,
401
+ spender,
402
+ tokenId
403
+ }: {
404
+ expires?: Expiration;
405
+ spender: string;
406
+ tokenId: string;
407
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
408
+ revoke: ({
409
+ spender,
410
+ tokenId
411
+ }: {
412
+ spender: string;
413
+ tokenId: string;
414
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
415
+ approveAll: ({
416
+ expires,
417
+ operator
418
+ }: {
419
+ expires?: Expiration;
420
+ operator: string;
421
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
422
+ revokeAll: ({
423
+ operator
424
+ }: {
425
+ operator: string;
426
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
427
+ mint: ({
428
+ extension,
429
+ owner,
430
+ tokenId,
431
+ tokenUri
432
+ }: {
433
+ extension: Empty;
434
+ owner: string;
435
+ tokenId: string;
436
+ tokenUri?: string;
437
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
438
+ burn: ({
439
+ tokenId
440
+ }: {
441
+ tokenId: string;
442
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
443
+ }"
444
+ `;
445
+
446
+ exports[`instantiate_msg 1`] = `
447
+ "export interface InstantiateMsg {
448
+ collectionInfo: CollectionInfo_for_RoyaltyInfoResponse;
449
+ minter: string;
450
+ name: string;
451
+ symbol: string;
452
+ }"
453
+ `;
454
+
455
+ exports[`nft_info_response 1`] = `
456
+ "export interface NftInfoResponse {
457
+ extension: Empty;
458
+ tokenUri?: string;
459
+ }"
460
+ `;
461
+
462
+ exports[`num_tokens_response 1`] = `
463
+ "export interface NumTokensResponse {
464
+ count: number;
465
+ }"
466
+ `;
467
+
468
+ exports[`operators_response 1`] = `
469
+ "export interface OperatorsResponse {
470
+ operators: Approval[];
471
+ }"
472
+ `;
473
+
474
+ exports[`owner_of_response 1`] = `
475
+ "export interface OwnerOfResponse {
476
+ approvals: Approval[];
477
+ owner: string;
478
+ }"
479
+ `;
480
+
481
+ exports[`query classes 1`] = `
482
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
483
+ client: CosmWasmClient;
484
+ contractAddress: string;
485
+
486
+ constructor(client: CosmWasmClient, contractAddress: string) {
487
+ this.client = client;
488
+ this.contractAddress = contractAddress;
489
+ this.ownerOf = this.ownerOf.bind(this);
490
+ this.approval = this.approval.bind(this);
491
+ this.approvals = this.approvals.bind(this);
492
+ this.allOperators = this.allOperators.bind(this);
493
+ this.numTokens = this.numTokens.bind(this);
494
+ this.contractInfo = this.contractInfo.bind(this);
495
+ this.nftInfo = this.nftInfo.bind(this);
496
+ this.allNftInfo = this.allNftInfo.bind(this);
497
+ this.tokens = this.tokens.bind(this);
498
+ this.allTokens = this.allTokens.bind(this);
499
+ this.minter = this.minter.bind(this);
500
+ this.collectionInfo = this.collectionInfo.bind(this);
501
+ }
502
+
503
+ ownerOf = async ({
504
+ includeExpired,
505
+ tokenId
506
+ }: {
507
+ includeExpired?: boolean;
508
+ tokenId: string;
509
+ }): Promise<OwnerOfResponse> => {
510
+ return this.client.queryContractSmart(this.contractAddress, {
511
+ owner_of: {
512
+ include_expired: includeExpired,
513
+ token_id: tokenId
514
+ }
515
+ });
516
+ };
517
+ approval = async ({
518
+ includeExpired,
519
+ spender,
520
+ tokenId
521
+ }: {
522
+ includeExpired?: boolean;
523
+ spender: string;
524
+ tokenId: string;
525
+ }): Promise<ApprovalResponse> => {
526
+ return this.client.queryContractSmart(this.contractAddress, {
527
+ approval: {
528
+ include_expired: includeExpired,
529
+ spender,
530
+ token_id: tokenId
531
+ }
532
+ });
533
+ };
534
+ approvals = async ({
535
+ includeExpired,
536
+ tokenId
537
+ }: {
538
+ includeExpired?: boolean;
539
+ tokenId: string;
540
+ }): Promise<ApprovalsResponse> => {
541
+ return this.client.queryContractSmart(this.contractAddress, {
542
+ approvals: {
543
+ include_expired: includeExpired,
544
+ token_id: tokenId
545
+ }
546
+ });
547
+ };
548
+ allOperators = async ({
549
+ includeExpired,
550
+ limit,
551
+ owner,
552
+ startAfter
553
+ }: {
554
+ includeExpired?: boolean;
555
+ limit?: number;
556
+ owner: string;
557
+ startAfter?: string;
558
+ }): Promise<AllOperatorsResponse> => {
559
+ return this.client.queryContractSmart(this.contractAddress, {
560
+ all_operators: {
561
+ include_expired: includeExpired,
562
+ limit,
563
+ owner,
564
+ start_after: startAfter
565
+ }
566
+ });
567
+ };
568
+ numTokens = async (): Promise<NumTokensResponse> => {
569
+ return this.client.queryContractSmart(this.contractAddress, {
570
+ num_tokens: {}
571
+ });
572
+ };
573
+ contractInfo = async (): Promise<ContractInfoResponse> => {
574
+ return this.client.queryContractSmart(this.contractAddress, {
575
+ contract_info: {}
576
+ });
577
+ };
578
+ nftInfo = async ({
579
+ tokenId
580
+ }: {
581
+ tokenId: string;
582
+ }): Promise<NftInfoResponse> => {
583
+ return this.client.queryContractSmart(this.contractAddress, {
584
+ nft_info: {
585
+ token_id: tokenId
586
+ }
587
+ });
588
+ };
589
+ allNftInfo = async ({
590
+ includeExpired,
591
+ tokenId
592
+ }: {
593
+ includeExpired?: boolean;
594
+ tokenId: string;
595
+ }): Promise<AllNftInfoResponse> => {
596
+ return this.client.queryContractSmart(this.contractAddress, {
597
+ all_nft_info: {
598
+ include_expired: includeExpired,
599
+ token_id: tokenId
600
+ }
601
+ });
602
+ };
603
+ tokens = async ({
604
+ limit,
605
+ owner,
606
+ startAfter
607
+ }: {
608
+ limit?: number;
609
+ owner: string;
610
+ startAfter?: string;
611
+ }): Promise<TokensResponse> => {
612
+ return this.client.queryContractSmart(this.contractAddress, {
613
+ tokens: {
614
+ limit,
615
+ owner,
616
+ start_after: startAfter
617
+ }
618
+ });
619
+ };
620
+ allTokens = async ({
621
+ limit,
622
+ startAfter
623
+ }: {
624
+ limit?: number;
625
+ startAfter?: string;
626
+ }): Promise<AllTokensResponse> => {
627
+ return this.client.queryContractSmart(this.contractAddress, {
628
+ all_tokens: {
629
+ limit,
630
+ start_after: startAfter
631
+ }
632
+ });
633
+ };
634
+ minter = async (): Promise<MinterResponse> => {
635
+ return this.client.queryContractSmart(this.contractAddress, {
636
+ minter: {}
637
+ });
638
+ };
639
+ collectionInfo = async (): Promise<CollectionInfoResponse> => {
640
+ return this.client.queryContractSmart(this.contractAddress, {
641
+ collection_info: {}
642
+ });
643
+ };
644
+ }"
645
+ `;
646
+
647
+ exports[`query interfaces 1`] = `
648
+ "export interface SG721ReadOnlyInstance {
649
+ contractAddress: string;
650
+ ownerOf: ({
651
+ includeExpired,
652
+ tokenId
653
+ }: {
654
+ includeExpired?: boolean;
655
+ tokenId: string;
656
+ }) => Promise<OwnerOfResponse>;
657
+ approval: ({
658
+ includeExpired,
659
+ spender,
660
+ tokenId
661
+ }: {
662
+ includeExpired?: boolean;
663
+ spender: string;
664
+ tokenId: string;
665
+ }) => Promise<ApprovalResponse>;
666
+ approvals: ({
667
+ includeExpired,
668
+ tokenId
669
+ }: {
670
+ includeExpired?: boolean;
671
+ tokenId: string;
672
+ }) => Promise<ApprovalsResponse>;
673
+ allOperators: ({
674
+ includeExpired,
675
+ limit,
676
+ owner,
677
+ startAfter
678
+ }: {
679
+ includeExpired?: boolean;
680
+ limit?: number;
681
+ owner: string;
682
+ startAfter?: string;
683
+ }) => Promise<AllOperatorsResponse>;
684
+ numTokens: () => Promise<NumTokensResponse>;
685
+ contractInfo: () => Promise<ContractInfoResponse>;
686
+ nftInfo: ({
687
+ tokenId
688
+ }: {
689
+ tokenId: string;
690
+ }) => Promise<NftInfoResponse>;
691
+ allNftInfo: ({
692
+ includeExpired,
693
+ tokenId
694
+ }: {
695
+ includeExpired?: boolean;
696
+ tokenId: string;
697
+ }) => Promise<AllNftInfoResponse>;
698
+ tokens: ({
699
+ limit,
700
+ owner,
701
+ startAfter
702
+ }: {
703
+ limit?: number;
704
+ owner: string;
705
+ startAfter?: string;
706
+ }) => Promise<TokensResponse>;
707
+ allTokens: ({
708
+ limit,
709
+ startAfter
710
+ }: {
711
+ limit?: number;
712
+ startAfter?: string;
713
+ }) => Promise<AllTokensResponse>;
714
+ minter: () => Promise<MinterResponse>;
715
+ collectionInfo: () => Promise<CollectionInfoResponse>;
716
+ }"
717
+ `;
718
+
719
+ exports[`tokens_response 1`] = `
720
+ "export interface TokensResponse {
721
+ tokens: string[];
722
+ }"
723
+ `;