@gitmyabi/audio 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 +108 -0
- package/contracts/AudiusAdminUpgradeabilityProxy_json.d.ts +256 -0
- package/contracts/AudiusAdminUpgradeabilityProxy_json.js +273 -0
- package/contracts/AudiusAdminUpgradeabilityProxy_json.ts +348 -0
- package/contracts/AudiusToken_json.d.ts +1371 -0
- package/contracts/AudiusToken_json.js +1355 -0
- package/contracts/AudiusToken_json.ts +1790 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1790 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* AudiusToken_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const AudiusToken_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"anonymous": false,
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"indexed": true,
|
|
15
|
+
"internalType": "address",
|
|
16
|
+
"name": "owner",
|
|
17
|
+
"type": "address"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"indexed": true,
|
|
21
|
+
"internalType": "address",
|
|
22
|
+
"name": "spender",
|
|
23
|
+
"type": "address"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"indexed": false,
|
|
27
|
+
"internalType": "uint256",
|
|
28
|
+
"name": "value",
|
|
29
|
+
"type": "uint256"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"name": "Approval",
|
|
33
|
+
"type": "event"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"anonymous": false,
|
|
37
|
+
"inputs": [
|
|
38
|
+
{
|
|
39
|
+
"indexed": true,
|
|
40
|
+
"internalType": "address",
|
|
41
|
+
"name": "account",
|
|
42
|
+
"type": "address"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"name": "MinterAdded",
|
|
46
|
+
"type": "event"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"anonymous": false,
|
|
50
|
+
"inputs": [
|
|
51
|
+
{
|
|
52
|
+
"indexed": true,
|
|
53
|
+
"internalType": "address",
|
|
54
|
+
"name": "account",
|
|
55
|
+
"type": "address"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"name": "MinterRemoved",
|
|
59
|
+
"type": "event"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"anonymous": false,
|
|
63
|
+
"inputs": [
|
|
64
|
+
{
|
|
65
|
+
"indexed": false,
|
|
66
|
+
"internalType": "address",
|
|
67
|
+
"name": "account",
|
|
68
|
+
"type": "address"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"name": "Paused",
|
|
72
|
+
"type": "event"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"anonymous": false,
|
|
76
|
+
"inputs": [
|
|
77
|
+
{
|
|
78
|
+
"indexed": true,
|
|
79
|
+
"internalType": "address",
|
|
80
|
+
"name": "account",
|
|
81
|
+
"type": "address"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"name": "PauserAdded",
|
|
85
|
+
"type": "event"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"anonymous": false,
|
|
89
|
+
"inputs": [
|
|
90
|
+
{
|
|
91
|
+
"indexed": true,
|
|
92
|
+
"internalType": "address",
|
|
93
|
+
"name": "account",
|
|
94
|
+
"type": "address"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"name": "PauserRemoved",
|
|
98
|
+
"type": "event"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"anonymous": false,
|
|
102
|
+
"inputs": [
|
|
103
|
+
{
|
|
104
|
+
"indexed": true,
|
|
105
|
+
"internalType": "address",
|
|
106
|
+
"name": "from",
|
|
107
|
+
"type": "address"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"indexed": true,
|
|
111
|
+
"internalType": "address",
|
|
112
|
+
"name": "to",
|
|
113
|
+
"type": "address"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"indexed": false,
|
|
117
|
+
"internalType": "uint256",
|
|
118
|
+
"name": "value",
|
|
119
|
+
"type": "uint256"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"name": "Transfer",
|
|
123
|
+
"type": "event"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"anonymous": false,
|
|
127
|
+
"inputs": [
|
|
128
|
+
{
|
|
129
|
+
"indexed": false,
|
|
130
|
+
"internalType": "address",
|
|
131
|
+
"name": "account",
|
|
132
|
+
"type": "address"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"name": "Unpaused",
|
|
136
|
+
"type": "event"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"constant": true,
|
|
140
|
+
"inputs": [],
|
|
141
|
+
"name": "DOMAIN_SEPARATOR",
|
|
142
|
+
"outputs": [
|
|
143
|
+
{
|
|
144
|
+
"internalType": "bytes32",
|
|
145
|
+
"name": "",
|
|
146
|
+
"type": "bytes32"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"payable": false,
|
|
150
|
+
"stateMutability": "view",
|
|
151
|
+
"type": "function"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"constant": true,
|
|
155
|
+
"inputs": [],
|
|
156
|
+
"name": "PERMIT_TYPEHASH",
|
|
157
|
+
"outputs": [
|
|
158
|
+
{
|
|
159
|
+
"internalType": "bytes32",
|
|
160
|
+
"name": "",
|
|
161
|
+
"type": "bytes32"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"payable": false,
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"constant": false,
|
|
170
|
+
"inputs": [
|
|
171
|
+
{
|
|
172
|
+
"internalType": "address",
|
|
173
|
+
"name": "account",
|
|
174
|
+
"type": "address"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"name": "addMinter",
|
|
178
|
+
"outputs": [],
|
|
179
|
+
"payable": false,
|
|
180
|
+
"stateMutability": "nonpayable",
|
|
181
|
+
"type": "function"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"constant": false,
|
|
185
|
+
"inputs": [
|
|
186
|
+
{
|
|
187
|
+
"internalType": "address",
|
|
188
|
+
"name": "account",
|
|
189
|
+
"type": "address"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"name": "addPauser",
|
|
193
|
+
"outputs": [],
|
|
194
|
+
"payable": false,
|
|
195
|
+
"stateMutability": "nonpayable",
|
|
196
|
+
"type": "function"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"constant": true,
|
|
200
|
+
"inputs": [
|
|
201
|
+
{
|
|
202
|
+
"internalType": "address",
|
|
203
|
+
"name": "owner",
|
|
204
|
+
"type": "address"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"internalType": "address",
|
|
208
|
+
"name": "spender",
|
|
209
|
+
"type": "address"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"name": "allowance",
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"internalType": "uint256",
|
|
216
|
+
"name": "",
|
|
217
|
+
"type": "uint256"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"payable": false,
|
|
221
|
+
"stateMutability": "view",
|
|
222
|
+
"type": "function"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"constant": false,
|
|
226
|
+
"inputs": [
|
|
227
|
+
{
|
|
228
|
+
"internalType": "address",
|
|
229
|
+
"name": "spender",
|
|
230
|
+
"type": "address"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"internalType": "uint256",
|
|
234
|
+
"name": "value",
|
|
235
|
+
"type": "uint256"
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"name": "approve",
|
|
239
|
+
"outputs": [
|
|
240
|
+
{
|
|
241
|
+
"internalType": "bool",
|
|
242
|
+
"name": "",
|
|
243
|
+
"type": "bool"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"payable": false,
|
|
247
|
+
"stateMutability": "nonpayable",
|
|
248
|
+
"type": "function"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"constant": true,
|
|
252
|
+
"inputs": [
|
|
253
|
+
{
|
|
254
|
+
"internalType": "address",
|
|
255
|
+
"name": "account",
|
|
256
|
+
"type": "address"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"name": "balanceOf",
|
|
260
|
+
"outputs": [
|
|
261
|
+
{
|
|
262
|
+
"internalType": "uint256",
|
|
263
|
+
"name": "",
|
|
264
|
+
"type": "uint256"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"payable": false,
|
|
268
|
+
"stateMutability": "view",
|
|
269
|
+
"type": "function"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"constant": false,
|
|
273
|
+
"inputs": [
|
|
274
|
+
{
|
|
275
|
+
"internalType": "uint256",
|
|
276
|
+
"name": "amount",
|
|
277
|
+
"type": "uint256"
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"name": "burn",
|
|
281
|
+
"outputs": [],
|
|
282
|
+
"payable": false,
|
|
283
|
+
"stateMutability": "nonpayable",
|
|
284
|
+
"type": "function"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"constant": false,
|
|
288
|
+
"inputs": [
|
|
289
|
+
{
|
|
290
|
+
"internalType": "address",
|
|
291
|
+
"name": "account",
|
|
292
|
+
"type": "address"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"internalType": "uint256",
|
|
296
|
+
"name": "amount",
|
|
297
|
+
"type": "uint256"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"name": "burnFrom",
|
|
301
|
+
"outputs": [],
|
|
302
|
+
"payable": false,
|
|
303
|
+
"stateMutability": "nonpayable",
|
|
304
|
+
"type": "function"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"constant": true,
|
|
308
|
+
"inputs": [],
|
|
309
|
+
"name": "decimals",
|
|
310
|
+
"outputs": [
|
|
311
|
+
{
|
|
312
|
+
"internalType": "uint8",
|
|
313
|
+
"name": "",
|
|
314
|
+
"type": "uint8"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"payable": false,
|
|
318
|
+
"stateMutability": "view",
|
|
319
|
+
"type": "function"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"constant": false,
|
|
323
|
+
"inputs": [
|
|
324
|
+
{
|
|
325
|
+
"internalType": "address",
|
|
326
|
+
"name": "spender",
|
|
327
|
+
"type": "address"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"internalType": "uint256",
|
|
331
|
+
"name": "subtractedValue",
|
|
332
|
+
"type": "uint256"
|
|
333
|
+
}
|
|
334
|
+
],
|
|
335
|
+
"name": "decreaseAllowance",
|
|
336
|
+
"outputs": [
|
|
337
|
+
{
|
|
338
|
+
"internalType": "bool",
|
|
339
|
+
"name": "",
|
|
340
|
+
"type": "bool"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"payable": false,
|
|
344
|
+
"stateMutability": "nonpayable",
|
|
345
|
+
"type": "function"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"constant": false,
|
|
349
|
+
"inputs": [
|
|
350
|
+
{
|
|
351
|
+
"internalType": "address",
|
|
352
|
+
"name": "spender",
|
|
353
|
+
"type": "address"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"internalType": "uint256",
|
|
357
|
+
"name": "addedValue",
|
|
358
|
+
"type": "uint256"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"name": "increaseAllowance",
|
|
362
|
+
"outputs": [
|
|
363
|
+
{
|
|
364
|
+
"internalType": "bool",
|
|
365
|
+
"name": "",
|
|
366
|
+
"type": "bool"
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"payable": false,
|
|
370
|
+
"stateMutability": "nonpayable",
|
|
371
|
+
"type": "function"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"constant": false,
|
|
375
|
+
"inputs": [
|
|
376
|
+
{
|
|
377
|
+
"internalType": "string",
|
|
378
|
+
"name": "name",
|
|
379
|
+
"type": "string"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"internalType": "string",
|
|
383
|
+
"name": "symbol",
|
|
384
|
+
"type": "string"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"internalType": "uint8",
|
|
388
|
+
"name": "decimals",
|
|
389
|
+
"type": "uint8"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
"name": "initialize",
|
|
393
|
+
"outputs": [],
|
|
394
|
+
"payable": false,
|
|
395
|
+
"stateMutability": "nonpayable",
|
|
396
|
+
"type": "function"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"constant": false,
|
|
400
|
+
"inputs": [
|
|
401
|
+
{
|
|
402
|
+
"internalType": "address",
|
|
403
|
+
"name": "_owner",
|
|
404
|
+
"type": "address"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"internalType": "address",
|
|
408
|
+
"name": "governance",
|
|
409
|
+
"type": "address"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
"name": "initialize",
|
|
413
|
+
"outputs": [],
|
|
414
|
+
"payable": false,
|
|
415
|
+
"stateMutability": "nonpayable",
|
|
416
|
+
"type": "function"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"constant": false,
|
|
420
|
+
"inputs": [],
|
|
421
|
+
"name": "initialize",
|
|
422
|
+
"outputs": [],
|
|
423
|
+
"payable": false,
|
|
424
|
+
"stateMutability": "nonpayable",
|
|
425
|
+
"type": "function"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"constant": false,
|
|
429
|
+
"inputs": [
|
|
430
|
+
{
|
|
431
|
+
"internalType": "address",
|
|
432
|
+
"name": "sender",
|
|
433
|
+
"type": "address"
|
|
434
|
+
}
|
|
435
|
+
],
|
|
436
|
+
"name": "initialize",
|
|
437
|
+
"outputs": [],
|
|
438
|
+
"payable": false,
|
|
439
|
+
"stateMutability": "nonpayable",
|
|
440
|
+
"type": "function"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"constant": true,
|
|
444
|
+
"inputs": [
|
|
445
|
+
{
|
|
446
|
+
"internalType": "address",
|
|
447
|
+
"name": "account",
|
|
448
|
+
"type": "address"
|
|
449
|
+
}
|
|
450
|
+
],
|
|
451
|
+
"name": "isMinter",
|
|
452
|
+
"outputs": [
|
|
453
|
+
{
|
|
454
|
+
"internalType": "bool",
|
|
455
|
+
"name": "",
|
|
456
|
+
"type": "bool"
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"payable": false,
|
|
460
|
+
"stateMutability": "view",
|
|
461
|
+
"type": "function"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"constant": true,
|
|
465
|
+
"inputs": [
|
|
466
|
+
{
|
|
467
|
+
"internalType": "address",
|
|
468
|
+
"name": "account",
|
|
469
|
+
"type": "address"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"name": "isPauser",
|
|
473
|
+
"outputs": [
|
|
474
|
+
{
|
|
475
|
+
"internalType": "bool",
|
|
476
|
+
"name": "",
|
|
477
|
+
"type": "bool"
|
|
478
|
+
}
|
|
479
|
+
],
|
|
480
|
+
"payable": false,
|
|
481
|
+
"stateMutability": "view",
|
|
482
|
+
"type": "function"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"constant": false,
|
|
486
|
+
"inputs": [
|
|
487
|
+
{
|
|
488
|
+
"internalType": "address",
|
|
489
|
+
"name": "account",
|
|
490
|
+
"type": "address"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"internalType": "uint256",
|
|
494
|
+
"name": "amount",
|
|
495
|
+
"type": "uint256"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"name": "mint",
|
|
499
|
+
"outputs": [
|
|
500
|
+
{
|
|
501
|
+
"internalType": "bool",
|
|
502
|
+
"name": "",
|
|
503
|
+
"type": "bool"
|
|
504
|
+
}
|
|
505
|
+
],
|
|
506
|
+
"payable": false,
|
|
507
|
+
"stateMutability": "nonpayable",
|
|
508
|
+
"type": "function"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"constant": true,
|
|
512
|
+
"inputs": [],
|
|
513
|
+
"name": "name",
|
|
514
|
+
"outputs": [
|
|
515
|
+
{
|
|
516
|
+
"internalType": "string",
|
|
517
|
+
"name": "",
|
|
518
|
+
"type": "string"
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
"payable": false,
|
|
522
|
+
"stateMutability": "view",
|
|
523
|
+
"type": "function"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"constant": true,
|
|
527
|
+
"inputs": [
|
|
528
|
+
{
|
|
529
|
+
"internalType": "address",
|
|
530
|
+
"name": "",
|
|
531
|
+
"type": "address"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
"name": "nonces",
|
|
535
|
+
"outputs": [
|
|
536
|
+
{
|
|
537
|
+
"internalType": "uint256",
|
|
538
|
+
"name": "",
|
|
539
|
+
"type": "uint256"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"payable": false,
|
|
543
|
+
"stateMutability": "view",
|
|
544
|
+
"type": "function"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
"constant": false,
|
|
548
|
+
"inputs": [],
|
|
549
|
+
"name": "pause",
|
|
550
|
+
"outputs": [],
|
|
551
|
+
"payable": false,
|
|
552
|
+
"stateMutability": "nonpayable",
|
|
553
|
+
"type": "function"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"constant": true,
|
|
557
|
+
"inputs": [],
|
|
558
|
+
"name": "paused",
|
|
559
|
+
"outputs": [
|
|
560
|
+
{
|
|
561
|
+
"internalType": "bool",
|
|
562
|
+
"name": "",
|
|
563
|
+
"type": "bool"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"payable": false,
|
|
567
|
+
"stateMutability": "view",
|
|
568
|
+
"type": "function"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"constant": false,
|
|
572
|
+
"inputs": [
|
|
573
|
+
{
|
|
574
|
+
"internalType": "address",
|
|
575
|
+
"name": "owner",
|
|
576
|
+
"type": "address"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"internalType": "address",
|
|
580
|
+
"name": "spender",
|
|
581
|
+
"type": "address"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"internalType": "uint256",
|
|
585
|
+
"name": "value",
|
|
586
|
+
"type": "uint256"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"internalType": "uint256",
|
|
590
|
+
"name": "deadline",
|
|
591
|
+
"type": "uint256"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"internalType": "uint8",
|
|
595
|
+
"name": "v",
|
|
596
|
+
"type": "uint8"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"internalType": "bytes32",
|
|
600
|
+
"name": "r",
|
|
601
|
+
"type": "bytes32"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"internalType": "bytes32",
|
|
605
|
+
"name": "s",
|
|
606
|
+
"type": "bytes32"
|
|
607
|
+
}
|
|
608
|
+
],
|
|
609
|
+
"name": "permit",
|
|
610
|
+
"outputs": [],
|
|
611
|
+
"payable": false,
|
|
612
|
+
"stateMutability": "nonpayable",
|
|
613
|
+
"type": "function"
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
"constant": false,
|
|
617
|
+
"inputs": [],
|
|
618
|
+
"name": "renounceMinter",
|
|
619
|
+
"outputs": [],
|
|
620
|
+
"payable": false,
|
|
621
|
+
"stateMutability": "nonpayable",
|
|
622
|
+
"type": "function"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"constant": false,
|
|
626
|
+
"inputs": [],
|
|
627
|
+
"name": "renouncePauser",
|
|
628
|
+
"outputs": [],
|
|
629
|
+
"payable": false,
|
|
630
|
+
"stateMutability": "nonpayable",
|
|
631
|
+
"type": "function"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"constant": true,
|
|
635
|
+
"inputs": [],
|
|
636
|
+
"name": "symbol",
|
|
637
|
+
"outputs": [
|
|
638
|
+
{
|
|
639
|
+
"internalType": "string",
|
|
640
|
+
"name": "",
|
|
641
|
+
"type": "string"
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
"payable": false,
|
|
645
|
+
"stateMutability": "view",
|
|
646
|
+
"type": "function"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"constant": true,
|
|
650
|
+
"inputs": [],
|
|
651
|
+
"name": "totalSupply",
|
|
652
|
+
"outputs": [
|
|
653
|
+
{
|
|
654
|
+
"internalType": "uint256",
|
|
655
|
+
"name": "",
|
|
656
|
+
"type": "uint256"
|
|
657
|
+
}
|
|
658
|
+
],
|
|
659
|
+
"payable": false,
|
|
660
|
+
"stateMutability": "view",
|
|
661
|
+
"type": "function"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"constant": false,
|
|
665
|
+
"inputs": [
|
|
666
|
+
{
|
|
667
|
+
"internalType": "address",
|
|
668
|
+
"name": "to",
|
|
669
|
+
"type": "address"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"internalType": "uint256",
|
|
673
|
+
"name": "value",
|
|
674
|
+
"type": "uint256"
|
|
675
|
+
}
|
|
676
|
+
],
|
|
677
|
+
"name": "transfer",
|
|
678
|
+
"outputs": [
|
|
679
|
+
{
|
|
680
|
+
"internalType": "bool",
|
|
681
|
+
"name": "",
|
|
682
|
+
"type": "bool"
|
|
683
|
+
}
|
|
684
|
+
],
|
|
685
|
+
"payable": false,
|
|
686
|
+
"stateMutability": "nonpayable",
|
|
687
|
+
"type": "function"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"constant": false,
|
|
691
|
+
"inputs": [
|
|
692
|
+
{
|
|
693
|
+
"internalType": "address",
|
|
694
|
+
"name": "from",
|
|
695
|
+
"type": "address"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"internalType": "address",
|
|
699
|
+
"name": "to",
|
|
700
|
+
"type": "address"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"internalType": "uint256",
|
|
704
|
+
"name": "value",
|
|
705
|
+
"type": "uint256"
|
|
706
|
+
}
|
|
707
|
+
],
|
|
708
|
+
"name": "transferFrom",
|
|
709
|
+
"outputs": [
|
|
710
|
+
{
|
|
711
|
+
"internalType": "bool",
|
|
712
|
+
"name": "",
|
|
713
|
+
"type": "bool"
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
"payable": false,
|
|
717
|
+
"stateMutability": "nonpayable",
|
|
718
|
+
"type": "function"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"constant": false,
|
|
722
|
+
"inputs": [],
|
|
723
|
+
"name": "unpause",
|
|
724
|
+
"outputs": [],
|
|
725
|
+
"payable": false,
|
|
726
|
+
"stateMutability": "nonpayable",
|
|
727
|
+
"type": "function"
|
|
728
|
+
}
|
|
729
|
+
] as const satisfies Abi;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Type-safe ABI for AudiusToken_json
|
|
733
|
+
*/
|
|
734
|
+
export type AudiusToken_jsonAbi = typeof AudiusToken_jsonAbi;
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Contract instance type for AudiusToken_json
|
|
738
|
+
*/
|
|
739
|
+
// Use any for contract type to avoid complex viem type issues
|
|
740
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
741
|
+
export type AudiusToken_jsonContract = any;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* AudiusToken_json Contract Class
|
|
745
|
+
*
|
|
746
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* ```typescript
|
|
750
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
751
|
+
* import { mainnet } from 'viem/chains';
|
|
752
|
+
* import { AudiusToken_json } from 'AudiusToken_json';
|
|
753
|
+
*
|
|
754
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
755
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
756
|
+
*
|
|
757
|
+
* const contract = new AudiusToken_json('0x...', { publicClient, walletClient });
|
|
758
|
+
*
|
|
759
|
+
* // Read functions
|
|
760
|
+
* const result = await contract.balanceOf('0x...');
|
|
761
|
+
*
|
|
762
|
+
* // Write functions
|
|
763
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
764
|
+
*
|
|
765
|
+
* // Simulate transactions (dry-run)
|
|
766
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
767
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
768
|
+
*
|
|
769
|
+
* // Watch events
|
|
770
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
771
|
+
* console.log('Transfer event:', event);
|
|
772
|
+
* });
|
|
773
|
+
* ```
|
|
774
|
+
*/
|
|
775
|
+
export class AudiusToken_json {
|
|
776
|
+
private contract: AudiusToken_jsonContract;
|
|
777
|
+
private contractAddress: Address;
|
|
778
|
+
private publicClient: PublicClient;
|
|
779
|
+
|
|
780
|
+
constructor(
|
|
781
|
+
address: Address,
|
|
782
|
+
clients: {
|
|
783
|
+
publicClient: PublicClient;
|
|
784
|
+
walletClient?: WalletClient;
|
|
785
|
+
}
|
|
786
|
+
) {
|
|
787
|
+
this.contractAddress = address;
|
|
788
|
+
this.publicClient = clients.publicClient;
|
|
789
|
+
this.contract = getContract({
|
|
790
|
+
address,
|
|
791
|
+
abi: AudiusToken_jsonAbi,
|
|
792
|
+
client: {
|
|
793
|
+
public: clients.publicClient,
|
|
794
|
+
wallet: clients.walletClient,
|
|
795
|
+
},
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Get the contract address
|
|
801
|
+
*/
|
|
802
|
+
get address(): Address {
|
|
803
|
+
return this.contractAddress;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Get the underlying viem contract instance
|
|
808
|
+
*/
|
|
809
|
+
getContract(): AudiusToken_jsonContract {
|
|
810
|
+
return this.contract;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* DOMAIN_SEPARATOR
|
|
815
|
+
* view
|
|
816
|
+
*/
|
|
817
|
+
async DOMAIN_SEPARATOR(): Promise<`0x${string}`> {
|
|
818
|
+
return this.contract.read.DOMAIN_SEPARATOR() as Promise<`0x${string}`>;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* PERMIT_TYPEHASH
|
|
823
|
+
* view
|
|
824
|
+
*/
|
|
825
|
+
async PERMIT_TYPEHASH(): Promise<`0x${string}`> {
|
|
826
|
+
return this.contract.read.PERMIT_TYPEHASH() as Promise<`0x${string}`>;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* allowance
|
|
831
|
+
* view
|
|
832
|
+
*/
|
|
833
|
+
async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
|
|
834
|
+
return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* balanceOf
|
|
839
|
+
* view
|
|
840
|
+
*/
|
|
841
|
+
async balanceOf(account: `0x${string}`): Promise<bigint> {
|
|
842
|
+
return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* decimals
|
|
847
|
+
* view
|
|
848
|
+
*/
|
|
849
|
+
async decimals(): Promise<bigint> {
|
|
850
|
+
return this.contract.read.decimals() as Promise<bigint>;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* isMinter
|
|
855
|
+
* view
|
|
856
|
+
*/
|
|
857
|
+
async isMinter(account: `0x${string}`): Promise<boolean> {
|
|
858
|
+
return this.contract.read.isMinter([account] as const) as Promise<boolean>;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* isPauser
|
|
863
|
+
* view
|
|
864
|
+
*/
|
|
865
|
+
async isPauser(account: `0x${string}`): Promise<boolean> {
|
|
866
|
+
return this.contract.read.isPauser([account] as const) as Promise<boolean>;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* name
|
|
871
|
+
* view
|
|
872
|
+
*/
|
|
873
|
+
async name(): Promise<string> {
|
|
874
|
+
return this.contract.read.name() as Promise<string>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* nonces
|
|
879
|
+
* view
|
|
880
|
+
*/
|
|
881
|
+
async nonces(arg0: `0x${string}`): Promise<bigint> {
|
|
882
|
+
return this.contract.read.nonces([arg0] as const) as Promise<bigint>;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* paused
|
|
887
|
+
* view
|
|
888
|
+
*/
|
|
889
|
+
async paused(): Promise<boolean> {
|
|
890
|
+
return this.contract.read.paused() as Promise<boolean>;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* symbol
|
|
895
|
+
* view
|
|
896
|
+
*/
|
|
897
|
+
async symbol(): Promise<string> {
|
|
898
|
+
return this.contract.read.symbol() as Promise<string>;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* totalSupply
|
|
903
|
+
* view
|
|
904
|
+
*/
|
|
905
|
+
async totalSupply(): Promise<bigint> {
|
|
906
|
+
return this.contract.read.totalSupply() as Promise<bigint>;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* addMinter
|
|
911
|
+
* nonpayable
|
|
912
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
913
|
+
*/
|
|
914
|
+
async addMinter(account: `0x${string}`, options?: {
|
|
915
|
+
accessList?: import('viem').AccessList;
|
|
916
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
917
|
+
chain?: import('viem').Chain | null;
|
|
918
|
+
dataSuffix?: `0x${string}`;
|
|
919
|
+
gas?: bigint;
|
|
920
|
+
gasPrice?: bigint;
|
|
921
|
+
maxFeePerGas?: bigint;
|
|
922
|
+
maxPriorityFeePerGas?: bigint;
|
|
923
|
+
nonce?: number;
|
|
924
|
+
value?: bigint;
|
|
925
|
+
}): Promise<`0x${string}`> {
|
|
926
|
+
if (!this.contract.write) {
|
|
927
|
+
throw new Error('Wallet client is required for write operations');
|
|
928
|
+
}
|
|
929
|
+
return this.contract.write.addMinter([account] as const, options) as Promise<`0x${string}`>;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* addPauser
|
|
934
|
+
* nonpayable
|
|
935
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
936
|
+
*/
|
|
937
|
+
async addPauser(account: `0x${string}`, options?: {
|
|
938
|
+
accessList?: import('viem').AccessList;
|
|
939
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
940
|
+
chain?: import('viem').Chain | null;
|
|
941
|
+
dataSuffix?: `0x${string}`;
|
|
942
|
+
gas?: bigint;
|
|
943
|
+
gasPrice?: bigint;
|
|
944
|
+
maxFeePerGas?: bigint;
|
|
945
|
+
maxPriorityFeePerGas?: bigint;
|
|
946
|
+
nonce?: number;
|
|
947
|
+
value?: bigint;
|
|
948
|
+
}): Promise<`0x${string}`> {
|
|
949
|
+
if (!this.contract.write) {
|
|
950
|
+
throw new Error('Wallet client is required for write operations');
|
|
951
|
+
}
|
|
952
|
+
return this.contract.write.addPauser([account] as const, options) as Promise<`0x${string}`>;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* approve
|
|
957
|
+
* nonpayable
|
|
958
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
959
|
+
*/
|
|
960
|
+
async approve(spender: `0x${string}`, value: bigint, 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<`0x${string}`> {
|
|
972
|
+
if (!this.contract.write) {
|
|
973
|
+
throw new Error('Wallet client is required for write operations');
|
|
974
|
+
}
|
|
975
|
+
return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* burn
|
|
980
|
+
* nonpayable
|
|
981
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
982
|
+
*/
|
|
983
|
+
async burn(amount: bigint, options?: {
|
|
984
|
+
accessList?: import('viem').AccessList;
|
|
985
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
986
|
+
chain?: import('viem').Chain | null;
|
|
987
|
+
dataSuffix?: `0x${string}`;
|
|
988
|
+
gas?: bigint;
|
|
989
|
+
gasPrice?: bigint;
|
|
990
|
+
maxFeePerGas?: bigint;
|
|
991
|
+
maxPriorityFeePerGas?: bigint;
|
|
992
|
+
nonce?: number;
|
|
993
|
+
value?: bigint;
|
|
994
|
+
}): Promise<`0x${string}`> {
|
|
995
|
+
if (!this.contract.write) {
|
|
996
|
+
throw new Error('Wallet client is required for write operations');
|
|
997
|
+
}
|
|
998
|
+
return this.contract.write.burn([amount] as const, options) as Promise<`0x${string}`>;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* burnFrom
|
|
1003
|
+
* nonpayable
|
|
1004
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1005
|
+
*/
|
|
1006
|
+
async burnFrom(account: `0x${string}`, amount: bigint, options?: {
|
|
1007
|
+
accessList?: import('viem').AccessList;
|
|
1008
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1009
|
+
chain?: import('viem').Chain | null;
|
|
1010
|
+
dataSuffix?: `0x${string}`;
|
|
1011
|
+
gas?: bigint;
|
|
1012
|
+
gasPrice?: bigint;
|
|
1013
|
+
maxFeePerGas?: bigint;
|
|
1014
|
+
maxPriorityFeePerGas?: bigint;
|
|
1015
|
+
nonce?: number;
|
|
1016
|
+
value?: bigint;
|
|
1017
|
+
}): Promise<`0x${string}`> {
|
|
1018
|
+
if (!this.contract.write) {
|
|
1019
|
+
throw new Error('Wallet client is required for write operations');
|
|
1020
|
+
}
|
|
1021
|
+
return this.contract.write.burnFrom([account, amount] as const, options) as Promise<`0x${string}`>;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* decreaseAllowance
|
|
1026
|
+
* nonpayable
|
|
1027
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1028
|
+
*/
|
|
1029
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1030
|
+
accessList?: import('viem').AccessList;
|
|
1031
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1032
|
+
chain?: import('viem').Chain | null;
|
|
1033
|
+
dataSuffix?: `0x${string}`;
|
|
1034
|
+
gas?: bigint;
|
|
1035
|
+
gasPrice?: bigint;
|
|
1036
|
+
maxFeePerGas?: bigint;
|
|
1037
|
+
maxPriorityFeePerGas?: bigint;
|
|
1038
|
+
nonce?: number;
|
|
1039
|
+
value?: bigint;
|
|
1040
|
+
}): Promise<`0x${string}`> {
|
|
1041
|
+
if (!this.contract.write) {
|
|
1042
|
+
throw new Error('Wallet client is required for write operations');
|
|
1043
|
+
}
|
|
1044
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* increaseAllowance
|
|
1049
|
+
* nonpayable
|
|
1050
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1051
|
+
*/
|
|
1052
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
1053
|
+
accessList?: import('viem').AccessList;
|
|
1054
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1055
|
+
chain?: import('viem').Chain | null;
|
|
1056
|
+
dataSuffix?: `0x${string}`;
|
|
1057
|
+
gas?: bigint;
|
|
1058
|
+
gasPrice?: bigint;
|
|
1059
|
+
maxFeePerGas?: bigint;
|
|
1060
|
+
maxPriorityFeePerGas?: bigint;
|
|
1061
|
+
nonce?: number;
|
|
1062
|
+
value?: bigint;
|
|
1063
|
+
}): Promise<`0x${string}`> {
|
|
1064
|
+
if (!this.contract.write) {
|
|
1065
|
+
throw new Error('Wallet client is required for write operations');
|
|
1066
|
+
}
|
|
1067
|
+
return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
async initialize(name: string, symbol: string, decimals: bigint, options?: {
|
|
1071
|
+
accessList?: import('viem').AccessList;
|
|
1072
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1073
|
+
chain?: import('viem').Chain | null;
|
|
1074
|
+
dataSuffix?: `0x${string}`;
|
|
1075
|
+
gas?: bigint;
|
|
1076
|
+
gasPrice?: bigint;
|
|
1077
|
+
maxFeePerGas?: bigint;
|
|
1078
|
+
maxPriorityFeePerGas?: bigint;
|
|
1079
|
+
nonce?: number;
|
|
1080
|
+
value?: bigint;
|
|
1081
|
+
}): Promise<`0x${string}`>;
|
|
1082
|
+
async initialize(_owner: `0x${string}`, governance: `0x${string}`, options?: {
|
|
1083
|
+
accessList?: import('viem').AccessList;
|
|
1084
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1085
|
+
chain?: import('viem').Chain | null;
|
|
1086
|
+
dataSuffix?: `0x${string}`;
|
|
1087
|
+
gas?: bigint;
|
|
1088
|
+
gasPrice?: bigint;
|
|
1089
|
+
maxFeePerGas?: bigint;
|
|
1090
|
+
maxPriorityFeePerGas?: bigint;
|
|
1091
|
+
nonce?: number;
|
|
1092
|
+
value?: bigint;
|
|
1093
|
+
}): Promise<`0x${string}`>;
|
|
1094
|
+
async initialize(options?: {
|
|
1095
|
+
accessList?: import('viem').AccessList;
|
|
1096
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1097
|
+
chain?: import('viem').Chain | null;
|
|
1098
|
+
dataSuffix?: `0x${string}`;
|
|
1099
|
+
gas?: bigint;
|
|
1100
|
+
gasPrice?: bigint;
|
|
1101
|
+
maxFeePerGas?: bigint;
|
|
1102
|
+
maxPriorityFeePerGas?: bigint;
|
|
1103
|
+
nonce?: number;
|
|
1104
|
+
value?: bigint;
|
|
1105
|
+
}): Promise<`0x${string}`>;
|
|
1106
|
+
async initialize(sender: `0x${string}`, options?: {
|
|
1107
|
+
accessList?: import('viem').AccessList;
|
|
1108
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1109
|
+
chain?: import('viem').Chain | null;
|
|
1110
|
+
dataSuffix?: `0x${string}`;
|
|
1111
|
+
gas?: bigint;
|
|
1112
|
+
gasPrice?: bigint;
|
|
1113
|
+
maxFeePerGas?: bigint;
|
|
1114
|
+
maxPriorityFeePerGas?: bigint;
|
|
1115
|
+
nonce?: number;
|
|
1116
|
+
value?: bigint;
|
|
1117
|
+
}): Promise<`0x${string}`>;
|
|
1118
|
+
async initialize(...args: any[]): Promise<`0x${string}`> {
|
|
1119
|
+
if (!this.contract.write) {
|
|
1120
|
+
throw new Error('Wallet client is required for write operations');
|
|
1121
|
+
}
|
|
1122
|
+
return this.contract.write.initialize(args as any) as Promise<`0x${string}`>;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* mint
|
|
1127
|
+
* nonpayable
|
|
1128
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1129
|
+
*/
|
|
1130
|
+
async mint(account: `0x${string}`, amount: bigint, options?: {
|
|
1131
|
+
accessList?: import('viem').AccessList;
|
|
1132
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1133
|
+
chain?: import('viem').Chain | null;
|
|
1134
|
+
dataSuffix?: `0x${string}`;
|
|
1135
|
+
gas?: bigint;
|
|
1136
|
+
gasPrice?: bigint;
|
|
1137
|
+
maxFeePerGas?: bigint;
|
|
1138
|
+
maxPriorityFeePerGas?: bigint;
|
|
1139
|
+
nonce?: number;
|
|
1140
|
+
value?: bigint;
|
|
1141
|
+
}): Promise<`0x${string}`> {
|
|
1142
|
+
if (!this.contract.write) {
|
|
1143
|
+
throw new Error('Wallet client is required for write operations');
|
|
1144
|
+
}
|
|
1145
|
+
return this.contract.write.mint([account, amount] as const, options) as Promise<`0x${string}`>;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* pause
|
|
1150
|
+
* nonpayable
|
|
1151
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1152
|
+
*/
|
|
1153
|
+
async pause(options?: {
|
|
1154
|
+
accessList?: import('viem').AccessList;
|
|
1155
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1156
|
+
chain?: import('viem').Chain | null;
|
|
1157
|
+
dataSuffix?: `0x${string}`;
|
|
1158
|
+
gas?: bigint;
|
|
1159
|
+
gasPrice?: bigint;
|
|
1160
|
+
maxFeePerGas?: bigint;
|
|
1161
|
+
maxPriorityFeePerGas?: bigint;
|
|
1162
|
+
nonce?: number;
|
|
1163
|
+
value?: bigint;
|
|
1164
|
+
}): Promise<`0x${string}`> {
|
|
1165
|
+
if (!this.contract.write) {
|
|
1166
|
+
throw new Error('Wallet client is required for write operations');
|
|
1167
|
+
}
|
|
1168
|
+
return this.contract.write.pause(options) as Promise<`0x${string}`>;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* permit
|
|
1173
|
+
* nonpayable
|
|
1174
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1175
|
+
*/
|
|
1176
|
+
async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
|
|
1177
|
+
accessList?: import('viem').AccessList;
|
|
1178
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1179
|
+
chain?: import('viem').Chain | null;
|
|
1180
|
+
dataSuffix?: `0x${string}`;
|
|
1181
|
+
gas?: bigint;
|
|
1182
|
+
gasPrice?: bigint;
|
|
1183
|
+
maxFeePerGas?: bigint;
|
|
1184
|
+
maxPriorityFeePerGas?: bigint;
|
|
1185
|
+
nonce?: number;
|
|
1186
|
+
value?: bigint;
|
|
1187
|
+
}): Promise<`0x${string}`> {
|
|
1188
|
+
if (!this.contract.write) {
|
|
1189
|
+
throw new Error('Wallet client is required for write operations');
|
|
1190
|
+
}
|
|
1191
|
+
return this.contract.write.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<`0x${string}`>;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* renounceMinter
|
|
1196
|
+
* nonpayable
|
|
1197
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1198
|
+
*/
|
|
1199
|
+
async renounceMinter(options?: {
|
|
1200
|
+
accessList?: import('viem').AccessList;
|
|
1201
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1202
|
+
chain?: import('viem').Chain | null;
|
|
1203
|
+
dataSuffix?: `0x${string}`;
|
|
1204
|
+
gas?: bigint;
|
|
1205
|
+
gasPrice?: bigint;
|
|
1206
|
+
maxFeePerGas?: bigint;
|
|
1207
|
+
maxPriorityFeePerGas?: bigint;
|
|
1208
|
+
nonce?: number;
|
|
1209
|
+
value?: bigint;
|
|
1210
|
+
}): Promise<`0x${string}`> {
|
|
1211
|
+
if (!this.contract.write) {
|
|
1212
|
+
throw new Error('Wallet client is required for write operations');
|
|
1213
|
+
}
|
|
1214
|
+
return this.contract.write.renounceMinter(options) as Promise<`0x${string}`>;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* renouncePauser
|
|
1219
|
+
* nonpayable
|
|
1220
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1221
|
+
*/
|
|
1222
|
+
async renouncePauser(options?: {
|
|
1223
|
+
accessList?: import('viem').AccessList;
|
|
1224
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1225
|
+
chain?: import('viem').Chain | null;
|
|
1226
|
+
dataSuffix?: `0x${string}`;
|
|
1227
|
+
gas?: bigint;
|
|
1228
|
+
gasPrice?: bigint;
|
|
1229
|
+
maxFeePerGas?: bigint;
|
|
1230
|
+
maxPriorityFeePerGas?: bigint;
|
|
1231
|
+
nonce?: number;
|
|
1232
|
+
value?: bigint;
|
|
1233
|
+
}): Promise<`0x${string}`> {
|
|
1234
|
+
if (!this.contract.write) {
|
|
1235
|
+
throw new Error('Wallet client is required for write operations');
|
|
1236
|
+
}
|
|
1237
|
+
return this.contract.write.renouncePauser(options) as Promise<`0x${string}`>;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* transfer
|
|
1242
|
+
* nonpayable
|
|
1243
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1244
|
+
*/
|
|
1245
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
1246
|
+
accessList?: import('viem').AccessList;
|
|
1247
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1248
|
+
chain?: import('viem').Chain | null;
|
|
1249
|
+
dataSuffix?: `0x${string}`;
|
|
1250
|
+
gas?: bigint;
|
|
1251
|
+
gasPrice?: bigint;
|
|
1252
|
+
maxFeePerGas?: bigint;
|
|
1253
|
+
maxPriorityFeePerGas?: bigint;
|
|
1254
|
+
nonce?: number;
|
|
1255
|
+
value?: bigint;
|
|
1256
|
+
}): Promise<`0x${string}`> {
|
|
1257
|
+
if (!this.contract.write) {
|
|
1258
|
+
throw new Error('Wallet client is required for write operations');
|
|
1259
|
+
}
|
|
1260
|
+
return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* transferFrom
|
|
1265
|
+
* nonpayable
|
|
1266
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1267
|
+
*/
|
|
1268
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
1269
|
+
accessList?: import('viem').AccessList;
|
|
1270
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1271
|
+
chain?: import('viem').Chain | null;
|
|
1272
|
+
dataSuffix?: `0x${string}`;
|
|
1273
|
+
gas?: bigint;
|
|
1274
|
+
gasPrice?: bigint;
|
|
1275
|
+
maxFeePerGas?: bigint;
|
|
1276
|
+
maxPriorityFeePerGas?: bigint;
|
|
1277
|
+
nonce?: number;
|
|
1278
|
+
value?: bigint;
|
|
1279
|
+
}): Promise<`0x${string}`> {
|
|
1280
|
+
if (!this.contract.write) {
|
|
1281
|
+
throw new Error('Wallet client is required for write operations');
|
|
1282
|
+
}
|
|
1283
|
+
return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* unpause
|
|
1288
|
+
* nonpayable
|
|
1289
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1290
|
+
*/
|
|
1291
|
+
async unpause(options?: {
|
|
1292
|
+
accessList?: import('viem').AccessList;
|
|
1293
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1294
|
+
chain?: import('viem').Chain | null;
|
|
1295
|
+
dataSuffix?: `0x${string}`;
|
|
1296
|
+
gas?: bigint;
|
|
1297
|
+
gasPrice?: bigint;
|
|
1298
|
+
maxFeePerGas?: bigint;
|
|
1299
|
+
maxPriorityFeePerGas?: bigint;
|
|
1300
|
+
nonce?: number;
|
|
1301
|
+
value?: bigint;
|
|
1302
|
+
}): Promise<`0x${string}`> {
|
|
1303
|
+
if (!this.contract.write) {
|
|
1304
|
+
throw new Error('Wallet client is required for write operations');
|
|
1305
|
+
}
|
|
1306
|
+
return this.contract.write.unpause(options) as Promise<`0x${string}`>;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1313
|
+
*
|
|
1314
|
+
* @example
|
|
1315
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1316
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1317
|
+
* console.log('Would succeed:', result.result);
|
|
1318
|
+
*/
|
|
1319
|
+
get simulate() {
|
|
1320
|
+
const contract = this.contract;
|
|
1321
|
+
if (!contract.simulate) {
|
|
1322
|
+
throw new Error('Public client is required for simulation');
|
|
1323
|
+
}
|
|
1324
|
+
return {
|
|
1325
|
+
/**
|
|
1326
|
+
* Simulate addMinter
|
|
1327
|
+
* Returns gas estimate and result without sending transaction
|
|
1328
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1329
|
+
*/
|
|
1330
|
+
async addMinter(account: `0x${string}`, options?: {
|
|
1331
|
+
accessList?: import('viem').AccessList;
|
|
1332
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1333
|
+
chain?: import('viem').Chain | null;
|
|
1334
|
+
dataSuffix?: `0x${string}`;
|
|
1335
|
+
gas?: bigint;
|
|
1336
|
+
gasPrice?: bigint;
|
|
1337
|
+
maxFeePerGas?: bigint;
|
|
1338
|
+
maxPriorityFeePerGas?: bigint;
|
|
1339
|
+
nonce?: number;
|
|
1340
|
+
value?: bigint;
|
|
1341
|
+
}): Promise<void> {
|
|
1342
|
+
return contract.simulate.addMinter([account] as const, options) as Promise<void>;
|
|
1343
|
+
},
|
|
1344
|
+
/**
|
|
1345
|
+
* Simulate addPauser
|
|
1346
|
+
* Returns gas estimate and result without sending transaction
|
|
1347
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1348
|
+
*/
|
|
1349
|
+
async addPauser(account: `0x${string}`, options?: {
|
|
1350
|
+
accessList?: import('viem').AccessList;
|
|
1351
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1352
|
+
chain?: import('viem').Chain | null;
|
|
1353
|
+
dataSuffix?: `0x${string}`;
|
|
1354
|
+
gas?: bigint;
|
|
1355
|
+
gasPrice?: bigint;
|
|
1356
|
+
maxFeePerGas?: bigint;
|
|
1357
|
+
maxPriorityFeePerGas?: bigint;
|
|
1358
|
+
nonce?: number;
|
|
1359
|
+
value?: bigint;
|
|
1360
|
+
}): Promise<void> {
|
|
1361
|
+
return contract.simulate.addPauser([account] as const, options) as Promise<void>;
|
|
1362
|
+
},
|
|
1363
|
+
/**
|
|
1364
|
+
* Simulate approve
|
|
1365
|
+
* Returns gas estimate and result without sending transaction
|
|
1366
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1367
|
+
*/
|
|
1368
|
+
async approve(spender: `0x${string}`, value: bigint, options?: {
|
|
1369
|
+
accessList?: import('viem').AccessList;
|
|
1370
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1371
|
+
chain?: import('viem').Chain | null;
|
|
1372
|
+
dataSuffix?: `0x${string}`;
|
|
1373
|
+
gas?: bigint;
|
|
1374
|
+
gasPrice?: bigint;
|
|
1375
|
+
maxFeePerGas?: bigint;
|
|
1376
|
+
maxPriorityFeePerGas?: bigint;
|
|
1377
|
+
nonce?: number;
|
|
1378
|
+
value?: bigint;
|
|
1379
|
+
}): Promise<boolean> {
|
|
1380
|
+
return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
|
|
1381
|
+
},
|
|
1382
|
+
/**
|
|
1383
|
+
* Simulate burn
|
|
1384
|
+
* Returns gas estimate and result without sending transaction
|
|
1385
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1386
|
+
*/
|
|
1387
|
+
async burn(amount: bigint, options?: {
|
|
1388
|
+
accessList?: import('viem').AccessList;
|
|
1389
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1390
|
+
chain?: import('viem').Chain | null;
|
|
1391
|
+
dataSuffix?: `0x${string}`;
|
|
1392
|
+
gas?: bigint;
|
|
1393
|
+
gasPrice?: bigint;
|
|
1394
|
+
maxFeePerGas?: bigint;
|
|
1395
|
+
maxPriorityFeePerGas?: bigint;
|
|
1396
|
+
nonce?: number;
|
|
1397
|
+
value?: bigint;
|
|
1398
|
+
}): Promise<void> {
|
|
1399
|
+
return contract.simulate.burn([amount] as const, options) as Promise<void>;
|
|
1400
|
+
},
|
|
1401
|
+
/**
|
|
1402
|
+
* Simulate burnFrom
|
|
1403
|
+
* Returns gas estimate and result without sending transaction
|
|
1404
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1405
|
+
*/
|
|
1406
|
+
async burnFrom(account: `0x${string}`, amount: bigint, options?: {
|
|
1407
|
+
accessList?: import('viem').AccessList;
|
|
1408
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1409
|
+
chain?: import('viem').Chain | null;
|
|
1410
|
+
dataSuffix?: `0x${string}`;
|
|
1411
|
+
gas?: bigint;
|
|
1412
|
+
gasPrice?: bigint;
|
|
1413
|
+
maxFeePerGas?: bigint;
|
|
1414
|
+
maxPriorityFeePerGas?: bigint;
|
|
1415
|
+
nonce?: number;
|
|
1416
|
+
value?: bigint;
|
|
1417
|
+
}): Promise<void> {
|
|
1418
|
+
return contract.simulate.burnFrom([account, amount] as const, options) as Promise<void>;
|
|
1419
|
+
},
|
|
1420
|
+
/**
|
|
1421
|
+
* Simulate decreaseAllowance
|
|
1422
|
+
* Returns gas estimate and result without sending transaction
|
|
1423
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1424
|
+
*/
|
|
1425
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1426
|
+
accessList?: import('viem').AccessList;
|
|
1427
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1428
|
+
chain?: import('viem').Chain | null;
|
|
1429
|
+
dataSuffix?: `0x${string}`;
|
|
1430
|
+
gas?: bigint;
|
|
1431
|
+
gasPrice?: bigint;
|
|
1432
|
+
maxFeePerGas?: bigint;
|
|
1433
|
+
maxPriorityFeePerGas?: bigint;
|
|
1434
|
+
nonce?: number;
|
|
1435
|
+
value?: bigint;
|
|
1436
|
+
}): Promise<boolean> {
|
|
1437
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
1438
|
+
},
|
|
1439
|
+
/**
|
|
1440
|
+
* Simulate increaseAllowance
|
|
1441
|
+
* Returns gas estimate and result without sending transaction
|
|
1442
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1443
|
+
*/
|
|
1444
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
1445
|
+
accessList?: import('viem').AccessList;
|
|
1446
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1447
|
+
chain?: import('viem').Chain | null;
|
|
1448
|
+
dataSuffix?: `0x${string}`;
|
|
1449
|
+
gas?: bigint;
|
|
1450
|
+
gasPrice?: bigint;
|
|
1451
|
+
maxFeePerGas?: bigint;
|
|
1452
|
+
maxPriorityFeePerGas?: bigint;
|
|
1453
|
+
nonce?: number;
|
|
1454
|
+
value?: bigint;
|
|
1455
|
+
}): Promise<boolean> {
|
|
1456
|
+
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
1457
|
+
},
|
|
1458
|
+
/**
|
|
1459
|
+
* Simulate initialize
|
|
1460
|
+
* Returns gas estimate and result without sending transaction
|
|
1461
|
+
* Supports multiple overloads: (string, string, uint8), (address, address), (none), (address)
|
|
1462
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1463
|
+
*/
|
|
1464
|
+
async initialize(...args: any[]): Promise<any> {
|
|
1465
|
+
return contract.simulate.initialize(args as any) as Promise<any>;
|
|
1466
|
+
},
|
|
1467
|
+
/**
|
|
1468
|
+
* Simulate mint
|
|
1469
|
+
* Returns gas estimate and result without sending transaction
|
|
1470
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1471
|
+
*/
|
|
1472
|
+
async mint(account: `0x${string}`, amount: bigint, options?: {
|
|
1473
|
+
accessList?: import('viem').AccessList;
|
|
1474
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1475
|
+
chain?: import('viem').Chain | null;
|
|
1476
|
+
dataSuffix?: `0x${string}`;
|
|
1477
|
+
gas?: bigint;
|
|
1478
|
+
gasPrice?: bigint;
|
|
1479
|
+
maxFeePerGas?: bigint;
|
|
1480
|
+
maxPriorityFeePerGas?: bigint;
|
|
1481
|
+
nonce?: number;
|
|
1482
|
+
value?: bigint;
|
|
1483
|
+
}): Promise<boolean> {
|
|
1484
|
+
return contract.simulate.mint([account, amount] as const, options) as Promise<boolean>;
|
|
1485
|
+
},
|
|
1486
|
+
/**
|
|
1487
|
+
* Simulate pause
|
|
1488
|
+
* Returns gas estimate and result without sending transaction
|
|
1489
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1490
|
+
*/
|
|
1491
|
+
async pause(options?: {
|
|
1492
|
+
accessList?: import('viem').AccessList;
|
|
1493
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1494
|
+
chain?: import('viem').Chain | null;
|
|
1495
|
+
dataSuffix?: `0x${string}`;
|
|
1496
|
+
gas?: bigint;
|
|
1497
|
+
gasPrice?: bigint;
|
|
1498
|
+
maxFeePerGas?: bigint;
|
|
1499
|
+
maxPriorityFeePerGas?: bigint;
|
|
1500
|
+
nonce?: number;
|
|
1501
|
+
value?: bigint;
|
|
1502
|
+
}): Promise<void> {
|
|
1503
|
+
return contract.simulate.pause(options) as Promise<void>;
|
|
1504
|
+
},
|
|
1505
|
+
/**
|
|
1506
|
+
* Simulate permit
|
|
1507
|
+
* Returns gas estimate and result without sending transaction
|
|
1508
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1509
|
+
*/
|
|
1510
|
+
async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
|
|
1511
|
+
accessList?: import('viem').AccessList;
|
|
1512
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1513
|
+
chain?: import('viem').Chain | null;
|
|
1514
|
+
dataSuffix?: `0x${string}`;
|
|
1515
|
+
gas?: bigint;
|
|
1516
|
+
gasPrice?: bigint;
|
|
1517
|
+
maxFeePerGas?: bigint;
|
|
1518
|
+
maxPriorityFeePerGas?: bigint;
|
|
1519
|
+
nonce?: number;
|
|
1520
|
+
value?: bigint;
|
|
1521
|
+
}): Promise<void> {
|
|
1522
|
+
return contract.simulate.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<void>;
|
|
1523
|
+
},
|
|
1524
|
+
/**
|
|
1525
|
+
* Simulate renounceMinter
|
|
1526
|
+
* Returns gas estimate and result without sending transaction
|
|
1527
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1528
|
+
*/
|
|
1529
|
+
async renounceMinter(options?: {
|
|
1530
|
+
accessList?: import('viem').AccessList;
|
|
1531
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1532
|
+
chain?: import('viem').Chain | null;
|
|
1533
|
+
dataSuffix?: `0x${string}`;
|
|
1534
|
+
gas?: bigint;
|
|
1535
|
+
gasPrice?: bigint;
|
|
1536
|
+
maxFeePerGas?: bigint;
|
|
1537
|
+
maxPriorityFeePerGas?: bigint;
|
|
1538
|
+
nonce?: number;
|
|
1539
|
+
value?: bigint;
|
|
1540
|
+
}): Promise<void> {
|
|
1541
|
+
return contract.simulate.renounceMinter(options) as Promise<void>;
|
|
1542
|
+
},
|
|
1543
|
+
/**
|
|
1544
|
+
* Simulate renouncePauser
|
|
1545
|
+
* Returns gas estimate and result without sending transaction
|
|
1546
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1547
|
+
*/
|
|
1548
|
+
async renouncePauser(options?: {
|
|
1549
|
+
accessList?: import('viem').AccessList;
|
|
1550
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1551
|
+
chain?: import('viem').Chain | null;
|
|
1552
|
+
dataSuffix?: `0x${string}`;
|
|
1553
|
+
gas?: bigint;
|
|
1554
|
+
gasPrice?: bigint;
|
|
1555
|
+
maxFeePerGas?: bigint;
|
|
1556
|
+
maxPriorityFeePerGas?: bigint;
|
|
1557
|
+
nonce?: number;
|
|
1558
|
+
value?: bigint;
|
|
1559
|
+
}): Promise<void> {
|
|
1560
|
+
return contract.simulate.renouncePauser(options) as Promise<void>;
|
|
1561
|
+
},
|
|
1562
|
+
/**
|
|
1563
|
+
* Simulate transfer
|
|
1564
|
+
* Returns gas estimate and result without sending transaction
|
|
1565
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1566
|
+
*/
|
|
1567
|
+
async transfer(to: `0x${string}`, value: bigint, options?: {
|
|
1568
|
+
accessList?: import('viem').AccessList;
|
|
1569
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1570
|
+
chain?: import('viem').Chain | null;
|
|
1571
|
+
dataSuffix?: `0x${string}`;
|
|
1572
|
+
gas?: bigint;
|
|
1573
|
+
gasPrice?: bigint;
|
|
1574
|
+
maxFeePerGas?: bigint;
|
|
1575
|
+
maxPriorityFeePerGas?: bigint;
|
|
1576
|
+
nonce?: number;
|
|
1577
|
+
value?: bigint;
|
|
1578
|
+
}): Promise<boolean> {
|
|
1579
|
+
return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
|
|
1580
|
+
},
|
|
1581
|
+
/**
|
|
1582
|
+
* Simulate transferFrom
|
|
1583
|
+
* Returns gas estimate and result without sending transaction
|
|
1584
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1585
|
+
*/
|
|
1586
|
+
async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
|
|
1587
|
+
accessList?: import('viem').AccessList;
|
|
1588
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1589
|
+
chain?: import('viem').Chain | null;
|
|
1590
|
+
dataSuffix?: `0x${string}`;
|
|
1591
|
+
gas?: bigint;
|
|
1592
|
+
gasPrice?: bigint;
|
|
1593
|
+
maxFeePerGas?: bigint;
|
|
1594
|
+
maxPriorityFeePerGas?: bigint;
|
|
1595
|
+
nonce?: number;
|
|
1596
|
+
value?: bigint;
|
|
1597
|
+
}): Promise<boolean> {
|
|
1598
|
+
return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
|
|
1599
|
+
},
|
|
1600
|
+
/**
|
|
1601
|
+
* Simulate unpause
|
|
1602
|
+
* Returns gas estimate and result without sending transaction
|
|
1603
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1604
|
+
*/
|
|
1605
|
+
async unpause(options?: {
|
|
1606
|
+
accessList?: import('viem').AccessList;
|
|
1607
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1608
|
+
chain?: import('viem').Chain | null;
|
|
1609
|
+
dataSuffix?: `0x${string}`;
|
|
1610
|
+
gas?: bigint;
|
|
1611
|
+
gasPrice?: bigint;
|
|
1612
|
+
maxFeePerGas?: bigint;
|
|
1613
|
+
maxPriorityFeePerGas?: bigint;
|
|
1614
|
+
nonce?: number;
|
|
1615
|
+
value?: bigint;
|
|
1616
|
+
}): Promise<void> {
|
|
1617
|
+
return contract.simulate.unpause(options) as Promise<void>;
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Watch contract events
|
|
1624
|
+
*
|
|
1625
|
+
* @example
|
|
1626
|
+
* // Watch all Transfer events
|
|
1627
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1628
|
+
* console.log('Transfer:', event);
|
|
1629
|
+
* });
|
|
1630
|
+
*
|
|
1631
|
+
* // Stop watching
|
|
1632
|
+
* unwatch();
|
|
1633
|
+
*/
|
|
1634
|
+
get watch() {
|
|
1635
|
+
return {
|
|
1636
|
+
/**
|
|
1637
|
+
* Watch Approval events
|
|
1638
|
+
* @param callback Function to call when event is emitted
|
|
1639
|
+
* @param filter Optional filter for indexed parameters
|
|
1640
|
+
* @returns Unwatch function to stop listening
|
|
1641
|
+
*/
|
|
1642
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
|
|
1643
|
+
return this.publicClient.watchContractEvent({
|
|
1644
|
+
address: this.contractAddress,
|
|
1645
|
+
abi: AudiusToken_jsonAbi,
|
|
1646
|
+
eventName: 'Approval',
|
|
1647
|
+
args: filter,
|
|
1648
|
+
onLogs: (logs: any[]) => {
|
|
1649
|
+
logs.forEach((log: any) => {
|
|
1650
|
+
callback(log.args as any);
|
|
1651
|
+
});
|
|
1652
|
+
},
|
|
1653
|
+
}) as () => void;
|
|
1654
|
+
},
|
|
1655
|
+
/**
|
|
1656
|
+
* Watch MinterAdded events
|
|
1657
|
+
* @param callback Function to call when event is emitted
|
|
1658
|
+
* @param filter Optional filter for indexed parameters
|
|
1659
|
+
* @returns Unwatch function to stop listening
|
|
1660
|
+
*/
|
|
1661
|
+
MinterAdded: (callback: (event: { account: `0x${string}` }) => void, filter?: { account: `0x${string}` }) => {
|
|
1662
|
+
return this.publicClient.watchContractEvent({
|
|
1663
|
+
address: this.contractAddress,
|
|
1664
|
+
abi: AudiusToken_jsonAbi,
|
|
1665
|
+
eventName: 'MinterAdded',
|
|
1666
|
+
args: filter,
|
|
1667
|
+
onLogs: (logs: any[]) => {
|
|
1668
|
+
logs.forEach((log: any) => {
|
|
1669
|
+
callback(log.args as any);
|
|
1670
|
+
});
|
|
1671
|
+
},
|
|
1672
|
+
}) as () => void;
|
|
1673
|
+
},
|
|
1674
|
+
/**
|
|
1675
|
+
* Watch MinterRemoved events
|
|
1676
|
+
* @param callback Function to call when event is emitted
|
|
1677
|
+
* @param filter Optional filter for indexed parameters
|
|
1678
|
+
* @returns Unwatch function to stop listening
|
|
1679
|
+
*/
|
|
1680
|
+
MinterRemoved: (callback: (event: { account: `0x${string}` }) => void, filter?: { account: `0x${string}` }) => {
|
|
1681
|
+
return this.publicClient.watchContractEvent({
|
|
1682
|
+
address: this.contractAddress,
|
|
1683
|
+
abi: AudiusToken_jsonAbi,
|
|
1684
|
+
eventName: 'MinterRemoved',
|
|
1685
|
+
args: filter,
|
|
1686
|
+
onLogs: (logs: any[]) => {
|
|
1687
|
+
logs.forEach((log: any) => {
|
|
1688
|
+
callback(log.args as any);
|
|
1689
|
+
});
|
|
1690
|
+
},
|
|
1691
|
+
}) as () => void;
|
|
1692
|
+
},
|
|
1693
|
+
/**
|
|
1694
|
+
* Watch Paused events
|
|
1695
|
+
* @param callback Function to call when event is emitted
|
|
1696
|
+
* @param filter Optional filter for indexed parameters
|
|
1697
|
+
* @returns Unwatch function to stop listening
|
|
1698
|
+
*/
|
|
1699
|
+
Paused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
1700
|
+
return this.publicClient.watchContractEvent({
|
|
1701
|
+
address: this.contractAddress,
|
|
1702
|
+
abi: AudiusToken_jsonAbi,
|
|
1703
|
+
eventName: 'Paused',
|
|
1704
|
+
|
|
1705
|
+
onLogs: (logs: any[]) => {
|
|
1706
|
+
logs.forEach((log: any) => {
|
|
1707
|
+
callback(log.args as any);
|
|
1708
|
+
});
|
|
1709
|
+
},
|
|
1710
|
+
}) as () => void;
|
|
1711
|
+
},
|
|
1712
|
+
/**
|
|
1713
|
+
* Watch PauserAdded events
|
|
1714
|
+
* @param callback Function to call when event is emitted
|
|
1715
|
+
* @param filter Optional filter for indexed parameters
|
|
1716
|
+
* @returns Unwatch function to stop listening
|
|
1717
|
+
*/
|
|
1718
|
+
PauserAdded: (callback: (event: { account: `0x${string}` }) => void, filter?: { account: `0x${string}` }) => {
|
|
1719
|
+
return this.publicClient.watchContractEvent({
|
|
1720
|
+
address: this.contractAddress,
|
|
1721
|
+
abi: AudiusToken_jsonAbi,
|
|
1722
|
+
eventName: 'PauserAdded',
|
|
1723
|
+
args: filter,
|
|
1724
|
+
onLogs: (logs: any[]) => {
|
|
1725
|
+
logs.forEach((log: any) => {
|
|
1726
|
+
callback(log.args as any);
|
|
1727
|
+
});
|
|
1728
|
+
},
|
|
1729
|
+
}) as () => void;
|
|
1730
|
+
},
|
|
1731
|
+
/**
|
|
1732
|
+
* Watch PauserRemoved events
|
|
1733
|
+
* @param callback Function to call when event is emitted
|
|
1734
|
+
* @param filter Optional filter for indexed parameters
|
|
1735
|
+
* @returns Unwatch function to stop listening
|
|
1736
|
+
*/
|
|
1737
|
+
PauserRemoved: (callback: (event: { account: `0x${string}` }) => void, filter?: { account: `0x${string}` }) => {
|
|
1738
|
+
return this.publicClient.watchContractEvent({
|
|
1739
|
+
address: this.contractAddress,
|
|
1740
|
+
abi: AudiusToken_jsonAbi,
|
|
1741
|
+
eventName: 'PauserRemoved',
|
|
1742
|
+
args: filter,
|
|
1743
|
+
onLogs: (logs: any[]) => {
|
|
1744
|
+
logs.forEach((log: any) => {
|
|
1745
|
+
callback(log.args as any);
|
|
1746
|
+
});
|
|
1747
|
+
},
|
|
1748
|
+
}) as () => void;
|
|
1749
|
+
},
|
|
1750
|
+
/**
|
|
1751
|
+
* Watch Transfer events
|
|
1752
|
+
* @param callback Function to call when event is emitted
|
|
1753
|
+
* @param filter Optional filter for indexed parameters
|
|
1754
|
+
* @returns Unwatch function to stop listening
|
|
1755
|
+
*/
|
|
1756
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
|
|
1757
|
+
return this.publicClient.watchContractEvent({
|
|
1758
|
+
address: this.contractAddress,
|
|
1759
|
+
abi: AudiusToken_jsonAbi,
|
|
1760
|
+
eventName: 'Transfer',
|
|
1761
|
+
args: filter,
|
|
1762
|
+
onLogs: (logs: any[]) => {
|
|
1763
|
+
logs.forEach((log: any) => {
|
|
1764
|
+
callback(log.args as any);
|
|
1765
|
+
});
|
|
1766
|
+
},
|
|
1767
|
+
}) as () => void;
|
|
1768
|
+
},
|
|
1769
|
+
/**
|
|
1770
|
+
* Watch Unpaused events
|
|
1771
|
+
* @param callback Function to call when event is emitted
|
|
1772
|
+
* @param filter Optional filter for indexed parameters
|
|
1773
|
+
* @returns Unwatch function to stop listening
|
|
1774
|
+
*/
|
|
1775
|
+
Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
1776
|
+
return this.publicClient.watchContractEvent({
|
|
1777
|
+
address: this.contractAddress,
|
|
1778
|
+
abi: AudiusToken_jsonAbi,
|
|
1779
|
+
eventName: 'Unpaused',
|
|
1780
|
+
|
|
1781
|
+
onLogs: (logs: any[]) => {
|
|
1782
|
+
logs.forEach((log: any) => {
|
|
1783
|
+
callback(log.args as any);
|
|
1784
|
+
});
|
|
1785
|
+
},
|
|
1786
|
+
}) as () => void;
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
}
|
|
1790
|
+
}
|