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