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