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