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