@gitmyabi/kndc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1311 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KanadeCoin_json = exports.KanadeCoin_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * KanadeCoin_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.KanadeCoin_jsonAbi = [
11
+ {
12
+ "constant": true,
13
+ "inputs": [],
14
+ "name": "name",
15
+ "outputs": [
16
+ {
17
+ "name": "",
18
+ "type": "string"
19
+ }
20
+ ],
21
+ "payable": false,
22
+ "stateMutability": "view",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "constant": false,
27
+ "inputs": [
28
+ {
29
+ "name": "_spender",
30
+ "type": "address"
31
+ },
32
+ {
33
+ "name": "_value",
34
+ "type": "uint256"
35
+ }
36
+ ],
37
+ "name": "approve",
38
+ "outputs": [
39
+ {
40
+ "name": "",
41
+ "type": "bool"
42
+ }
43
+ ],
44
+ "payable": false,
45
+ "stateMutability": "nonpayable",
46
+ "type": "function"
47
+ },
48
+ {
49
+ "constant": true,
50
+ "inputs": [],
51
+ "name": "contractStartTime",
52
+ "outputs": [
53
+ {
54
+ "name": "",
55
+ "type": "uint256"
56
+ }
57
+ ],
58
+ "payable": false,
59
+ "stateMutability": "view",
60
+ "type": "function"
61
+ },
62
+ {
63
+ "constant": false,
64
+ "inputs": [
65
+ {
66
+ "name": "_text",
67
+ "type": "string"
68
+ }
69
+ ],
70
+ "name": "putSaveData",
71
+ "outputs": [],
72
+ "payable": false,
73
+ "stateMutability": "nonpayable",
74
+ "type": "function"
75
+ },
76
+ {
77
+ "constant": true,
78
+ "inputs": [],
79
+ "name": "totalSupply",
80
+ "outputs": [
81
+ {
82
+ "name": "",
83
+ "type": "uint256"
84
+ }
85
+ ],
86
+ "payable": false,
87
+ "stateMutability": "view",
88
+ "type": "function"
89
+ },
90
+ {
91
+ "constant": false,
92
+ "inputs": [
93
+ {
94
+ "name": "_id_max32",
95
+ "type": "string"
96
+ },
97
+ {
98
+ "name": "_recipient",
99
+ "type": "address"
100
+ },
101
+ {
102
+ "name": "_volume",
103
+ "type": "uint64"
104
+ },
105
+ {
106
+ "name": "_amount",
107
+ "type": "uint256"
108
+ },
109
+ {
110
+ "name": "_finish",
111
+ "type": "uint128"
112
+ }
113
+ ],
114
+ "name": "createRandomBox",
115
+ "outputs": [],
116
+ "payable": false,
117
+ "stateMutability": "nonpayable",
118
+ "type": "function"
119
+ },
120
+ {
121
+ "constant": true,
122
+ "inputs": [],
123
+ "name": "addrLockUp",
124
+ "outputs": [
125
+ {
126
+ "name": "",
127
+ "type": "address"
128
+ }
129
+ ],
130
+ "payable": false,
131
+ "stateMutability": "view",
132
+ "type": "function"
133
+ },
134
+ {
135
+ "constant": false,
136
+ "inputs": [
137
+ {
138
+ "name": "_from",
139
+ "type": "address"
140
+ },
141
+ {
142
+ "name": "_to",
143
+ "type": "address"
144
+ },
145
+ {
146
+ "name": "_value",
147
+ "type": "uint256"
148
+ }
149
+ ],
150
+ "name": "transferFrom",
151
+ "outputs": [
152
+ {
153
+ "name": "",
154
+ "type": "bool"
155
+ }
156
+ ],
157
+ "payable": false,
158
+ "stateMutability": "nonpayable",
159
+ "type": "function"
160
+ },
161
+ {
162
+ "constant": true,
163
+ "inputs": [],
164
+ "name": "atto",
165
+ "outputs": [
166
+ {
167
+ "name": "",
168
+ "type": "uint256"
169
+ }
170
+ ],
171
+ "payable": false,
172
+ "stateMutability": "view",
173
+ "type": "function"
174
+ },
175
+ {
176
+ "constant": true,
177
+ "inputs": [],
178
+ "name": "addrAirDrop",
179
+ "outputs": [
180
+ {
181
+ "name": "",
182
+ "type": "address"
183
+ }
184
+ ],
185
+ "payable": false,
186
+ "stateMutability": "view",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "constant": true,
191
+ "inputs": [
192
+ {
193
+ "name": "_id_max32",
194
+ "type": "string"
195
+ }
196
+ ],
197
+ "name": "getRandomBox",
198
+ "outputs": [
199
+ {
200
+ "name": "",
201
+ "type": "uint256[5]"
202
+ }
203
+ ],
204
+ "payable": false,
205
+ "stateMutability": "view",
206
+ "type": "function"
207
+ },
208
+ {
209
+ "constant": true,
210
+ "inputs": [],
211
+ "name": "decimals",
212
+ "outputs": [
213
+ {
214
+ "name": "",
215
+ "type": "uint256"
216
+ }
217
+ ],
218
+ "payable": false,
219
+ "stateMutability": "view",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "constant": false,
224
+ "inputs": [
225
+ {
226
+ "name": "_id_max32",
227
+ "type": "string"
228
+ },
229
+ {
230
+ "name": "_recipient",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "name": "_finish",
235
+ "type": "uint128"
236
+ },
237
+ {
238
+ "name": "_under",
239
+ "type": "uint256"
240
+ }
241
+ ],
242
+ "name": "createQuestion",
243
+ "outputs": [],
244
+ "payable": false,
245
+ "stateMutability": "nonpayable",
246
+ "type": "function"
247
+ },
248
+ {
249
+ "constant": true,
250
+ "inputs": [],
251
+ "name": "addrDevTeam",
252
+ "outputs": [
253
+ {
254
+ "name": "",
255
+ "type": "address"
256
+ }
257
+ ],
258
+ "payable": false,
259
+ "stateMutability": "view",
260
+ "type": "function"
261
+ },
262
+ {
263
+ "constant": true,
264
+ "inputs": [],
265
+ "name": "addrDistribution",
266
+ "outputs": [
267
+ {
268
+ "name": "",
269
+ "type": "address"
270
+ }
271
+ ],
272
+ "payable": false,
273
+ "stateMutability": "view",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "constant": true,
278
+ "inputs": [
279
+ {
280
+ "name": "_id_max32",
281
+ "type": "string"
282
+ },
283
+ {
284
+ "name": "_position",
285
+ "type": "uint256"
286
+ }
287
+ ],
288
+ "name": "getQuestionVote",
289
+ "outputs": [
290
+ {
291
+ "name": "",
292
+ "type": "uint256[4]"
293
+ }
294
+ ],
295
+ "payable": false,
296
+ "stateMutability": "view",
297
+ "type": "function"
298
+ },
299
+ {
300
+ "constant": false,
301
+ "inputs": [],
302
+ "name": "unLockup",
303
+ "outputs": [],
304
+ "payable": false,
305
+ "stateMutability": "nonpayable",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "constant": false,
310
+ "inputs": [
311
+ {
312
+ "name": "_id_max32",
313
+ "type": "string"
314
+ },
315
+ {
316
+ "name": "_count",
317
+ "type": "uint256"
318
+ }
319
+ ],
320
+ "name": "drawRandomItem",
321
+ "outputs": [],
322
+ "payable": false,
323
+ "stateMutability": "nonpayable",
324
+ "type": "function"
325
+ },
326
+ {
327
+ "constant": false,
328
+ "inputs": [
329
+ {
330
+ "name": "_recipients",
331
+ "type": "address[]"
332
+ },
333
+ {
334
+ "name": "_values",
335
+ "type": "uint256[]"
336
+ }
337
+ ],
338
+ "name": "airDrop",
339
+ "outputs": [
340
+ {
341
+ "name": "",
342
+ "type": "bool"
343
+ }
344
+ ],
345
+ "payable": false,
346
+ "stateMutability": "nonpayable",
347
+ "type": "function"
348
+ },
349
+ {
350
+ "constant": false,
351
+ "inputs": [
352
+ {
353
+ "name": "_spender",
354
+ "type": "address"
355
+ },
356
+ {
357
+ "name": "_subtractedValue",
358
+ "type": "uint256"
359
+ }
360
+ ],
361
+ "name": "decreaseApproval",
362
+ "outputs": [
363
+ {
364
+ "name": "",
365
+ "type": "bool"
366
+ }
367
+ ],
368
+ "payable": false,
369
+ "stateMutability": "nonpayable",
370
+ "type": "function"
371
+ },
372
+ {
373
+ "constant": true,
374
+ "inputs": [
375
+ {
376
+ "name": "_id_max32",
377
+ "type": "string"
378
+ }
379
+ ],
380
+ "name": "getQuestionVotesAllCount",
381
+ "outputs": [
382
+ {
383
+ "name": "",
384
+ "type": "uint256"
385
+ }
386
+ ],
387
+ "payable": false,
388
+ "stateMutability": "view",
389
+ "type": "function"
390
+ },
391
+ {
392
+ "constant": true,
393
+ "inputs": [
394
+ {
395
+ "name": "_owner",
396
+ "type": "address"
397
+ }
398
+ ],
399
+ "name": "balanceOf",
400
+ "outputs": [
401
+ {
402
+ "name": "balance",
403
+ "type": "uint256"
404
+ }
405
+ ],
406
+ "payable": false,
407
+ "stateMutability": "view",
408
+ "type": "function"
409
+ },
410
+ {
411
+ "constant": true,
412
+ "inputs": [],
413
+ "name": "lockupSeconds",
414
+ "outputs": [
415
+ {
416
+ "name": "",
417
+ "type": "uint64"
418
+ }
419
+ ],
420
+ "payable": false,
421
+ "stateMutability": "view",
422
+ "type": "function"
423
+ },
424
+ {
425
+ "constant": false,
426
+ "inputs": [
427
+ {
428
+ "name": "_recipients",
429
+ "type": "address[]"
430
+ },
431
+ {
432
+ "name": "_values",
433
+ "type": "uint256[]"
434
+ }
435
+ ],
436
+ "name": "rain",
437
+ "outputs": [
438
+ {
439
+ "name": "",
440
+ "type": "bool"
441
+ }
442
+ ],
443
+ "payable": false,
444
+ "stateMutability": "nonpayable",
445
+ "type": "function"
446
+ },
447
+ {
448
+ "constant": true,
449
+ "inputs": [],
450
+ "name": "owner",
451
+ "outputs": [
452
+ {
453
+ "name": "",
454
+ "type": "address"
455
+ }
456
+ ],
457
+ "payable": false,
458
+ "stateMutability": "view",
459
+ "type": "function"
460
+ },
461
+ {
462
+ "constant": true,
463
+ "inputs": [],
464
+ "name": "symbol",
465
+ "outputs": [
466
+ {
467
+ "name": "",
468
+ "type": "string"
469
+ }
470
+ ],
471
+ "payable": false,
472
+ "stateMutability": "view",
473
+ "type": "function"
474
+ },
475
+ {
476
+ "constant": false,
477
+ "inputs": [],
478
+ "name": "initializeContract",
479
+ "outputs": [],
480
+ "payable": false,
481
+ "stateMutability": "nonpayable",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "constant": false,
486
+ "inputs": [
487
+ {
488
+ "name": "_to",
489
+ "type": "address"
490
+ },
491
+ {
492
+ "name": "_value",
493
+ "type": "uint256"
494
+ }
495
+ ],
496
+ "name": "transfer",
497
+ "outputs": [
498
+ {
499
+ "name": "",
500
+ "type": "bool"
501
+ }
502
+ ],
503
+ "payable": false,
504
+ "stateMutability": "nonpayable",
505
+ "type": "function"
506
+ },
507
+ {
508
+ "constant": true,
509
+ "inputs": [],
510
+ "name": "addrBounty",
511
+ "outputs": [
512
+ {
513
+ "name": "",
514
+ "type": "address"
515
+ }
516
+ ],
517
+ "payable": false,
518
+ "stateMutability": "view",
519
+ "type": "function"
520
+ },
521
+ {
522
+ "constant": true,
523
+ "inputs": [
524
+ {
525
+ "name": "_addrss",
526
+ "type": "address"
527
+ },
528
+ {
529
+ "name": "_id_max32",
530
+ "type": "string"
531
+ }
532
+ ],
533
+ "name": "getRandomItems",
534
+ "outputs": [
535
+ {
536
+ "name": "",
537
+ "type": "uint256[]"
538
+ }
539
+ ],
540
+ "payable": false,
541
+ "stateMutability": "view",
542
+ "type": "function"
543
+ },
544
+ {
545
+ "constant": true,
546
+ "inputs": [
547
+ {
548
+ "name": "_id_max32",
549
+ "type": "string"
550
+ }
551
+ ],
552
+ "name": "getQuestion",
553
+ "outputs": [
554
+ {
555
+ "name": "",
556
+ "type": "uint256[4]"
557
+ }
558
+ ],
559
+ "payable": false,
560
+ "stateMutability": "view",
561
+ "type": "function"
562
+ },
563
+ {
564
+ "constant": false,
565
+ "inputs": [
566
+ {
567
+ "name": "_spender",
568
+ "type": "address"
569
+ },
570
+ {
571
+ "name": "_addedValue",
572
+ "type": "uint256"
573
+ }
574
+ ],
575
+ "name": "increaseApproval",
576
+ "outputs": [
577
+ {
578
+ "name": "",
579
+ "type": "bool"
580
+ }
581
+ ],
582
+ "payable": false,
583
+ "stateMutability": "nonpayable",
584
+ "type": "function"
585
+ },
586
+ {
587
+ "constant": true,
588
+ "inputs": [
589
+ {
590
+ "name": "_owner",
591
+ "type": "address"
592
+ },
593
+ {
594
+ "name": "_spender",
595
+ "type": "address"
596
+ }
597
+ ],
598
+ "name": "allowance",
599
+ "outputs": [
600
+ {
601
+ "name": "",
602
+ "type": "uint256"
603
+ }
604
+ ],
605
+ "payable": false,
606
+ "stateMutability": "view",
607
+ "type": "function"
608
+ },
609
+ {
610
+ "constant": false,
611
+ "inputs": [
612
+ {
613
+ "name": "_id_max32",
614
+ "type": "string"
615
+ },
616
+ {
617
+ "name": "_number",
618
+ "type": "uint128"
619
+ },
620
+ {
621
+ "name": "_amount",
622
+ "type": "uint256"
623
+ }
624
+ ],
625
+ "name": "vote",
626
+ "outputs": [],
627
+ "payable": false,
628
+ "stateMutability": "nonpayable",
629
+ "type": "function"
630
+ },
631
+ {
632
+ "constant": false,
633
+ "inputs": [
634
+ {
635
+ "name": "newOwner",
636
+ "type": "address"
637
+ }
638
+ ],
639
+ "name": "transferOwnership",
640
+ "outputs": [],
641
+ "payable": false,
642
+ "stateMutability": "nonpayable",
643
+ "type": "function"
644
+ },
645
+ {
646
+ "constant": true,
647
+ "inputs": [
648
+ {
649
+ "name": "_address",
650
+ "type": "address"
651
+ }
652
+ ],
653
+ "name": "getSaveData",
654
+ "outputs": [
655
+ {
656
+ "name": "",
657
+ "type": "string"
658
+ }
659
+ ],
660
+ "payable": false,
661
+ "stateMutability": "view",
662
+ "type": "function"
663
+ },
664
+ {
665
+ "inputs": [],
666
+ "payable": false,
667
+ "stateMutability": "nonpayable",
668
+ "type": "constructor"
669
+ },
670
+ {
671
+ "anonymous": false,
672
+ "inputs": [
673
+ {
674
+ "indexed": true,
675
+ "name": "previousOwner",
676
+ "type": "address"
677
+ },
678
+ {
679
+ "indexed": true,
680
+ "name": "newOwner",
681
+ "type": "address"
682
+ }
683
+ ],
684
+ "name": "OwnershipTransferred",
685
+ "type": "event"
686
+ },
687
+ {
688
+ "anonymous": false,
689
+ "inputs": [
690
+ {
691
+ "indexed": true,
692
+ "name": "owner",
693
+ "type": "address"
694
+ },
695
+ {
696
+ "indexed": true,
697
+ "name": "spender",
698
+ "type": "address"
699
+ },
700
+ {
701
+ "indexed": false,
702
+ "name": "value",
703
+ "type": "uint256"
704
+ }
705
+ ],
706
+ "name": "Approval",
707
+ "type": "event"
708
+ },
709
+ {
710
+ "anonymous": false,
711
+ "inputs": [
712
+ {
713
+ "indexed": true,
714
+ "name": "from",
715
+ "type": "address"
716
+ },
717
+ {
718
+ "indexed": true,
719
+ "name": "to",
720
+ "type": "address"
721
+ },
722
+ {
723
+ "indexed": false,
724
+ "name": "value",
725
+ "type": "uint256"
726
+ }
727
+ ],
728
+ "name": "Transfer",
729
+ "type": "event"
730
+ }
731
+ ];
732
+ /**
733
+ * KanadeCoin_json Contract Class
734
+ *
735
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
736
+ *
737
+ * @example
738
+ * ```typescript
739
+ * import { createPublicClient, createWalletClient, http } from 'viem';
740
+ * import { mainnet } from 'viem/chains';
741
+ * import { KanadeCoin_json } from 'KanadeCoin_json';
742
+ *
743
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
744
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
745
+ *
746
+ * const contract = new KanadeCoin_json('0x...', { publicClient, walletClient });
747
+ *
748
+ * // Read functions
749
+ * const result = await contract.balanceOf('0x...');
750
+ *
751
+ * // Write functions
752
+ * const hash = await contract.transfer('0x...', 1000n);
753
+ *
754
+ * // Simulate transactions (dry-run)
755
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
756
+ * console.log('Gas estimate:', simulation.request.gas);
757
+ *
758
+ * // Watch events
759
+ * const unwatch = contract.watch.Transfer((event) => {
760
+ * console.log('Transfer event:', event);
761
+ * });
762
+ * ```
763
+ */
764
+ class KanadeCoin_json {
765
+ constructor(address, clients) {
766
+ this.contractAddress = address;
767
+ this.publicClient = clients.publicClient;
768
+ this.contract = (0, viem_1.getContract)({
769
+ address,
770
+ abi: exports.KanadeCoin_jsonAbi,
771
+ client: {
772
+ public: clients.publicClient,
773
+ wallet: clients.walletClient,
774
+ },
775
+ });
776
+ }
777
+ /**
778
+ * Get the contract address
779
+ */
780
+ get address() {
781
+ return this.contractAddress;
782
+ }
783
+ /**
784
+ * Get the underlying viem contract instance
785
+ */
786
+ getContract() {
787
+ return this.contract;
788
+ }
789
+ /**
790
+ * name
791
+ * view
792
+ */
793
+ async name() {
794
+ return this.contract.read.name();
795
+ }
796
+ /**
797
+ * contractStartTime
798
+ * view
799
+ */
800
+ async contractStartTime() {
801
+ return this.contract.read.contractStartTime();
802
+ }
803
+ /**
804
+ * totalSupply
805
+ * view
806
+ */
807
+ async totalSupply() {
808
+ return this.contract.read.totalSupply();
809
+ }
810
+ /**
811
+ * addrLockUp
812
+ * view
813
+ */
814
+ async addrLockUp() {
815
+ return this.contract.read.addrLockUp();
816
+ }
817
+ /**
818
+ * atto
819
+ * view
820
+ */
821
+ async atto() {
822
+ return this.contract.read.atto();
823
+ }
824
+ /**
825
+ * addrAirDrop
826
+ * view
827
+ */
828
+ async addrAirDrop() {
829
+ return this.contract.read.addrAirDrop();
830
+ }
831
+ /**
832
+ * getRandomBox
833
+ * view
834
+ */
835
+ async getRandomBox(_id_max32) {
836
+ return this.contract.read.getRandomBox([_id_max32]);
837
+ }
838
+ /**
839
+ * decimals
840
+ * view
841
+ */
842
+ async decimals() {
843
+ return this.contract.read.decimals();
844
+ }
845
+ /**
846
+ * addrDevTeam
847
+ * view
848
+ */
849
+ async addrDevTeam() {
850
+ return this.contract.read.addrDevTeam();
851
+ }
852
+ /**
853
+ * addrDistribution
854
+ * view
855
+ */
856
+ async addrDistribution() {
857
+ return this.contract.read.addrDistribution();
858
+ }
859
+ /**
860
+ * getQuestionVote
861
+ * view
862
+ */
863
+ async getQuestionVote(_id_max32, _position) {
864
+ return this.contract.read.getQuestionVote([_id_max32, _position]);
865
+ }
866
+ /**
867
+ * getQuestionVotesAllCount
868
+ * view
869
+ */
870
+ async getQuestionVotesAllCount(_id_max32) {
871
+ return this.contract.read.getQuestionVotesAllCount([_id_max32]);
872
+ }
873
+ /**
874
+ * balanceOf
875
+ * view
876
+ */
877
+ async balanceOf(_owner) {
878
+ return this.contract.read.balanceOf([_owner]);
879
+ }
880
+ /**
881
+ * lockupSeconds
882
+ * view
883
+ */
884
+ async lockupSeconds() {
885
+ return this.contract.read.lockupSeconds();
886
+ }
887
+ /**
888
+ * owner
889
+ * view
890
+ */
891
+ async owner() {
892
+ return this.contract.read.owner();
893
+ }
894
+ /**
895
+ * symbol
896
+ * view
897
+ */
898
+ async symbol() {
899
+ return this.contract.read.symbol();
900
+ }
901
+ /**
902
+ * addrBounty
903
+ * view
904
+ */
905
+ async addrBounty() {
906
+ return this.contract.read.addrBounty();
907
+ }
908
+ /**
909
+ * getRandomItems
910
+ * view
911
+ */
912
+ async getRandomItems(_addrss, _id_max32) {
913
+ return this.contract.read.getRandomItems([_addrss, _id_max32]);
914
+ }
915
+ /**
916
+ * getQuestion
917
+ * view
918
+ */
919
+ async getQuestion(_id_max32) {
920
+ return this.contract.read.getQuestion([_id_max32]);
921
+ }
922
+ /**
923
+ * allowance
924
+ * view
925
+ */
926
+ async allowance(_owner, _spender) {
927
+ return this.contract.read.allowance([_owner, _spender]);
928
+ }
929
+ /**
930
+ * getSaveData
931
+ * view
932
+ */
933
+ async getSaveData(_address) {
934
+ return this.contract.read.getSaveData([_address]);
935
+ }
936
+ /**
937
+ * approve
938
+ * nonpayable
939
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
940
+ */
941
+ async approve(_spender, _value, options) {
942
+ if (!this.contract.write) {
943
+ throw new Error('Wallet client is required for write operations');
944
+ }
945
+ return this.contract.write.approve([_spender, _value], options);
946
+ }
947
+ /**
948
+ * putSaveData
949
+ * nonpayable
950
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
951
+ */
952
+ async putSaveData(_text, options) {
953
+ if (!this.contract.write) {
954
+ throw new Error('Wallet client is required for write operations');
955
+ }
956
+ return this.contract.write.putSaveData([_text], options);
957
+ }
958
+ /**
959
+ * createRandomBox
960
+ * nonpayable
961
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
962
+ */
963
+ async createRandomBox(_id_max32, _recipient, _volume, _amount, _finish, options) {
964
+ if (!this.contract.write) {
965
+ throw new Error('Wallet client is required for write operations');
966
+ }
967
+ return this.contract.write.createRandomBox([_id_max32, _recipient, _volume, _amount, _finish], options);
968
+ }
969
+ /**
970
+ * transferFrom
971
+ * nonpayable
972
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
973
+ */
974
+ async transferFrom(_from, _to, _value, options) {
975
+ if (!this.contract.write) {
976
+ throw new Error('Wallet client is required for write operations');
977
+ }
978
+ return this.contract.write.transferFrom([_from, _to, _value], options);
979
+ }
980
+ /**
981
+ * createQuestion
982
+ * nonpayable
983
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
984
+ */
985
+ async createQuestion(_id_max32, _recipient, _finish, _under, options) {
986
+ if (!this.contract.write) {
987
+ throw new Error('Wallet client is required for write operations');
988
+ }
989
+ return this.contract.write.createQuestion([_id_max32, _recipient, _finish, _under], options);
990
+ }
991
+ /**
992
+ * unLockup
993
+ * nonpayable
994
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
995
+ */
996
+ async unLockup(options) {
997
+ if (!this.contract.write) {
998
+ throw new Error('Wallet client is required for write operations');
999
+ }
1000
+ return this.contract.write.unLockup(options);
1001
+ }
1002
+ /**
1003
+ * drawRandomItem
1004
+ * nonpayable
1005
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1006
+ */
1007
+ async drawRandomItem(_id_max32, _count, options) {
1008
+ if (!this.contract.write) {
1009
+ throw new Error('Wallet client is required for write operations');
1010
+ }
1011
+ return this.contract.write.drawRandomItem([_id_max32, _count], options);
1012
+ }
1013
+ /**
1014
+ * airDrop
1015
+ * nonpayable
1016
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1017
+ */
1018
+ async airDrop(_recipients, _values, options) {
1019
+ if (!this.contract.write) {
1020
+ throw new Error('Wallet client is required for write operations');
1021
+ }
1022
+ return this.contract.write.airDrop([_recipients, _values], options);
1023
+ }
1024
+ /**
1025
+ * decreaseApproval
1026
+ * nonpayable
1027
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1028
+ */
1029
+ async decreaseApproval(_spender, _subtractedValue, options) {
1030
+ if (!this.contract.write) {
1031
+ throw new Error('Wallet client is required for write operations');
1032
+ }
1033
+ return this.contract.write.decreaseApproval([_spender, _subtractedValue], options);
1034
+ }
1035
+ /**
1036
+ * rain
1037
+ * nonpayable
1038
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1039
+ */
1040
+ async rain(_recipients, _values, options) {
1041
+ if (!this.contract.write) {
1042
+ throw new Error('Wallet client is required for write operations');
1043
+ }
1044
+ return this.contract.write.rain([_recipients, _values], options);
1045
+ }
1046
+ /**
1047
+ * initializeContract
1048
+ * nonpayable
1049
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1050
+ */
1051
+ async initializeContract(options) {
1052
+ if (!this.contract.write) {
1053
+ throw new Error('Wallet client is required for write operations');
1054
+ }
1055
+ return this.contract.write.initializeContract(options);
1056
+ }
1057
+ /**
1058
+ * transfer
1059
+ * nonpayable
1060
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1061
+ */
1062
+ async transfer(_to, _value, options) {
1063
+ if (!this.contract.write) {
1064
+ throw new Error('Wallet client is required for write operations');
1065
+ }
1066
+ return this.contract.write.transfer([_to, _value], options);
1067
+ }
1068
+ /**
1069
+ * increaseApproval
1070
+ * nonpayable
1071
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1072
+ */
1073
+ async increaseApproval(_spender, _addedValue, options) {
1074
+ if (!this.contract.write) {
1075
+ throw new Error('Wallet client is required for write operations');
1076
+ }
1077
+ return this.contract.write.increaseApproval([_spender, _addedValue], options);
1078
+ }
1079
+ /**
1080
+ * vote
1081
+ * nonpayable
1082
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1083
+ */
1084
+ async vote(_id_max32, _number, _amount, options) {
1085
+ if (!this.contract.write) {
1086
+ throw new Error('Wallet client is required for write operations');
1087
+ }
1088
+ return this.contract.write.vote([_id_max32, _number, _amount], options);
1089
+ }
1090
+ /**
1091
+ * transferOwnership
1092
+ * nonpayable
1093
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1094
+ */
1095
+ async transferOwnership(newOwner, options) {
1096
+ if (!this.contract.write) {
1097
+ throw new Error('Wallet client is required for write operations');
1098
+ }
1099
+ return this.contract.write.transferOwnership([newOwner], options);
1100
+ }
1101
+ /**
1102
+ * Simulate contract write operations (dry-run without sending transaction)
1103
+ *
1104
+ * @example
1105
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1106
+ * console.log('Gas estimate:', result.request.gas);
1107
+ * console.log('Would succeed:', result.result);
1108
+ */
1109
+ get simulate() {
1110
+ const contract = this.contract;
1111
+ if (!contract.simulate) {
1112
+ throw new Error('Public client is required for simulation');
1113
+ }
1114
+ return {
1115
+ /**
1116
+ * Simulate approve
1117
+ * Returns gas estimate and result without sending transaction
1118
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1119
+ */
1120
+ async approve(_spender, _value, options) {
1121
+ return contract.simulate.approve([_spender, _value], options);
1122
+ },
1123
+ /**
1124
+ * Simulate putSaveData
1125
+ * Returns gas estimate and result without sending transaction
1126
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1127
+ */
1128
+ async putSaveData(_text, options) {
1129
+ return contract.simulate.putSaveData([_text], options);
1130
+ },
1131
+ /**
1132
+ * Simulate createRandomBox
1133
+ * Returns gas estimate and result without sending transaction
1134
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1135
+ */
1136
+ async createRandomBox(_id_max32, _recipient, _volume, _amount, _finish, options) {
1137
+ return contract.simulate.createRandomBox([_id_max32, _recipient, _volume, _amount, _finish], options);
1138
+ },
1139
+ /**
1140
+ * Simulate transferFrom
1141
+ * Returns gas estimate and result without sending transaction
1142
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1143
+ */
1144
+ async transferFrom(_from, _to, _value, options) {
1145
+ return contract.simulate.transferFrom([_from, _to, _value], options);
1146
+ },
1147
+ /**
1148
+ * Simulate createQuestion
1149
+ * Returns gas estimate and result without sending transaction
1150
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1151
+ */
1152
+ async createQuestion(_id_max32, _recipient, _finish, _under, options) {
1153
+ return contract.simulate.createQuestion([_id_max32, _recipient, _finish, _under], options);
1154
+ },
1155
+ /**
1156
+ * Simulate unLockup
1157
+ * Returns gas estimate and result without sending transaction
1158
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1159
+ */
1160
+ async unLockup(options) {
1161
+ return contract.simulate.unLockup(options);
1162
+ },
1163
+ /**
1164
+ * Simulate drawRandomItem
1165
+ * Returns gas estimate and result without sending transaction
1166
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1167
+ */
1168
+ async drawRandomItem(_id_max32, _count, options) {
1169
+ return contract.simulate.drawRandomItem([_id_max32, _count], options);
1170
+ },
1171
+ /**
1172
+ * Simulate airDrop
1173
+ * Returns gas estimate and result without sending transaction
1174
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1175
+ */
1176
+ async airDrop(_recipients, _values, options) {
1177
+ return contract.simulate.airDrop([_recipients, _values], options);
1178
+ },
1179
+ /**
1180
+ * Simulate decreaseApproval
1181
+ * Returns gas estimate and result without sending transaction
1182
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1183
+ */
1184
+ async decreaseApproval(_spender, _subtractedValue, options) {
1185
+ return contract.simulate.decreaseApproval([_spender, _subtractedValue], options);
1186
+ },
1187
+ /**
1188
+ * Simulate rain
1189
+ * Returns gas estimate and result without sending transaction
1190
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1191
+ */
1192
+ async rain(_recipients, _values, options) {
1193
+ return contract.simulate.rain([_recipients, _values], options);
1194
+ },
1195
+ /**
1196
+ * Simulate initializeContract
1197
+ * Returns gas estimate and result without sending transaction
1198
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1199
+ */
1200
+ async initializeContract(options) {
1201
+ return contract.simulate.initializeContract(options);
1202
+ },
1203
+ /**
1204
+ * Simulate transfer
1205
+ * Returns gas estimate and result without sending transaction
1206
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1207
+ */
1208
+ async transfer(_to, _value, options) {
1209
+ return contract.simulate.transfer([_to, _value], options);
1210
+ },
1211
+ /**
1212
+ * Simulate increaseApproval
1213
+ * Returns gas estimate and result without sending transaction
1214
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1215
+ */
1216
+ async increaseApproval(_spender, _addedValue, options) {
1217
+ return contract.simulate.increaseApproval([_spender, _addedValue], options);
1218
+ },
1219
+ /**
1220
+ * Simulate vote
1221
+ * Returns gas estimate and result without sending transaction
1222
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1223
+ */
1224
+ async vote(_id_max32, _number, _amount, options) {
1225
+ return contract.simulate.vote([_id_max32, _number, _amount], options);
1226
+ },
1227
+ /**
1228
+ * Simulate transferOwnership
1229
+ * Returns gas estimate and result without sending transaction
1230
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1231
+ */
1232
+ async transferOwnership(newOwner, options) {
1233
+ return contract.simulate.transferOwnership([newOwner], options);
1234
+ }
1235
+ };
1236
+ }
1237
+ /**
1238
+ * Watch contract events
1239
+ *
1240
+ * @example
1241
+ * // Watch all Transfer events
1242
+ * const unwatch = contract.watch.Transfer((event) => {
1243
+ * console.log('Transfer:', event);
1244
+ * });
1245
+ *
1246
+ * // Stop watching
1247
+ * unwatch();
1248
+ */
1249
+ get watch() {
1250
+ return {
1251
+ /**
1252
+ * Watch OwnershipTransferred events
1253
+ * @param callback Function to call when event is emitted
1254
+ * @param filter Optional filter for indexed parameters
1255
+ * @returns Unwatch function to stop listening
1256
+ */
1257
+ OwnershipTransferred: (callback, filter) => {
1258
+ return this.publicClient.watchContractEvent({
1259
+ address: this.contractAddress,
1260
+ abi: exports.KanadeCoin_jsonAbi,
1261
+ eventName: 'OwnershipTransferred',
1262
+ args: filter,
1263
+ onLogs: (logs) => {
1264
+ logs.forEach((log) => {
1265
+ callback(log.args);
1266
+ });
1267
+ },
1268
+ });
1269
+ },
1270
+ /**
1271
+ * Watch Approval events
1272
+ * @param callback Function to call when event is emitted
1273
+ * @param filter Optional filter for indexed parameters
1274
+ * @returns Unwatch function to stop listening
1275
+ */
1276
+ Approval: (callback, filter) => {
1277
+ return this.publicClient.watchContractEvent({
1278
+ address: this.contractAddress,
1279
+ abi: exports.KanadeCoin_jsonAbi,
1280
+ eventName: 'Approval',
1281
+ args: filter,
1282
+ onLogs: (logs) => {
1283
+ logs.forEach((log) => {
1284
+ callback(log.args);
1285
+ });
1286
+ },
1287
+ });
1288
+ },
1289
+ /**
1290
+ * Watch Transfer events
1291
+ * @param callback Function to call when event is emitted
1292
+ * @param filter Optional filter for indexed parameters
1293
+ * @returns Unwatch function to stop listening
1294
+ */
1295
+ Transfer: (callback, filter) => {
1296
+ return this.publicClient.watchContractEvent({
1297
+ address: this.contractAddress,
1298
+ abi: exports.KanadeCoin_jsonAbi,
1299
+ eventName: 'Transfer',
1300
+ args: filter,
1301
+ onLogs: (logs) => {
1302
+ logs.forEach((log) => {
1303
+ callback(log.args);
1304
+ });
1305
+ },
1306
+ });
1307
+ }
1308
+ };
1309
+ }
1310
+ }
1311
+ exports.KanadeCoin_json = KanadeCoin_json;