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