@gitmyabi/collectionv2 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/CollectionV2_json.d.ts +1738 -0
- package/contracts/CollectionV2_json.js +1899 -0
- package/contracts/CollectionV2_json.ts +2299 -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,2299 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CollectionData struct type
|
|
7
|
+
*/
|
|
8
|
+
export type CollectionData = {
|
|
9
|
+
uri: string;
|
|
10
|
+
total: bigint;
|
|
11
|
+
startTime: bigint;
|
|
12
|
+
endTime: bigint;
|
|
13
|
+
amount: bigint;
|
|
14
|
+
percent: bigint;
|
|
15
|
+
admin: `0x${string}`;
|
|
16
|
+
factoryAddress: `0x${string}`;
|
|
17
|
+
currencyType: bigint;
|
|
18
|
+
farm: `0x${string}`;
|
|
19
|
+
moneyHandler: `0x${string}`;
|
|
20
|
+
treasury: `0x${string}`;
|
|
21
|
+
token: `0x${string}`;
|
|
22
|
+
stone: `0x${string}`;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* CollectionV2_json ABI
|
|
26
|
+
*
|
|
27
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
28
|
+
*/
|
|
29
|
+
export const CollectionV2_jsonAbi = [
|
|
30
|
+
{
|
|
31
|
+
"inputs": [
|
|
32
|
+
{
|
|
33
|
+
"components": [
|
|
34
|
+
{
|
|
35
|
+
"internalType": "string",
|
|
36
|
+
"name": "uri",
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"internalType": "uint256",
|
|
41
|
+
"name": "total",
|
|
42
|
+
"type": "uint256"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"internalType": "uint256",
|
|
46
|
+
"name": "startTime",
|
|
47
|
+
"type": "uint256"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"internalType": "uint256",
|
|
51
|
+
"name": "endTime",
|
|
52
|
+
"type": "uint256"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"internalType": "uint256",
|
|
56
|
+
"name": "amount",
|
|
57
|
+
"type": "uint256"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"internalType": "uint256",
|
|
61
|
+
"name": "percent",
|
|
62
|
+
"type": "uint256"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"internalType": "address",
|
|
66
|
+
"name": "admin",
|
|
67
|
+
"type": "address"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"internalType": "address",
|
|
71
|
+
"name": "factoryAddress",
|
|
72
|
+
"type": "address"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"internalType": "uint8",
|
|
76
|
+
"name": "currencyType",
|
|
77
|
+
"type": "uint8"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"internalType": "address",
|
|
81
|
+
"name": "farm",
|
|
82
|
+
"type": "address"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"internalType": "address",
|
|
86
|
+
"name": "moneyHandler",
|
|
87
|
+
"type": "address"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"internalType": "address",
|
|
91
|
+
"name": "treasury",
|
|
92
|
+
"type": "address"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"internalType": "address",
|
|
96
|
+
"name": "token",
|
|
97
|
+
"type": "address"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"internalType": "address",
|
|
101
|
+
"name": "stone",
|
|
102
|
+
"type": "address"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"internalType": "struct CollectionData",
|
|
106
|
+
"name": "collecData",
|
|
107
|
+
"type": "tuple"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"stateMutability": "nonpayable",
|
|
111
|
+
"type": "constructor"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"anonymous": false,
|
|
115
|
+
"inputs": [
|
|
116
|
+
{
|
|
117
|
+
"indexed": true,
|
|
118
|
+
"internalType": "address",
|
|
119
|
+
"name": "account",
|
|
120
|
+
"type": "address"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"indexed": true,
|
|
124
|
+
"internalType": "address",
|
|
125
|
+
"name": "operator",
|
|
126
|
+
"type": "address"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"indexed": false,
|
|
130
|
+
"internalType": "bool",
|
|
131
|
+
"name": "approved",
|
|
132
|
+
"type": "bool"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"name": "ApprovalForAll",
|
|
136
|
+
"type": "event"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"anonymous": false,
|
|
140
|
+
"inputs": [
|
|
141
|
+
{
|
|
142
|
+
"indexed": false,
|
|
143
|
+
"internalType": "uint256",
|
|
144
|
+
"name": "endTime",
|
|
145
|
+
"type": "uint256"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"name": "NewEndTime",
|
|
149
|
+
"type": "event"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"anonymous": false,
|
|
153
|
+
"inputs": [
|
|
154
|
+
{
|
|
155
|
+
"indexed": false,
|
|
156
|
+
"internalType": "uint256",
|
|
157
|
+
"name": "startTime",
|
|
158
|
+
"type": "uint256"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"name": "NewStartTime",
|
|
162
|
+
"type": "event"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"anonymous": false,
|
|
166
|
+
"inputs": [
|
|
167
|
+
{
|
|
168
|
+
"indexed": false,
|
|
169
|
+
"internalType": "uint256",
|
|
170
|
+
"name": "amount",
|
|
171
|
+
"type": "uint256"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"name": "NewUsdAmount",
|
|
175
|
+
"type": "event"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"anonymous": false,
|
|
179
|
+
"inputs": [
|
|
180
|
+
{
|
|
181
|
+
"indexed": false,
|
|
182
|
+
"internalType": "address",
|
|
183
|
+
"name": "account",
|
|
184
|
+
"type": "address"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"indexed": false,
|
|
188
|
+
"internalType": "uint256",
|
|
189
|
+
"name": "amount",
|
|
190
|
+
"type": "uint256"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"name": "PaymentShared",
|
|
194
|
+
"type": "event"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"anonymous": false,
|
|
198
|
+
"inputs": [
|
|
199
|
+
{
|
|
200
|
+
"indexed": false,
|
|
201
|
+
"internalType": "address",
|
|
202
|
+
"name": "account",
|
|
203
|
+
"type": "address"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"indexed": false,
|
|
207
|
+
"internalType": "uint256",
|
|
208
|
+
"name": "amount",
|
|
209
|
+
"type": "uint256"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"name": "PaymentTreasure",
|
|
213
|
+
"type": "event"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"anonymous": false,
|
|
217
|
+
"inputs": [
|
|
218
|
+
{
|
|
219
|
+
"indexed": true,
|
|
220
|
+
"internalType": "bytes32",
|
|
221
|
+
"name": "role",
|
|
222
|
+
"type": "bytes32"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"indexed": true,
|
|
226
|
+
"internalType": "bytes32",
|
|
227
|
+
"name": "previousAdminRole",
|
|
228
|
+
"type": "bytes32"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"indexed": true,
|
|
232
|
+
"internalType": "bytes32",
|
|
233
|
+
"name": "newAdminRole",
|
|
234
|
+
"type": "bytes32"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"name": "RoleAdminChanged",
|
|
238
|
+
"type": "event"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"anonymous": false,
|
|
242
|
+
"inputs": [
|
|
243
|
+
{
|
|
244
|
+
"indexed": true,
|
|
245
|
+
"internalType": "bytes32",
|
|
246
|
+
"name": "role",
|
|
247
|
+
"type": "bytes32"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"indexed": true,
|
|
251
|
+
"internalType": "address",
|
|
252
|
+
"name": "account",
|
|
253
|
+
"type": "address"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"indexed": true,
|
|
257
|
+
"internalType": "address",
|
|
258
|
+
"name": "sender",
|
|
259
|
+
"type": "address"
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
"name": "RoleGranted",
|
|
263
|
+
"type": "event"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"anonymous": false,
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"indexed": true,
|
|
270
|
+
"internalType": "bytes32",
|
|
271
|
+
"name": "role",
|
|
272
|
+
"type": "bytes32"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"indexed": true,
|
|
276
|
+
"internalType": "address",
|
|
277
|
+
"name": "account",
|
|
278
|
+
"type": "address"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"indexed": true,
|
|
282
|
+
"internalType": "address",
|
|
283
|
+
"name": "sender",
|
|
284
|
+
"type": "address"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"name": "RoleRevoked",
|
|
288
|
+
"type": "event"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"anonymous": false,
|
|
292
|
+
"inputs": [
|
|
293
|
+
{
|
|
294
|
+
"indexed": false,
|
|
295
|
+
"internalType": "address",
|
|
296
|
+
"name": "token",
|
|
297
|
+
"type": "address"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"indexed": false,
|
|
301
|
+
"internalType": "address",
|
|
302
|
+
"name": "stone",
|
|
303
|
+
"type": "address"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"indexed": false,
|
|
307
|
+
"internalType": "address",
|
|
308
|
+
"name": "treasury",
|
|
309
|
+
"type": "address"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"indexed": false,
|
|
313
|
+
"internalType": "address",
|
|
314
|
+
"name": "moneyHandler",
|
|
315
|
+
"type": "address"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"name": "SetAddresses",
|
|
319
|
+
"type": "event"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"anonymous": false,
|
|
323
|
+
"inputs": [
|
|
324
|
+
{
|
|
325
|
+
"indexed": true,
|
|
326
|
+
"internalType": "address",
|
|
327
|
+
"name": "operator",
|
|
328
|
+
"type": "address"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"indexed": true,
|
|
332
|
+
"internalType": "address",
|
|
333
|
+
"name": "to",
|
|
334
|
+
"type": "address"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"indexed": true,
|
|
338
|
+
"internalType": "uint256",
|
|
339
|
+
"name": "id",
|
|
340
|
+
"type": "uint256"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"indexed": false,
|
|
344
|
+
"internalType": "uint256",
|
|
345
|
+
"name": "amount",
|
|
346
|
+
"type": "uint256"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"name": "Sold",
|
|
350
|
+
"type": "event"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"anonymous": false,
|
|
354
|
+
"inputs": [
|
|
355
|
+
{
|
|
356
|
+
"indexed": false,
|
|
357
|
+
"internalType": "address",
|
|
358
|
+
"name": "buyer",
|
|
359
|
+
"type": "address"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"indexed": false,
|
|
363
|
+
"internalType": "uint256",
|
|
364
|
+
"name": "amount",
|
|
365
|
+
"type": "uint256"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"name": "SoldWithStones",
|
|
369
|
+
"type": "event"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"anonymous": false,
|
|
373
|
+
"inputs": [
|
|
374
|
+
{
|
|
375
|
+
"indexed": true,
|
|
376
|
+
"internalType": "address",
|
|
377
|
+
"name": "operator",
|
|
378
|
+
"type": "address"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"indexed": true,
|
|
382
|
+
"internalType": "address",
|
|
383
|
+
"name": "from",
|
|
384
|
+
"type": "address"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"indexed": true,
|
|
388
|
+
"internalType": "address",
|
|
389
|
+
"name": "to",
|
|
390
|
+
"type": "address"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"indexed": false,
|
|
394
|
+
"internalType": "uint256[]",
|
|
395
|
+
"name": "ids",
|
|
396
|
+
"type": "uint256[]"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"indexed": false,
|
|
400
|
+
"internalType": "uint256[]",
|
|
401
|
+
"name": "values",
|
|
402
|
+
"type": "uint256[]"
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
"name": "TransferBatch",
|
|
406
|
+
"type": "event"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"anonymous": false,
|
|
410
|
+
"inputs": [
|
|
411
|
+
{
|
|
412
|
+
"indexed": true,
|
|
413
|
+
"internalType": "address",
|
|
414
|
+
"name": "operator",
|
|
415
|
+
"type": "address"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"indexed": true,
|
|
419
|
+
"internalType": "address",
|
|
420
|
+
"name": "from",
|
|
421
|
+
"type": "address"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"indexed": true,
|
|
425
|
+
"internalType": "address",
|
|
426
|
+
"name": "to",
|
|
427
|
+
"type": "address"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"indexed": false,
|
|
431
|
+
"internalType": "uint256",
|
|
432
|
+
"name": "id",
|
|
433
|
+
"type": "uint256"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"indexed": false,
|
|
437
|
+
"internalType": "uint256",
|
|
438
|
+
"name": "value",
|
|
439
|
+
"type": "uint256"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"name": "TransferSingle",
|
|
443
|
+
"type": "event"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"anonymous": false,
|
|
447
|
+
"inputs": [
|
|
448
|
+
{
|
|
449
|
+
"indexed": false,
|
|
450
|
+
"internalType": "string",
|
|
451
|
+
"name": "value",
|
|
452
|
+
"type": "string"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"indexed": true,
|
|
456
|
+
"internalType": "uint256",
|
|
457
|
+
"name": "id",
|
|
458
|
+
"type": "uint256"
|
|
459
|
+
}
|
|
460
|
+
],
|
|
461
|
+
"name": "URI",
|
|
462
|
+
"type": "event"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"inputs": [],
|
|
466
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
467
|
+
"outputs": [
|
|
468
|
+
{
|
|
469
|
+
"internalType": "bytes32",
|
|
470
|
+
"name": "",
|
|
471
|
+
"type": "bytes32"
|
|
472
|
+
}
|
|
473
|
+
],
|
|
474
|
+
"stateMutability": "view",
|
|
475
|
+
"type": "function"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"inputs": [],
|
|
479
|
+
"name": "MINTER_ROLE",
|
|
480
|
+
"outputs": [
|
|
481
|
+
{
|
|
482
|
+
"internalType": "bytes32",
|
|
483
|
+
"name": "",
|
|
484
|
+
"type": "bytes32"
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
"stateMutability": "view",
|
|
488
|
+
"type": "function"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"inputs": [
|
|
492
|
+
{
|
|
493
|
+
"internalType": "address",
|
|
494
|
+
"name": "_token",
|
|
495
|
+
"type": "address"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"internalType": "address",
|
|
499
|
+
"name": "_stone",
|
|
500
|
+
"type": "address"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"internalType": "address",
|
|
504
|
+
"name": "_treasury",
|
|
505
|
+
"type": "address"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"internalType": "address",
|
|
509
|
+
"name": "_moneyHandler",
|
|
510
|
+
"type": "address"
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
"name": "addExternalAddresses",
|
|
514
|
+
"outputs": [],
|
|
515
|
+
"stateMutability": "nonpayable",
|
|
516
|
+
"type": "function"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"inputs": [],
|
|
520
|
+
"name": "amount",
|
|
521
|
+
"outputs": [
|
|
522
|
+
{
|
|
523
|
+
"internalType": "uint256",
|
|
524
|
+
"name": "",
|
|
525
|
+
"type": "uint256"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
"stateMutability": "view",
|
|
529
|
+
"type": "function"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"inputs": [],
|
|
533
|
+
"name": "available",
|
|
534
|
+
"outputs": [
|
|
535
|
+
{
|
|
536
|
+
"internalType": "uint256",
|
|
537
|
+
"name": "",
|
|
538
|
+
"type": "uint256"
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
"stateMutability": "view",
|
|
542
|
+
"type": "function"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"inputs": [
|
|
546
|
+
{
|
|
547
|
+
"internalType": "address",
|
|
548
|
+
"name": "account",
|
|
549
|
+
"type": "address"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"internalType": "uint256",
|
|
553
|
+
"name": "id",
|
|
554
|
+
"type": "uint256"
|
|
555
|
+
}
|
|
556
|
+
],
|
|
557
|
+
"name": "balanceOf",
|
|
558
|
+
"outputs": [
|
|
559
|
+
{
|
|
560
|
+
"internalType": "uint256",
|
|
561
|
+
"name": "",
|
|
562
|
+
"type": "uint256"
|
|
563
|
+
}
|
|
564
|
+
],
|
|
565
|
+
"stateMutability": "view",
|
|
566
|
+
"type": "function"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"inputs": [
|
|
570
|
+
{
|
|
571
|
+
"internalType": "address[]",
|
|
572
|
+
"name": "accounts",
|
|
573
|
+
"type": "address[]"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"internalType": "uint256[]",
|
|
577
|
+
"name": "ids",
|
|
578
|
+
"type": "uint256[]"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"name": "balanceOfBatch",
|
|
582
|
+
"outputs": [
|
|
583
|
+
{
|
|
584
|
+
"internalType": "uint256[]",
|
|
585
|
+
"name": "",
|
|
586
|
+
"type": "uint256[]"
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
"stateMutability": "view",
|
|
590
|
+
"type": "function"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"inputs": [
|
|
594
|
+
{
|
|
595
|
+
"internalType": "address",
|
|
596
|
+
"name": "buyer",
|
|
597
|
+
"type": "address"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"internalType": "uint256",
|
|
601
|
+
"name": "_id",
|
|
602
|
+
"type": "uint256"
|
|
603
|
+
}
|
|
604
|
+
],
|
|
605
|
+
"name": "buy",
|
|
606
|
+
"outputs": [],
|
|
607
|
+
"stateMutability": "nonpayable",
|
|
608
|
+
"type": "function"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"inputs": [],
|
|
612
|
+
"name": "cType",
|
|
613
|
+
"outputs": [
|
|
614
|
+
{
|
|
615
|
+
"internalType": "uint8",
|
|
616
|
+
"name": "",
|
|
617
|
+
"type": "uint8"
|
|
618
|
+
}
|
|
619
|
+
],
|
|
620
|
+
"stateMutability": "view",
|
|
621
|
+
"type": "function"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"inputs": [],
|
|
625
|
+
"name": "endTime",
|
|
626
|
+
"outputs": [
|
|
627
|
+
{
|
|
628
|
+
"internalType": "uint256",
|
|
629
|
+
"name": "",
|
|
630
|
+
"type": "uint256"
|
|
631
|
+
}
|
|
632
|
+
],
|
|
633
|
+
"stateMutability": "view",
|
|
634
|
+
"type": "function"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"inputs": [],
|
|
638
|
+
"name": "ernTreasure",
|
|
639
|
+
"outputs": [
|
|
640
|
+
{
|
|
641
|
+
"internalType": "address",
|
|
642
|
+
"name": "",
|
|
643
|
+
"type": "address"
|
|
644
|
+
}
|
|
645
|
+
],
|
|
646
|
+
"stateMutability": "view",
|
|
647
|
+
"type": "function"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"inputs": [],
|
|
651
|
+
"name": "facAddress",
|
|
652
|
+
"outputs": [
|
|
653
|
+
{
|
|
654
|
+
"internalType": "address",
|
|
655
|
+
"name": "",
|
|
656
|
+
"type": "address"
|
|
657
|
+
}
|
|
658
|
+
],
|
|
659
|
+
"stateMutability": "view",
|
|
660
|
+
"type": "function"
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"inputs": [],
|
|
664
|
+
"name": "getCardPrice",
|
|
665
|
+
"outputs": [
|
|
666
|
+
{
|
|
667
|
+
"internalType": "uint256",
|
|
668
|
+
"name": "",
|
|
669
|
+
"type": "uint256"
|
|
670
|
+
}
|
|
671
|
+
],
|
|
672
|
+
"stateMutability": "view",
|
|
673
|
+
"type": "function"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"inputs": [
|
|
677
|
+
{
|
|
678
|
+
"internalType": "bytes32",
|
|
679
|
+
"name": "role",
|
|
680
|
+
"type": "bytes32"
|
|
681
|
+
}
|
|
682
|
+
],
|
|
683
|
+
"name": "getRoleAdmin",
|
|
684
|
+
"outputs": [
|
|
685
|
+
{
|
|
686
|
+
"internalType": "bytes32",
|
|
687
|
+
"name": "",
|
|
688
|
+
"type": "bytes32"
|
|
689
|
+
}
|
|
690
|
+
],
|
|
691
|
+
"stateMutability": "view",
|
|
692
|
+
"type": "function"
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"inputs": [],
|
|
696
|
+
"name": "getTokenPrice",
|
|
697
|
+
"outputs": [
|
|
698
|
+
{
|
|
699
|
+
"internalType": "uint256",
|
|
700
|
+
"name": "",
|
|
701
|
+
"type": "uint256"
|
|
702
|
+
}
|
|
703
|
+
],
|
|
704
|
+
"stateMutability": "view",
|
|
705
|
+
"type": "function"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"inputs": [
|
|
709
|
+
{
|
|
710
|
+
"internalType": "bytes32",
|
|
711
|
+
"name": "role",
|
|
712
|
+
"type": "bytes32"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"internalType": "address",
|
|
716
|
+
"name": "account",
|
|
717
|
+
"type": "address"
|
|
718
|
+
}
|
|
719
|
+
],
|
|
720
|
+
"name": "grantRole",
|
|
721
|
+
"outputs": [],
|
|
722
|
+
"stateMutability": "nonpayable",
|
|
723
|
+
"type": "function"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"inputs": [
|
|
727
|
+
{
|
|
728
|
+
"internalType": "bytes32",
|
|
729
|
+
"name": "role",
|
|
730
|
+
"type": "bytes32"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"internalType": "address",
|
|
734
|
+
"name": "account",
|
|
735
|
+
"type": "address"
|
|
736
|
+
}
|
|
737
|
+
],
|
|
738
|
+
"name": "hasRole",
|
|
739
|
+
"outputs": [
|
|
740
|
+
{
|
|
741
|
+
"internalType": "bool",
|
|
742
|
+
"name": "",
|
|
743
|
+
"type": "bool"
|
|
744
|
+
}
|
|
745
|
+
],
|
|
746
|
+
"stateMutability": "view",
|
|
747
|
+
"type": "function"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"inputs": [
|
|
751
|
+
{
|
|
752
|
+
"internalType": "address",
|
|
753
|
+
"name": "account",
|
|
754
|
+
"type": "address"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"internalType": "address",
|
|
758
|
+
"name": "operator",
|
|
759
|
+
"type": "address"
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
"name": "isApprovedForAll",
|
|
763
|
+
"outputs": [
|
|
764
|
+
{
|
|
765
|
+
"internalType": "bool",
|
|
766
|
+
"name": "",
|
|
767
|
+
"type": "bool"
|
|
768
|
+
}
|
|
769
|
+
],
|
|
770
|
+
"stateMutability": "view",
|
|
771
|
+
"type": "function"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"inputs": [
|
|
775
|
+
{
|
|
776
|
+
"internalType": "address",
|
|
777
|
+
"name": "to",
|
|
778
|
+
"type": "address"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"internalType": "uint256",
|
|
782
|
+
"name": "_id",
|
|
783
|
+
"type": "uint256"
|
|
784
|
+
}
|
|
785
|
+
],
|
|
786
|
+
"name": "mint",
|
|
787
|
+
"outputs": [],
|
|
788
|
+
"stateMutability": "nonpayable",
|
|
789
|
+
"type": "function"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"inputs": [
|
|
793
|
+
{
|
|
794
|
+
"internalType": "address",
|
|
795
|
+
"name": "to",
|
|
796
|
+
"type": "address"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"internalType": "uint256[]",
|
|
800
|
+
"name": "ids",
|
|
801
|
+
"type": "uint256[]"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
"internalType": "uint256[]",
|
|
805
|
+
"name": "amount_",
|
|
806
|
+
"type": "uint256[]"
|
|
807
|
+
}
|
|
808
|
+
],
|
|
809
|
+
"name": "mintBatch",
|
|
810
|
+
"outputs": [],
|
|
811
|
+
"stateMutability": "nonpayable",
|
|
812
|
+
"type": "function"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"inputs": [],
|
|
816
|
+
"name": "moneyHand",
|
|
817
|
+
"outputs": [
|
|
818
|
+
{
|
|
819
|
+
"internalType": "contract MoneyHandler",
|
|
820
|
+
"name": "",
|
|
821
|
+
"type": "address"
|
|
822
|
+
}
|
|
823
|
+
],
|
|
824
|
+
"stateMutability": "view",
|
|
825
|
+
"type": "function"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"inputs": [],
|
|
829
|
+
"name": "percent",
|
|
830
|
+
"outputs": [
|
|
831
|
+
{
|
|
832
|
+
"internalType": "uint256",
|
|
833
|
+
"name": "",
|
|
834
|
+
"type": "uint256"
|
|
835
|
+
}
|
|
836
|
+
],
|
|
837
|
+
"stateMutability": "view",
|
|
838
|
+
"type": "function"
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"inputs": [
|
|
842
|
+
{
|
|
843
|
+
"internalType": "address",
|
|
844
|
+
"name": "_token",
|
|
845
|
+
"type": "address"
|
|
846
|
+
}
|
|
847
|
+
],
|
|
848
|
+
"name": "recoverToken",
|
|
849
|
+
"outputs": [],
|
|
850
|
+
"stateMutability": "nonpayable",
|
|
851
|
+
"type": "function"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"inputs": [
|
|
855
|
+
{
|
|
856
|
+
"internalType": "bytes32",
|
|
857
|
+
"name": "role",
|
|
858
|
+
"type": "bytes32"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"internalType": "address",
|
|
862
|
+
"name": "account",
|
|
863
|
+
"type": "address"
|
|
864
|
+
}
|
|
865
|
+
],
|
|
866
|
+
"name": "renounceRole",
|
|
867
|
+
"outputs": [],
|
|
868
|
+
"stateMutability": "nonpayable",
|
|
869
|
+
"type": "function"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"inputs": [
|
|
873
|
+
{
|
|
874
|
+
"internalType": "bytes32",
|
|
875
|
+
"name": "role",
|
|
876
|
+
"type": "bytes32"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"internalType": "address",
|
|
880
|
+
"name": "account",
|
|
881
|
+
"type": "address"
|
|
882
|
+
}
|
|
883
|
+
],
|
|
884
|
+
"name": "revokeRole",
|
|
885
|
+
"outputs": [],
|
|
886
|
+
"stateMutability": "nonpayable",
|
|
887
|
+
"type": "function"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"inputs": [
|
|
891
|
+
{
|
|
892
|
+
"internalType": "address",
|
|
893
|
+
"name": "from",
|
|
894
|
+
"type": "address"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"internalType": "address",
|
|
898
|
+
"name": "to",
|
|
899
|
+
"type": "address"
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
"internalType": "uint256[]",
|
|
903
|
+
"name": "ids",
|
|
904
|
+
"type": "uint256[]"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
"internalType": "uint256[]",
|
|
908
|
+
"name": "amounts",
|
|
909
|
+
"type": "uint256[]"
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
"internalType": "bytes",
|
|
913
|
+
"name": "data",
|
|
914
|
+
"type": "bytes"
|
|
915
|
+
}
|
|
916
|
+
],
|
|
917
|
+
"name": "safeBatchTransferFrom",
|
|
918
|
+
"outputs": [],
|
|
919
|
+
"stateMutability": "nonpayable",
|
|
920
|
+
"type": "function"
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"inputs": [
|
|
924
|
+
{
|
|
925
|
+
"internalType": "address",
|
|
926
|
+
"name": "from",
|
|
927
|
+
"type": "address"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
"internalType": "address",
|
|
931
|
+
"name": "to",
|
|
932
|
+
"type": "address"
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
"internalType": "uint256",
|
|
936
|
+
"name": "id",
|
|
937
|
+
"type": "uint256"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"internalType": "uint256",
|
|
941
|
+
"name": "amount",
|
|
942
|
+
"type": "uint256"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
"internalType": "bytes",
|
|
946
|
+
"name": "data",
|
|
947
|
+
"type": "bytes"
|
|
948
|
+
}
|
|
949
|
+
],
|
|
950
|
+
"name": "safeTransferFrom",
|
|
951
|
+
"outputs": [],
|
|
952
|
+
"stateMutability": "nonpayable",
|
|
953
|
+
"type": "function"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"inputs": [
|
|
957
|
+
{
|
|
958
|
+
"internalType": "uint256",
|
|
959
|
+
"name": "_newAmount",
|
|
960
|
+
"type": "uint256"
|
|
961
|
+
}
|
|
962
|
+
],
|
|
963
|
+
"name": "setAmount",
|
|
964
|
+
"outputs": [],
|
|
965
|
+
"stateMutability": "nonpayable",
|
|
966
|
+
"type": "function"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
"inputs": [
|
|
970
|
+
{
|
|
971
|
+
"internalType": "address",
|
|
972
|
+
"name": "operator",
|
|
973
|
+
"type": "address"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
"internalType": "bool",
|
|
977
|
+
"name": "approved",
|
|
978
|
+
"type": "bool"
|
|
979
|
+
}
|
|
980
|
+
],
|
|
981
|
+
"name": "setApprovalForAll",
|
|
982
|
+
"outputs": [],
|
|
983
|
+
"stateMutability": "nonpayable",
|
|
984
|
+
"type": "function"
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
"inputs": [
|
|
988
|
+
{
|
|
989
|
+
"internalType": "uint256",
|
|
990
|
+
"name": "_endTime",
|
|
991
|
+
"type": "uint256"
|
|
992
|
+
}
|
|
993
|
+
],
|
|
994
|
+
"name": "setEndTime",
|
|
995
|
+
"outputs": [],
|
|
996
|
+
"stateMutability": "nonpayable",
|
|
997
|
+
"type": "function"
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"inputs": [
|
|
1001
|
+
{
|
|
1002
|
+
"internalType": "uint256",
|
|
1003
|
+
"name": "_starTime",
|
|
1004
|
+
"type": "uint256"
|
|
1005
|
+
}
|
|
1006
|
+
],
|
|
1007
|
+
"name": "setStarTime",
|
|
1008
|
+
"outputs": [],
|
|
1009
|
+
"stateMutability": "nonpayable",
|
|
1010
|
+
"type": "function"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"inputs": [],
|
|
1014
|
+
"name": "sold",
|
|
1015
|
+
"outputs": [
|
|
1016
|
+
{
|
|
1017
|
+
"internalType": "uint256",
|
|
1018
|
+
"name": "",
|
|
1019
|
+
"type": "uint256"
|
|
1020
|
+
}
|
|
1021
|
+
],
|
|
1022
|
+
"stateMutability": "view",
|
|
1023
|
+
"type": "function"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
"inputs": [],
|
|
1027
|
+
"name": "startTime",
|
|
1028
|
+
"outputs": [
|
|
1029
|
+
{
|
|
1030
|
+
"internalType": "uint256",
|
|
1031
|
+
"name": "",
|
|
1032
|
+
"type": "uint256"
|
|
1033
|
+
}
|
|
1034
|
+
],
|
|
1035
|
+
"stateMutability": "view",
|
|
1036
|
+
"type": "function"
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
"inputs": [],
|
|
1040
|
+
"name": "stone",
|
|
1041
|
+
"outputs": [
|
|
1042
|
+
{
|
|
1043
|
+
"internalType": "contract FarmV2",
|
|
1044
|
+
"name": "",
|
|
1045
|
+
"type": "address"
|
|
1046
|
+
}
|
|
1047
|
+
],
|
|
1048
|
+
"stateMutability": "view",
|
|
1049
|
+
"type": "function"
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"inputs": [
|
|
1053
|
+
{
|
|
1054
|
+
"internalType": "bytes4",
|
|
1055
|
+
"name": "interfaceId",
|
|
1056
|
+
"type": "bytes4"
|
|
1057
|
+
}
|
|
1058
|
+
],
|
|
1059
|
+
"name": "supportsInterface",
|
|
1060
|
+
"outputs": [
|
|
1061
|
+
{
|
|
1062
|
+
"internalType": "bool",
|
|
1063
|
+
"name": "",
|
|
1064
|
+
"type": "bool"
|
|
1065
|
+
}
|
|
1066
|
+
],
|
|
1067
|
+
"stateMutability": "view",
|
|
1068
|
+
"type": "function"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"inputs": [],
|
|
1072
|
+
"name": "token",
|
|
1073
|
+
"outputs": [
|
|
1074
|
+
{
|
|
1075
|
+
"internalType": "contract IERC20",
|
|
1076
|
+
"name": "",
|
|
1077
|
+
"type": "address"
|
|
1078
|
+
}
|
|
1079
|
+
],
|
|
1080
|
+
"stateMutability": "view",
|
|
1081
|
+
"type": "function"
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"inputs": [],
|
|
1085
|
+
"name": "total",
|
|
1086
|
+
"outputs": [
|
|
1087
|
+
{
|
|
1088
|
+
"internalType": "uint256",
|
|
1089
|
+
"name": "",
|
|
1090
|
+
"type": "uint256"
|
|
1091
|
+
}
|
|
1092
|
+
],
|
|
1093
|
+
"stateMutability": "view",
|
|
1094
|
+
"type": "function"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"inputs": [
|
|
1098
|
+
{
|
|
1099
|
+
"internalType": "uint256",
|
|
1100
|
+
"name": "",
|
|
1101
|
+
"type": "uint256"
|
|
1102
|
+
}
|
|
1103
|
+
],
|
|
1104
|
+
"name": "uri",
|
|
1105
|
+
"outputs": [
|
|
1106
|
+
{
|
|
1107
|
+
"internalType": "string",
|
|
1108
|
+
"name": "",
|
|
1109
|
+
"type": "string"
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
"stateMutability": "view",
|
|
1113
|
+
"type": "function"
|
|
1114
|
+
}
|
|
1115
|
+
] as const satisfies Abi;
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Type-safe ABI for CollectionV2_json
|
|
1119
|
+
*/
|
|
1120
|
+
export type CollectionV2_jsonAbi = typeof CollectionV2_jsonAbi;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Contract instance type for CollectionV2_json
|
|
1124
|
+
*/
|
|
1125
|
+
// Use any for contract type to avoid complex viem type issues
|
|
1126
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
1127
|
+
export type CollectionV2_jsonContract = any;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* CollectionV2_json Contract Class
|
|
1131
|
+
*
|
|
1132
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1133
|
+
*
|
|
1134
|
+
* @example
|
|
1135
|
+
* ```typescript
|
|
1136
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1137
|
+
* import { mainnet } from 'viem/chains';
|
|
1138
|
+
* import { CollectionV2_json } from 'CollectionV2_json';
|
|
1139
|
+
*
|
|
1140
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1141
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1142
|
+
*
|
|
1143
|
+
* const contract = new CollectionV2_json('0x...', { publicClient, walletClient });
|
|
1144
|
+
*
|
|
1145
|
+
* // Read functions
|
|
1146
|
+
* const result = await contract.balanceOf('0x...');
|
|
1147
|
+
*
|
|
1148
|
+
* // Write functions
|
|
1149
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1150
|
+
*
|
|
1151
|
+
* // Simulate transactions (dry-run)
|
|
1152
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1153
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1154
|
+
*
|
|
1155
|
+
* // Watch events
|
|
1156
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1157
|
+
* console.log('Transfer event:', event);
|
|
1158
|
+
* });
|
|
1159
|
+
* ```
|
|
1160
|
+
*/
|
|
1161
|
+
export class CollectionV2_json {
|
|
1162
|
+
private contract: CollectionV2_jsonContract;
|
|
1163
|
+
private contractAddress: Address;
|
|
1164
|
+
private publicClient: PublicClient;
|
|
1165
|
+
|
|
1166
|
+
constructor(
|
|
1167
|
+
address: Address,
|
|
1168
|
+
clients: {
|
|
1169
|
+
publicClient: PublicClient;
|
|
1170
|
+
walletClient?: WalletClient;
|
|
1171
|
+
}
|
|
1172
|
+
) {
|
|
1173
|
+
this.contractAddress = address;
|
|
1174
|
+
this.publicClient = clients.publicClient;
|
|
1175
|
+
this.contract = getContract({
|
|
1176
|
+
address,
|
|
1177
|
+
abi: CollectionV2_jsonAbi,
|
|
1178
|
+
client: {
|
|
1179
|
+
public: clients.publicClient,
|
|
1180
|
+
wallet: clients.walletClient,
|
|
1181
|
+
},
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Get the contract address
|
|
1187
|
+
*/
|
|
1188
|
+
get address(): Address {
|
|
1189
|
+
return this.contractAddress;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Get the underlying viem contract instance
|
|
1194
|
+
*/
|
|
1195
|
+
getContract(): CollectionV2_jsonContract {
|
|
1196
|
+
return this.contract;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* DEFAULT_ADMIN_ROLE
|
|
1201
|
+
* view
|
|
1202
|
+
*/
|
|
1203
|
+
async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
|
|
1204
|
+
return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* MINTER_ROLE
|
|
1209
|
+
* view
|
|
1210
|
+
*/
|
|
1211
|
+
async MINTER_ROLE(): Promise<`0x${string}`> {
|
|
1212
|
+
return this.contract.read.MINTER_ROLE() as Promise<`0x${string}`>;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* amount
|
|
1217
|
+
* view
|
|
1218
|
+
*/
|
|
1219
|
+
async amount(): Promise<bigint> {
|
|
1220
|
+
return this.contract.read.amount() as Promise<bigint>;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* available
|
|
1225
|
+
* view
|
|
1226
|
+
*/
|
|
1227
|
+
async available(): Promise<bigint> {
|
|
1228
|
+
return this.contract.read.available() as Promise<bigint>;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* balanceOf
|
|
1233
|
+
* view
|
|
1234
|
+
*/
|
|
1235
|
+
async balanceOf(account: `0x${string}`, id: bigint): Promise<bigint> {
|
|
1236
|
+
return this.contract.read.balanceOf([account, id] as const) as Promise<bigint>;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* balanceOfBatch
|
|
1241
|
+
* view
|
|
1242
|
+
*/
|
|
1243
|
+
async balanceOfBatch(accounts: `0x${string}`[], ids: bigint[]): Promise<bigint[]> {
|
|
1244
|
+
return this.contract.read.balanceOfBatch([accounts, ids] as const) as Promise<bigint[]>;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* cType
|
|
1249
|
+
* view
|
|
1250
|
+
*/
|
|
1251
|
+
async cType(): Promise<bigint> {
|
|
1252
|
+
return this.contract.read.cType() as Promise<bigint>;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* endTime
|
|
1257
|
+
* view
|
|
1258
|
+
*/
|
|
1259
|
+
async endTime(): Promise<bigint> {
|
|
1260
|
+
return this.contract.read.endTime() as Promise<bigint>;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* ernTreasure
|
|
1265
|
+
* view
|
|
1266
|
+
*/
|
|
1267
|
+
async ernTreasure(): Promise<`0x${string}`> {
|
|
1268
|
+
return this.contract.read.ernTreasure() as Promise<`0x${string}`>;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* facAddress
|
|
1273
|
+
* view
|
|
1274
|
+
*/
|
|
1275
|
+
async facAddress(): Promise<`0x${string}`> {
|
|
1276
|
+
return this.contract.read.facAddress() as Promise<`0x${string}`>;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* getCardPrice
|
|
1281
|
+
* view
|
|
1282
|
+
*/
|
|
1283
|
+
async getCardPrice(): Promise<bigint> {
|
|
1284
|
+
return this.contract.read.getCardPrice() as Promise<bigint>;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
/**
|
|
1288
|
+
* getRoleAdmin
|
|
1289
|
+
* view
|
|
1290
|
+
*/
|
|
1291
|
+
async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
|
|
1292
|
+
return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/**
|
|
1296
|
+
* getTokenPrice
|
|
1297
|
+
* view
|
|
1298
|
+
*/
|
|
1299
|
+
async getTokenPrice(): Promise<bigint> {
|
|
1300
|
+
return this.contract.read.getTokenPrice() as Promise<bigint>;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* hasRole
|
|
1305
|
+
* view
|
|
1306
|
+
*/
|
|
1307
|
+
async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
|
|
1308
|
+
return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* isApprovedForAll
|
|
1313
|
+
* view
|
|
1314
|
+
*/
|
|
1315
|
+
async isApprovedForAll(account: `0x${string}`, operator: `0x${string}`): Promise<boolean> {
|
|
1316
|
+
return this.contract.read.isApprovedForAll([account, operator] as const) as Promise<boolean>;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* moneyHand
|
|
1321
|
+
* view
|
|
1322
|
+
*/
|
|
1323
|
+
async moneyHand(): Promise<`0x${string}`> {
|
|
1324
|
+
return this.contract.read.moneyHand() as Promise<`0x${string}`>;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* percent
|
|
1329
|
+
* view
|
|
1330
|
+
*/
|
|
1331
|
+
async percent(): Promise<bigint> {
|
|
1332
|
+
return this.contract.read.percent() as Promise<bigint>;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* sold
|
|
1337
|
+
* view
|
|
1338
|
+
*/
|
|
1339
|
+
async sold(): Promise<bigint> {
|
|
1340
|
+
return this.contract.read.sold() as Promise<bigint>;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* startTime
|
|
1345
|
+
* view
|
|
1346
|
+
*/
|
|
1347
|
+
async startTime(): Promise<bigint> {
|
|
1348
|
+
return this.contract.read.startTime() as Promise<bigint>;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* stone
|
|
1353
|
+
* view
|
|
1354
|
+
*/
|
|
1355
|
+
async stone(): Promise<`0x${string}`> {
|
|
1356
|
+
return this.contract.read.stone() as Promise<`0x${string}`>;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* supportsInterface
|
|
1361
|
+
* view
|
|
1362
|
+
*/
|
|
1363
|
+
async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
|
|
1364
|
+
return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* token
|
|
1369
|
+
* view
|
|
1370
|
+
*/
|
|
1371
|
+
async token(): Promise<`0x${string}`> {
|
|
1372
|
+
return this.contract.read.token() as Promise<`0x${string}`>;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* total
|
|
1377
|
+
* view
|
|
1378
|
+
*/
|
|
1379
|
+
async total(): Promise<bigint> {
|
|
1380
|
+
return this.contract.read.total() as Promise<bigint>;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* uri
|
|
1385
|
+
* view
|
|
1386
|
+
*/
|
|
1387
|
+
async uri(arg0: bigint): Promise<string> {
|
|
1388
|
+
return this.contract.read.uri([arg0] as const) as Promise<string>;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* addExternalAddresses
|
|
1393
|
+
* nonpayable
|
|
1394
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1395
|
+
*/
|
|
1396
|
+
async addExternalAddresses(_token: `0x${string}`, _stone: `0x${string}`, _treasury: `0x${string}`, _moneyHandler: `0x${string}`, options?: {
|
|
1397
|
+
accessList?: import('viem').AccessList;
|
|
1398
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1399
|
+
chain?: import('viem').Chain | null;
|
|
1400
|
+
dataSuffix?: `0x${string}`;
|
|
1401
|
+
gas?: bigint;
|
|
1402
|
+
gasPrice?: bigint;
|
|
1403
|
+
maxFeePerGas?: bigint;
|
|
1404
|
+
maxPriorityFeePerGas?: bigint;
|
|
1405
|
+
nonce?: number;
|
|
1406
|
+
value?: bigint;
|
|
1407
|
+
}): Promise<`0x${string}`> {
|
|
1408
|
+
if (!this.contract.write) {
|
|
1409
|
+
throw new Error('Wallet client is required for write operations');
|
|
1410
|
+
}
|
|
1411
|
+
return this.contract.write.addExternalAddresses([_token, _stone, _treasury, _moneyHandler] as const, options) as Promise<`0x${string}`>;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* buy
|
|
1416
|
+
* nonpayable
|
|
1417
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1418
|
+
*/
|
|
1419
|
+
async buy(buyer: `0x${string}`, _id: bigint, options?: {
|
|
1420
|
+
accessList?: import('viem').AccessList;
|
|
1421
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1422
|
+
chain?: import('viem').Chain | null;
|
|
1423
|
+
dataSuffix?: `0x${string}`;
|
|
1424
|
+
gas?: bigint;
|
|
1425
|
+
gasPrice?: bigint;
|
|
1426
|
+
maxFeePerGas?: bigint;
|
|
1427
|
+
maxPriorityFeePerGas?: bigint;
|
|
1428
|
+
nonce?: number;
|
|
1429
|
+
value?: bigint;
|
|
1430
|
+
}): Promise<`0x${string}`> {
|
|
1431
|
+
if (!this.contract.write) {
|
|
1432
|
+
throw new Error('Wallet client is required for write operations');
|
|
1433
|
+
}
|
|
1434
|
+
return this.contract.write.buy([buyer, _id] as const, options) as Promise<`0x${string}`>;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* grantRole
|
|
1439
|
+
* nonpayable
|
|
1440
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1441
|
+
*/
|
|
1442
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1443
|
+
accessList?: import('viem').AccessList;
|
|
1444
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1445
|
+
chain?: import('viem').Chain | null;
|
|
1446
|
+
dataSuffix?: `0x${string}`;
|
|
1447
|
+
gas?: bigint;
|
|
1448
|
+
gasPrice?: bigint;
|
|
1449
|
+
maxFeePerGas?: bigint;
|
|
1450
|
+
maxPriorityFeePerGas?: bigint;
|
|
1451
|
+
nonce?: number;
|
|
1452
|
+
value?: bigint;
|
|
1453
|
+
}): Promise<`0x${string}`> {
|
|
1454
|
+
if (!this.contract.write) {
|
|
1455
|
+
throw new Error('Wallet client is required for write operations');
|
|
1456
|
+
}
|
|
1457
|
+
return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* mint
|
|
1462
|
+
* nonpayable
|
|
1463
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1464
|
+
*/
|
|
1465
|
+
async mint(to: `0x${string}`, _id: bigint, options?: {
|
|
1466
|
+
accessList?: import('viem').AccessList;
|
|
1467
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1468
|
+
chain?: import('viem').Chain | null;
|
|
1469
|
+
dataSuffix?: `0x${string}`;
|
|
1470
|
+
gas?: bigint;
|
|
1471
|
+
gasPrice?: bigint;
|
|
1472
|
+
maxFeePerGas?: bigint;
|
|
1473
|
+
maxPriorityFeePerGas?: bigint;
|
|
1474
|
+
nonce?: number;
|
|
1475
|
+
value?: bigint;
|
|
1476
|
+
}): Promise<`0x${string}`> {
|
|
1477
|
+
if (!this.contract.write) {
|
|
1478
|
+
throw new Error('Wallet client is required for write operations');
|
|
1479
|
+
}
|
|
1480
|
+
return this.contract.write.mint([to, _id] as const, options) as Promise<`0x${string}`>;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* mintBatch
|
|
1485
|
+
* nonpayable
|
|
1486
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1487
|
+
*/
|
|
1488
|
+
async mintBatch(to: `0x${string}`, ids: bigint[], amount_: bigint[], options?: {
|
|
1489
|
+
accessList?: import('viem').AccessList;
|
|
1490
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1491
|
+
chain?: import('viem').Chain | null;
|
|
1492
|
+
dataSuffix?: `0x${string}`;
|
|
1493
|
+
gas?: bigint;
|
|
1494
|
+
gasPrice?: bigint;
|
|
1495
|
+
maxFeePerGas?: bigint;
|
|
1496
|
+
maxPriorityFeePerGas?: bigint;
|
|
1497
|
+
nonce?: number;
|
|
1498
|
+
value?: bigint;
|
|
1499
|
+
}): Promise<`0x${string}`> {
|
|
1500
|
+
if (!this.contract.write) {
|
|
1501
|
+
throw new Error('Wallet client is required for write operations');
|
|
1502
|
+
}
|
|
1503
|
+
return this.contract.write.mintBatch([to, ids, amount_] as const, options) as Promise<`0x${string}`>;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* recoverToken
|
|
1508
|
+
* nonpayable
|
|
1509
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1510
|
+
*/
|
|
1511
|
+
async recoverToken(_token: `0x${string}`, 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<`0x${string}`> {
|
|
1523
|
+
if (!this.contract.write) {
|
|
1524
|
+
throw new Error('Wallet client is required for write operations');
|
|
1525
|
+
}
|
|
1526
|
+
return this.contract.write.recoverToken([_token] as const, options) as Promise<`0x${string}`>;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* renounceRole
|
|
1531
|
+
* nonpayable
|
|
1532
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1533
|
+
*/
|
|
1534
|
+
async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1535
|
+
accessList?: import('viem').AccessList;
|
|
1536
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1537
|
+
chain?: import('viem').Chain | null;
|
|
1538
|
+
dataSuffix?: `0x${string}`;
|
|
1539
|
+
gas?: bigint;
|
|
1540
|
+
gasPrice?: bigint;
|
|
1541
|
+
maxFeePerGas?: bigint;
|
|
1542
|
+
maxPriorityFeePerGas?: bigint;
|
|
1543
|
+
nonce?: number;
|
|
1544
|
+
value?: bigint;
|
|
1545
|
+
}): Promise<`0x${string}`> {
|
|
1546
|
+
if (!this.contract.write) {
|
|
1547
|
+
throw new Error('Wallet client is required for write operations');
|
|
1548
|
+
}
|
|
1549
|
+
return this.contract.write.renounceRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* revokeRole
|
|
1554
|
+
* nonpayable
|
|
1555
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1556
|
+
*/
|
|
1557
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, 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<`0x${string}`> {
|
|
1569
|
+
if (!this.contract.write) {
|
|
1570
|
+
throw new Error('Wallet client is required for write operations');
|
|
1571
|
+
}
|
|
1572
|
+
return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* safeBatchTransferFrom
|
|
1577
|
+
* nonpayable
|
|
1578
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1579
|
+
*/
|
|
1580
|
+
async safeBatchTransferFrom(from: `0x${string}`, to: `0x${string}`, ids: bigint[], amounts: bigint[], data: `0x${string}`, options?: {
|
|
1581
|
+
accessList?: import('viem').AccessList;
|
|
1582
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1583
|
+
chain?: import('viem').Chain | null;
|
|
1584
|
+
dataSuffix?: `0x${string}`;
|
|
1585
|
+
gas?: bigint;
|
|
1586
|
+
gasPrice?: bigint;
|
|
1587
|
+
maxFeePerGas?: bigint;
|
|
1588
|
+
maxPriorityFeePerGas?: bigint;
|
|
1589
|
+
nonce?: number;
|
|
1590
|
+
value?: bigint;
|
|
1591
|
+
}): Promise<`0x${string}`> {
|
|
1592
|
+
if (!this.contract.write) {
|
|
1593
|
+
throw new Error('Wallet client is required for write operations');
|
|
1594
|
+
}
|
|
1595
|
+
return this.contract.write.safeBatchTransferFrom([from, to, ids, amounts, data] as const, options) as Promise<`0x${string}`>;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* safeTransferFrom
|
|
1600
|
+
* nonpayable
|
|
1601
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1602
|
+
*/
|
|
1603
|
+
async safeTransferFrom(from: `0x${string}`, to: `0x${string}`, id: bigint, amount: bigint, data: `0x${string}`, options?: {
|
|
1604
|
+
accessList?: import('viem').AccessList;
|
|
1605
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1606
|
+
chain?: import('viem').Chain | null;
|
|
1607
|
+
dataSuffix?: `0x${string}`;
|
|
1608
|
+
gas?: bigint;
|
|
1609
|
+
gasPrice?: bigint;
|
|
1610
|
+
maxFeePerGas?: bigint;
|
|
1611
|
+
maxPriorityFeePerGas?: bigint;
|
|
1612
|
+
nonce?: number;
|
|
1613
|
+
value?: bigint;
|
|
1614
|
+
}): Promise<`0x${string}`> {
|
|
1615
|
+
if (!this.contract.write) {
|
|
1616
|
+
throw new Error('Wallet client is required for write operations');
|
|
1617
|
+
}
|
|
1618
|
+
return this.contract.write.safeTransferFrom([from, to, id, amount, data] as const, options) as Promise<`0x${string}`>;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* setAmount
|
|
1623
|
+
* nonpayable
|
|
1624
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1625
|
+
*/
|
|
1626
|
+
async setAmount(_newAmount: bigint, options?: {
|
|
1627
|
+
accessList?: import('viem').AccessList;
|
|
1628
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1629
|
+
chain?: import('viem').Chain | null;
|
|
1630
|
+
dataSuffix?: `0x${string}`;
|
|
1631
|
+
gas?: bigint;
|
|
1632
|
+
gasPrice?: bigint;
|
|
1633
|
+
maxFeePerGas?: bigint;
|
|
1634
|
+
maxPriorityFeePerGas?: bigint;
|
|
1635
|
+
nonce?: number;
|
|
1636
|
+
value?: bigint;
|
|
1637
|
+
}): Promise<`0x${string}`> {
|
|
1638
|
+
if (!this.contract.write) {
|
|
1639
|
+
throw new Error('Wallet client is required for write operations');
|
|
1640
|
+
}
|
|
1641
|
+
return this.contract.write.setAmount([_newAmount] as const, options) as Promise<`0x${string}`>;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* setApprovalForAll
|
|
1646
|
+
* nonpayable
|
|
1647
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1648
|
+
*/
|
|
1649
|
+
async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
|
|
1650
|
+
accessList?: import('viem').AccessList;
|
|
1651
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1652
|
+
chain?: import('viem').Chain | null;
|
|
1653
|
+
dataSuffix?: `0x${string}`;
|
|
1654
|
+
gas?: bigint;
|
|
1655
|
+
gasPrice?: bigint;
|
|
1656
|
+
maxFeePerGas?: bigint;
|
|
1657
|
+
maxPriorityFeePerGas?: bigint;
|
|
1658
|
+
nonce?: number;
|
|
1659
|
+
value?: bigint;
|
|
1660
|
+
}): Promise<`0x${string}`> {
|
|
1661
|
+
if (!this.contract.write) {
|
|
1662
|
+
throw new Error('Wallet client is required for write operations');
|
|
1663
|
+
}
|
|
1664
|
+
return this.contract.write.setApprovalForAll([operator, approved] as const, options) as Promise<`0x${string}`>;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* setEndTime
|
|
1669
|
+
* nonpayable
|
|
1670
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1671
|
+
*/
|
|
1672
|
+
async setEndTime(_endTime: bigint, options?: {
|
|
1673
|
+
accessList?: import('viem').AccessList;
|
|
1674
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1675
|
+
chain?: import('viem').Chain | null;
|
|
1676
|
+
dataSuffix?: `0x${string}`;
|
|
1677
|
+
gas?: bigint;
|
|
1678
|
+
gasPrice?: bigint;
|
|
1679
|
+
maxFeePerGas?: bigint;
|
|
1680
|
+
maxPriorityFeePerGas?: bigint;
|
|
1681
|
+
nonce?: number;
|
|
1682
|
+
value?: bigint;
|
|
1683
|
+
}): Promise<`0x${string}`> {
|
|
1684
|
+
if (!this.contract.write) {
|
|
1685
|
+
throw new Error('Wallet client is required for write operations');
|
|
1686
|
+
}
|
|
1687
|
+
return this.contract.write.setEndTime([_endTime] as const, options) as Promise<`0x${string}`>;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* setStarTime
|
|
1692
|
+
* nonpayable
|
|
1693
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1694
|
+
*/
|
|
1695
|
+
async setStarTime(_starTime: bigint, options?: {
|
|
1696
|
+
accessList?: import('viem').AccessList;
|
|
1697
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1698
|
+
chain?: import('viem').Chain | null;
|
|
1699
|
+
dataSuffix?: `0x${string}`;
|
|
1700
|
+
gas?: bigint;
|
|
1701
|
+
gasPrice?: bigint;
|
|
1702
|
+
maxFeePerGas?: bigint;
|
|
1703
|
+
maxPriorityFeePerGas?: bigint;
|
|
1704
|
+
nonce?: number;
|
|
1705
|
+
value?: bigint;
|
|
1706
|
+
}): Promise<`0x${string}`> {
|
|
1707
|
+
if (!this.contract.write) {
|
|
1708
|
+
throw new Error('Wallet client is required for write operations');
|
|
1709
|
+
}
|
|
1710
|
+
return this.contract.write.setStarTime([_starTime] as const, options) as Promise<`0x${string}`>;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1717
|
+
*
|
|
1718
|
+
* @example
|
|
1719
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1720
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1721
|
+
* console.log('Would succeed:', result.result);
|
|
1722
|
+
*/
|
|
1723
|
+
get simulate() {
|
|
1724
|
+
const contract = this.contract;
|
|
1725
|
+
if (!contract.simulate) {
|
|
1726
|
+
throw new Error('Public client is required for simulation');
|
|
1727
|
+
}
|
|
1728
|
+
return {
|
|
1729
|
+
/**
|
|
1730
|
+
* Simulate addExternalAddresses
|
|
1731
|
+
* Returns gas estimate and result without sending transaction
|
|
1732
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1733
|
+
*/
|
|
1734
|
+
async addExternalAddresses(_token: `0x${string}`, _stone: `0x${string}`, _treasury: `0x${string}`, _moneyHandler: `0x${string}`, options?: {
|
|
1735
|
+
accessList?: import('viem').AccessList;
|
|
1736
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1737
|
+
chain?: import('viem').Chain | null;
|
|
1738
|
+
dataSuffix?: `0x${string}`;
|
|
1739
|
+
gas?: bigint;
|
|
1740
|
+
gasPrice?: bigint;
|
|
1741
|
+
maxFeePerGas?: bigint;
|
|
1742
|
+
maxPriorityFeePerGas?: bigint;
|
|
1743
|
+
nonce?: number;
|
|
1744
|
+
value?: bigint;
|
|
1745
|
+
}): Promise<void> {
|
|
1746
|
+
return contract.simulate.addExternalAddresses([_token, _stone, _treasury, _moneyHandler] as const, options) as Promise<void>;
|
|
1747
|
+
},
|
|
1748
|
+
/**
|
|
1749
|
+
* Simulate buy
|
|
1750
|
+
* Returns gas estimate and result without sending transaction
|
|
1751
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1752
|
+
*/
|
|
1753
|
+
async buy(buyer: `0x${string}`, _id: bigint, options?: {
|
|
1754
|
+
accessList?: import('viem').AccessList;
|
|
1755
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1756
|
+
chain?: import('viem').Chain | null;
|
|
1757
|
+
dataSuffix?: `0x${string}`;
|
|
1758
|
+
gas?: bigint;
|
|
1759
|
+
gasPrice?: bigint;
|
|
1760
|
+
maxFeePerGas?: bigint;
|
|
1761
|
+
maxPriorityFeePerGas?: bigint;
|
|
1762
|
+
nonce?: number;
|
|
1763
|
+
value?: bigint;
|
|
1764
|
+
}): Promise<void> {
|
|
1765
|
+
return contract.simulate.buy([buyer, _id] as const, options) as Promise<void>;
|
|
1766
|
+
},
|
|
1767
|
+
/**
|
|
1768
|
+
* Simulate grantRole
|
|
1769
|
+
* Returns gas estimate and result without sending transaction
|
|
1770
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1771
|
+
*/
|
|
1772
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1773
|
+
accessList?: import('viem').AccessList;
|
|
1774
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1775
|
+
chain?: import('viem').Chain | null;
|
|
1776
|
+
dataSuffix?: `0x${string}`;
|
|
1777
|
+
gas?: bigint;
|
|
1778
|
+
gasPrice?: bigint;
|
|
1779
|
+
maxFeePerGas?: bigint;
|
|
1780
|
+
maxPriorityFeePerGas?: bigint;
|
|
1781
|
+
nonce?: number;
|
|
1782
|
+
value?: bigint;
|
|
1783
|
+
}): Promise<void> {
|
|
1784
|
+
return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
|
|
1785
|
+
},
|
|
1786
|
+
/**
|
|
1787
|
+
* Simulate mint
|
|
1788
|
+
* Returns gas estimate and result without sending transaction
|
|
1789
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1790
|
+
*/
|
|
1791
|
+
async mint(to: `0x${string}`, _id: bigint, options?: {
|
|
1792
|
+
accessList?: import('viem').AccessList;
|
|
1793
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1794
|
+
chain?: import('viem').Chain | null;
|
|
1795
|
+
dataSuffix?: `0x${string}`;
|
|
1796
|
+
gas?: bigint;
|
|
1797
|
+
gasPrice?: bigint;
|
|
1798
|
+
maxFeePerGas?: bigint;
|
|
1799
|
+
maxPriorityFeePerGas?: bigint;
|
|
1800
|
+
nonce?: number;
|
|
1801
|
+
value?: bigint;
|
|
1802
|
+
}): Promise<void> {
|
|
1803
|
+
return contract.simulate.mint([to, _id] as const, options) as Promise<void>;
|
|
1804
|
+
},
|
|
1805
|
+
/**
|
|
1806
|
+
* Simulate mintBatch
|
|
1807
|
+
* Returns gas estimate and result without sending transaction
|
|
1808
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1809
|
+
*/
|
|
1810
|
+
async mintBatch(to: `0x${string}`, ids: bigint[], amount_: bigint[], options?: {
|
|
1811
|
+
accessList?: import('viem').AccessList;
|
|
1812
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1813
|
+
chain?: import('viem').Chain | null;
|
|
1814
|
+
dataSuffix?: `0x${string}`;
|
|
1815
|
+
gas?: bigint;
|
|
1816
|
+
gasPrice?: bigint;
|
|
1817
|
+
maxFeePerGas?: bigint;
|
|
1818
|
+
maxPriorityFeePerGas?: bigint;
|
|
1819
|
+
nonce?: number;
|
|
1820
|
+
value?: bigint;
|
|
1821
|
+
}): Promise<void> {
|
|
1822
|
+
return contract.simulate.mintBatch([to, ids, amount_] as const, options) as Promise<void>;
|
|
1823
|
+
},
|
|
1824
|
+
/**
|
|
1825
|
+
* Simulate recoverToken
|
|
1826
|
+
* Returns gas estimate and result without sending transaction
|
|
1827
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1828
|
+
*/
|
|
1829
|
+
async recoverToken(_token: `0x${string}`, options?: {
|
|
1830
|
+
accessList?: import('viem').AccessList;
|
|
1831
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1832
|
+
chain?: import('viem').Chain | null;
|
|
1833
|
+
dataSuffix?: `0x${string}`;
|
|
1834
|
+
gas?: bigint;
|
|
1835
|
+
gasPrice?: bigint;
|
|
1836
|
+
maxFeePerGas?: bigint;
|
|
1837
|
+
maxPriorityFeePerGas?: bigint;
|
|
1838
|
+
nonce?: number;
|
|
1839
|
+
value?: bigint;
|
|
1840
|
+
}): Promise<void> {
|
|
1841
|
+
return contract.simulate.recoverToken([_token] as const, options) as Promise<void>;
|
|
1842
|
+
},
|
|
1843
|
+
/**
|
|
1844
|
+
* Simulate renounceRole
|
|
1845
|
+
* Returns gas estimate and result without sending transaction
|
|
1846
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1847
|
+
*/
|
|
1848
|
+
async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1849
|
+
accessList?: import('viem').AccessList;
|
|
1850
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1851
|
+
chain?: import('viem').Chain | null;
|
|
1852
|
+
dataSuffix?: `0x${string}`;
|
|
1853
|
+
gas?: bigint;
|
|
1854
|
+
gasPrice?: bigint;
|
|
1855
|
+
maxFeePerGas?: bigint;
|
|
1856
|
+
maxPriorityFeePerGas?: bigint;
|
|
1857
|
+
nonce?: number;
|
|
1858
|
+
value?: bigint;
|
|
1859
|
+
}): Promise<void> {
|
|
1860
|
+
return contract.simulate.renounceRole([role, account] as const, options) as Promise<void>;
|
|
1861
|
+
},
|
|
1862
|
+
/**
|
|
1863
|
+
* Simulate revokeRole
|
|
1864
|
+
* Returns gas estimate and result without sending transaction
|
|
1865
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1866
|
+
*/
|
|
1867
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1868
|
+
accessList?: import('viem').AccessList;
|
|
1869
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1870
|
+
chain?: import('viem').Chain | null;
|
|
1871
|
+
dataSuffix?: `0x${string}`;
|
|
1872
|
+
gas?: bigint;
|
|
1873
|
+
gasPrice?: bigint;
|
|
1874
|
+
maxFeePerGas?: bigint;
|
|
1875
|
+
maxPriorityFeePerGas?: bigint;
|
|
1876
|
+
nonce?: number;
|
|
1877
|
+
value?: bigint;
|
|
1878
|
+
}): Promise<void> {
|
|
1879
|
+
return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
|
|
1880
|
+
},
|
|
1881
|
+
/**
|
|
1882
|
+
* Simulate safeBatchTransferFrom
|
|
1883
|
+
* Returns gas estimate and result without sending transaction
|
|
1884
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1885
|
+
*/
|
|
1886
|
+
async safeBatchTransferFrom(from: `0x${string}`, to: `0x${string}`, ids: bigint[], amounts: bigint[], data: `0x${string}`, options?: {
|
|
1887
|
+
accessList?: import('viem').AccessList;
|
|
1888
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1889
|
+
chain?: import('viem').Chain | null;
|
|
1890
|
+
dataSuffix?: `0x${string}`;
|
|
1891
|
+
gas?: bigint;
|
|
1892
|
+
gasPrice?: bigint;
|
|
1893
|
+
maxFeePerGas?: bigint;
|
|
1894
|
+
maxPriorityFeePerGas?: bigint;
|
|
1895
|
+
nonce?: number;
|
|
1896
|
+
value?: bigint;
|
|
1897
|
+
}): Promise<void> {
|
|
1898
|
+
return contract.simulate.safeBatchTransferFrom([from, to, ids, amounts, data] as const, options) as Promise<void>;
|
|
1899
|
+
},
|
|
1900
|
+
/**
|
|
1901
|
+
* Simulate safeTransferFrom
|
|
1902
|
+
* Returns gas estimate and result without sending transaction
|
|
1903
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1904
|
+
*/
|
|
1905
|
+
async safeTransferFrom(from: `0x${string}`, to: `0x${string}`, id: bigint, amount: bigint, data: `0x${string}`, options?: {
|
|
1906
|
+
accessList?: import('viem').AccessList;
|
|
1907
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1908
|
+
chain?: import('viem').Chain | null;
|
|
1909
|
+
dataSuffix?: `0x${string}`;
|
|
1910
|
+
gas?: bigint;
|
|
1911
|
+
gasPrice?: bigint;
|
|
1912
|
+
maxFeePerGas?: bigint;
|
|
1913
|
+
maxPriorityFeePerGas?: bigint;
|
|
1914
|
+
nonce?: number;
|
|
1915
|
+
value?: bigint;
|
|
1916
|
+
}): Promise<void> {
|
|
1917
|
+
return contract.simulate.safeTransferFrom([from, to, id, amount, data] as const, options) as Promise<void>;
|
|
1918
|
+
},
|
|
1919
|
+
/**
|
|
1920
|
+
* Simulate setAmount
|
|
1921
|
+
* Returns gas estimate and result without sending transaction
|
|
1922
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1923
|
+
*/
|
|
1924
|
+
async setAmount(_newAmount: bigint, options?: {
|
|
1925
|
+
accessList?: import('viem').AccessList;
|
|
1926
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1927
|
+
chain?: import('viem').Chain | null;
|
|
1928
|
+
dataSuffix?: `0x${string}`;
|
|
1929
|
+
gas?: bigint;
|
|
1930
|
+
gasPrice?: bigint;
|
|
1931
|
+
maxFeePerGas?: bigint;
|
|
1932
|
+
maxPriorityFeePerGas?: bigint;
|
|
1933
|
+
nonce?: number;
|
|
1934
|
+
value?: bigint;
|
|
1935
|
+
}): Promise<void> {
|
|
1936
|
+
return contract.simulate.setAmount([_newAmount] as const, options) as Promise<void>;
|
|
1937
|
+
},
|
|
1938
|
+
/**
|
|
1939
|
+
* Simulate setApprovalForAll
|
|
1940
|
+
* Returns gas estimate and result without sending transaction
|
|
1941
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1942
|
+
*/
|
|
1943
|
+
async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
|
|
1944
|
+
accessList?: import('viem').AccessList;
|
|
1945
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1946
|
+
chain?: import('viem').Chain | null;
|
|
1947
|
+
dataSuffix?: `0x${string}`;
|
|
1948
|
+
gas?: bigint;
|
|
1949
|
+
gasPrice?: bigint;
|
|
1950
|
+
maxFeePerGas?: bigint;
|
|
1951
|
+
maxPriorityFeePerGas?: bigint;
|
|
1952
|
+
nonce?: number;
|
|
1953
|
+
value?: bigint;
|
|
1954
|
+
}): Promise<void> {
|
|
1955
|
+
return contract.simulate.setApprovalForAll([operator, approved] as const, options) as Promise<void>;
|
|
1956
|
+
},
|
|
1957
|
+
/**
|
|
1958
|
+
* Simulate setEndTime
|
|
1959
|
+
* Returns gas estimate and result without sending transaction
|
|
1960
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1961
|
+
*/
|
|
1962
|
+
async setEndTime(_endTime: bigint, options?: {
|
|
1963
|
+
accessList?: import('viem').AccessList;
|
|
1964
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1965
|
+
chain?: import('viem').Chain | null;
|
|
1966
|
+
dataSuffix?: `0x${string}`;
|
|
1967
|
+
gas?: bigint;
|
|
1968
|
+
gasPrice?: bigint;
|
|
1969
|
+
maxFeePerGas?: bigint;
|
|
1970
|
+
maxPriorityFeePerGas?: bigint;
|
|
1971
|
+
nonce?: number;
|
|
1972
|
+
value?: bigint;
|
|
1973
|
+
}): Promise<void> {
|
|
1974
|
+
return contract.simulate.setEndTime([_endTime] as const, options) as Promise<void>;
|
|
1975
|
+
},
|
|
1976
|
+
/**
|
|
1977
|
+
* Simulate setStarTime
|
|
1978
|
+
* Returns gas estimate and result without sending transaction
|
|
1979
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1980
|
+
*/
|
|
1981
|
+
async setStarTime(_starTime: bigint, options?: {
|
|
1982
|
+
accessList?: import('viem').AccessList;
|
|
1983
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1984
|
+
chain?: import('viem').Chain | null;
|
|
1985
|
+
dataSuffix?: `0x${string}`;
|
|
1986
|
+
gas?: bigint;
|
|
1987
|
+
gasPrice?: bigint;
|
|
1988
|
+
maxFeePerGas?: bigint;
|
|
1989
|
+
maxPriorityFeePerGas?: bigint;
|
|
1990
|
+
nonce?: number;
|
|
1991
|
+
value?: bigint;
|
|
1992
|
+
}): Promise<void> {
|
|
1993
|
+
return contract.simulate.setStarTime([_starTime] as const, options) as Promise<void>;
|
|
1994
|
+
}
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* Watch contract events
|
|
2000
|
+
*
|
|
2001
|
+
* @example
|
|
2002
|
+
* // Watch all Transfer events
|
|
2003
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
2004
|
+
* console.log('Transfer:', event);
|
|
2005
|
+
* });
|
|
2006
|
+
*
|
|
2007
|
+
* // Stop watching
|
|
2008
|
+
* unwatch();
|
|
2009
|
+
*/
|
|
2010
|
+
get watch() {
|
|
2011
|
+
return {
|
|
2012
|
+
/**
|
|
2013
|
+
* Watch ApprovalForAll events
|
|
2014
|
+
* @param callback Function to call when event is emitted
|
|
2015
|
+
* @param filter Optional filter for indexed parameters
|
|
2016
|
+
* @returns Unwatch function to stop listening
|
|
2017
|
+
*/
|
|
2018
|
+
ApprovalForAll: (callback: (event: { account: `0x${string}`; operator: `0x${string}`; approved: boolean }) => void, filter?: { account: `0x${string}`; operator: `0x${string}` }) => {
|
|
2019
|
+
return this.publicClient.watchContractEvent({
|
|
2020
|
+
address: this.contractAddress,
|
|
2021
|
+
abi: CollectionV2_jsonAbi,
|
|
2022
|
+
eventName: 'ApprovalForAll',
|
|
2023
|
+
args: filter,
|
|
2024
|
+
onLogs: (logs: any[]) => {
|
|
2025
|
+
logs.forEach((log: any) => {
|
|
2026
|
+
callback(log.args as any);
|
|
2027
|
+
});
|
|
2028
|
+
},
|
|
2029
|
+
}) as () => void;
|
|
2030
|
+
},
|
|
2031
|
+
/**
|
|
2032
|
+
* Watch NewEndTime events
|
|
2033
|
+
* @param callback Function to call when event is emitted
|
|
2034
|
+
* @param filter Optional filter for indexed parameters
|
|
2035
|
+
* @returns Unwatch function to stop listening
|
|
2036
|
+
*/
|
|
2037
|
+
NewEndTime: (callback: (event: { endTime: bigint }) => void) => {
|
|
2038
|
+
return this.publicClient.watchContractEvent({
|
|
2039
|
+
address: this.contractAddress,
|
|
2040
|
+
abi: CollectionV2_jsonAbi,
|
|
2041
|
+
eventName: 'NewEndTime',
|
|
2042
|
+
|
|
2043
|
+
onLogs: (logs: any[]) => {
|
|
2044
|
+
logs.forEach((log: any) => {
|
|
2045
|
+
callback(log.args as any);
|
|
2046
|
+
});
|
|
2047
|
+
},
|
|
2048
|
+
}) as () => void;
|
|
2049
|
+
},
|
|
2050
|
+
/**
|
|
2051
|
+
* Watch NewStartTime events
|
|
2052
|
+
* @param callback Function to call when event is emitted
|
|
2053
|
+
* @param filter Optional filter for indexed parameters
|
|
2054
|
+
* @returns Unwatch function to stop listening
|
|
2055
|
+
*/
|
|
2056
|
+
NewStartTime: (callback: (event: { startTime: bigint }) => void) => {
|
|
2057
|
+
return this.publicClient.watchContractEvent({
|
|
2058
|
+
address: this.contractAddress,
|
|
2059
|
+
abi: CollectionV2_jsonAbi,
|
|
2060
|
+
eventName: 'NewStartTime',
|
|
2061
|
+
|
|
2062
|
+
onLogs: (logs: any[]) => {
|
|
2063
|
+
logs.forEach((log: any) => {
|
|
2064
|
+
callback(log.args as any);
|
|
2065
|
+
});
|
|
2066
|
+
},
|
|
2067
|
+
}) as () => void;
|
|
2068
|
+
},
|
|
2069
|
+
/**
|
|
2070
|
+
* Watch NewUsdAmount events
|
|
2071
|
+
* @param callback Function to call when event is emitted
|
|
2072
|
+
* @param filter Optional filter for indexed parameters
|
|
2073
|
+
* @returns Unwatch function to stop listening
|
|
2074
|
+
*/
|
|
2075
|
+
NewUsdAmount: (callback: (event: { amount: bigint }) => void) => {
|
|
2076
|
+
return this.publicClient.watchContractEvent({
|
|
2077
|
+
address: this.contractAddress,
|
|
2078
|
+
abi: CollectionV2_jsonAbi,
|
|
2079
|
+
eventName: 'NewUsdAmount',
|
|
2080
|
+
|
|
2081
|
+
onLogs: (logs: any[]) => {
|
|
2082
|
+
logs.forEach((log: any) => {
|
|
2083
|
+
callback(log.args as any);
|
|
2084
|
+
});
|
|
2085
|
+
},
|
|
2086
|
+
}) as () => void;
|
|
2087
|
+
},
|
|
2088
|
+
/**
|
|
2089
|
+
* Watch PaymentShared events
|
|
2090
|
+
* @param callback Function to call when event is emitted
|
|
2091
|
+
* @param filter Optional filter for indexed parameters
|
|
2092
|
+
* @returns Unwatch function to stop listening
|
|
2093
|
+
*/
|
|
2094
|
+
PaymentShared: (callback: (event: { account: `0x${string}`; amount: bigint }) => void) => {
|
|
2095
|
+
return this.publicClient.watchContractEvent({
|
|
2096
|
+
address: this.contractAddress,
|
|
2097
|
+
abi: CollectionV2_jsonAbi,
|
|
2098
|
+
eventName: 'PaymentShared',
|
|
2099
|
+
|
|
2100
|
+
onLogs: (logs: any[]) => {
|
|
2101
|
+
logs.forEach((log: any) => {
|
|
2102
|
+
callback(log.args as any);
|
|
2103
|
+
});
|
|
2104
|
+
},
|
|
2105
|
+
}) as () => void;
|
|
2106
|
+
},
|
|
2107
|
+
/**
|
|
2108
|
+
* Watch PaymentTreasure events
|
|
2109
|
+
* @param callback Function to call when event is emitted
|
|
2110
|
+
* @param filter Optional filter for indexed parameters
|
|
2111
|
+
* @returns Unwatch function to stop listening
|
|
2112
|
+
*/
|
|
2113
|
+
PaymentTreasure: (callback: (event: { account: `0x${string}`; amount: bigint }) => void) => {
|
|
2114
|
+
return this.publicClient.watchContractEvent({
|
|
2115
|
+
address: this.contractAddress,
|
|
2116
|
+
abi: CollectionV2_jsonAbi,
|
|
2117
|
+
eventName: 'PaymentTreasure',
|
|
2118
|
+
|
|
2119
|
+
onLogs: (logs: any[]) => {
|
|
2120
|
+
logs.forEach((log: any) => {
|
|
2121
|
+
callback(log.args as any);
|
|
2122
|
+
});
|
|
2123
|
+
},
|
|
2124
|
+
}) as () => void;
|
|
2125
|
+
},
|
|
2126
|
+
/**
|
|
2127
|
+
* Watch RoleAdminChanged events
|
|
2128
|
+
* @param callback Function to call when event is emitted
|
|
2129
|
+
* @param filter Optional filter for indexed parameters
|
|
2130
|
+
* @returns Unwatch function to stop listening
|
|
2131
|
+
*/
|
|
2132
|
+
RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => {
|
|
2133
|
+
return this.publicClient.watchContractEvent({
|
|
2134
|
+
address: this.contractAddress,
|
|
2135
|
+
abi: CollectionV2_jsonAbi,
|
|
2136
|
+
eventName: 'RoleAdminChanged',
|
|
2137
|
+
args: filter,
|
|
2138
|
+
onLogs: (logs: any[]) => {
|
|
2139
|
+
logs.forEach((log: any) => {
|
|
2140
|
+
callback(log.args as any);
|
|
2141
|
+
});
|
|
2142
|
+
},
|
|
2143
|
+
}) as () => void;
|
|
2144
|
+
},
|
|
2145
|
+
/**
|
|
2146
|
+
* Watch RoleGranted events
|
|
2147
|
+
* @param callback Function to call when event is emitted
|
|
2148
|
+
* @param filter Optional filter for indexed parameters
|
|
2149
|
+
* @returns Unwatch function to stop listening
|
|
2150
|
+
*/
|
|
2151
|
+
RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
|
|
2152
|
+
return this.publicClient.watchContractEvent({
|
|
2153
|
+
address: this.contractAddress,
|
|
2154
|
+
abi: CollectionV2_jsonAbi,
|
|
2155
|
+
eventName: 'RoleGranted',
|
|
2156
|
+
args: filter,
|
|
2157
|
+
onLogs: (logs: any[]) => {
|
|
2158
|
+
logs.forEach((log: any) => {
|
|
2159
|
+
callback(log.args as any);
|
|
2160
|
+
});
|
|
2161
|
+
},
|
|
2162
|
+
}) as () => void;
|
|
2163
|
+
},
|
|
2164
|
+
/**
|
|
2165
|
+
* Watch RoleRevoked events
|
|
2166
|
+
* @param callback Function to call when event is emitted
|
|
2167
|
+
* @param filter Optional filter for indexed parameters
|
|
2168
|
+
* @returns Unwatch function to stop listening
|
|
2169
|
+
*/
|
|
2170
|
+
RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
|
|
2171
|
+
return this.publicClient.watchContractEvent({
|
|
2172
|
+
address: this.contractAddress,
|
|
2173
|
+
abi: CollectionV2_jsonAbi,
|
|
2174
|
+
eventName: 'RoleRevoked',
|
|
2175
|
+
args: filter,
|
|
2176
|
+
onLogs: (logs: any[]) => {
|
|
2177
|
+
logs.forEach((log: any) => {
|
|
2178
|
+
callback(log.args as any);
|
|
2179
|
+
});
|
|
2180
|
+
},
|
|
2181
|
+
}) as () => void;
|
|
2182
|
+
},
|
|
2183
|
+
/**
|
|
2184
|
+
* Watch SetAddresses events
|
|
2185
|
+
* @param callback Function to call when event is emitted
|
|
2186
|
+
* @param filter Optional filter for indexed parameters
|
|
2187
|
+
* @returns Unwatch function to stop listening
|
|
2188
|
+
*/
|
|
2189
|
+
SetAddresses: (callback: (event: { token: `0x${string}`; stone: `0x${string}`; treasury: `0x${string}`; moneyHandler: `0x${string}` }) => void) => {
|
|
2190
|
+
return this.publicClient.watchContractEvent({
|
|
2191
|
+
address: this.contractAddress,
|
|
2192
|
+
abi: CollectionV2_jsonAbi,
|
|
2193
|
+
eventName: 'SetAddresses',
|
|
2194
|
+
|
|
2195
|
+
onLogs: (logs: any[]) => {
|
|
2196
|
+
logs.forEach((log: any) => {
|
|
2197
|
+
callback(log.args as any);
|
|
2198
|
+
});
|
|
2199
|
+
},
|
|
2200
|
+
}) as () => void;
|
|
2201
|
+
},
|
|
2202
|
+
/**
|
|
2203
|
+
* Watch Sold events
|
|
2204
|
+
* @param callback Function to call when event is emitted
|
|
2205
|
+
* @param filter Optional filter for indexed parameters
|
|
2206
|
+
* @returns Unwatch function to stop listening
|
|
2207
|
+
*/
|
|
2208
|
+
Sold: (callback: (event: { operator: `0x${string}`; to: `0x${string}`; id: bigint; amount: bigint }) => void, filter?: { operator: `0x${string}`; to: `0x${string}`; id: bigint }) => {
|
|
2209
|
+
return this.publicClient.watchContractEvent({
|
|
2210
|
+
address: this.contractAddress,
|
|
2211
|
+
abi: CollectionV2_jsonAbi,
|
|
2212
|
+
eventName: 'Sold',
|
|
2213
|
+
args: filter,
|
|
2214
|
+
onLogs: (logs: any[]) => {
|
|
2215
|
+
logs.forEach((log: any) => {
|
|
2216
|
+
callback(log.args as any);
|
|
2217
|
+
});
|
|
2218
|
+
},
|
|
2219
|
+
}) as () => void;
|
|
2220
|
+
},
|
|
2221
|
+
/**
|
|
2222
|
+
* Watch SoldWithStones events
|
|
2223
|
+
* @param callback Function to call when event is emitted
|
|
2224
|
+
* @param filter Optional filter for indexed parameters
|
|
2225
|
+
* @returns Unwatch function to stop listening
|
|
2226
|
+
*/
|
|
2227
|
+
SoldWithStones: (callback: (event: { buyer: `0x${string}`; amount: bigint }) => void) => {
|
|
2228
|
+
return this.publicClient.watchContractEvent({
|
|
2229
|
+
address: this.contractAddress,
|
|
2230
|
+
abi: CollectionV2_jsonAbi,
|
|
2231
|
+
eventName: 'SoldWithStones',
|
|
2232
|
+
|
|
2233
|
+
onLogs: (logs: any[]) => {
|
|
2234
|
+
logs.forEach((log: any) => {
|
|
2235
|
+
callback(log.args as any);
|
|
2236
|
+
});
|
|
2237
|
+
},
|
|
2238
|
+
}) as () => void;
|
|
2239
|
+
},
|
|
2240
|
+
/**
|
|
2241
|
+
* Watch TransferBatch events
|
|
2242
|
+
* @param callback Function to call when event is emitted
|
|
2243
|
+
* @param filter Optional filter for indexed parameters
|
|
2244
|
+
* @returns Unwatch function to stop listening
|
|
2245
|
+
*/
|
|
2246
|
+
TransferBatch: (callback: (event: { operator: `0x${string}`; from: `0x${string}`; to: `0x${string}`; ids: bigint[]; values: bigint[] }) => void, filter?: { operator: `0x${string}`; from: `0x${string}`; to: `0x${string}` }) => {
|
|
2247
|
+
return this.publicClient.watchContractEvent({
|
|
2248
|
+
address: this.contractAddress,
|
|
2249
|
+
abi: CollectionV2_jsonAbi,
|
|
2250
|
+
eventName: 'TransferBatch',
|
|
2251
|
+
args: filter,
|
|
2252
|
+
onLogs: (logs: any[]) => {
|
|
2253
|
+
logs.forEach((log: any) => {
|
|
2254
|
+
callback(log.args as any);
|
|
2255
|
+
});
|
|
2256
|
+
},
|
|
2257
|
+
}) as () => void;
|
|
2258
|
+
},
|
|
2259
|
+
/**
|
|
2260
|
+
* Watch TransferSingle events
|
|
2261
|
+
* @param callback Function to call when event is emitted
|
|
2262
|
+
* @param filter Optional filter for indexed parameters
|
|
2263
|
+
* @returns Unwatch function to stop listening
|
|
2264
|
+
*/
|
|
2265
|
+
TransferSingle: (callback: (event: { operator: `0x${string}`; from: `0x${string}`; to: `0x${string}`; id: bigint; value: bigint }) => void, filter?: { operator: `0x${string}`; from: `0x${string}`; to: `0x${string}` }) => {
|
|
2266
|
+
return this.publicClient.watchContractEvent({
|
|
2267
|
+
address: this.contractAddress,
|
|
2268
|
+
abi: CollectionV2_jsonAbi,
|
|
2269
|
+
eventName: 'TransferSingle',
|
|
2270
|
+
args: filter,
|
|
2271
|
+
onLogs: (logs: any[]) => {
|
|
2272
|
+
logs.forEach((log: any) => {
|
|
2273
|
+
callback(log.args as any);
|
|
2274
|
+
});
|
|
2275
|
+
},
|
|
2276
|
+
}) as () => void;
|
|
2277
|
+
},
|
|
2278
|
+
/**
|
|
2279
|
+
* Watch URI events
|
|
2280
|
+
* @param callback Function to call when event is emitted
|
|
2281
|
+
* @param filter Optional filter for indexed parameters
|
|
2282
|
+
* @returns Unwatch function to stop listening
|
|
2283
|
+
*/
|
|
2284
|
+
URI: (callback: (event: { id: bigint; value: string }) => void, filter?: { id: bigint }) => {
|
|
2285
|
+
return this.publicClient.watchContractEvent({
|
|
2286
|
+
address: this.contractAddress,
|
|
2287
|
+
abi: CollectionV2_jsonAbi,
|
|
2288
|
+
eventName: 'URI',
|
|
2289
|
+
args: filter,
|
|
2290
|
+
onLogs: (logs: any[]) => {
|
|
2291
|
+
logs.forEach((log: any) => {
|
|
2292
|
+
callback(log.args as any);
|
|
2293
|
+
});
|
|
2294
|
+
},
|
|
2295
|
+
}) as () => void;
|
|
2296
|
+
}
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
}
|