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