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,984 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`execute class /issues/55/batch.json 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
+ }
14
+
15
+ }"
16
+ `;
17
+
18
+ exports[`execute class /issues/55/denom_response.json 1`] = `
19
+ "export class SG721Client implements SG721Instance {
20
+ client: SigningCosmWasmClient;
21
+ sender: string;
22
+ contractAddress: string;
23
+
24
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
25
+ this.client = client;
26
+ this.sender = sender;
27
+ this.contractAddress = contractAddress;
28
+ }
29
+
30
+ }"
31
+ `;
32
+
33
+ exports[`execute class /issues/55/edge.json 1`] = `
34
+ "export class SG721Client implements SG721Instance {
35
+ client: SigningCosmWasmClient;
36
+ sender: string;
37
+ contractAddress: string;
38
+
39
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
40
+ this.client = client;
41
+ this.sender = sender;
42
+ this.contractAddress = contractAddress;
43
+ }
44
+
45
+ }"
46
+ `;
47
+
48
+ exports[`execute class /issues/55/execute_msg.json 1`] = `
49
+ "export class SG721Client implements SG721Instance {
50
+ client: SigningCosmWasmClient;
51
+ sender: string;
52
+ contractAddress: string;
53
+
54
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
55
+ this.client = client;
56
+ this.sender = sender;
57
+ this.contractAddress = contractAddress;
58
+ this.createEdge = this.createEdge.bind(this);
59
+ this.editEdge = this.editEdge.bind(this);
60
+ this.removeEdge = this.removeEdge.bind(this);
61
+ this.createGraph = this.createGraph.bind(this);
62
+ this.createGraphSimplified = this.createGraphSimplified.bind(this);
63
+ this.editGraphSimplified = this.editGraphSimplified.bind(this);
64
+ this.removeGraph = this.removeGraph.bind(this);
65
+ this.updateEdges = this.updateEdges.bind(this);
66
+ this.findSavings = this.findSavings.bind(this);
67
+ this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this);
68
+ this.reset = this.reset.bind(this);
69
+ this.saveNetworkToFile = this.saveNetworkToFile.bind(this);
70
+ this.createGraphFromFile = this.createGraphFromFile.bind(this);
71
+ this.applySetOffFromFile = this.applySetOffFromFile.bind(this);
72
+ }
73
+
74
+ createEdge = async ({
75
+ amount,
76
+ creditor
77
+ }: {
78
+ amount: number;
79
+ creditor: Addr;
80
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
81
+ return await this.client.execute(this.sender, this.contractAddress, {
82
+ create_edge: {
83
+ amount,
84
+ creditor
85
+ }
86
+ }, fee, memo, funds);
87
+ };
88
+ editEdge = async ({
89
+ amount,
90
+ creditor,
91
+ edgeId
92
+ }: {
93
+ amount: number;
94
+ creditor: Addr;
95
+ edgeId: number;
96
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
97
+ return await this.client.execute(this.sender, this.contractAddress, {
98
+ edit_edge: {
99
+ amount,
100
+ creditor,
101
+ edge_id: edgeId
102
+ }
103
+ }, fee, memo, funds);
104
+ };
105
+ removeEdge = async ({
106
+ edgeId
107
+ }: {
108
+ edgeId: number;
109
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
110
+ return await this.client.execute(this.sender, this.contractAddress, {
111
+ remove_edge: {
112
+ edge_id: edgeId
113
+ }
114
+ }, fee, memo, funds);
115
+ };
116
+ createGraph = async ({
117
+ graph
118
+ }: {
119
+ graph: Edge[];
120
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
121
+ return await this.client.execute(this.sender, this.contractAddress, {
122
+ create_graph: {
123
+ graph
124
+ }
125
+ }, fee, memo, funds);
126
+ };
127
+ createGraphSimplified = async ({
128
+ graph,
129
+ graphId
130
+ }: {
131
+ graph: Addr[][];
132
+ graphId: number;
133
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
134
+ return await this.client.execute(this.sender, this.contractAddress, {
135
+ create_graph_simplified: {
136
+ graph,
137
+ graph_id: graphId
138
+ }
139
+ }, fee, memo, funds);
140
+ };
141
+ editGraphSimplified = async ({
142
+ graph,
143
+ graphId
144
+ }: {
145
+ graph: Addr[][];
146
+ graphId: number;
147
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
148
+ return await this.client.execute(this.sender, this.contractAddress, {
149
+ edit_graph_simplified: {
150
+ graph,
151
+ graph_id: graphId
152
+ }
153
+ }, fee, memo, funds);
154
+ };
155
+ removeGraph = async ({
156
+ graphId
157
+ }: {
158
+ graphId: number;
159
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
160
+ return await this.client.execute(this.sender, this.contractAddress, {
161
+ remove_graph: {
162
+ graph_id: graphId
163
+ }
164
+ }, fee, memo, funds);
165
+ };
166
+ updateEdges = async ({
167
+ edges
168
+ }: {
169
+ edges: number[][];
170
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
171
+ return await this.client.execute(this.sender, this.contractAddress, {
172
+ update_edges: {
173
+ edges
174
+ }
175
+ }, fee, memo, funds);
176
+ };
177
+ findSavings = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
178
+ return await this.client.execute(this.sender, this.contractAddress, {
179
+ find_savings: {}
180
+ }, fee, memo, funds);
181
+ };
182
+ findSavingsInAGraph = async ({
183
+ graphId
184
+ }: {
185
+ graphId: number;
186
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
187
+ return await this.client.execute(this.sender, this.contractAddress, {
188
+ find_savings_in_a_graph: {
189
+ graph_id: graphId
190
+ }
191
+ }, fee, memo, funds);
192
+ };
193
+ reset = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
194
+ return await this.client.execute(this.sender, this.contractAddress, {
195
+ reset: {}
196
+ }, fee, memo, funds);
197
+ };
198
+ saveNetworkToFile = async ({
199
+ filepath
200
+ }: {
201
+ filepath: string;
202
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
203
+ return await this.client.execute(this.sender, this.contractAddress, {
204
+ save_network_to_file: {
205
+ filepath
206
+ }
207
+ }, fee, memo, funds);
208
+ };
209
+ createGraphFromFile = async ({
210
+ filepath
211
+ }: {
212
+ filepath: string;
213
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
214
+ return await this.client.execute(this.sender, this.contractAddress, {
215
+ create_graph_from_file: {
216
+ filepath
217
+ }
218
+ }, fee, memo, funds);
219
+ };
220
+ applySetOffFromFile = async ({
221
+ filepath
222
+ }: {
223
+ filepath: string;
224
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
225
+ return await this.client.execute(this.sender, this.contractAddress, {
226
+ apply_set_off_from_file: {
227
+ filepath
228
+ }
229
+ }, fee, memo, funds);
230
+ };
231
+ }"
232
+ `;
233
+
234
+ exports[`execute class /issues/55/instantiate_msg.json 1`] = `
235
+ "export class SG721Client implements SG721Instance {
236
+ client: SigningCosmWasmClient;
237
+ sender: string;
238
+ contractAddress: string;
239
+
240
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
241
+ this.client = client;
242
+ this.sender = sender;
243
+ this.contractAddress = contractAddress;
244
+ }
245
+
246
+ }"
247
+ `;
248
+
249
+ exports[`execute class /issues/55/network.json 1`] = `
250
+ "export class SG721Client implements SG721Instance {
251
+ client: SigningCosmWasmClient;
252
+ sender: string;
253
+ contractAddress: string;
254
+
255
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
256
+ this.client = client;
257
+ this.sender = sender;
258
+ this.contractAddress = contractAddress;
259
+ }
260
+
261
+ }"
262
+ `;
263
+
264
+ exports[`execute class /issues/55/query_msg.json 1`] = `
265
+ "export class SG721Client implements SG721Instance {
266
+ client: SigningCosmWasmClient;
267
+ sender: string;
268
+ contractAddress: string;
269
+
270
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) {
271
+ this.client = client;
272
+ this.sender = sender;
273
+ this.contractAddress = contractAddress;
274
+ this.getDenom = this.getDenom.bind(this);
275
+ this.getOwner = this.getOwner.bind(this);
276
+ this.allEdges = this.allEdges.bind(this);
277
+ this.oneEdge = this.oneEdge.bind(this);
278
+ this.oneBatch = this.oneBatch.bind(this);
279
+ this.oneGraph = this.oneGraph.bind(this);
280
+ this.getEdgesByAddress = this.getEdgesByAddress.bind(this);
281
+ this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this);
282
+ this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this);
283
+ this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this);
284
+ this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this);
285
+ this.getTotalDebt = this.getTotalDebt.bind(this);
286
+ }
287
+
288
+ getDenom = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
289
+ return await this.client.execute(this.sender, this.contractAddress, {
290
+ get_denom: {}
291
+ }, fee, memo, funds);
292
+ };
293
+ getOwner = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
294
+ return await this.client.execute(this.sender, this.contractAddress, {
295
+ get_owner: {}
296
+ }, fee, memo, funds);
297
+ };
298
+ allEdges = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
299
+ return await this.client.execute(this.sender, this.contractAddress, {
300
+ all_edges: {}
301
+ }, fee, memo, funds);
302
+ };
303
+ oneEdge = async ({
304
+ edgeId
305
+ }: {
306
+ edgeId: number;
307
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
308
+ return await this.client.execute(this.sender, this.contractAddress, {
309
+ one_edge: {
310
+ edge_id: edgeId
311
+ }
312
+ }, fee, memo, funds);
313
+ };
314
+ oneBatch = async ({
315
+ batchId
316
+ }: {
317
+ batchId: number;
318
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
319
+ return await this.client.execute(this.sender, this.contractAddress, {
320
+ one_batch: {
321
+ batch_id: batchId
322
+ }
323
+ }, fee, memo, funds);
324
+ };
325
+ oneGraph = async ({
326
+ graphId
327
+ }: {
328
+ graphId: number;
329
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
330
+ return await this.client.execute(this.sender, this.contractAddress, {
331
+ one_graph: {
332
+ graph_id: graphId
333
+ }
334
+ }, fee, memo, funds);
335
+ };
336
+ getEdgesByAddress = async ({
337
+ address
338
+ }: {
339
+ address: Addr;
340
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
341
+ return await this.client.execute(this.sender, this.contractAddress, {
342
+ get_edges_by_address: {
343
+ address
344
+ }
345
+ }, fee, memo, funds);
346
+ };
347
+ getEdgesAsCounterparty = async ({
348
+ address
349
+ }: {
350
+ address: Addr;
351
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
352
+ return await this.client.execute(this.sender, this.contractAddress, {
353
+ get_edges_as_counterparty: {
354
+ address
355
+ }
356
+ }, fee, memo, funds);
357
+ };
358
+ getTotalDebtPerAddress = async ({
359
+ address
360
+ }: {
361
+ address: Addr;
362
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
363
+ return await this.client.execute(this.sender, this.contractAddress, {
364
+ get_total_debt_per_address: {
365
+ address
366
+ }
367
+ }, fee, memo, funds);
368
+ };
369
+ getTotalCreditPerAddress = async ({
370
+ address
371
+ }: {
372
+ address: Addr;
373
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
374
+ return await this.client.execute(this.sender, this.contractAddress, {
375
+ get_total_credit_per_address: {
376
+ address
377
+ }
378
+ }, fee, memo, funds);
379
+ };
380
+ getTotalDebtByGraph = async ({
381
+ graphId
382
+ }: {
383
+ graphId: number;
384
+ }, fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
385
+ return await this.client.execute(this.sender, this.contractAddress, {
386
+ get_total_debt_by_graph: {
387
+ graph_id: graphId
388
+ }
389
+ }, fee, memo, funds);
390
+ };
391
+ getTotalDebt = async (fee: number | StdFee | \\"auto\\" = \\"auto\\", memo?: string, funds?: Coin[]): Promise<ExecuteResult> => {
392
+ return await this.client.execute(this.sender, this.contractAddress, {
393
+ get_total_debt: {}
394
+ }, fee, memo, funds);
395
+ };
396
+ }"
397
+ `;
398
+
399
+ exports[`execute interface /issues/55/batch.json 1`] = `
400
+ "export interface SG721Instance {
401
+ contractAddress: string;
402
+ sender: string;
403
+ }"
404
+ `;
405
+
406
+ exports[`execute interface /issues/55/denom_response.json 1`] = `
407
+ "export interface SG721Instance {
408
+ contractAddress: string;
409
+ sender: string;
410
+ }"
411
+ `;
412
+
413
+ exports[`execute interface /issues/55/edge.json 1`] = `
414
+ "export interface SG721Instance {
415
+ contractAddress: string;
416
+ sender: string;
417
+ }"
418
+ `;
419
+
420
+ exports[`execute interface /issues/55/execute_msg.json 1`] = `
421
+ "export interface SG721Instance {
422
+ contractAddress: string;
423
+ sender: string;
424
+ createEdge: ({
425
+ amount,
426
+ creditor
427
+ }: {
428
+ amount: number;
429
+ creditor: Addr;
430
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
431
+ editEdge: ({
432
+ amount,
433
+ creditor,
434
+ edgeId
435
+ }: {
436
+ amount: number;
437
+ creditor: Addr;
438
+ edgeId: number;
439
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
440
+ removeEdge: ({
441
+ edgeId
442
+ }: {
443
+ edgeId: number;
444
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
445
+ createGraph: ({
446
+ graph
447
+ }: {
448
+ graph: Edge[];
449
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
450
+ createGraphSimplified: ({
451
+ graph,
452
+ graphId
453
+ }: {
454
+ graph: Addr[][];
455
+ graphId: number;
456
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
457
+ editGraphSimplified: ({
458
+ graph,
459
+ graphId
460
+ }: {
461
+ graph: Addr[][];
462
+ graphId: number;
463
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
464
+ removeGraph: ({
465
+ graphId
466
+ }: {
467
+ graphId: number;
468
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
469
+ updateEdges: ({
470
+ edges
471
+ }: {
472
+ edges: number[][];
473
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
474
+ findSavings: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
475
+ findSavingsInAGraph: ({
476
+ graphId
477
+ }: {
478
+ graphId: number;
479
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
480
+ reset: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
481
+ saveNetworkToFile: ({
482
+ filepath
483
+ }: {
484
+ filepath: string;
485
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
486
+ createGraphFromFile: ({
487
+ filepath
488
+ }: {
489
+ filepath: string;
490
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
491
+ applySetOffFromFile: ({
492
+ filepath
493
+ }: {
494
+ filepath: string;
495
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
496
+ }"
497
+ `;
498
+
499
+ exports[`execute interface /issues/55/instantiate_msg.json 1`] = `
500
+ "export interface SG721Instance {
501
+ contractAddress: string;
502
+ sender: string;
503
+ }"
504
+ `;
505
+
506
+ exports[`execute interface /issues/55/network.json 1`] = `
507
+ "export interface SG721Instance {
508
+ contractAddress: string;
509
+ sender: string;
510
+ }"
511
+ `;
512
+
513
+ exports[`execute interface /issues/55/query_msg.json 1`] = `
514
+ "export interface SG721Instance {
515
+ contractAddress: string;
516
+ sender: string;
517
+ getDenom: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
518
+ getOwner: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
519
+ allEdges: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
520
+ oneEdge: ({
521
+ edgeId
522
+ }: {
523
+ edgeId: number;
524
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
525
+ oneBatch: ({
526
+ batchId
527
+ }: {
528
+ batchId: number;
529
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
530
+ oneGraph: ({
531
+ graphId
532
+ }: {
533
+ graphId: number;
534
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
535
+ getEdgesByAddress: ({
536
+ address
537
+ }: {
538
+ address: Addr;
539
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
540
+ getEdgesAsCounterparty: ({
541
+ address
542
+ }: {
543
+ address: Addr;
544
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
545
+ getTotalDebtPerAddress: ({
546
+ address
547
+ }: {
548
+ address: Addr;
549
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
550
+ getTotalCreditPerAddress: ({
551
+ address
552
+ }: {
553
+ address: Addr;
554
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
555
+ getTotalDebtByGraph: ({
556
+ graphId
557
+ }: {
558
+ graphId: number;
559
+ }, fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
560
+ getTotalDebt: (fee?: number | StdFee | \\"auto\\", memo?: string, funds?: Coin[]) => Promise<ExecuteResult>;
561
+ }"
562
+ `;
563
+
564
+ exports[`execute_msg_for__empty /issues/55/batch.json 1`] = `
565
+ "export interface Batch {
566
+ batchId: number;
567
+ setoffs: number[][];
568
+ }"
569
+ `;
570
+
571
+ exports[`execute_msg_for__empty /issues/55/denom_response.json 1`] = `
572
+ "export interface DenomResponse {
573
+ denom: string;
574
+ }"
575
+ `;
576
+
577
+ exports[`execute_msg_for__empty /issues/55/edge.json 1`] = `
578
+ "export interface Edge {
579
+ amount: number;
580
+ creditor: Addr;
581
+ debtor: Addr;
582
+ edgeId: number;
583
+ graphId?: number;
584
+ }"
585
+ `;
586
+
587
+ exports[`execute_msg_for__empty /issues/55/execute_msg.json 1`] = `"export type ExecuteMsg = ExecuteMsg;"`;
588
+
589
+ exports[`execute_msg_for__empty /issues/55/instantiate_msg.json 1`] = `
590
+ "export interface InstantiateMsg {
591
+ denom: string;
592
+ }"
593
+ `;
594
+
595
+ exports[`execute_msg_for__empty /issues/55/network.json 1`] = `
596
+ "export interface Network {
597
+ denom: string;
598
+ owner: Addr;
599
+ }"
600
+ `;
601
+
602
+ exports[`execute_msg_for__empty /issues/55/query_msg.json 1`] = `"export type QueryMsg = QueryMsg;"`;
603
+
604
+ exports[`query classes /issues/55/batch.json 1`] = `
605
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
606
+ client: CosmWasmClient;
607
+ contractAddress: string;
608
+
609
+ constructor(client: CosmWasmClient, contractAddress: string) {
610
+ this.client = client;
611
+ this.contractAddress = contractAddress;
612
+ }
613
+
614
+ }"
615
+ `;
616
+
617
+ exports[`query classes /issues/55/denom_response.json 1`] = `
618
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
619
+ client: CosmWasmClient;
620
+ contractAddress: string;
621
+
622
+ constructor(client: CosmWasmClient, contractAddress: string) {
623
+ this.client = client;
624
+ this.contractAddress = contractAddress;
625
+ }
626
+
627
+ }"
628
+ `;
629
+
630
+ exports[`query classes /issues/55/edge.json 1`] = `
631
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
632
+ client: CosmWasmClient;
633
+ contractAddress: string;
634
+
635
+ constructor(client: CosmWasmClient, contractAddress: string) {
636
+ this.client = client;
637
+ this.contractAddress = contractAddress;
638
+ }
639
+
640
+ }"
641
+ `;
642
+
643
+ exports[`query classes /issues/55/execute_msg.json 1`] = `
644
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
645
+ client: CosmWasmClient;
646
+ contractAddress: string;
647
+
648
+ constructor(client: CosmWasmClient, contractAddress: string) {
649
+ this.client = client;
650
+ this.contractAddress = contractAddress;
651
+ this.createEdge = this.createEdge.bind(this);
652
+ this.editEdge = this.editEdge.bind(this);
653
+ this.removeEdge = this.removeEdge.bind(this);
654
+ this.createGraph = this.createGraph.bind(this);
655
+ this.createGraphSimplified = this.createGraphSimplified.bind(this);
656
+ this.editGraphSimplified = this.editGraphSimplified.bind(this);
657
+ this.removeGraph = this.removeGraph.bind(this);
658
+ this.updateEdges = this.updateEdges.bind(this);
659
+ this.findSavings = this.findSavings.bind(this);
660
+ this.findSavingsInAGraph = this.findSavingsInAGraph.bind(this);
661
+ this.reset = this.reset.bind(this);
662
+ this.saveNetworkToFile = this.saveNetworkToFile.bind(this);
663
+ this.createGraphFromFile = this.createGraphFromFile.bind(this);
664
+ this.applySetOffFromFile = this.applySetOffFromFile.bind(this);
665
+ }
666
+
667
+ createEdge = async ({
668
+ amount,
669
+ creditor
670
+ }: {
671
+ amount: number;
672
+ creditor: Addr;
673
+ }): Promise<CreateEdgeResponse> => {
674
+ return this.client.queryContractSmart(this.contractAddress, {
675
+ create_edge: {
676
+ amount,
677
+ creditor
678
+ }
679
+ });
680
+ };
681
+ editEdge = async ({
682
+ amount,
683
+ creditor,
684
+ edgeId
685
+ }: {
686
+ amount: number;
687
+ creditor: Addr;
688
+ edgeId: number;
689
+ }): Promise<EditEdgeResponse> => {
690
+ return this.client.queryContractSmart(this.contractAddress, {
691
+ edit_edge: {
692
+ amount,
693
+ creditor,
694
+ edge_id: edgeId
695
+ }
696
+ });
697
+ };
698
+ removeEdge = async ({
699
+ edgeId
700
+ }: {
701
+ edgeId: number;
702
+ }): Promise<RemoveEdgeResponse> => {
703
+ return this.client.queryContractSmart(this.contractAddress, {
704
+ remove_edge: {
705
+ edge_id: edgeId
706
+ }
707
+ });
708
+ };
709
+ createGraph = async ({
710
+ graph
711
+ }: {
712
+ graph: Edge[];
713
+ }): Promise<CreateGraphResponse> => {
714
+ return this.client.queryContractSmart(this.contractAddress, {
715
+ create_graph: {
716
+ graph
717
+ }
718
+ });
719
+ };
720
+ createGraphSimplified = async ({
721
+ graph,
722
+ graphId
723
+ }: {
724
+ graph: Addr[][];
725
+ graphId: number;
726
+ }): Promise<CreateGraphSimplifiedResponse> => {
727
+ return this.client.queryContractSmart(this.contractAddress, {
728
+ create_graph_simplified: {
729
+ graph,
730
+ graph_id: graphId
731
+ }
732
+ });
733
+ };
734
+ editGraphSimplified = async ({
735
+ graph,
736
+ graphId
737
+ }: {
738
+ graph: Addr[][];
739
+ graphId: number;
740
+ }): Promise<EditGraphSimplifiedResponse> => {
741
+ return this.client.queryContractSmart(this.contractAddress, {
742
+ edit_graph_simplified: {
743
+ graph,
744
+ graph_id: graphId
745
+ }
746
+ });
747
+ };
748
+ removeGraph = async ({
749
+ graphId
750
+ }: {
751
+ graphId: number;
752
+ }): Promise<RemoveGraphResponse> => {
753
+ return this.client.queryContractSmart(this.contractAddress, {
754
+ remove_graph: {
755
+ graph_id: graphId
756
+ }
757
+ });
758
+ };
759
+ updateEdges = async ({
760
+ edges
761
+ }: {
762
+ edges: number[][];
763
+ }): Promise<UpdateEdgesResponse> => {
764
+ return this.client.queryContractSmart(this.contractAddress, {
765
+ update_edges: {
766
+ edges
767
+ }
768
+ });
769
+ };
770
+ findSavings = async (): Promise<FindSavingsResponse> => {
771
+ return this.client.queryContractSmart(this.contractAddress, {
772
+ find_savings: {}
773
+ });
774
+ };
775
+ findSavingsInAGraph = async ({
776
+ graphId
777
+ }: {
778
+ graphId: number;
779
+ }): Promise<FindSavingsInAGraphResponse> => {
780
+ return this.client.queryContractSmart(this.contractAddress, {
781
+ find_savings_in_a_graph: {
782
+ graph_id: graphId
783
+ }
784
+ });
785
+ };
786
+ reset = async (): Promise<ResetResponse> => {
787
+ return this.client.queryContractSmart(this.contractAddress, {
788
+ reset: {}
789
+ });
790
+ };
791
+ saveNetworkToFile = async ({
792
+ filepath
793
+ }: {
794
+ filepath: string;
795
+ }): Promise<SaveNetworkToFileResponse> => {
796
+ return this.client.queryContractSmart(this.contractAddress, {
797
+ save_network_to_file: {
798
+ filepath
799
+ }
800
+ });
801
+ };
802
+ createGraphFromFile = async ({
803
+ filepath
804
+ }: {
805
+ filepath: string;
806
+ }): Promise<CreateGraphFromFileResponse> => {
807
+ return this.client.queryContractSmart(this.contractAddress, {
808
+ create_graph_from_file: {
809
+ filepath
810
+ }
811
+ });
812
+ };
813
+ applySetOffFromFile = async ({
814
+ filepath
815
+ }: {
816
+ filepath: string;
817
+ }): Promise<ApplySetOffFromFileResponse> => {
818
+ return this.client.queryContractSmart(this.contractAddress, {
819
+ apply_set_off_from_file: {
820
+ filepath
821
+ }
822
+ });
823
+ };
824
+ }"
825
+ `;
826
+
827
+ exports[`query classes /issues/55/instantiate_msg.json 1`] = `
828
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
829
+ client: CosmWasmClient;
830
+ contractAddress: string;
831
+
832
+ constructor(client: CosmWasmClient, contractAddress: string) {
833
+ this.client = client;
834
+ this.contractAddress = contractAddress;
835
+ }
836
+
837
+ }"
838
+ `;
839
+
840
+ exports[`query classes /issues/55/network.json 1`] = `
841
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
842
+ client: CosmWasmClient;
843
+ contractAddress: string;
844
+
845
+ constructor(client: CosmWasmClient, contractAddress: string) {
846
+ this.client = client;
847
+ this.contractAddress = contractAddress;
848
+ }
849
+
850
+ }"
851
+ `;
852
+
853
+ exports[`query classes /issues/55/query_msg.json 1`] = `
854
+ "export class SG721QueryClient implements SG721ReadOnlyInstance {
855
+ client: CosmWasmClient;
856
+ contractAddress: string;
857
+
858
+ constructor(client: CosmWasmClient, contractAddress: string) {
859
+ this.client = client;
860
+ this.contractAddress = contractAddress;
861
+ this.getDenom = this.getDenom.bind(this);
862
+ this.getOwner = this.getOwner.bind(this);
863
+ this.allEdges = this.allEdges.bind(this);
864
+ this.oneEdge = this.oneEdge.bind(this);
865
+ this.oneBatch = this.oneBatch.bind(this);
866
+ this.oneGraph = this.oneGraph.bind(this);
867
+ this.getEdgesByAddress = this.getEdgesByAddress.bind(this);
868
+ this.getEdgesAsCounterparty = this.getEdgesAsCounterparty.bind(this);
869
+ this.getTotalDebtPerAddress = this.getTotalDebtPerAddress.bind(this);
870
+ this.getTotalCreditPerAddress = this.getTotalCreditPerAddress.bind(this);
871
+ this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this);
872
+ this.getTotalDebt = this.getTotalDebt.bind(this);
873
+ }
874
+
875
+ getDenom = async (): Promise<GetDenomResponse> => {
876
+ return this.client.queryContractSmart(this.contractAddress, {
877
+ get_denom: {}
878
+ });
879
+ };
880
+ getOwner = async (): Promise<GetOwnerResponse> => {
881
+ return this.client.queryContractSmart(this.contractAddress, {
882
+ get_owner: {}
883
+ });
884
+ };
885
+ allEdges = async (): Promise<AllEdgesResponse> => {
886
+ return this.client.queryContractSmart(this.contractAddress, {
887
+ all_edges: {}
888
+ });
889
+ };
890
+ oneEdge = async ({
891
+ edgeId
892
+ }: {
893
+ edgeId: number;
894
+ }): Promise<OneEdgeResponse> => {
895
+ return this.client.queryContractSmart(this.contractAddress, {
896
+ one_edge: {
897
+ edge_id: edgeId
898
+ }
899
+ });
900
+ };
901
+ oneBatch = async ({
902
+ batchId
903
+ }: {
904
+ batchId: number;
905
+ }): Promise<OneBatchResponse> => {
906
+ return this.client.queryContractSmart(this.contractAddress, {
907
+ one_batch: {
908
+ batch_id: batchId
909
+ }
910
+ });
911
+ };
912
+ oneGraph = async ({
913
+ graphId
914
+ }: {
915
+ graphId: number;
916
+ }): Promise<OneGraphResponse> => {
917
+ return this.client.queryContractSmart(this.contractAddress, {
918
+ one_graph: {
919
+ graph_id: graphId
920
+ }
921
+ });
922
+ };
923
+ getEdgesByAddress = async ({
924
+ address
925
+ }: {
926
+ address: Addr;
927
+ }): Promise<GetEdgesByAddressResponse> => {
928
+ return this.client.queryContractSmart(this.contractAddress, {
929
+ get_edges_by_address: {
930
+ address
931
+ }
932
+ });
933
+ };
934
+ getEdgesAsCounterparty = async ({
935
+ address
936
+ }: {
937
+ address: Addr;
938
+ }): Promise<GetEdgesAsCounterpartyResponse> => {
939
+ return this.client.queryContractSmart(this.contractAddress, {
940
+ get_edges_as_counterparty: {
941
+ address
942
+ }
943
+ });
944
+ };
945
+ getTotalDebtPerAddress = async ({
946
+ address
947
+ }: {
948
+ address: Addr;
949
+ }): Promise<GetTotalDebtPerAddressResponse> => {
950
+ return this.client.queryContractSmart(this.contractAddress, {
951
+ get_total_debt_per_address: {
952
+ address
953
+ }
954
+ });
955
+ };
956
+ getTotalCreditPerAddress = async ({
957
+ address
958
+ }: {
959
+ address: Addr;
960
+ }): Promise<GetTotalCreditPerAddressResponse> => {
961
+ return this.client.queryContractSmart(this.contractAddress, {
962
+ get_total_credit_per_address: {
963
+ address
964
+ }
965
+ });
966
+ };
967
+ getTotalDebtByGraph = async ({
968
+ graphId
969
+ }: {
970
+ graphId: number;
971
+ }): Promise<GetTotalDebtByGraphResponse> => {
972
+ return this.client.queryContractSmart(this.contractAddress, {
973
+ get_total_debt_by_graph: {
974
+ graph_id: graphId
975
+ }
976
+ });
977
+ };
978
+ getTotalDebt = async (): Promise<GetTotalDebtResponse> => {
979
+ return this.client.queryContractSmart(this.contractAddress, {
980
+ get_total_debt: {}
981
+ });
982
+ };
983
+ }"
984
+ `;