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