@gitmyabi/dot 1.0.1 → 1.0.3
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 +3 -3
- package/contracts/{Token_json.d.ts → ERC6160Ext20_json.d.ts} +312 -151
- package/contracts/{Token_json.js → ERC6160Ext20_json.js} +300 -190
- package/contracts/{Token_json.ts → ERC6160Ext20_json.ts} +399 -194
- package/contracts/index.d.ts +2 -2
- package/contracts/index.js +4 -4
- package/contracts/index.ts +2 -2
- package/package.json +3 -3
|
@@ -2,131 +2,40 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* ERC6160Ext20_json ABI
|
|
6
6
|
*
|
|
7
7
|
* This ABI is typed using viem's type system for full type safety.
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
9
|
+
export const ERC6160Ext20_jsonAbi = [
|
|
10
10
|
{
|
|
11
11
|
"inputs": [
|
|
12
12
|
{
|
|
13
|
-
"internalType": "
|
|
14
|
-
"name": "
|
|
15
|
-
"type": "
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "admin",
|
|
15
|
+
"type": "address"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"internalType": "string",
|
|
19
|
-
"name": "
|
|
19
|
+
"name": "name",
|
|
20
20
|
"type": "string"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
"internalType": "
|
|
24
|
-
"name": "
|
|
25
|
-
"type": "
|
|
23
|
+
"internalType": "string",
|
|
24
|
+
"name": "symbol",
|
|
25
|
+
"type": "string"
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
28
|
"stateMutability": "nonpayable",
|
|
29
29
|
"type": "constructor"
|
|
30
30
|
},
|
|
31
|
-
{
|
|
32
|
-
"inputs": [
|
|
33
|
-
{
|
|
34
|
-
"internalType": "address",
|
|
35
|
-
"name": "spender",
|
|
36
|
-
"type": "address"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"internalType": "uint256",
|
|
40
|
-
"name": "allowance",
|
|
41
|
-
"type": "uint256"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"internalType": "uint256",
|
|
45
|
-
"name": "needed",
|
|
46
|
-
"type": "uint256"
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"name": "InsufficientAllowance",
|
|
50
|
-
"type": "error"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"inputs": [
|
|
54
|
-
{
|
|
55
|
-
"internalType": "address",
|
|
56
|
-
"name": "sender",
|
|
57
|
-
"type": "address"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"internalType": "uint256",
|
|
61
|
-
"name": "balance",
|
|
62
|
-
"type": "uint256"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"internalType": "uint256",
|
|
66
|
-
"name": "needed",
|
|
67
|
-
"type": "uint256"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"name": "InsufficientBalance",
|
|
71
|
-
"type": "error"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"inputs": [
|
|
75
|
-
{
|
|
76
|
-
"internalType": "address",
|
|
77
|
-
"name": "",
|
|
78
|
-
"type": "address"
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"name": "InvalidApprover",
|
|
82
|
-
"type": "error"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"inputs": [
|
|
86
|
-
{
|
|
87
|
-
"internalType": "address",
|
|
88
|
-
"name": "",
|
|
89
|
-
"type": "address"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"name": "InvalidReceiver",
|
|
93
|
-
"type": "error"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"inputs": [
|
|
97
|
-
{
|
|
98
|
-
"internalType": "address",
|
|
99
|
-
"name": "",
|
|
100
|
-
"type": "address"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"name": "InvalidSender",
|
|
104
|
-
"type": "error"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"inputs": [],
|
|
108
|
-
"name": "InvalidSignature",
|
|
109
|
-
"type": "error"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"inputs": [
|
|
113
|
-
{
|
|
114
|
-
"internalType": "address",
|
|
115
|
-
"name": "",
|
|
116
|
-
"type": "address"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"name": "InvalidSpender",
|
|
120
|
-
"type": "error"
|
|
121
|
-
},
|
|
122
31
|
{
|
|
123
32
|
"inputs": [],
|
|
124
|
-
"name": "
|
|
33
|
+
"name": "NotRoleAdmin",
|
|
125
34
|
"type": "error"
|
|
126
35
|
},
|
|
127
36
|
{
|
|
128
37
|
"inputs": [],
|
|
129
|
-
"name": "
|
|
38
|
+
"name": "PermissionDenied",
|
|
130
39
|
"type": "error"
|
|
131
40
|
},
|
|
132
41
|
{
|
|
@@ -181,7 +90,20 @@ export const Token_jsonAbi = [
|
|
|
181
90
|
},
|
|
182
91
|
{
|
|
183
92
|
"inputs": [],
|
|
184
|
-
"name": "
|
|
93
|
+
"name": "BURNER_ROLE",
|
|
94
|
+
"outputs": [
|
|
95
|
+
{
|
|
96
|
+
"internalType": "bytes32",
|
|
97
|
+
"name": "",
|
|
98
|
+
"type": "bytes32"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"stateMutability": "view",
|
|
102
|
+
"type": "function"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputs": [],
|
|
106
|
+
"name": "MINTER_ROLE",
|
|
185
107
|
"outputs": [
|
|
186
108
|
{
|
|
187
109
|
"internalType": "bytes32",
|
|
@@ -196,7 +118,7 @@ export const Token_jsonAbi = [
|
|
|
196
118
|
"inputs": [
|
|
197
119
|
{
|
|
198
120
|
"internalType": "address",
|
|
199
|
-
"name": "
|
|
121
|
+
"name": "owner",
|
|
200
122
|
"type": "address"
|
|
201
123
|
},
|
|
202
124
|
{
|
|
@@ -263,12 +185,12 @@ export const Token_jsonAbi = [
|
|
|
263
185
|
"inputs": [
|
|
264
186
|
{
|
|
265
187
|
"internalType": "address",
|
|
266
|
-
"name": "
|
|
188
|
+
"name": "_from",
|
|
267
189
|
"type": "address"
|
|
268
190
|
},
|
|
269
191
|
{
|
|
270
192
|
"internalType": "uint256",
|
|
271
|
-
"name": "
|
|
193
|
+
"name": "_amount",
|
|
272
194
|
"type": "uint256"
|
|
273
195
|
}
|
|
274
196
|
],
|
|
@@ -278,26 +200,26 @@ export const Token_jsonAbi = [
|
|
|
278
200
|
"type": "function"
|
|
279
201
|
},
|
|
280
202
|
{
|
|
281
|
-
"inputs": [
|
|
282
|
-
"name": "decimals",
|
|
283
|
-
"outputs": [
|
|
203
|
+
"inputs": [
|
|
284
204
|
{
|
|
285
|
-
"internalType": "
|
|
286
|
-
"name": "",
|
|
287
|
-
"type": "
|
|
205
|
+
"internalType": "address",
|
|
206
|
+
"name": "newAdmin",
|
|
207
|
+
"type": "address"
|
|
288
208
|
}
|
|
289
209
|
],
|
|
290
|
-
"
|
|
210
|
+
"name": "changeAdmin",
|
|
211
|
+
"outputs": [],
|
|
212
|
+
"stateMutability": "nonpayable",
|
|
291
213
|
"type": "function"
|
|
292
214
|
},
|
|
293
215
|
{
|
|
294
216
|
"inputs": [],
|
|
295
|
-
"name": "
|
|
217
|
+
"name": "decimals",
|
|
296
218
|
"outputs": [
|
|
297
219
|
{
|
|
298
|
-
"internalType": "
|
|
220
|
+
"internalType": "uint8",
|
|
299
221
|
"name": "",
|
|
300
|
-
"type": "
|
|
222
|
+
"type": "uint8"
|
|
301
223
|
}
|
|
302
224
|
],
|
|
303
225
|
"stateMutability": "view",
|
|
@@ -307,47 +229,89 @@ export const Token_jsonAbi = [
|
|
|
307
229
|
"inputs": [
|
|
308
230
|
{
|
|
309
231
|
"internalType": "address",
|
|
310
|
-
"name": "
|
|
232
|
+
"name": "spender",
|
|
311
233
|
"type": "address"
|
|
312
234
|
},
|
|
313
235
|
{
|
|
314
236
|
"internalType": "uint256",
|
|
315
|
-
"name": "
|
|
237
|
+
"name": "subtractedValue",
|
|
316
238
|
"type": "uint256"
|
|
317
239
|
}
|
|
318
240
|
],
|
|
319
|
-
"name": "
|
|
320
|
-
"outputs": [
|
|
241
|
+
"name": "decreaseAllowance",
|
|
242
|
+
"outputs": [
|
|
243
|
+
{
|
|
244
|
+
"internalType": "bool",
|
|
245
|
+
"name": "",
|
|
246
|
+
"type": "bool"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
321
249
|
"stateMutability": "nonpayable",
|
|
322
250
|
"type": "function"
|
|
323
251
|
},
|
|
324
252
|
{
|
|
325
253
|
"inputs": [],
|
|
326
|
-
"name": "
|
|
254
|
+
"name": "getBurnerRole",
|
|
327
255
|
"outputs": [
|
|
328
256
|
{
|
|
329
|
-
"internalType": "
|
|
257
|
+
"internalType": "bytes32",
|
|
330
258
|
"name": "",
|
|
331
|
-
"type": "
|
|
259
|
+
"type": "bytes32"
|
|
332
260
|
}
|
|
333
261
|
],
|
|
334
|
-
"stateMutability": "
|
|
262
|
+
"stateMutability": "pure",
|
|
263
|
+
"type": "function"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"inputs": [],
|
|
267
|
+
"name": "getMinterRole",
|
|
268
|
+
"outputs": [
|
|
269
|
+
{
|
|
270
|
+
"internalType": "bytes32",
|
|
271
|
+
"name": "",
|
|
272
|
+
"type": "bytes32"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
"stateMutability": "pure",
|
|
335
276
|
"type": "function"
|
|
336
277
|
},
|
|
337
278
|
{
|
|
338
279
|
"inputs": [
|
|
280
|
+
{
|
|
281
|
+
"internalType": "bytes32",
|
|
282
|
+
"name": "_role",
|
|
283
|
+
"type": "bytes32"
|
|
284
|
+
},
|
|
339
285
|
{
|
|
340
286
|
"internalType": "address",
|
|
341
|
-
"name": "
|
|
287
|
+
"name": "_account",
|
|
342
288
|
"type": "address"
|
|
343
289
|
}
|
|
344
290
|
],
|
|
345
|
-
"name": "
|
|
291
|
+
"name": "grantRole",
|
|
292
|
+
"outputs": [],
|
|
293
|
+
"stateMutability": "nonpayable",
|
|
294
|
+
"type": "function"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"inputs": [
|
|
298
|
+
{
|
|
299
|
+
"internalType": "bytes32",
|
|
300
|
+
"name": "_role",
|
|
301
|
+
"type": "bytes32"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"internalType": "address",
|
|
305
|
+
"name": "_account",
|
|
306
|
+
"type": "address"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"name": "hasRole",
|
|
346
310
|
"outputs": [
|
|
347
311
|
{
|
|
348
|
-
"internalType": "
|
|
312
|
+
"internalType": "bool",
|
|
349
313
|
"name": "",
|
|
350
|
-
"type": "
|
|
314
|
+
"type": "bool"
|
|
351
315
|
}
|
|
352
316
|
],
|
|
353
317
|
"stateMutability": "view",
|
|
@@ -355,11 +319,6 @@ export const Token_jsonAbi = [
|
|
|
355
319
|
},
|
|
356
320
|
{
|
|
357
321
|
"inputs": [
|
|
358
|
-
{
|
|
359
|
-
"internalType": "address",
|
|
360
|
-
"name": "issuer",
|
|
361
|
-
"type": "address"
|
|
362
|
-
},
|
|
363
322
|
{
|
|
364
323
|
"internalType": "address",
|
|
365
324
|
"name": "spender",
|
|
@@ -367,35 +326,89 @@ export const Token_jsonAbi = [
|
|
|
367
326
|
},
|
|
368
327
|
{
|
|
369
328
|
"internalType": "uint256",
|
|
370
|
-
"name": "
|
|
329
|
+
"name": "addedValue",
|
|
371
330
|
"type": "uint256"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"name": "increaseAllowance",
|
|
334
|
+
"outputs": [
|
|
335
|
+
{
|
|
336
|
+
"internalType": "bool",
|
|
337
|
+
"name": "",
|
|
338
|
+
"type": "bool"
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
"stateMutability": "nonpayable",
|
|
342
|
+
"type": "function"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"inputs": [
|
|
346
|
+
{
|
|
347
|
+
"internalType": "address",
|
|
348
|
+
"name": "_to",
|
|
349
|
+
"type": "address"
|
|
372
350
|
},
|
|
373
351
|
{
|
|
374
352
|
"internalType": "uint256",
|
|
375
|
-
"name": "
|
|
353
|
+
"name": "_amount",
|
|
376
354
|
"type": "uint256"
|
|
377
|
-
}
|
|
355
|
+
}
|
|
356
|
+
],
|
|
357
|
+
"name": "mint",
|
|
358
|
+
"outputs": [],
|
|
359
|
+
"stateMutability": "nonpayable",
|
|
360
|
+
"type": "function"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"inputs": [],
|
|
364
|
+
"name": "name",
|
|
365
|
+
"outputs": [
|
|
378
366
|
{
|
|
379
|
-
"internalType": "
|
|
380
|
-
"name": "
|
|
381
|
-
"type": "
|
|
382
|
-
}
|
|
367
|
+
"internalType": "string",
|
|
368
|
+
"name": "",
|
|
369
|
+
"type": "string"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"stateMutability": "view",
|
|
373
|
+
"type": "function"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"inputs": [
|
|
383
377
|
{
|
|
384
378
|
"internalType": "bytes32",
|
|
385
|
-
"name": "
|
|
379
|
+
"name": "_role",
|
|
386
380
|
"type": "bytes32"
|
|
387
381
|
},
|
|
388
382
|
{
|
|
389
|
-
"internalType": "
|
|
390
|
-
"name": "
|
|
391
|
-
"type": "
|
|
383
|
+
"internalType": "address",
|
|
384
|
+
"name": "_account",
|
|
385
|
+
"type": "address"
|
|
392
386
|
}
|
|
393
387
|
],
|
|
394
|
-
"name": "
|
|
388
|
+
"name": "revokeRole",
|
|
395
389
|
"outputs": [],
|
|
396
390
|
"stateMutability": "nonpayable",
|
|
397
391
|
"type": "function"
|
|
398
392
|
},
|
|
393
|
+
{
|
|
394
|
+
"inputs": [
|
|
395
|
+
{
|
|
396
|
+
"internalType": "bytes4",
|
|
397
|
+
"name": "_interfaceId",
|
|
398
|
+
"type": "bytes4"
|
|
399
|
+
}
|
|
400
|
+
],
|
|
401
|
+
"name": "supportsInterface",
|
|
402
|
+
"outputs": [
|
|
403
|
+
{
|
|
404
|
+
"internalType": "bool",
|
|
405
|
+
"name": "",
|
|
406
|
+
"type": "bool"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"stateMutability": "view",
|
|
410
|
+
"type": "function"
|
|
411
|
+
},
|
|
399
412
|
{
|
|
400
413
|
"inputs": [],
|
|
401
414
|
"name": "symbol",
|
|
@@ -426,7 +439,7 @@ export const Token_jsonAbi = [
|
|
|
426
439
|
"inputs": [
|
|
427
440
|
{
|
|
428
441
|
"internalType": "address",
|
|
429
|
-
"name": "
|
|
442
|
+
"name": "to",
|
|
430
443
|
"type": "address"
|
|
431
444
|
},
|
|
432
445
|
{
|
|
@@ -450,12 +463,12 @@ export const Token_jsonAbi = [
|
|
|
450
463
|
"inputs": [
|
|
451
464
|
{
|
|
452
465
|
"internalType": "address",
|
|
453
|
-
"name": "
|
|
466
|
+
"name": "from",
|
|
454
467
|
"type": "address"
|
|
455
468
|
},
|
|
456
469
|
{
|
|
457
470
|
"internalType": "address",
|
|
458
|
-
"name": "
|
|
471
|
+
"name": "to",
|
|
459
472
|
"type": "address"
|
|
460
473
|
},
|
|
461
474
|
{
|
|
@@ -478,19 +491,19 @@ export const Token_jsonAbi = [
|
|
|
478
491
|
] as const satisfies Abi;
|
|
479
492
|
|
|
480
493
|
/**
|
|
481
|
-
* Type-safe ABI for
|
|
494
|
+
* Type-safe ABI for ERC6160Ext20_json
|
|
482
495
|
*/
|
|
483
|
-
export type
|
|
496
|
+
export type ERC6160Ext20_jsonAbi = typeof ERC6160Ext20_jsonAbi;
|
|
484
497
|
|
|
485
498
|
/**
|
|
486
|
-
* Contract instance type for
|
|
499
|
+
* Contract instance type for ERC6160Ext20_json
|
|
487
500
|
*/
|
|
488
501
|
// Use any for contract type to avoid complex viem type issues
|
|
489
502
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
490
|
-
export type
|
|
503
|
+
export type ERC6160Ext20_jsonContract = any;
|
|
491
504
|
|
|
492
505
|
/**
|
|
493
|
-
*
|
|
506
|
+
* ERC6160Ext20_json Contract Class
|
|
494
507
|
*
|
|
495
508
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
496
509
|
*
|
|
@@ -498,12 +511,12 @@ export type Token_jsonContract = any;
|
|
|
498
511
|
* ```typescript
|
|
499
512
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
500
513
|
* import { mainnet } from 'viem/chains';
|
|
501
|
-
* import {
|
|
514
|
+
* import { ERC6160Ext20_json } from 'ERC6160Ext20_json';
|
|
502
515
|
*
|
|
503
516
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
504
517
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
505
518
|
*
|
|
506
|
-
* const contract = new
|
|
519
|
+
* const contract = new ERC6160Ext20_json('0x...', { publicClient, walletClient });
|
|
507
520
|
*
|
|
508
521
|
* // Read functions
|
|
509
522
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -521,8 +534,8 @@ export type Token_jsonContract = any;
|
|
|
521
534
|
* });
|
|
522
535
|
* ```
|
|
523
536
|
*/
|
|
524
|
-
export class
|
|
525
|
-
private contract:
|
|
537
|
+
export class ERC6160Ext20_json {
|
|
538
|
+
private contract: ERC6160Ext20_jsonContract;
|
|
526
539
|
private contractAddress: Address;
|
|
527
540
|
private publicClient: PublicClient;
|
|
528
541
|
|
|
@@ -537,7 +550,7 @@ export class Token_json {
|
|
|
537
550
|
this.publicClient = clients.publicClient;
|
|
538
551
|
this.contract = getContract({
|
|
539
552
|
address,
|
|
540
|
-
abi:
|
|
553
|
+
abi: ERC6160Ext20_jsonAbi,
|
|
541
554
|
client: {
|
|
542
555
|
public: clients.publicClient,
|
|
543
556
|
wallet: clients.walletClient,
|
|
@@ -555,24 +568,32 @@ export class Token_json {
|
|
|
555
568
|
/**
|
|
556
569
|
* Get the underlying viem contract instance
|
|
557
570
|
*/
|
|
558
|
-
getContract():
|
|
571
|
+
getContract(): ERC6160Ext20_jsonContract {
|
|
559
572
|
return this.contract;
|
|
560
573
|
}
|
|
561
574
|
|
|
562
575
|
/**
|
|
563
|
-
*
|
|
576
|
+
* BURNER_ROLE
|
|
577
|
+
* view
|
|
578
|
+
*/
|
|
579
|
+
async BURNER_ROLE(): Promise<`0x${string}`> {
|
|
580
|
+
return this.contract.read.BURNER_ROLE() as Promise<`0x${string}`>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* MINTER_ROLE
|
|
564
585
|
* view
|
|
565
586
|
*/
|
|
566
|
-
async
|
|
567
|
-
return this.contract.read.
|
|
587
|
+
async MINTER_ROLE(): Promise<`0x${string}`> {
|
|
588
|
+
return this.contract.read.MINTER_ROLE() as Promise<`0x${string}`>;
|
|
568
589
|
}
|
|
569
590
|
|
|
570
591
|
/**
|
|
571
592
|
* allowance
|
|
572
593
|
* view
|
|
573
594
|
*/
|
|
574
|
-
async allowance(
|
|
575
|
-
return this.contract.read.allowance([
|
|
595
|
+
async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
|
|
596
|
+
return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
|
|
576
597
|
}
|
|
577
598
|
|
|
578
599
|
/**
|
|
@@ -592,11 +613,27 @@ export class Token_json {
|
|
|
592
613
|
}
|
|
593
614
|
|
|
594
615
|
/**
|
|
595
|
-
*
|
|
616
|
+
* getBurnerRole
|
|
617
|
+
* pure
|
|
618
|
+
*/
|
|
619
|
+
async getBurnerRole(): Promise<`0x${string}`> {
|
|
620
|
+
return this.contract.read.getBurnerRole() as Promise<`0x${string}`>;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* getMinterRole
|
|
625
|
+
* pure
|
|
626
|
+
*/
|
|
627
|
+
async getMinterRole(): Promise<`0x${string}`> {
|
|
628
|
+
return this.contract.read.getMinterRole() as Promise<`0x${string}`>;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* hasRole
|
|
596
633
|
* view
|
|
597
634
|
*/
|
|
598
|
-
async
|
|
599
|
-
return this.contract.read.
|
|
635
|
+
async hasRole(_role: `0x${string}`, _account: `0x${string}`): Promise<boolean> {
|
|
636
|
+
return this.contract.read.hasRole([_role, _account] as const) as Promise<boolean>;
|
|
600
637
|
}
|
|
601
638
|
|
|
602
639
|
/**
|
|
@@ -608,11 +645,11 @@ export class Token_json {
|
|
|
608
645
|
}
|
|
609
646
|
|
|
610
647
|
/**
|
|
611
|
-
*
|
|
648
|
+
* supportsInterface
|
|
612
649
|
* view
|
|
613
650
|
*/
|
|
614
|
-
async
|
|
615
|
-
return this.contract.read.
|
|
651
|
+
async supportsInterface(_interfaceId: `0x${string}`): Promise<boolean> {
|
|
652
|
+
return this.contract.read.supportsInterface([_interfaceId] as const) as Promise<boolean>;
|
|
616
653
|
}
|
|
617
654
|
|
|
618
655
|
/**
|
|
@@ -659,7 +696,30 @@ export class Token_json {
|
|
|
659
696
|
* nonpayable
|
|
660
697
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
661
698
|
*/
|
|
662
|
-
async burn(
|
|
699
|
+
async burn(_from: `0x${string}`, _amount: bigint, options?: {
|
|
700
|
+
accessList?: import('viem').AccessList;
|
|
701
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
702
|
+
chain?: import('viem').Chain | null;
|
|
703
|
+
dataSuffix?: `0x${string}`;
|
|
704
|
+
gas?: bigint;
|
|
705
|
+
gasPrice?: bigint;
|
|
706
|
+
maxFeePerGas?: bigint;
|
|
707
|
+
maxPriorityFeePerGas?: bigint;
|
|
708
|
+
nonce?: number;
|
|
709
|
+
value?: bigint;
|
|
710
|
+
}): Promise<`0x${string}`> {
|
|
711
|
+
if (!this.contract.write) {
|
|
712
|
+
throw new Error('Wallet client is required for write operations');
|
|
713
|
+
}
|
|
714
|
+
return this.contract.write.burn([_from, _amount] as const, options) as Promise<`0x${string}`>;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* changeAdmin
|
|
719
|
+
* nonpayable
|
|
720
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
721
|
+
*/
|
|
722
|
+
async changeAdmin(newAdmin: `0x${string}`, options?: {
|
|
663
723
|
accessList?: import('viem').AccessList;
|
|
664
724
|
authorizationList?: import('viem').AuthorizationList;
|
|
665
725
|
chain?: import('viem').Chain | null;
|
|
@@ -674,7 +734,76 @@ export class Token_json {
|
|
|
674
734
|
if (!this.contract.write) {
|
|
675
735
|
throw new Error('Wallet client is required for write operations');
|
|
676
736
|
}
|
|
677
|
-
return this.contract.write.
|
|
737
|
+
return this.contract.write.changeAdmin([newAdmin] as const, options) as Promise<`0x${string}`>;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* decreaseAllowance
|
|
742
|
+
* nonpayable
|
|
743
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
744
|
+
*/
|
|
745
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
746
|
+
accessList?: import('viem').AccessList;
|
|
747
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
748
|
+
chain?: import('viem').Chain | null;
|
|
749
|
+
dataSuffix?: `0x${string}`;
|
|
750
|
+
gas?: bigint;
|
|
751
|
+
gasPrice?: bigint;
|
|
752
|
+
maxFeePerGas?: bigint;
|
|
753
|
+
maxPriorityFeePerGas?: bigint;
|
|
754
|
+
nonce?: number;
|
|
755
|
+
value?: bigint;
|
|
756
|
+
}): Promise<`0x${string}`> {
|
|
757
|
+
if (!this.contract.write) {
|
|
758
|
+
throw new Error('Wallet client is required for write operations');
|
|
759
|
+
}
|
|
760
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* grantRole
|
|
765
|
+
* nonpayable
|
|
766
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
767
|
+
*/
|
|
768
|
+
async grantRole(_role: `0x${string}`, _account: `0x${string}`, options?: {
|
|
769
|
+
accessList?: import('viem').AccessList;
|
|
770
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
771
|
+
chain?: import('viem').Chain | null;
|
|
772
|
+
dataSuffix?: `0x${string}`;
|
|
773
|
+
gas?: bigint;
|
|
774
|
+
gasPrice?: bigint;
|
|
775
|
+
maxFeePerGas?: bigint;
|
|
776
|
+
maxPriorityFeePerGas?: bigint;
|
|
777
|
+
nonce?: number;
|
|
778
|
+
value?: bigint;
|
|
779
|
+
}): Promise<`0x${string}`> {
|
|
780
|
+
if (!this.contract.write) {
|
|
781
|
+
throw new Error('Wallet client is required for write operations');
|
|
782
|
+
}
|
|
783
|
+
return this.contract.write.grantRole([_role, _account] as const, options) as Promise<`0x${string}`>;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* increaseAllowance
|
|
788
|
+
* nonpayable
|
|
789
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
790
|
+
*/
|
|
791
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
792
|
+
accessList?: import('viem').AccessList;
|
|
793
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
794
|
+
chain?: import('viem').Chain | null;
|
|
795
|
+
dataSuffix?: `0x${string}`;
|
|
796
|
+
gas?: bigint;
|
|
797
|
+
gasPrice?: bigint;
|
|
798
|
+
maxFeePerGas?: bigint;
|
|
799
|
+
maxPriorityFeePerGas?: bigint;
|
|
800
|
+
nonce?: number;
|
|
801
|
+
value?: bigint;
|
|
802
|
+
}): Promise<`0x${string}`> {
|
|
803
|
+
if (!this.contract.write) {
|
|
804
|
+
throw new Error('Wallet client is required for write operations');
|
|
805
|
+
}
|
|
806
|
+
return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
|
|
678
807
|
}
|
|
679
808
|
|
|
680
809
|
/**
|
|
@@ -682,7 +811,7 @@ export class Token_json {
|
|
|
682
811
|
* nonpayable
|
|
683
812
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
684
813
|
*/
|
|
685
|
-
async mint(
|
|
814
|
+
async mint(_to: `0x${string}`, _amount: bigint, options?: {
|
|
686
815
|
accessList?: import('viem').AccessList;
|
|
687
816
|
authorizationList?: import('viem').AuthorizationList;
|
|
688
817
|
chain?: import('viem').Chain | null;
|
|
@@ -697,15 +826,15 @@ export class Token_json {
|
|
|
697
826
|
if (!this.contract.write) {
|
|
698
827
|
throw new Error('Wallet client is required for write operations');
|
|
699
828
|
}
|
|
700
|
-
return this.contract.write.mint([
|
|
829
|
+
return this.contract.write.mint([_to, _amount] as const, options) as Promise<`0x${string}`>;
|
|
701
830
|
}
|
|
702
831
|
|
|
703
832
|
/**
|
|
704
|
-
*
|
|
833
|
+
* revokeRole
|
|
705
834
|
* nonpayable
|
|
706
835
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
707
836
|
*/
|
|
708
|
-
async
|
|
837
|
+
async revokeRole(_role: `0x${string}`, _account: `0x${string}`, options?: {
|
|
709
838
|
accessList?: import('viem').AccessList;
|
|
710
839
|
authorizationList?: import('viem').AuthorizationList;
|
|
711
840
|
chain?: import('viem').Chain | null;
|
|
@@ -720,7 +849,7 @@ export class Token_json {
|
|
|
720
849
|
if (!this.contract.write) {
|
|
721
850
|
throw new Error('Wallet client is required for write operations');
|
|
722
851
|
}
|
|
723
|
-
return this.contract.write.
|
|
852
|
+
return this.contract.write.revokeRole([_role, _account] as const, options) as Promise<`0x${string}`>;
|
|
724
853
|
}
|
|
725
854
|
|
|
726
855
|
/**
|
|
@@ -728,7 +857,7 @@ export class Token_json {
|
|
|
728
857
|
* nonpayable
|
|
729
858
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
730
859
|
*/
|
|
731
|
-
async transfer(
|
|
860
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
732
861
|
accessList?: import('viem').AccessList;
|
|
733
862
|
authorizationList?: import('viem').AuthorizationList;
|
|
734
863
|
chain?: import('viem').Chain | null;
|
|
@@ -743,7 +872,7 @@ export class Token_json {
|
|
|
743
872
|
if (!this.contract.write) {
|
|
744
873
|
throw new Error('Wallet client is required for write operations');
|
|
745
874
|
}
|
|
746
|
-
return this.contract.write.transfer([
|
|
875
|
+
return this.contract.write.transfer([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
747
876
|
}
|
|
748
877
|
|
|
749
878
|
/**
|
|
@@ -751,7 +880,7 @@ export class Token_json {
|
|
|
751
880
|
* nonpayable
|
|
752
881
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
753
882
|
*/
|
|
754
|
-
async transferFrom(
|
|
883
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
755
884
|
accessList?: import('viem').AccessList;
|
|
756
885
|
authorizationList?: import('viem').AuthorizationList;
|
|
757
886
|
chain?: import('viem').Chain | null;
|
|
@@ -766,7 +895,7 @@ export class Token_json {
|
|
|
766
895
|
if (!this.contract.write) {
|
|
767
896
|
throw new Error('Wallet client is required for write operations');
|
|
768
897
|
}
|
|
769
|
-
return this.contract.write.transferFrom([
|
|
898
|
+
return this.contract.write.transferFrom([from, to, amount] as const, options) as Promise<`0x${string}`>;
|
|
770
899
|
}
|
|
771
900
|
|
|
772
901
|
|
|
@@ -809,7 +938,7 @@ export class Token_json {
|
|
|
809
938
|
* Returns gas estimate and result without sending transaction
|
|
810
939
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
811
940
|
*/
|
|
812
|
-
async burn(
|
|
941
|
+
async burn(_from: `0x${string}`, _amount: bigint, options?: {
|
|
813
942
|
accessList?: import('viem').AccessList;
|
|
814
943
|
authorizationList?: import('viem').AuthorizationList;
|
|
815
944
|
chain?: import('viem').Chain | null;
|
|
@@ -821,14 +950,90 @@ export class Token_json {
|
|
|
821
950
|
nonce?: number;
|
|
822
951
|
value?: bigint;
|
|
823
952
|
}): Promise<void> {
|
|
824
|
-
return contract.simulate.burn([
|
|
953
|
+
return contract.simulate.burn([_from, _amount] as const, options) as Promise<void>;
|
|
954
|
+
},
|
|
955
|
+
/**
|
|
956
|
+
* Simulate changeAdmin
|
|
957
|
+
* Returns gas estimate and result without sending transaction
|
|
958
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
959
|
+
*/
|
|
960
|
+
async changeAdmin(newAdmin: `0x${string}`, options?: {
|
|
961
|
+
accessList?: import('viem').AccessList;
|
|
962
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
963
|
+
chain?: import('viem').Chain | null;
|
|
964
|
+
dataSuffix?: `0x${string}`;
|
|
965
|
+
gas?: bigint;
|
|
966
|
+
gasPrice?: bigint;
|
|
967
|
+
maxFeePerGas?: bigint;
|
|
968
|
+
maxPriorityFeePerGas?: bigint;
|
|
969
|
+
nonce?: number;
|
|
970
|
+
value?: bigint;
|
|
971
|
+
}): Promise<void> {
|
|
972
|
+
return contract.simulate.changeAdmin([newAdmin] as const, options) as Promise<void>;
|
|
973
|
+
},
|
|
974
|
+
/**
|
|
975
|
+
* Simulate decreaseAllowance
|
|
976
|
+
* Returns gas estimate and result without sending transaction
|
|
977
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
978
|
+
*/
|
|
979
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
980
|
+
accessList?: import('viem').AccessList;
|
|
981
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
982
|
+
chain?: import('viem').Chain | null;
|
|
983
|
+
dataSuffix?: `0x${string}`;
|
|
984
|
+
gas?: bigint;
|
|
985
|
+
gasPrice?: bigint;
|
|
986
|
+
maxFeePerGas?: bigint;
|
|
987
|
+
maxPriorityFeePerGas?: bigint;
|
|
988
|
+
nonce?: number;
|
|
989
|
+
value?: bigint;
|
|
990
|
+
}): Promise<boolean> {
|
|
991
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
992
|
+
},
|
|
993
|
+
/**
|
|
994
|
+
* Simulate grantRole
|
|
995
|
+
* Returns gas estimate and result without sending transaction
|
|
996
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
997
|
+
*/
|
|
998
|
+
async grantRole(_role: `0x${string}`, _account: `0x${string}`, options?: {
|
|
999
|
+
accessList?: import('viem').AccessList;
|
|
1000
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1001
|
+
chain?: import('viem').Chain | null;
|
|
1002
|
+
dataSuffix?: `0x${string}`;
|
|
1003
|
+
gas?: bigint;
|
|
1004
|
+
gasPrice?: bigint;
|
|
1005
|
+
maxFeePerGas?: bigint;
|
|
1006
|
+
maxPriorityFeePerGas?: bigint;
|
|
1007
|
+
nonce?: number;
|
|
1008
|
+
value?: bigint;
|
|
1009
|
+
}): Promise<void> {
|
|
1010
|
+
return contract.simulate.grantRole([_role, _account] as const, options) as Promise<void>;
|
|
1011
|
+
},
|
|
1012
|
+
/**
|
|
1013
|
+
* Simulate increaseAllowance
|
|
1014
|
+
* Returns gas estimate and result without sending transaction
|
|
1015
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1016
|
+
*/
|
|
1017
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
1018
|
+
accessList?: import('viem').AccessList;
|
|
1019
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1020
|
+
chain?: import('viem').Chain | null;
|
|
1021
|
+
dataSuffix?: `0x${string}`;
|
|
1022
|
+
gas?: bigint;
|
|
1023
|
+
gasPrice?: bigint;
|
|
1024
|
+
maxFeePerGas?: bigint;
|
|
1025
|
+
maxPriorityFeePerGas?: bigint;
|
|
1026
|
+
nonce?: number;
|
|
1027
|
+
value?: bigint;
|
|
1028
|
+
}): Promise<boolean> {
|
|
1029
|
+
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
825
1030
|
},
|
|
826
1031
|
/**
|
|
827
1032
|
* Simulate mint
|
|
828
1033
|
* Returns gas estimate and result without sending transaction
|
|
829
1034
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
830
1035
|
*/
|
|
831
|
-
async mint(
|
|
1036
|
+
async mint(_to: `0x${string}`, _amount: bigint, options?: {
|
|
832
1037
|
accessList?: import('viem').AccessList;
|
|
833
1038
|
authorizationList?: import('viem').AuthorizationList;
|
|
834
1039
|
chain?: import('viem').Chain | null;
|
|
@@ -840,14 +1045,14 @@ export class Token_json {
|
|
|
840
1045
|
nonce?: number;
|
|
841
1046
|
value?: bigint;
|
|
842
1047
|
}): Promise<void> {
|
|
843
|
-
return contract.simulate.mint([
|
|
1048
|
+
return contract.simulate.mint([_to, _amount] as const, options) as Promise<void>;
|
|
844
1049
|
},
|
|
845
1050
|
/**
|
|
846
|
-
* Simulate
|
|
1051
|
+
* Simulate revokeRole
|
|
847
1052
|
* Returns gas estimate and result without sending transaction
|
|
848
1053
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
849
1054
|
*/
|
|
850
|
-
async
|
|
1055
|
+
async revokeRole(_role: `0x${string}`, _account: `0x${string}`, options?: {
|
|
851
1056
|
accessList?: import('viem').AccessList;
|
|
852
1057
|
authorizationList?: import('viem').AuthorizationList;
|
|
853
1058
|
chain?: import('viem').Chain | null;
|
|
@@ -859,14 +1064,14 @@ export class Token_json {
|
|
|
859
1064
|
nonce?: number;
|
|
860
1065
|
value?: bigint;
|
|
861
1066
|
}): Promise<void> {
|
|
862
|
-
return contract.simulate.
|
|
1067
|
+
return contract.simulate.revokeRole([_role, _account] as const, options) as Promise<void>;
|
|
863
1068
|
},
|
|
864
1069
|
/**
|
|
865
1070
|
* Simulate transfer
|
|
866
1071
|
* Returns gas estimate and result without sending transaction
|
|
867
1072
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
868
1073
|
*/
|
|
869
|
-
async transfer(
|
|
1074
|
+
async transfer(to: `0x${string}`, amount: bigint, options?: {
|
|
870
1075
|
accessList?: import('viem').AccessList;
|
|
871
1076
|
authorizationList?: import('viem').AuthorizationList;
|
|
872
1077
|
chain?: import('viem').Chain | null;
|
|
@@ -878,14 +1083,14 @@ export class Token_json {
|
|
|
878
1083
|
nonce?: number;
|
|
879
1084
|
value?: bigint;
|
|
880
1085
|
}): Promise<boolean> {
|
|
881
|
-
return contract.simulate.transfer([
|
|
1086
|
+
return contract.simulate.transfer([to, amount] as const, options) as Promise<boolean>;
|
|
882
1087
|
},
|
|
883
1088
|
/**
|
|
884
1089
|
* Simulate transferFrom
|
|
885
1090
|
* Returns gas estimate and result without sending transaction
|
|
886
1091
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
887
1092
|
*/
|
|
888
|
-
async transferFrom(
|
|
1093
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, amount: bigint, options?: {
|
|
889
1094
|
accessList?: import('viem').AccessList;
|
|
890
1095
|
authorizationList?: import('viem').AuthorizationList;
|
|
891
1096
|
chain?: import('viem').Chain | null;
|
|
@@ -897,7 +1102,7 @@ export class Token_json {
|
|
|
897
1102
|
nonce?: number;
|
|
898
1103
|
value?: bigint;
|
|
899
1104
|
}): Promise<boolean> {
|
|
900
|
-
return contract.simulate.transferFrom([
|
|
1105
|
+
return contract.simulate.transferFrom([from, to, amount] as const, options) as Promise<boolean>;
|
|
901
1106
|
}
|
|
902
1107
|
};
|
|
903
1108
|
}
|
|
@@ -925,7 +1130,7 @@ export class Token_json {
|
|
|
925
1130
|
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
926
1131
|
return this.publicClient.watchContractEvent({
|
|
927
1132
|
address: this.contractAddress,
|
|
928
|
-
abi:
|
|
1133
|
+
abi: ERC6160Ext20_jsonAbi,
|
|
929
1134
|
eventName: 'Approval',
|
|
930
1135
|
args: filter,
|
|
931
1136
|
onLogs: (logs: any[]) => {
|
|
@@ -944,7 +1149,7 @@ export class Token_json {
|
|
|
944
1149
|
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
945
1150
|
return this.publicClient.watchContractEvent({
|
|
946
1151
|
address: this.contractAddress,
|
|
947
|
-
abi:
|
|
1152
|
+
abi: ERC6160Ext20_jsonAbi,
|
|
948
1153
|
eventName: 'Transfer',
|
|
949
1154
|
args: filter,
|
|
950
1155
|
onLogs: (logs: any[]) => {
|