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