arc200-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/index.d.mts +689 -0
- package/dist/index.d.ts +689 -0
- package/dist/index.js +735 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +698 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
// contracts/clients/Arc200Client.ts
|
|
2
|
+
import * as algokit from "@algorandfoundation/algokit-utils";
|
|
3
|
+
import { AtomicTransactionComposer, modelsv2 } from "algosdk";
|
|
4
|
+
var APP_SPEC = {
|
|
5
|
+
"hints": {
|
|
6
|
+
"arc200_name()string": {
|
|
7
|
+
"call_config": {
|
|
8
|
+
"no_op": "CALL"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"arc200_symbol()string": {
|
|
12
|
+
"call_config": {
|
|
13
|
+
"no_op": "CALL"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"arc200_decimals()uint8": {
|
|
17
|
+
"call_config": {
|
|
18
|
+
"no_op": "CALL"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"arc200_totalSupply()uint256": {
|
|
22
|
+
"call_config": {
|
|
23
|
+
"no_op": "CALL"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"arc200_balanceOf(address)uint256": {
|
|
27
|
+
"call_config": {
|
|
28
|
+
"no_op": "CALL"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"arc200_transfer(address,uint256)bool": {
|
|
32
|
+
"call_config": {
|
|
33
|
+
"no_op": "CALL"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"arc200_transferFrom(address,address,uint256)bool": {
|
|
37
|
+
"call_config": {
|
|
38
|
+
"no_op": "CALL"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"arc200_approve(address,uint256)bool": {
|
|
42
|
+
"call_config": {
|
|
43
|
+
"no_op": "CALL"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"arc200_allowance(address,address)uint256": {
|
|
47
|
+
"call_config": {
|
|
48
|
+
"no_op": "CALL"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"createApplication()void": {
|
|
52
|
+
"call_config": {
|
|
53
|
+
"no_op": "CREATE"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"bare_call_config": {
|
|
58
|
+
"no_op": "NEVER",
|
|
59
|
+
"opt_in": "NEVER",
|
|
60
|
+
"close_out": "NEVER",
|
|
61
|
+
"update_application": "NEVER",
|
|
62
|
+
"delete_application": "NEVER"
|
|
63
|
+
},
|
|
64
|
+
"schema": {
|
|
65
|
+
"local": {
|
|
66
|
+
"declared": {},
|
|
67
|
+
"reserved": {}
|
|
68
|
+
},
|
|
69
|
+
"global": {
|
|
70
|
+
"declared": {},
|
|
71
|
+
"reserved": {}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"state": {
|
|
75
|
+
"global": {
|
|
76
|
+
"num_byte_slices": 0,
|
|
77
|
+
"num_uints": 0
|
|
78
|
+
},
|
|
79
|
+
"local": {
|
|
80
|
+
"num_byte_slices": 0,
|
|
81
|
+
"num_uints": 0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"source": {
|
|
85
|
+
"approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgovLyBUaGlzIFRFQUwgd2FzIGdlbmVyYXRlZCBieSBURUFMU2NyaXB0IHYwLjg0LjAKLy8gaHR0cHM6Ly9naXRodWIuY29tL2FsZ29yYW5kZm91bmRhdGlvbi9URUFMU2NyaXB0CgovLyBUaGlzIGNvbnRyYWN0IGlzIGNvbXBsaWFudCB3aXRoIGFuZC9vciBpbXBsZW1lbnRzIHRoZSBmb2xsb3dpbmcgQVJDczogWyBBUkM0IF0KCi8vIFRoZSBm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iIKCW1ldGhvZCAiYXJjMjAwX2JhbGFuY2VPZihhZGRyZXNzKXVpbnQyNTYiCgltZXRob2QgImFyYzIwMF90cmFuc2ZlcihhZGRyZXNzLHVpbnQyNTYpYm9vbCIKCW1ldGhvZCAiYXJjMjAwX3RyYW5zZmVyRnJvbShhZGRyZXNzLGFkZHJlc3MsdWludDI1Nilib29sIgoJbWV0aG9kICJhcmMyMDBfYXBwcm92ZShhZGRyZXNzLHVpbnQyNTYpYm9vbCIKCW1ldGhvZCAiYXJjMjAwX2FsbG93YW5jZShhZGRyZXNzLGFkZHJlc3MpdWludDI1NiIKCXR4bmEgQXBwbGljYXRpb25BcmdzIDAKCW1hdGNoICphYmlfcm91dGVfYXJjMjAwX25hbWUgKmFiaV9yb3V0ZV9hcmMyMDBfc3ltYm9sICphYmlfcm91dGVfYXJjMjAwX2RlY2ltYWxzICphYmlfcm91dGVfYXJjMjAwX3RvdGFsU3VwcGx5ICphYmlfcm91dGVfYXJjMjAwX2JhbGFuY2VPZiAqYWJpX3JvdXRlX2FyYzIwMF90cmFuc2ZlciAqYWJpX3JvdXRlX2FyYzIwMF90cmFuc2ZlckZyb20gKmFiaV9yb3V0ZV9hcmMyMDBfYXBwcm92ZSAqYWJpX3JvdXRlX2FyYzIwMF9hbGxvd2FuY2UKCWVycg==",
|
|
86
|
+
"clear": "I3ByYWdtYSB2ZXJzaW9uIDEw"
|
|
87
|
+
},
|
|
88
|
+
"contract": {
|
|
89
|
+
"name": "Arc200",
|
|
90
|
+
"desc": "",
|
|
91
|
+
"methods": [
|
|
92
|
+
{
|
|
93
|
+
"name": "arc200_name",
|
|
94
|
+
"desc": "Returns the name of the token",
|
|
95
|
+
"readonly": true,
|
|
96
|
+
"args": [],
|
|
97
|
+
"returns": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"desc": "The name of the token"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "arc200_symbol",
|
|
104
|
+
"desc": "Returns the symbol of the token",
|
|
105
|
+
"readonly": true,
|
|
106
|
+
"args": [],
|
|
107
|
+
"returns": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"desc": "The symbol of the token"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "arc200_decimals",
|
|
114
|
+
"desc": "Returns the decimals of the token",
|
|
115
|
+
"readonly": true,
|
|
116
|
+
"args": [],
|
|
117
|
+
"returns": {
|
|
118
|
+
"type": "uint8",
|
|
119
|
+
"desc": "The decimals of the token"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "arc200_totalSupply",
|
|
124
|
+
"desc": "Returns the total supply of the token",
|
|
125
|
+
"readonly": true,
|
|
126
|
+
"args": [],
|
|
127
|
+
"returns": {
|
|
128
|
+
"type": "uint256",
|
|
129
|
+
"desc": "The total supply of the token"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "arc200_balanceOf",
|
|
134
|
+
"desc": "Returns the current balance of the owner of the token",
|
|
135
|
+
"readonly": true,
|
|
136
|
+
"args": [
|
|
137
|
+
{
|
|
138
|
+
"name": "owner",
|
|
139
|
+
"type": "address",
|
|
140
|
+
"desc": "The address of the owner of the token"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"returns": {
|
|
144
|
+
"type": "uint256",
|
|
145
|
+
"desc": "The current balance of the holder of the token"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "arc200_transfer",
|
|
150
|
+
"desc": "Transfers tokens",
|
|
151
|
+
"args": [
|
|
152
|
+
{
|
|
153
|
+
"name": "to",
|
|
154
|
+
"type": "address",
|
|
155
|
+
"desc": "The destination of the transfer"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "value",
|
|
159
|
+
"type": "uint256",
|
|
160
|
+
"desc": "Amount of tokens to transfer"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"returns": {
|
|
164
|
+
"type": "bool",
|
|
165
|
+
"desc": "Success"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "arc200_transferFrom",
|
|
170
|
+
"desc": "Transfers tokens from source to destination as approved spender",
|
|
171
|
+
"args": [
|
|
172
|
+
{
|
|
173
|
+
"name": "from",
|
|
174
|
+
"type": "address",
|
|
175
|
+
"desc": "The source of the transfer"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "to",
|
|
179
|
+
"type": "address",
|
|
180
|
+
"desc": "The destination of the transfer"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "value",
|
|
184
|
+
"type": "uint256",
|
|
185
|
+
"desc": "Amount of tokens to transfer"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"returns": {
|
|
189
|
+
"type": "bool",
|
|
190
|
+
"desc": "Success"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"name": "arc200_approve",
|
|
195
|
+
"desc": "Approve spender for a token",
|
|
196
|
+
"args": [
|
|
197
|
+
{
|
|
198
|
+
"name": "spender",
|
|
199
|
+
"type": "address",
|
|
200
|
+
"desc": "Who is allowed to take tokens on owner's behalf"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "value",
|
|
204
|
+
"type": "uint256",
|
|
205
|
+
"desc": "Amount of tokens to be taken by spender"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"returns": {
|
|
209
|
+
"type": "bool",
|
|
210
|
+
"desc": "Success"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "arc200_allowance",
|
|
215
|
+
"desc": "Returns the current allowance of the spender of the tokens of the owner",
|
|
216
|
+
"readonly": true,
|
|
217
|
+
"args": [
|
|
218
|
+
{
|
|
219
|
+
"name": "owner",
|
|
220
|
+
"type": "address",
|
|
221
|
+
"desc": "Owner's account"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "spender",
|
|
225
|
+
"type": "address",
|
|
226
|
+
"desc": "Who is allowed to take tokens on owner's behalf"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"returns": {
|
|
230
|
+
"type": "uint256",
|
|
231
|
+
"desc": "The remaining allowance"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "createApplication",
|
|
236
|
+
"args": [],
|
|
237
|
+
"returns": {
|
|
238
|
+
"type": "void"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
var Arc200CallFactory = class {
|
|
245
|
+
/**
|
|
246
|
+
* Gets available create call factories
|
|
247
|
+
*/
|
|
248
|
+
static get create() {
|
|
249
|
+
return {
|
|
250
|
+
/**
|
|
251
|
+
* Constructs a create call for the Arc200 smart contract using the createApplication()void ABI method
|
|
252
|
+
*
|
|
253
|
+
* @param args Any args for the contract call
|
|
254
|
+
* @param params Any additional parameters for the call
|
|
255
|
+
* @returns A TypedCallParams object for the call
|
|
256
|
+
*/
|
|
257
|
+
createApplication(args, params = {}) {
|
|
258
|
+
return {
|
|
259
|
+
method: "createApplication()void",
|
|
260
|
+
methodArgs: Array.isArray(args) ? args : [],
|
|
261
|
+
...params
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Constructs a no op call for the arc200_name()string ABI method
|
|
268
|
+
*
|
|
269
|
+
* Returns the name of the token
|
|
270
|
+
*
|
|
271
|
+
* @param args Any args for the contract call
|
|
272
|
+
* @param params Any additional parameters for the call
|
|
273
|
+
* @returns A TypedCallParams object for the call
|
|
274
|
+
*/
|
|
275
|
+
static arc200Name(args, params) {
|
|
276
|
+
return {
|
|
277
|
+
method: "arc200_name()string",
|
|
278
|
+
methodArgs: Array.isArray(args) ? args : [],
|
|
279
|
+
...params
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Constructs a no op call for the arc200_symbol()string ABI method
|
|
284
|
+
*
|
|
285
|
+
* Returns the symbol of the token
|
|
286
|
+
*
|
|
287
|
+
* @param args Any args for the contract call
|
|
288
|
+
* @param params Any additional parameters for the call
|
|
289
|
+
* @returns A TypedCallParams object for the call
|
|
290
|
+
*/
|
|
291
|
+
static arc200Symbol(args, params) {
|
|
292
|
+
return {
|
|
293
|
+
method: "arc200_symbol()string",
|
|
294
|
+
methodArgs: Array.isArray(args) ? args : [],
|
|
295
|
+
...params
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Constructs a no op call for the arc200_decimals()uint8 ABI method
|
|
300
|
+
*
|
|
301
|
+
* Returns the decimals of the token
|
|
302
|
+
*
|
|
303
|
+
* @param args Any args for the contract call
|
|
304
|
+
* @param params Any additional parameters for the call
|
|
305
|
+
* @returns A TypedCallParams object for the call
|
|
306
|
+
*/
|
|
307
|
+
static arc200Decimals(args, params) {
|
|
308
|
+
return {
|
|
309
|
+
method: "arc200_decimals()uint8",
|
|
310
|
+
methodArgs: Array.isArray(args) ? args : [],
|
|
311
|
+
...params
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Constructs a no op call for the arc200_totalSupply()uint256 ABI method
|
|
316
|
+
*
|
|
317
|
+
* Returns the total supply of the token
|
|
318
|
+
*
|
|
319
|
+
* @param args Any args for the contract call
|
|
320
|
+
* @param params Any additional parameters for the call
|
|
321
|
+
* @returns A TypedCallParams object for the call
|
|
322
|
+
*/
|
|
323
|
+
static arc200TotalSupply(args, params) {
|
|
324
|
+
return {
|
|
325
|
+
method: "arc200_totalSupply()uint256",
|
|
326
|
+
methodArgs: Array.isArray(args) ? args : [],
|
|
327
|
+
...params
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Constructs a no op call for the arc200_balanceOf(address)uint256 ABI method
|
|
332
|
+
*
|
|
333
|
+
* Returns the current balance of the owner of the token
|
|
334
|
+
*
|
|
335
|
+
* @param args Any args for the contract call
|
|
336
|
+
* @param params Any additional parameters for the call
|
|
337
|
+
* @returns A TypedCallParams object for the call
|
|
338
|
+
*/
|
|
339
|
+
static arc200BalanceOf(args, params) {
|
|
340
|
+
return {
|
|
341
|
+
method: "arc200_balanceOf(address)uint256",
|
|
342
|
+
methodArgs: Array.isArray(args) ? args : [args.owner],
|
|
343
|
+
...params
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Constructs a no op call for the arc200_transfer(address,uint256)bool ABI method
|
|
348
|
+
*
|
|
349
|
+
* Transfers tokens
|
|
350
|
+
*
|
|
351
|
+
* @param args Any args for the contract call
|
|
352
|
+
* @param params Any additional parameters for the call
|
|
353
|
+
* @returns A TypedCallParams object for the call
|
|
354
|
+
*/
|
|
355
|
+
static arc200Transfer(args, params) {
|
|
356
|
+
return {
|
|
357
|
+
method: "arc200_transfer(address,uint256)bool",
|
|
358
|
+
methodArgs: Array.isArray(args) ? args : [args.to, args.value],
|
|
359
|
+
...params
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Constructs a no op call for the arc200_transferFrom(address,address,uint256)bool ABI method
|
|
364
|
+
*
|
|
365
|
+
* Transfers tokens from source to destination as approved spender
|
|
366
|
+
*
|
|
367
|
+
* @param args Any args for the contract call
|
|
368
|
+
* @param params Any additional parameters for the call
|
|
369
|
+
* @returns A TypedCallParams object for the call
|
|
370
|
+
*/
|
|
371
|
+
static arc200TransferFrom(args, params) {
|
|
372
|
+
return {
|
|
373
|
+
method: "arc200_transferFrom(address,address,uint256)bool",
|
|
374
|
+
methodArgs: Array.isArray(args) ? args : [args.from, args.to, args.value],
|
|
375
|
+
...params
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Constructs a no op call for the arc200_approve(address,uint256)bool ABI method
|
|
380
|
+
*
|
|
381
|
+
* Approve spender for a token
|
|
382
|
+
*
|
|
383
|
+
* @param args Any args for the contract call
|
|
384
|
+
* @param params Any additional parameters for the call
|
|
385
|
+
* @returns A TypedCallParams object for the call
|
|
386
|
+
*/
|
|
387
|
+
static arc200Approve(args, params) {
|
|
388
|
+
return {
|
|
389
|
+
method: "arc200_approve(address,uint256)bool",
|
|
390
|
+
methodArgs: Array.isArray(args) ? args : [args.spender, args.value],
|
|
391
|
+
...params
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Constructs a no op call for the arc200_allowance(address,address)uint256 ABI method
|
|
396
|
+
*
|
|
397
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
398
|
+
*
|
|
399
|
+
* @param args Any args for the contract call
|
|
400
|
+
* @param params Any additional parameters for the call
|
|
401
|
+
* @returns A TypedCallParams object for the call
|
|
402
|
+
*/
|
|
403
|
+
static arc200Allowance(args, params) {
|
|
404
|
+
return {
|
|
405
|
+
method: "arc200_allowance(address,address)uint256",
|
|
406
|
+
methodArgs: Array.isArray(args) ? args : [args.owner, args.spender],
|
|
407
|
+
...params
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
var Arc200Client = class {
|
|
412
|
+
/**
|
|
413
|
+
* Creates a new instance of `Arc200Client`
|
|
414
|
+
*
|
|
415
|
+
* @param appDetails appDetails The details to identify the app to deploy
|
|
416
|
+
* @param algod An algod client instance
|
|
417
|
+
*/
|
|
418
|
+
constructor(appDetails, algod) {
|
|
419
|
+
this.algod = algod;
|
|
420
|
+
this.sender = appDetails.sender;
|
|
421
|
+
this.appClient = algokit.getAppClient({
|
|
422
|
+
...appDetails,
|
|
423
|
+
app: APP_SPEC
|
|
424
|
+
}, algod);
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type
|
|
428
|
+
*
|
|
429
|
+
* @param result The AppCallTransactionResult to be mapped
|
|
430
|
+
* @param returnValueFormatter An optional delegate to format the return value if required
|
|
431
|
+
* @returns The smart contract response with an updated return value
|
|
432
|
+
*/
|
|
433
|
+
mapReturnValue(result, returnValueFormatter) {
|
|
434
|
+
if (result.return?.decodeError) {
|
|
435
|
+
throw result.return.decodeError;
|
|
436
|
+
}
|
|
437
|
+
const returnValue = result.return?.returnValue !== void 0 && returnValueFormatter !== void 0 ? returnValueFormatter(result.return.returnValue) : result.return?.returnValue;
|
|
438
|
+
return { ...result, return: returnValue };
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Calls the ABI method with the matching signature using an onCompletion code of NO_OP
|
|
442
|
+
*
|
|
443
|
+
* @param typedCallParams An object containing the method signature, args, and any other relevant parameters
|
|
444
|
+
* @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type
|
|
445
|
+
* @returns The result of the smart contract call
|
|
446
|
+
*/
|
|
447
|
+
async call(typedCallParams, returnValueFormatter) {
|
|
448
|
+
return this.mapReturnValue(await this.appClient.call(typedCallParams), returnValueFormatter);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Idempotently deploys the Arc200 smart contract.
|
|
452
|
+
*
|
|
453
|
+
* @param params The arguments for the contract calls and any additional parameters for the call
|
|
454
|
+
* @returns The deployment result
|
|
455
|
+
*/
|
|
456
|
+
deploy(params = {}) {
|
|
457
|
+
const createArgs = params.createCall?.(Arc200CallFactory.create);
|
|
458
|
+
return this.appClient.deploy({
|
|
459
|
+
...params,
|
|
460
|
+
createArgs,
|
|
461
|
+
createOnCompleteAction: createArgs?.onCompleteAction
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Gets available create methods
|
|
466
|
+
*/
|
|
467
|
+
get create() {
|
|
468
|
+
const $this = this;
|
|
469
|
+
return {
|
|
470
|
+
/**
|
|
471
|
+
* Creates a new instance of the Arc200 smart contract using the createApplication()void ABI method.
|
|
472
|
+
*
|
|
473
|
+
* @param args The arguments for the smart contract call
|
|
474
|
+
* @param params Any additional parameters for the call
|
|
475
|
+
* @returns The create result
|
|
476
|
+
*/
|
|
477
|
+
async createApplication(args, params = {}) {
|
|
478
|
+
return $this.mapReturnValue(await $this.appClient.create(Arc200CallFactory.create.createApplication(args, params)));
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Makes a clear_state call to an existing instance of the Arc200 smart contract.
|
|
484
|
+
*
|
|
485
|
+
* @param args The arguments for the bare call
|
|
486
|
+
* @returns The clear_state result
|
|
487
|
+
*/
|
|
488
|
+
clearState(args = {}) {
|
|
489
|
+
return this.appClient.clearState(args);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Calls the arc200_name()string ABI method.
|
|
493
|
+
*
|
|
494
|
+
* Returns the name of the token
|
|
495
|
+
*
|
|
496
|
+
* @param args The arguments for the contract call
|
|
497
|
+
* @param params Any additional parameters for the call
|
|
498
|
+
* @returns The result of the call: The name of the token
|
|
499
|
+
*/
|
|
500
|
+
arc200Name(args, params = {}) {
|
|
501
|
+
return this.call(Arc200CallFactory.arc200Name(args, params));
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Calls the arc200_symbol()string ABI method.
|
|
505
|
+
*
|
|
506
|
+
* Returns the symbol of the token
|
|
507
|
+
*
|
|
508
|
+
* @param args The arguments for the contract call
|
|
509
|
+
* @param params Any additional parameters for the call
|
|
510
|
+
* @returns The result of the call: The symbol of the token
|
|
511
|
+
*/
|
|
512
|
+
arc200Symbol(args, params = {}) {
|
|
513
|
+
return this.call(Arc200CallFactory.arc200Symbol(args, params));
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Calls the arc200_decimals()uint8 ABI method.
|
|
517
|
+
*
|
|
518
|
+
* Returns the decimals of the token
|
|
519
|
+
*
|
|
520
|
+
* @param args The arguments for the contract call
|
|
521
|
+
* @param params Any additional parameters for the call
|
|
522
|
+
* @returns The result of the call: The decimals of the token
|
|
523
|
+
*/
|
|
524
|
+
arc200Decimals(args, params = {}) {
|
|
525
|
+
return this.call(Arc200CallFactory.arc200Decimals(args, params));
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Calls the arc200_totalSupply()uint256 ABI method.
|
|
529
|
+
*
|
|
530
|
+
* Returns the total supply of the token
|
|
531
|
+
*
|
|
532
|
+
* @param args The arguments for the contract call
|
|
533
|
+
* @param params Any additional parameters for the call
|
|
534
|
+
* @returns The result of the call: The total supply of the token
|
|
535
|
+
*/
|
|
536
|
+
arc200TotalSupply(args, params = {}) {
|
|
537
|
+
return this.call(Arc200CallFactory.arc200TotalSupply(args, params));
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Calls the arc200_balanceOf(address)uint256 ABI method.
|
|
541
|
+
*
|
|
542
|
+
* Returns the current balance of the owner of the token
|
|
543
|
+
*
|
|
544
|
+
* @param args The arguments for the contract call
|
|
545
|
+
* @param params Any additional parameters for the call
|
|
546
|
+
* @returns The result of the call: The current balance of the holder of the token
|
|
547
|
+
*/
|
|
548
|
+
arc200BalanceOf(args, params = {}) {
|
|
549
|
+
return this.call(Arc200CallFactory.arc200BalanceOf(args, params));
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Calls the arc200_transfer(address,uint256)bool ABI method.
|
|
553
|
+
*
|
|
554
|
+
* Transfers tokens
|
|
555
|
+
*
|
|
556
|
+
* @param args The arguments for the contract call
|
|
557
|
+
* @param params Any additional parameters for the call
|
|
558
|
+
* @returns The result of the call: Success
|
|
559
|
+
*/
|
|
560
|
+
arc200Transfer(args, params = {}) {
|
|
561
|
+
return this.call(Arc200CallFactory.arc200Transfer(args, params));
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Calls the arc200_transferFrom(address,address,uint256)bool ABI method.
|
|
565
|
+
*
|
|
566
|
+
* Transfers tokens from source to destination as approved spender
|
|
567
|
+
*
|
|
568
|
+
* @param args The arguments for the contract call
|
|
569
|
+
* @param params Any additional parameters for the call
|
|
570
|
+
* @returns The result of the call: Success
|
|
571
|
+
*/
|
|
572
|
+
arc200TransferFrom(args, params = {}) {
|
|
573
|
+
return this.call(Arc200CallFactory.arc200TransferFrom(args, params));
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Calls the arc200_approve(address,uint256)bool ABI method.
|
|
577
|
+
*
|
|
578
|
+
* Approve spender for a token
|
|
579
|
+
*
|
|
580
|
+
* @param args The arguments for the contract call
|
|
581
|
+
* @param params Any additional parameters for the call
|
|
582
|
+
* @returns The result of the call: Success
|
|
583
|
+
*/
|
|
584
|
+
arc200Approve(args, params = {}) {
|
|
585
|
+
return this.call(Arc200CallFactory.arc200Approve(args, params));
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Calls the arc200_allowance(address,address)uint256 ABI method.
|
|
589
|
+
*
|
|
590
|
+
* Returns the current allowance of the spender of the tokens of the owner
|
|
591
|
+
*
|
|
592
|
+
* @param args The arguments for the contract call
|
|
593
|
+
* @param params Any additional parameters for the call
|
|
594
|
+
* @returns The result of the call: The remaining allowance
|
|
595
|
+
*/
|
|
596
|
+
arc200Allowance(args, params = {}) {
|
|
597
|
+
return this.call(Arc200CallFactory.arc200Allowance(args, params));
|
|
598
|
+
}
|
|
599
|
+
compose() {
|
|
600
|
+
const client = this;
|
|
601
|
+
const atc = new AtomicTransactionComposer();
|
|
602
|
+
let promiseChain = Promise.resolve();
|
|
603
|
+
const resultMappers = [];
|
|
604
|
+
return {
|
|
605
|
+
arc200Name(args, params) {
|
|
606
|
+
promiseChain = promiseChain.then(() => client.arc200Name(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
607
|
+
resultMappers.push(void 0);
|
|
608
|
+
return this;
|
|
609
|
+
},
|
|
610
|
+
arc200Symbol(args, params) {
|
|
611
|
+
promiseChain = promiseChain.then(() => client.arc200Symbol(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
612
|
+
resultMappers.push(void 0);
|
|
613
|
+
return this;
|
|
614
|
+
},
|
|
615
|
+
arc200Decimals(args, params) {
|
|
616
|
+
promiseChain = promiseChain.then(() => client.arc200Decimals(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
617
|
+
resultMappers.push(void 0);
|
|
618
|
+
return this;
|
|
619
|
+
},
|
|
620
|
+
arc200TotalSupply(args, params) {
|
|
621
|
+
promiseChain = promiseChain.then(() => client.arc200TotalSupply(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
622
|
+
resultMappers.push(void 0);
|
|
623
|
+
return this;
|
|
624
|
+
},
|
|
625
|
+
arc200BalanceOf(args, params) {
|
|
626
|
+
promiseChain = promiseChain.then(() => client.arc200BalanceOf(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
627
|
+
resultMappers.push(void 0);
|
|
628
|
+
return this;
|
|
629
|
+
},
|
|
630
|
+
arc200Transfer(args, params) {
|
|
631
|
+
promiseChain = promiseChain.then(() => client.arc200Transfer(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
632
|
+
resultMappers.push(void 0);
|
|
633
|
+
return this;
|
|
634
|
+
},
|
|
635
|
+
arc200TransferFrom(args, params) {
|
|
636
|
+
promiseChain = promiseChain.then(() => client.arc200TransferFrom(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
637
|
+
resultMappers.push(void 0);
|
|
638
|
+
return this;
|
|
639
|
+
},
|
|
640
|
+
arc200Approve(args, params) {
|
|
641
|
+
promiseChain = promiseChain.then(() => client.arc200Approve(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
642
|
+
resultMappers.push(void 0);
|
|
643
|
+
return this;
|
|
644
|
+
},
|
|
645
|
+
arc200Allowance(args, params) {
|
|
646
|
+
promiseChain = promiseChain.then(() => client.arc200Allowance(args, { ...params, sendParams: { ...params?.sendParams, skipSending: true, atc } }));
|
|
647
|
+
resultMappers.push(void 0);
|
|
648
|
+
return this;
|
|
649
|
+
},
|
|
650
|
+
clearState(args) {
|
|
651
|
+
promiseChain = promiseChain.then(() => client.clearState({ ...args, sendParams: { ...args?.sendParams, skipSending: true, atc } }));
|
|
652
|
+
resultMappers.push(void 0);
|
|
653
|
+
return this;
|
|
654
|
+
},
|
|
655
|
+
addTransaction(txn, defaultSender) {
|
|
656
|
+
promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender)));
|
|
657
|
+
return this;
|
|
658
|
+
},
|
|
659
|
+
async atc() {
|
|
660
|
+
await promiseChain;
|
|
661
|
+
return atc;
|
|
662
|
+
},
|
|
663
|
+
async simulate(options) {
|
|
664
|
+
await promiseChain;
|
|
665
|
+
const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options }));
|
|
666
|
+
return {
|
|
667
|
+
...result,
|
|
668
|
+
returns: result.methodResults?.map((val, i) => resultMappers[i] !== void 0 ? resultMappers[i](val.returnValue) : val.returnValue)
|
|
669
|
+
};
|
|
670
|
+
},
|
|
671
|
+
async execute() {
|
|
672
|
+
await promiseChain;
|
|
673
|
+
const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams: {} }, client.algod);
|
|
674
|
+
return {
|
|
675
|
+
...result,
|
|
676
|
+
returns: result.returns?.map((val, i) => resultMappers[i] !== void 0 ? resultMappers[i](val.returnValue) : val.returnValue)
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// src/getArc200Client.ts
|
|
684
|
+
var getArc200Client = (input) => {
|
|
685
|
+
return new Arc200Client(
|
|
686
|
+
{
|
|
687
|
+
sender: input.sender,
|
|
688
|
+
resolveBy: "id",
|
|
689
|
+
id: input.appId
|
|
690
|
+
},
|
|
691
|
+
input.algod
|
|
692
|
+
);
|
|
693
|
+
};
|
|
694
|
+
var getArc200Client_default = getArc200Client;
|
|
695
|
+
export {
|
|
696
|
+
getArc200Client_default as getArc200Client
|
|
697
|
+
};
|
|
698
|
+
//# sourceMappingURL=index.mjs.map
|