@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.
@@ -0,0 +1,1574 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MyCryptoChampCore_json = exports.MyCryptoChampCore_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * MyCryptoChampCore_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.MyCryptoChampCore_jsonAbi = [
11
+ {
12
+ "constant": true,
13
+ "inputs": [],
14
+ "name": "getItemsForSale",
15
+ "outputs": [
16
+ {
17
+ "name": "",
18
+ "type": "uint256[]"
19
+ }
20
+ ],
21
+ "payable": false,
22
+ "stateMutability": "view",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "constant": true,
27
+ "inputs": [],
28
+ "name": "itemsForSaleCount",
29
+ "outputs": [
30
+ {
31
+ "name": "",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "payable": false,
36
+ "stateMutability": "view",
37
+ "type": "function"
38
+ },
39
+ {
40
+ "constant": true,
41
+ "inputs": [
42
+ {
43
+ "name": "",
44
+ "type": "uint256"
45
+ }
46
+ ],
47
+ "name": "itemToOwner",
48
+ "outputs": [
49
+ {
50
+ "name": "",
51
+ "type": "address"
52
+ }
53
+ ],
54
+ "payable": false,
55
+ "stateMutability": "view",
56
+ "type": "function"
57
+ },
58
+ {
59
+ "constant": true,
60
+ "inputs": [],
61
+ "name": "champsForSaleCount",
62
+ "outputs": [
63
+ {
64
+ "name": "",
65
+ "type": "uint256"
66
+ }
67
+ ],
68
+ "payable": false,
69
+ "stateMutability": "view",
70
+ "type": "function"
71
+ },
72
+ {
73
+ "constant": true,
74
+ "inputs": [
75
+ {
76
+ "name": "",
77
+ "type": "address"
78
+ }
79
+ ],
80
+ "name": "addressInfo",
81
+ "outputs": [
82
+ {
83
+ "name": "withdrawal",
84
+ "type": "uint256"
85
+ },
86
+ {
87
+ "name": "champsCount",
88
+ "type": "uint256"
89
+ },
90
+ {
91
+ "name": "itemsCount",
92
+ "type": "uint256"
93
+ },
94
+ {
95
+ "name": "name",
96
+ "type": "string"
97
+ }
98
+ ],
99
+ "payable": false,
100
+ "stateMutability": "view",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "constant": true,
105
+ "inputs": [
106
+ {
107
+ "name": "_owner",
108
+ "type": "address"
109
+ }
110
+ ],
111
+ "name": "getItemsByOwner",
112
+ "outputs": [
113
+ {
114
+ "name": "",
115
+ "type": "uint256[]"
116
+ }
117
+ ],
118
+ "payable": false,
119
+ "stateMutability": "view",
120
+ "type": "function"
121
+ },
122
+ {
123
+ "constant": true,
124
+ "inputs": [],
125
+ "name": "getChampsCount",
126
+ "outputs": [
127
+ {
128
+ "name": "",
129
+ "type": "uint256"
130
+ }
131
+ ],
132
+ "payable": false,
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "constant": false,
138
+ "inputs": [
139
+ {
140
+ "name": "_affiliateAddress",
141
+ "type": "address"
142
+ }
143
+ ],
144
+ "name": "openLootbox",
145
+ "outputs": [],
146
+ "payable": true,
147
+ "stateMutability": "payable",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "constant": false,
152
+ "inputs": [
153
+ {
154
+ "name": "_id",
155
+ "type": "uint256"
156
+ }
157
+ ],
158
+ "name": "withdrawChamp",
159
+ "outputs": [],
160
+ "payable": false,
161
+ "stateMutability": "nonpayable",
162
+ "type": "function"
163
+ },
164
+ {
165
+ "constant": false,
166
+ "inputs": [
167
+ {
168
+ "name": "_parentItemID",
169
+ "type": "uint256"
170
+ },
171
+ {
172
+ "name": "_childItemID",
173
+ "type": "uint256"
174
+ }
175
+ ],
176
+ "name": "forgeItems",
177
+ "outputs": [],
178
+ "payable": false,
179
+ "stateMutability": "nonpayable",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "constant": true,
184
+ "inputs": [
185
+ {
186
+ "name": "_champId",
187
+ "type": "uint256"
188
+ }
189
+ ],
190
+ "name": "getChampStats",
191
+ "outputs": [
192
+ {
193
+ "name": "",
194
+ "type": "uint256"
195
+ },
196
+ {
197
+ "name": "",
198
+ "type": "uint256"
199
+ },
200
+ {
201
+ "name": "",
202
+ "type": "uint256"
203
+ }
204
+ ],
205
+ "payable": false,
206
+ "stateMutability": "view",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "constant": false,
211
+ "inputs": [
212
+ {
213
+ "name": "_champId",
214
+ "type": "uint256"
215
+ },
216
+ {
217
+ "name": "_itemId",
218
+ "type": "uint256"
219
+ }
220
+ ],
221
+ "name": "putOn",
222
+ "outputs": [],
223
+ "payable": false,
224
+ "stateMutability": "nonpayable",
225
+ "type": "function"
226
+ },
227
+ {
228
+ "constant": true,
229
+ "inputs": [],
230
+ "name": "getChampsForSale",
231
+ "outputs": [
232
+ {
233
+ "name": "",
234
+ "type": "uint256[]"
235
+ }
236
+ ],
237
+ "payable": false,
238
+ "stateMutability": "view",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "constant": false,
243
+ "inputs": [
244
+ {
245
+ "name": "_id",
246
+ "type": "uint256"
247
+ }
248
+ ],
249
+ "name": "cancelChampSale",
250
+ "outputs": [],
251
+ "payable": false,
252
+ "stateMutability": "nonpayable",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "constant": false,
257
+ "inputs": [
258
+ {
259
+ "name": "_id",
260
+ "type": "uint256"
261
+ }
262
+ ],
263
+ "name": "buyChamp",
264
+ "outputs": [],
265
+ "payable": true,
266
+ "stateMutability": "payable",
267
+ "type": "function"
268
+ },
269
+ {
270
+ "constant": false,
271
+ "inputs": [
272
+ {
273
+ "name": "_name",
274
+ "type": "string"
275
+ }
276
+ ],
277
+ "name": "changePlayersName",
278
+ "outputs": [],
279
+ "payable": false,
280
+ "stateMutability": "nonpayable",
281
+ "type": "function"
282
+ },
283
+ {
284
+ "constant": false,
285
+ "inputs": [
286
+ {
287
+ "name": "_to",
288
+ "type": "address"
289
+ },
290
+ {
291
+ "name": "_champId",
292
+ "type": "uint256"
293
+ }
294
+ ],
295
+ "name": "giveChamp",
296
+ "outputs": [],
297
+ "payable": false,
298
+ "stateMutability": "nonpayable",
299
+ "type": "function"
300
+ },
301
+ {
302
+ "constant": false,
303
+ "inputs": [],
304
+ "name": "triggerPause",
305
+ "outputs": [],
306
+ "payable": false,
307
+ "stateMutability": "nonpayable",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "constant": true,
312
+ "inputs": [
313
+ {
314
+ "name": "",
315
+ "type": "uint256"
316
+ }
317
+ ],
318
+ "name": "champToName",
319
+ "outputs": [
320
+ {
321
+ "name": "",
322
+ "type": "string"
323
+ }
324
+ ],
325
+ "payable": false,
326
+ "stateMutability": "view",
327
+ "type": "function"
328
+ },
329
+ {
330
+ "constant": false,
331
+ "inputs": [
332
+ {
333
+ "name": "_affiliateAddress",
334
+ "type": "address"
335
+ }
336
+ ],
337
+ "name": "createChamp",
338
+ "outputs": [],
339
+ "payable": true,
340
+ "stateMutability": "payable",
341
+ "type": "function"
342
+ },
343
+ {
344
+ "constant": true,
345
+ "inputs": [
346
+ {
347
+ "name": "_position",
348
+ "type": "uint256"
349
+ }
350
+ ],
351
+ "name": "getChampReward",
352
+ "outputs": [
353
+ {
354
+ "name": "",
355
+ "type": "uint256"
356
+ }
357
+ ],
358
+ "payable": false,
359
+ "stateMutability": "view",
360
+ "type": "function"
361
+ },
362
+ {
363
+ "constant": false,
364
+ "inputs": [
365
+ {
366
+ "name": "_address",
367
+ "type": "address"
368
+ }
369
+ ],
370
+ "name": "withdrawToAddress",
371
+ "outputs": [],
372
+ "payable": false,
373
+ "stateMutability": "nonpayable",
374
+ "type": "function"
375
+ },
376
+ {
377
+ "constant": false,
378
+ "inputs": [
379
+ {
380
+ "name": "_id",
381
+ "type": "uint256"
382
+ },
383
+ {
384
+ "name": "_price",
385
+ "type": "uint256"
386
+ }
387
+ ],
388
+ "name": "setItemForSale",
389
+ "outputs": [],
390
+ "payable": false,
391
+ "stateMutability": "nonpayable",
392
+ "type": "function"
393
+ },
394
+ {
395
+ "constant": false,
396
+ "inputs": [
397
+ {
398
+ "name": "_champId",
399
+ "type": "uint256"
400
+ },
401
+ {
402
+ "name": "_name",
403
+ "type": "string"
404
+ }
405
+ ],
406
+ "name": "changeChampsName",
407
+ "outputs": [],
408
+ "payable": false,
409
+ "stateMutability": "nonpayable",
410
+ "type": "function"
411
+ },
412
+ {
413
+ "constant": true,
414
+ "inputs": [
415
+ {
416
+ "name": "",
417
+ "type": "uint256"
418
+ }
419
+ ],
420
+ "name": "leaderboard",
421
+ "outputs": [
422
+ {
423
+ "name": "",
424
+ "type": "uint256"
425
+ }
426
+ ],
427
+ "payable": false,
428
+ "stateMutability": "view",
429
+ "type": "function"
430
+ },
431
+ {
432
+ "constant": true,
433
+ "inputs": [
434
+ {
435
+ "name": "",
436
+ "type": "uint256"
437
+ }
438
+ ],
439
+ "name": "items",
440
+ "outputs": [
441
+ {
442
+ "name": "itemType",
443
+ "type": "uint8"
444
+ },
445
+ {
446
+ "name": "itemRarity",
447
+ "type": "uint8"
448
+ },
449
+ {
450
+ "name": "attackPower",
451
+ "type": "uint256"
452
+ },
453
+ {
454
+ "name": "defencePower",
455
+ "type": "uint256"
456
+ },
457
+ {
458
+ "name": "cooldownReduction",
459
+ "type": "uint256"
460
+ },
461
+ {
462
+ "name": "price",
463
+ "type": "uint256"
464
+ },
465
+ {
466
+ "name": "onChampId",
467
+ "type": "uint256"
468
+ },
469
+ {
470
+ "name": "onChamp",
471
+ "type": "bool"
472
+ },
473
+ {
474
+ "name": "forSale",
475
+ "type": "bool"
476
+ }
477
+ ],
478
+ "payable": false,
479
+ "stateMutability": "view",
480
+ "type": "function"
481
+ },
482
+ {
483
+ "constant": false,
484
+ "inputs": [
485
+ {
486
+ "name": "_id",
487
+ "type": "uint256"
488
+ }
489
+ ],
490
+ "name": "cancelItemSale",
491
+ "outputs": [],
492
+ "payable": false,
493
+ "stateMutability": "nonpayable",
494
+ "type": "function"
495
+ },
496
+ {
497
+ "constant": true,
498
+ "inputs": [
499
+ {
500
+ "name": "",
501
+ "type": "uint256"
502
+ }
503
+ ],
504
+ "name": "champs",
505
+ "outputs": [
506
+ {
507
+ "name": "id",
508
+ "type": "uint256"
509
+ },
510
+ {
511
+ "name": "attackPower",
512
+ "type": "uint256"
513
+ },
514
+ {
515
+ "name": "defencePower",
516
+ "type": "uint256"
517
+ },
518
+ {
519
+ "name": "cooldownTime",
520
+ "type": "uint256"
521
+ },
522
+ {
523
+ "name": "readyTime",
524
+ "type": "uint256"
525
+ },
526
+ {
527
+ "name": "winCount",
528
+ "type": "uint256"
529
+ },
530
+ {
531
+ "name": "lossCount",
532
+ "type": "uint256"
533
+ },
534
+ {
535
+ "name": "position",
536
+ "type": "uint256"
537
+ },
538
+ {
539
+ "name": "price",
540
+ "type": "uint256"
541
+ },
542
+ {
543
+ "name": "withdrawCooldown",
544
+ "type": "uint256"
545
+ },
546
+ {
547
+ "name": "eq_sword",
548
+ "type": "uint256"
549
+ },
550
+ {
551
+ "name": "eq_shield",
552
+ "type": "uint256"
553
+ },
554
+ {
555
+ "name": "eq_helmet",
556
+ "type": "uint256"
557
+ },
558
+ {
559
+ "name": "forSale",
560
+ "type": "bool"
561
+ }
562
+ ],
563
+ "payable": false,
564
+ "stateMutability": "view",
565
+ "type": "function"
566
+ },
567
+ {
568
+ "constant": false,
569
+ "inputs": [
570
+ {
571
+ "name": "_fee",
572
+ "type": "uint256"
573
+ }
574
+ ],
575
+ "name": "setCreateChampFee",
576
+ "outputs": [],
577
+ "payable": false,
578
+ "stateMutability": "nonpayable",
579
+ "type": "function"
580
+ },
581
+ {
582
+ "constant": false,
583
+ "inputs": [
584
+ {
585
+ "name": "_to",
586
+ "type": "address"
587
+ },
588
+ {
589
+ "name": "_itemID",
590
+ "type": "uint256"
591
+ }
592
+ ],
593
+ "name": "giveItem",
594
+ "outputs": [],
595
+ "payable": false,
596
+ "stateMutability": "nonpayable",
597
+ "type": "function"
598
+ },
599
+ {
600
+ "constant": false,
601
+ "inputs": [
602
+ {
603
+ "name": "_champId",
604
+ "type": "uint256"
605
+ },
606
+ {
607
+ "name": "_type",
608
+ "type": "uint8"
609
+ }
610
+ ],
611
+ "name": "takeOffItem",
612
+ "outputs": [],
613
+ "payable": false,
614
+ "stateMutability": "nonpayable",
615
+ "type": "function"
616
+ },
617
+ {
618
+ "constant": false,
619
+ "inputs": [
620
+ {
621
+ "name": "_fee",
622
+ "type": "uint256"
623
+ }
624
+ ],
625
+ "name": "setLootboxFee",
626
+ "outputs": [],
627
+ "payable": false,
628
+ "stateMutability": "nonpayable",
629
+ "type": "function"
630
+ },
631
+ {
632
+ "constant": false,
633
+ "inputs": [
634
+ {
635
+ "name": "_champId",
636
+ "type": "uint256"
637
+ },
638
+ {
639
+ "name": "_targetId",
640
+ "type": "uint256"
641
+ }
642
+ ],
643
+ "name": "attack",
644
+ "outputs": [],
645
+ "payable": false,
646
+ "stateMutability": "nonpayable",
647
+ "type": "function"
648
+ },
649
+ {
650
+ "constant": false,
651
+ "inputs": [
652
+ {
653
+ "name": "_id",
654
+ "type": "uint256"
655
+ }
656
+ ],
657
+ "name": "buyItem",
658
+ "outputs": [],
659
+ "payable": true,
660
+ "stateMutability": "payable",
661
+ "type": "function"
662
+ },
663
+ {
664
+ "constant": false,
665
+ "inputs": [
666
+ {
667
+ "name": "_id",
668
+ "type": "uint256"
669
+ },
670
+ {
671
+ "name": "_price",
672
+ "type": "uint256"
673
+ }
674
+ ],
675
+ "name": "setChampForSale",
676
+ "outputs": [],
677
+ "payable": false,
678
+ "stateMutability": "nonpayable",
679
+ "type": "function"
680
+ },
681
+ {
682
+ "constant": true,
683
+ "inputs": [
684
+ {
685
+ "name": "_owner",
686
+ "type": "address"
687
+ }
688
+ ],
689
+ "name": "getChampsByOwner",
690
+ "outputs": [
691
+ {
692
+ "name": "",
693
+ "type": "uint256[]"
694
+ }
695
+ ],
696
+ "payable": false,
697
+ "stateMutability": "view",
698
+ "type": "function"
699
+ },
700
+ {
701
+ "constant": false,
702
+ "inputs": [
703
+ {
704
+ "name": "newOwner",
705
+ "type": "address"
706
+ }
707
+ ],
708
+ "name": "transferOwnership",
709
+ "outputs": [],
710
+ "payable": false,
711
+ "stateMutability": "nonpayable",
712
+ "type": "function"
713
+ },
714
+ {
715
+ "constant": true,
716
+ "inputs": [
717
+ {
718
+ "name": "",
719
+ "type": "uint256"
720
+ }
721
+ ],
722
+ "name": "champToOwner",
723
+ "outputs": [
724
+ {
725
+ "name": "",
726
+ "type": "address"
727
+ }
728
+ ],
729
+ "payable": false,
730
+ "stateMutability": "view",
731
+ "type": "function"
732
+ },
733
+ {
734
+ "anonymous": false,
735
+ "inputs": [
736
+ {
737
+ "indexed": false,
738
+ "name": "from",
739
+ "type": "address"
740
+ },
741
+ {
742
+ "indexed": false,
743
+ "name": "to",
744
+ "type": "address"
745
+ },
746
+ {
747
+ "indexed": false,
748
+ "name": "champID",
749
+ "type": "uint256"
750
+ }
751
+ ],
752
+ "name": "TransferChamp",
753
+ "type": "event"
754
+ },
755
+ {
756
+ "anonymous": false,
757
+ "inputs": [
758
+ {
759
+ "indexed": false,
760
+ "name": "winnerChampID",
761
+ "type": "uint256"
762
+ },
763
+ {
764
+ "indexed": false,
765
+ "name": "defeatedChampID",
766
+ "type": "uint256"
767
+ },
768
+ {
769
+ "indexed": false,
770
+ "name": "didAttackerWin",
771
+ "type": "bool"
772
+ }
773
+ ],
774
+ "name": "Attack",
775
+ "type": "event"
776
+ },
777
+ {
778
+ "anonymous": false,
779
+ "inputs": [
780
+ {
781
+ "indexed": false,
782
+ "name": "forgedItemID",
783
+ "type": "uint256"
784
+ }
785
+ ],
786
+ "name": "Forge",
787
+ "type": "event"
788
+ },
789
+ {
790
+ "anonymous": false,
791
+ "inputs": [
792
+ {
793
+ "indexed": false,
794
+ "name": "from",
795
+ "type": "address"
796
+ },
797
+ {
798
+ "indexed": false,
799
+ "name": "to",
800
+ "type": "address"
801
+ },
802
+ {
803
+ "indexed": false,
804
+ "name": "itemID",
805
+ "type": "uint256"
806
+ }
807
+ ],
808
+ "name": "TransferItem",
809
+ "type": "event"
810
+ },
811
+ {
812
+ "anonymous": false,
813
+ "inputs": [
814
+ {
815
+ "indexed": false,
816
+ "name": "itemID",
817
+ "type": "uint256"
818
+ },
819
+ {
820
+ "indexed": false,
821
+ "name": "owner",
822
+ "type": "address"
823
+ }
824
+ ],
825
+ "name": "NewItem",
826
+ "type": "event"
827
+ },
828
+ {
829
+ "anonymous": false,
830
+ "inputs": [
831
+ {
832
+ "indexed": false,
833
+ "name": "champID",
834
+ "type": "uint256"
835
+ },
836
+ {
837
+ "indexed": false,
838
+ "name": "owner",
839
+ "type": "address"
840
+ }
841
+ ],
842
+ "name": "NewChamp",
843
+ "type": "event"
844
+ }
845
+ ];
846
+ /**
847
+ * MyCryptoChampCore_json Contract Class
848
+ *
849
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
850
+ *
851
+ * @example
852
+ * ```typescript
853
+ * import { createPublicClient, createWalletClient, http } from 'viem';
854
+ * import { mainnet } from 'viem/chains';
855
+ * import { MyCryptoChampCore_json } from 'MyCryptoChampCore_json';
856
+ *
857
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
858
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
859
+ *
860
+ * const contract = new MyCryptoChampCore_json('0x...', { publicClient, walletClient });
861
+ *
862
+ * // Read functions
863
+ * const result = await contract.balanceOf('0x...');
864
+ *
865
+ * // Write functions
866
+ * const hash = await contract.transfer('0x...', 1000n);
867
+ *
868
+ * // Simulate transactions (dry-run)
869
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
870
+ * console.log('Gas estimate:', simulation.request.gas);
871
+ *
872
+ * // Watch events
873
+ * const unwatch = contract.watch.Transfer((event) => {
874
+ * console.log('Transfer event:', event);
875
+ * });
876
+ * ```
877
+ */
878
+ class MyCryptoChampCore_json {
879
+ constructor(address, clients) {
880
+ this.contractAddress = address;
881
+ this.publicClient = clients.publicClient;
882
+ this.contract = (0, viem_1.getContract)({
883
+ address,
884
+ abi: exports.MyCryptoChampCore_jsonAbi,
885
+ client: {
886
+ public: clients.publicClient,
887
+ wallet: clients.walletClient,
888
+ },
889
+ });
890
+ }
891
+ /**
892
+ * Get the contract address
893
+ */
894
+ get address() {
895
+ return this.contractAddress;
896
+ }
897
+ /**
898
+ * Get the underlying viem contract instance
899
+ */
900
+ getContract() {
901
+ return this.contract;
902
+ }
903
+ /**
904
+ * getItemsForSale
905
+ * view
906
+ */
907
+ async getItemsForSale() {
908
+ return this.contract.read.getItemsForSale();
909
+ }
910
+ /**
911
+ * itemsForSaleCount
912
+ * view
913
+ */
914
+ async itemsForSaleCount() {
915
+ return this.contract.read.itemsForSaleCount();
916
+ }
917
+ /**
918
+ * itemToOwner
919
+ * view
920
+ */
921
+ async itemToOwner(arg0) {
922
+ return this.contract.read.itemToOwner([arg0]);
923
+ }
924
+ /**
925
+ * champsForSaleCount
926
+ * view
927
+ */
928
+ async champsForSaleCount() {
929
+ return this.contract.read.champsForSaleCount();
930
+ }
931
+ /**
932
+ * addressInfo
933
+ * view
934
+ */
935
+ async addressInfo(arg0) {
936
+ return this.contract.read.addressInfo([arg0]);
937
+ }
938
+ /**
939
+ * getItemsByOwner
940
+ * view
941
+ */
942
+ async getItemsByOwner(_owner) {
943
+ return this.contract.read.getItemsByOwner([_owner]);
944
+ }
945
+ /**
946
+ * getChampsCount
947
+ * view
948
+ */
949
+ async getChampsCount() {
950
+ return this.contract.read.getChampsCount();
951
+ }
952
+ /**
953
+ * getChampStats
954
+ * view
955
+ */
956
+ async getChampStats(_champId) {
957
+ return this.contract.read.getChampStats([_champId]);
958
+ }
959
+ /**
960
+ * getChampsForSale
961
+ * view
962
+ */
963
+ async getChampsForSale() {
964
+ return this.contract.read.getChampsForSale();
965
+ }
966
+ /**
967
+ * champToName
968
+ * view
969
+ */
970
+ async champToName(arg0) {
971
+ return this.contract.read.champToName([arg0]);
972
+ }
973
+ /**
974
+ * getChampReward
975
+ * view
976
+ */
977
+ async getChampReward(_position) {
978
+ return this.contract.read.getChampReward([_position]);
979
+ }
980
+ /**
981
+ * leaderboard
982
+ * view
983
+ */
984
+ async leaderboard(arg0) {
985
+ return this.contract.read.leaderboard([arg0]);
986
+ }
987
+ /**
988
+ * items
989
+ * view
990
+ */
991
+ async items(arg0) {
992
+ return this.contract.read.items([arg0]);
993
+ }
994
+ /**
995
+ * champs
996
+ * view
997
+ */
998
+ async champs(arg0) {
999
+ return this.contract.read.champs([arg0]);
1000
+ }
1001
+ /**
1002
+ * getChampsByOwner
1003
+ * view
1004
+ */
1005
+ async getChampsByOwner(_owner) {
1006
+ return this.contract.read.getChampsByOwner([_owner]);
1007
+ }
1008
+ /**
1009
+ * champToOwner
1010
+ * view
1011
+ */
1012
+ async champToOwner(arg0) {
1013
+ return this.contract.read.champToOwner([arg0]);
1014
+ }
1015
+ /**
1016
+ * openLootbox
1017
+ * payable
1018
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1019
+ */
1020
+ async openLootbox(_affiliateAddress, options) {
1021
+ if (!this.contract.write) {
1022
+ throw new Error('Wallet client is required for write operations');
1023
+ }
1024
+ return this.contract.write.openLootbox([_affiliateAddress], options);
1025
+ }
1026
+ /**
1027
+ * withdrawChamp
1028
+ * nonpayable
1029
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1030
+ */
1031
+ async withdrawChamp(_id, options) {
1032
+ if (!this.contract.write) {
1033
+ throw new Error('Wallet client is required for write operations');
1034
+ }
1035
+ return this.contract.write.withdrawChamp([_id], options);
1036
+ }
1037
+ /**
1038
+ * forgeItems
1039
+ * nonpayable
1040
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1041
+ */
1042
+ async forgeItems(_parentItemID, _childItemID, options) {
1043
+ if (!this.contract.write) {
1044
+ throw new Error('Wallet client is required for write operations');
1045
+ }
1046
+ return this.contract.write.forgeItems([_parentItemID, _childItemID], options);
1047
+ }
1048
+ /**
1049
+ * putOn
1050
+ * nonpayable
1051
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1052
+ */
1053
+ async putOn(_champId, _itemId, options) {
1054
+ if (!this.contract.write) {
1055
+ throw new Error('Wallet client is required for write operations');
1056
+ }
1057
+ return this.contract.write.putOn([_champId, _itemId], options);
1058
+ }
1059
+ /**
1060
+ * cancelChampSale
1061
+ * nonpayable
1062
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1063
+ */
1064
+ async cancelChampSale(_id, options) {
1065
+ if (!this.contract.write) {
1066
+ throw new Error('Wallet client is required for write operations');
1067
+ }
1068
+ return this.contract.write.cancelChampSale([_id], options);
1069
+ }
1070
+ /**
1071
+ * buyChamp
1072
+ * payable
1073
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1074
+ */
1075
+ async buyChamp(_id, options) {
1076
+ if (!this.contract.write) {
1077
+ throw new Error('Wallet client is required for write operations');
1078
+ }
1079
+ return this.contract.write.buyChamp([_id], options);
1080
+ }
1081
+ /**
1082
+ * changePlayersName
1083
+ * nonpayable
1084
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1085
+ */
1086
+ async changePlayersName(_name, options) {
1087
+ if (!this.contract.write) {
1088
+ throw new Error('Wallet client is required for write operations');
1089
+ }
1090
+ return this.contract.write.changePlayersName([_name], options);
1091
+ }
1092
+ /**
1093
+ * giveChamp
1094
+ * nonpayable
1095
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1096
+ */
1097
+ async giveChamp(_to, _champId, options) {
1098
+ if (!this.contract.write) {
1099
+ throw new Error('Wallet client is required for write operations');
1100
+ }
1101
+ return this.contract.write.giveChamp([_to, _champId], options);
1102
+ }
1103
+ /**
1104
+ * triggerPause
1105
+ * nonpayable
1106
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1107
+ */
1108
+ async triggerPause(options) {
1109
+ if (!this.contract.write) {
1110
+ throw new Error('Wallet client is required for write operations');
1111
+ }
1112
+ return this.contract.write.triggerPause(options);
1113
+ }
1114
+ /**
1115
+ * createChamp
1116
+ * payable
1117
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1118
+ */
1119
+ async createChamp(_affiliateAddress, options) {
1120
+ if (!this.contract.write) {
1121
+ throw new Error('Wallet client is required for write operations');
1122
+ }
1123
+ return this.contract.write.createChamp([_affiliateAddress], options);
1124
+ }
1125
+ /**
1126
+ * withdrawToAddress
1127
+ * nonpayable
1128
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1129
+ */
1130
+ async withdrawToAddress(_address, options) {
1131
+ if (!this.contract.write) {
1132
+ throw new Error('Wallet client is required for write operations');
1133
+ }
1134
+ return this.contract.write.withdrawToAddress([_address], options);
1135
+ }
1136
+ /**
1137
+ * setItemForSale
1138
+ * nonpayable
1139
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1140
+ */
1141
+ async setItemForSale(_id, _price, options) {
1142
+ if (!this.contract.write) {
1143
+ throw new Error('Wallet client is required for write operations');
1144
+ }
1145
+ return this.contract.write.setItemForSale([_id, _price], options);
1146
+ }
1147
+ /**
1148
+ * changeChampsName
1149
+ * nonpayable
1150
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1151
+ */
1152
+ async changeChampsName(_champId, _name, options) {
1153
+ if (!this.contract.write) {
1154
+ throw new Error('Wallet client is required for write operations');
1155
+ }
1156
+ return this.contract.write.changeChampsName([_champId, _name], options);
1157
+ }
1158
+ /**
1159
+ * cancelItemSale
1160
+ * nonpayable
1161
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1162
+ */
1163
+ async cancelItemSale(_id, options) {
1164
+ if (!this.contract.write) {
1165
+ throw new Error('Wallet client is required for write operations');
1166
+ }
1167
+ return this.contract.write.cancelItemSale([_id], options);
1168
+ }
1169
+ /**
1170
+ * setCreateChampFee
1171
+ * nonpayable
1172
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1173
+ */
1174
+ async setCreateChampFee(_fee, options) {
1175
+ if (!this.contract.write) {
1176
+ throw new Error('Wallet client is required for write operations');
1177
+ }
1178
+ return this.contract.write.setCreateChampFee([_fee], options);
1179
+ }
1180
+ /**
1181
+ * giveItem
1182
+ * nonpayable
1183
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1184
+ */
1185
+ async giveItem(_to, _itemID, options) {
1186
+ if (!this.contract.write) {
1187
+ throw new Error('Wallet client is required for write operations');
1188
+ }
1189
+ return this.contract.write.giveItem([_to, _itemID], options);
1190
+ }
1191
+ /**
1192
+ * takeOffItem
1193
+ * nonpayable
1194
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1195
+ */
1196
+ async takeOffItem(_champId, _type, options) {
1197
+ if (!this.contract.write) {
1198
+ throw new Error('Wallet client is required for write operations');
1199
+ }
1200
+ return this.contract.write.takeOffItem([_champId, _type], options);
1201
+ }
1202
+ /**
1203
+ * setLootboxFee
1204
+ * nonpayable
1205
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1206
+ */
1207
+ async setLootboxFee(_fee, options) {
1208
+ if (!this.contract.write) {
1209
+ throw new Error('Wallet client is required for write operations');
1210
+ }
1211
+ return this.contract.write.setLootboxFee([_fee], options);
1212
+ }
1213
+ /**
1214
+ * attack
1215
+ * nonpayable
1216
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1217
+ */
1218
+ async attack(_champId, _targetId, options) {
1219
+ if (!this.contract.write) {
1220
+ throw new Error('Wallet client is required for write operations');
1221
+ }
1222
+ return this.contract.write.attack([_champId, _targetId], options);
1223
+ }
1224
+ /**
1225
+ * buyItem
1226
+ * payable
1227
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1228
+ */
1229
+ async buyItem(_id, options) {
1230
+ if (!this.contract.write) {
1231
+ throw new Error('Wallet client is required for write operations');
1232
+ }
1233
+ return this.contract.write.buyItem([_id], options);
1234
+ }
1235
+ /**
1236
+ * setChampForSale
1237
+ * nonpayable
1238
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1239
+ */
1240
+ async setChampForSale(_id, _price, options) {
1241
+ if (!this.contract.write) {
1242
+ throw new Error('Wallet client is required for write operations');
1243
+ }
1244
+ return this.contract.write.setChampForSale([_id, _price], options);
1245
+ }
1246
+ /**
1247
+ * transferOwnership
1248
+ * nonpayable
1249
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1250
+ */
1251
+ async transferOwnership(newOwner, options) {
1252
+ if (!this.contract.write) {
1253
+ throw new Error('Wallet client is required for write operations');
1254
+ }
1255
+ return this.contract.write.transferOwnership([newOwner], options);
1256
+ }
1257
+ /**
1258
+ * Simulate contract write operations (dry-run without sending transaction)
1259
+ *
1260
+ * @example
1261
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1262
+ * console.log('Gas estimate:', result.request.gas);
1263
+ * console.log('Would succeed:', result.result);
1264
+ */
1265
+ get simulate() {
1266
+ const contract = this.contract;
1267
+ if (!contract.simulate) {
1268
+ throw new Error('Public client is required for simulation');
1269
+ }
1270
+ return {
1271
+ /**
1272
+ * Simulate openLootbox
1273
+ * Returns gas estimate and result without sending transaction
1274
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1275
+ */
1276
+ async openLootbox(_affiliateAddress, options) {
1277
+ return contract.simulate.openLootbox([_affiliateAddress], options);
1278
+ },
1279
+ /**
1280
+ * Simulate withdrawChamp
1281
+ * Returns gas estimate and result without sending transaction
1282
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1283
+ */
1284
+ async withdrawChamp(_id, options) {
1285
+ return contract.simulate.withdrawChamp([_id], options);
1286
+ },
1287
+ /**
1288
+ * Simulate forgeItems
1289
+ * Returns gas estimate and result without sending transaction
1290
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1291
+ */
1292
+ async forgeItems(_parentItemID, _childItemID, options) {
1293
+ return contract.simulate.forgeItems([_parentItemID, _childItemID], options);
1294
+ },
1295
+ /**
1296
+ * Simulate putOn
1297
+ * Returns gas estimate and result without sending transaction
1298
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1299
+ */
1300
+ async putOn(_champId, _itemId, options) {
1301
+ return contract.simulate.putOn([_champId, _itemId], options);
1302
+ },
1303
+ /**
1304
+ * Simulate cancelChampSale
1305
+ * Returns gas estimate and result without sending transaction
1306
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1307
+ */
1308
+ async cancelChampSale(_id, options) {
1309
+ return contract.simulate.cancelChampSale([_id], options);
1310
+ },
1311
+ /**
1312
+ * Simulate buyChamp
1313
+ * Returns gas estimate and result without sending transaction
1314
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1315
+ */
1316
+ async buyChamp(_id, options) {
1317
+ return contract.simulate.buyChamp([_id], options);
1318
+ },
1319
+ /**
1320
+ * Simulate changePlayersName
1321
+ * Returns gas estimate and result without sending transaction
1322
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1323
+ */
1324
+ async changePlayersName(_name, options) {
1325
+ return contract.simulate.changePlayersName([_name], options);
1326
+ },
1327
+ /**
1328
+ * Simulate giveChamp
1329
+ * Returns gas estimate and result without sending transaction
1330
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1331
+ */
1332
+ async giveChamp(_to, _champId, options) {
1333
+ return contract.simulate.giveChamp([_to, _champId], options);
1334
+ },
1335
+ /**
1336
+ * Simulate triggerPause
1337
+ * Returns gas estimate and result without sending transaction
1338
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1339
+ */
1340
+ async triggerPause(options) {
1341
+ return contract.simulate.triggerPause(options);
1342
+ },
1343
+ /**
1344
+ * Simulate createChamp
1345
+ * Returns gas estimate and result without sending transaction
1346
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1347
+ */
1348
+ async createChamp(_affiliateAddress, options) {
1349
+ return contract.simulate.createChamp([_affiliateAddress], options);
1350
+ },
1351
+ /**
1352
+ * Simulate withdrawToAddress
1353
+ * Returns gas estimate and result without sending transaction
1354
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1355
+ */
1356
+ async withdrawToAddress(_address, options) {
1357
+ return contract.simulate.withdrawToAddress([_address], options);
1358
+ },
1359
+ /**
1360
+ * Simulate setItemForSale
1361
+ * Returns gas estimate and result without sending transaction
1362
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1363
+ */
1364
+ async setItemForSale(_id, _price, options) {
1365
+ return contract.simulate.setItemForSale([_id, _price], options);
1366
+ },
1367
+ /**
1368
+ * Simulate changeChampsName
1369
+ * Returns gas estimate and result without sending transaction
1370
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1371
+ */
1372
+ async changeChampsName(_champId, _name, options) {
1373
+ return contract.simulate.changeChampsName([_champId, _name], options);
1374
+ },
1375
+ /**
1376
+ * Simulate cancelItemSale
1377
+ * Returns gas estimate and result without sending transaction
1378
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1379
+ */
1380
+ async cancelItemSale(_id, options) {
1381
+ return contract.simulate.cancelItemSale([_id], options);
1382
+ },
1383
+ /**
1384
+ * Simulate setCreateChampFee
1385
+ * Returns gas estimate and result without sending transaction
1386
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1387
+ */
1388
+ async setCreateChampFee(_fee, options) {
1389
+ return contract.simulate.setCreateChampFee([_fee], options);
1390
+ },
1391
+ /**
1392
+ * Simulate giveItem
1393
+ * Returns gas estimate and result without sending transaction
1394
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1395
+ */
1396
+ async giveItem(_to, _itemID, options) {
1397
+ return contract.simulate.giveItem([_to, _itemID], options);
1398
+ },
1399
+ /**
1400
+ * Simulate takeOffItem
1401
+ * Returns gas estimate and result without sending transaction
1402
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1403
+ */
1404
+ async takeOffItem(_champId, _type, options) {
1405
+ return contract.simulate.takeOffItem([_champId, _type], options);
1406
+ },
1407
+ /**
1408
+ * Simulate setLootboxFee
1409
+ * Returns gas estimate and result without sending transaction
1410
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1411
+ */
1412
+ async setLootboxFee(_fee, options) {
1413
+ return contract.simulate.setLootboxFee([_fee], options);
1414
+ },
1415
+ /**
1416
+ * Simulate attack
1417
+ * Returns gas estimate and result without sending transaction
1418
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1419
+ */
1420
+ async attack(_champId, _targetId, options) {
1421
+ return contract.simulate.attack([_champId, _targetId], options);
1422
+ },
1423
+ /**
1424
+ * Simulate buyItem
1425
+ * Returns gas estimate and result without sending transaction
1426
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1427
+ */
1428
+ async buyItem(_id, options) {
1429
+ return contract.simulate.buyItem([_id], options);
1430
+ },
1431
+ /**
1432
+ * Simulate setChampForSale
1433
+ * Returns gas estimate and result without sending transaction
1434
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1435
+ */
1436
+ async setChampForSale(_id, _price, options) {
1437
+ return contract.simulate.setChampForSale([_id, _price], options);
1438
+ },
1439
+ /**
1440
+ * Simulate transferOwnership
1441
+ * Returns gas estimate and result without sending transaction
1442
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1443
+ */
1444
+ async transferOwnership(newOwner, options) {
1445
+ return contract.simulate.transferOwnership([newOwner], options);
1446
+ }
1447
+ };
1448
+ }
1449
+ /**
1450
+ * Watch contract events
1451
+ *
1452
+ * @example
1453
+ * // Watch all Transfer events
1454
+ * const unwatch = contract.watch.Transfer((event) => {
1455
+ * console.log('Transfer:', event);
1456
+ * });
1457
+ *
1458
+ * // Stop watching
1459
+ * unwatch();
1460
+ */
1461
+ get watch() {
1462
+ return {
1463
+ /**
1464
+ * Watch TransferChamp events
1465
+ * @param callback Function to call when event is emitted
1466
+ * @param filter Optional filter for indexed parameters
1467
+ * @returns Unwatch function to stop listening
1468
+ */
1469
+ TransferChamp: (callback) => {
1470
+ return this.publicClient.watchContractEvent({
1471
+ address: this.contractAddress,
1472
+ abi: exports.MyCryptoChampCore_jsonAbi,
1473
+ eventName: 'TransferChamp',
1474
+ onLogs: (logs) => {
1475
+ logs.forEach((log) => {
1476
+ callback(log.args);
1477
+ });
1478
+ },
1479
+ });
1480
+ },
1481
+ /**
1482
+ * Watch Attack events
1483
+ * @param callback Function to call when event is emitted
1484
+ * @param filter Optional filter for indexed parameters
1485
+ * @returns Unwatch function to stop listening
1486
+ */
1487
+ Attack: (callback) => {
1488
+ return this.publicClient.watchContractEvent({
1489
+ address: this.contractAddress,
1490
+ abi: exports.MyCryptoChampCore_jsonAbi,
1491
+ eventName: 'Attack',
1492
+ onLogs: (logs) => {
1493
+ logs.forEach((log) => {
1494
+ callback(log.args);
1495
+ });
1496
+ },
1497
+ });
1498
+ },
1499
+ /**
1500
+ * Watch Forge events
1501
+ * @param callback Function to call when event is emitted
1502
+ * @param filter Optional filter for indexed parameters
1503
+ * @returns Unwatch function to stop listening
1504
+ */
1505
+ Forge: (callback) => {
1506
+ return this.publicClient.watchContractEvent({
1507
+ address: this.contractAddress,
1508
+ abi: exports.MyCryptoChampCore_jsonAbi,
1509
+ eventName: 'Forge',
1510
+ onLogs: (logs) => {
1511
+ logs.forEach((log) => {
1512
+ callback(log.args);
1513
+ });
1514
+ },
1515
+ });
1516
+ },
1517
+ /**
1518
+ * Watch TransferItem events
1519
+ * @param callback Function to call when event is emitted
1520
+ * @param filter Optional filter for indexed parameters
1521
+ * @returns Unwatch function to stop listening
1522
+ */
1523
+ TransferItem: (callback) => {
1524
+ return this.publicClient.watchContractEvent({
1525
+ address: this.contractAddress,
1526
+ abi: exports.MyCryptoChampCore_jsonAbi,
1527
+ eventName: 'TransferItem',
1528
+ onLogs: (logs) => {
1529
+ logs.forEach((log) => {
1530
+ callback(log.args);
1531
+ });
1532
+ },
1533
+ });
1534
+ },
1535
+ /**
1536
+ * Watch NewItem events
1537
+ * @param callback Function to call when event is emitted
1538
+ * @param filter Optional filter for indexed parameters
1539
+ * @returns Unwatch function to stop listening
1540
+ */
1541
+ NewItem: (callback) => {
1542
+ return this.publicClient.watchContractEvent({
1543
+ address: this.contractAddress,
1544
+ abi: exports.MyCryptoChampCore_jsonAbi,
1545
+ eventName: 'NewItem',
1546
+ onLogs: (logs) => {
1547
+ logs.forEach((log) => {
1548
+ callback(log.args);
1549
+ });
1550
+ },
1551
+ });
1552
+ },
1553
+ /**
1554
+ * Watch NewChamp events
1555
+ * @param callback Function to call when event is emitted
1556
+ * @param filter Optional filter for indexed parameters
1557
+ * @returns Unwatch function to stop listening
1558
+ */
1559
+ NewChamp: (callback) => {
1560
+ return this.publicClient.watchContractEvent({
1561
+ address: this.contractAddress,
1562
+ abi: exports.MyCryptoChampCore_jsonAbi,
1563
+ eventName: 'NewChamp',
1564
+ onLogs: (logs) => {
1565
+ logs.forEach((log) => {
1566
+ callback(log.args);
1567
+ });
1568
+ },
1569
+ });
1570
+ }
1571
+ };
1572
+ }
1573
+ }
1574
+ exports.MyCryptoChampCore_json = MyCryptoChampCore_json;