@gitmyabi/apfc 1.0.1

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,875 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APFC_json = exports.APFC_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * APFC_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.APFC_jsonAbi = [
11
+ {
12
+ "constant": true,
13
+ "inputs": [],
14
+ "name": "mintingFinished",
15
+ "outputs": [
16
+ {
17
+ "name": "",
18
+ "type": "bool"
19
+ }
20
+ ],
21
+ "payable": false,
22
+ "stateMutability": "view",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "constant": true,
27
+ "inputs": [],
28
+ "name": "name",
29
+ "outputs": [
30
+ {
31
+ "name": "",
32
+ "type": "string"
33
+ }
34
+ ],
35
+ "payable": false,
36
+ "stateMutability": "view",
37
+ "type": "function"
38
+ },
39
+ {
40
+ "constant": false,
41
+ "inputs": [
42
+ {
43
+ "name": "_spender",
44
+ "type": "address"
45
+ },
46
+ {
47
+ "name": "_value",
48
+ "type": "uint256"
49
+ }
50
+ ],
51
+ "name": "approve",
52
+ "outputs": [
53
+ {
54
+ "name": "",
55
+ "type": "bool"
56
+ }
57
+ ],
58
+ "payable": false,
59
+ "stateMutability": "nonpayable",
60
+ "type": "function"
61
+ },
62
+ {
63
+ "constant": true,
64
+ "inputs": [],
65
+ "name": "totalSupply",
66
+ "outputs": [
67
+ {
68
+ "name": "",
69
+ "type": "uint256"
70
+ }
71
+ ],
72
+ "payable": false,
73
+ "stateMutability": "view",
74
+ "type": "function"
75
+ },
76
+ {
77
+ "constant": false,
78
+ "inputs": [
79
+ {
80
+ "name": "_from",
81
+ "type": "address"
82
+ },
83
+ {
84
+ "name": "_to",
85
+ "type": "address"
86
+ },
87
+ {
88
+ "name": "_value",
89
+ "type": "uint256"
90
+ }
91
+ ],
92
+ "name": "transferFrom",
93
+ "outputs": [
94
+ {
95
+ "name": "",
96
+ "type": "bool"
97
+ }
98
+ ],
99
+ "payable": false,
100
+ "stateMutability": "nonpayable",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "constant": true,
105
+ "inputs": [],
106
+ "name": "decimals",
107
+ "outputs": [
108
+ {
109
+ "name": "",
110
+ "type": "uint8"
111
+ }
112
+ ],
113
+ "payable": false,
114
+ "stateMutability": "view",
115
+ "type": "function"
116
+ },
117
+ {
118
+ "constant": true,
119
+ "inputs": [],
120
+ "name": "cap",
121
+ "outputs": [
122
+ {
123
+ "name": "",
124
+ "type": "uint256"
125
+ }
126
+ ],
127
+ "payable": false,
128
+ "stateMutability": "view",
129
+ "type": "function"
130
+ },
131
+ {
132
+ "constant": false,
133
+ "inputs": [
134
+ {
135
+ "name": "_to",
136
+ "type": "address"
137
+ },
138
+ {
139
+ "name": "_amount",
140
+ "type": "uint256"
141
+ }
142
+ ],
143
+ "name": "mint",
144
+ "outputs": [
145
+ {
146
+ "name": "",
147
+ "type": "bool"
148
+ }
149
+ ],
150
+ "payable": false,
151
+ "stateMutability": "nonpayable",
152
+ "type": "function"
153
+ },
154
+ {
155
+ "constant": false,
156
+ "inputs": [
157
+ {
158
+ "name": "_spender",
159
+ "type": "address"
160
+ },
161
+ {
162
+ "name": "_subtractedValue",
163
+ "type": "uint256"
164
+ }
165
+ ],
166
+ "name": "decreaseApproval",
167
+ "outputs": [
168
+ {
169
+ "name": "",
170
+ "type": "bool"
171
+ }
172
+ ],
173
+ "payable": false,
174
+ "stateMutability": "nonpayable",
175
+ "type": "function"
176
+ },
177
+ {
178
+ "constant": true,
179
+ "inputs": [
180
+ {
181
+ "name": "_owner",
182
+ "type": "address"
183
+ }
184
+ ],
185
+ "name": "balanceOf",
186
+ "outputs": [
187
+ {
188
+ "name": "",
189
+ "type": "uint256"
190
+ }
191
+ ],
192
+ "payable": false,
193
+ "stateMutability": "view",
194
+ "type": "function"
195
+ },
196
+ {
197
+ "constant": false,
198
+ "inputs": [],
199
+ "name": "renounceOwnership",
200
+ "outputs": [],
201
+ "payable": false,
202
+ "stateMutability": "nonpayable",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "constant": false,
207
+ "inputs": [],
208
+ "name": "finishMinting",
209
+ "outputs": [
210
+ {
211
+ "name": "",
212
+ "type": "bool"
213
+ }
214
+ ],
215
+ "payable": false,
216
+ "stateMutability": "nonpayable",
217
+ "type": "function"
218
+ },
219
+ {
220
+ "constant": true,
221
+ "inputs": [],
222
+ "name": "owner",
223
+ "outputs": [
224
+ {
225
+ "name": "",
226
+ "type": "address"
227
+ }
228
+ ],
229
+ "payable": false,
230
+ "stateMutability": "view",
231
+ "type": "function"
232
+ },
233
+ {
234
+ "constant": true,
235
+ "inputs": [],
236
+ "name": "symbol",
237
+ "outputs": [
238
+ {
239
+ "name": "",
240
+ "type": "string"
241
+ }
242
+ ],
243
+ "payable": false,
244
+ "stateMutability": "view",
245
+ "type": "function"
246
+ },
247
+ {
248
+ "constant": false,
249
+ "inputs": [
250
+ {
251
+ "name": "_to",
252
+ "type": "address"
253
+ },
254
+ {
255
+ "name": "_value",
256
+ "type": "uint256"
257
+ }
258
+ ],
259
+ "name": "transfer",
260
+ "outputs": [
261
+ {
262
+ "name": "",
263
+ "type": "bool"
264
+ }
265
+ ],
266
+ "payable": false,
267
+ "stateMutability": "nonpayable",
268
+ "type": "function"
269
+ },
270
+ {
271
+ "constant": false,
272
+ "inputs": [
273
+ {
274
+ "name": "_spender",
275
+ "type": "address"
276
+ },
277
+ {
278
+ "name": "_addedValue",
279
+ "type": "uint256"
280
+ }
281
+ ],
282
+ "name": "increaseApproval",
283
+ "outputs": [
284
+ {
285
+ "name": "",
286
+ "type": "bool"
287
+ }
288
+ ],
289
+ "payable": false,
290
+ "stateMutability": "nonpayable",
291
+ "type": "function"
292
+ },
293
+ {
294
+ "constant": true,
295
+ "inputs": [
296
+ {
297
+ "name": "_owner",
298
+ "type": "address"
299
+ },
300
+ {
301
+ "name": "_spender",
302
+ "type": "address"
303
+ }
304
+ ],
305
+ "name": "allowance",
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": "_newOwner",
321
+ "type": "address"
322
+ }
323
+ ],
324
+ "name": "transferOwnership",
325
+ "outputs": [],
326
+ "payable": false,
327
+ "stateMutability": "nonpayable",
328
+ "type": "function"
329
+ },
330
+ {
331
+ "inputs": [
332
+ {
333
+ "name": "_cap",
334
+ "type": "uint256"
335
+ }
336
+ ],
337
+ "payable": false,
338
+ "stateMutability": "nonpayable",
339
+ "type": "constructor"
340
+ },
341
+ {
342
+ "anonymous": false,
343
+ "inputs": [
344
+ {
345
+ "indexed": true,
346
+ "name": "to",
347
+ "type": "address"
348
+ },
349
+ {
350
+ "indexed": false,
351
+ "name": "amount",
352
+ "type": "uint256"
353
+ }
354
+ ],
355
+ "name": "Mint",
356
+ "type": "event"
357
+ },
358
+ {
359
+ "anonymous": false,
360
+ "inputs": [],
361
+ "name": "MintFinished",
362
+ "type": "event"
363
+ },
364
+ {
365
+ "anonymous": false,
366
+ "inputs": [
367
+ {
368
+ "indexed": true,
369
+ "name": "previousOwner",
370
+ "type": "address"
371
+ }
372
+ ],
373
+ "name": "OwnershipRenounced",
374
+ "type": "event"
375
+ },
376
+ {
377
+ "anonymous": false,
378
+ "inputs": [
379
+ {
380
+ "indexed": true,
381
+ "name": "previousOwner",
382
+ "type": "address"
383
+ },
384
+ {
385
+ "indexed": true,
386
+ "name": "newOwner",
387
+ "type": "address"
388
+ }
389
+ ],
390
+ "name": "OwnershipTransferred",
391
+ "type": "event"
392
+ },
393
+ {
394
+ "anonymous": false,
395
+ "inputs": [
396
+ {
397
+ "indexed": true,
398
+ "name": "owner",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "indexed": true,
403
+ "name": "spender",
404
+ "type": "address"
405
+ },
406
+ {
407
+ "indexed": false,
408
+ "name": "value",
409
+ "type": "uint256"
410
+ }
411
+ ],
412
+ "name": "Approval",
413
+ "type": "event"
414
+ },
415
+ {
416
+ "anonymous": false,
417
+ "inputs": [
418
+ {
419
+ "indexed": true,
420
+ "name": "from",
421
+ "type": "address"
422
+ },
423
+ {
424
+ "indexed": true,
425
+ "name": "to",
426
+ "type": "address"
427
+ },
428
+ {
429
+ "indexed": false,
430
+ "name": "value",
431
+ "type": "uint256"
432
+ }
433
+ ],
434
+ "name": "Transfer",
435
+ "type": "event"
436
+ }
437
+ ];
438
+ /**
439
+ * APFC_json Contract Class
440
+ *
441
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
442
+ *
443
+ * @example
444
+ * ```typescript
445
+ * import { createPublicClient, createWalletClient, http } from 'viem';
446
+ * import { mainnet } from 'viem/chains';
447
+ * import { APFC_json } from 'APFC_json';
448
+ *
449
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
450
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
451
+ *
452
+ * const contract = new APFC_json('0x...', { publicClient, walletClient });
453
+ *
454
+ * // Read functions
455
+ * const result = await contract.balanceOf('0x...');
456
+ *
457
+ * // Write functions
458
+ * const hash = await contract.transfer('0x...', 1000n);
459
+ *
460
+ * // Simulate transactions (dry-run)
461
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
462
+ * console.log('Gas estimate:', simulation.request.gas);
463
+ *
464
+ * // Watch events
465
+ * const unwatch = contract.watch.Transfer((event) => {
466
+ * console.log('Transfer event:', event);
467
+ * });
468
+ * ```
469
+ */
470
+ class APFC_json {
471
+ constructor(address, clients) {
472
+ this.contractAddress = address;
473
+ this.publicClient = clients.publicClient;
474
+ this.contract = (0, viem_1.getContract)({
475
+ address,
476
+ abi: exports.APFC_jsonAbi,
477
+ client: {
478
+ public: clients.publicClient,
479
+ wallet: clients.walletClient,
480
+ },
481
+ });
482
+ }
483
+ /**
484
+ * Get the contract address
485
+ */
486
+ get address() {
487
+ return this.contractAddress;
488
+ }
489
+ /**
490
+ * Get the underlying viem contract instance
491
+ */
492
+ getContract() {
493
+ return this.contract;
494
+ }
495
+ /**
496
+ * mintingFinished
497
+ * view
498
+ */
499
+ async mintingFinished() {
500
+ return this.contract.read.mintingFinished();
501
+ }
502
+ /**
503
+ * name
504
+ * view
505
+ */
506
+ async name() {
507
+ return this.contract.read.name();
508
+ }
509
+ /**
510
+ * totalSupply
511
+ * view
512
+ */
513
+ async totalSupply() {
514
+ return this.contract.read.totalSupply();
515
+ }
516
+ /**
517
+ * decimals
518
+ * view
519
+ */
520
+ async decimals() {
521
+ return this.contract.read.decimals();
522
+ }
523
+ /**
524
+ * cap
525
+ * view
526
+ */
527
+ async cap() {
528
+ return this.contract.read.cap();
529
+ }
530
+ /**
531
+ * balanceOf
532
+ * view
533
+ */
534
+ async balanceOf(_owner) {
535
+ return this.contract.read.balanceOf([_owner]);
536
+ }
537
+ /**
538
+ * owner
539
+ * view
540
+ */
541
+ async owner() {
542
+ return this.contract.read.owner();
543
+ }
544
+ /**
545
+ * symbol
546
+ * view
547
+ */
548
+ async symbol() {
549
+ return this.contract.read.symbol();
550
+ }
551
+ /**
552
+ * allowance
553
+ * view
554
+ */
555
+ async allowance(_owner, _spender) {
556
+ return this.contract.read.allowance([_owner, _spender]);
557
+ }
558
+ /**
559
+ * approve
560
+ * nonpayable
561
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
562
+ */
563
+ async approve(_spender, _value, options) {
564
+ if (!this.contract.write) {
565
+ throw new Error('Wallet client is required for write operations');
566
+ }
567
+ return this.contract.write.approve([_spender, _value], options);
568
+ }
569
+ /**
570
+ * transferFrom
571
+ * nonpayable
572
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
573
+ */
574
+ async transferFrom(_from, _to, _value, options) {
575
+ if (!this.contract.write) {
576
+ throw new Error('Wallet client is required for write operations');
577
+ }
578
+ return this.contract.write.transferFrom([_from, _to, _value], options);
579
+ }
580
+ /**
581
+ * mint
582
+ * nonpayable
583
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
584
+ */
585
+ async mint(_to, _amount, options) {
586
+ if (!this.contract.write) {
587
+ throw new Error('Wallet client is required for write operations');
588
+ }
589
+ return this.contract.write.mint([_to, _amount], options);
590
+ }
591
+ /**
592
+ * decreaseApproval
593
+ * nonpayable
594
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
595
+ */
596
+ async decreaseApproval(_spender, _subtractedValue, options) {
597
+ if (!this.contract.write) {
598
+ throw new Error('Wallet client is required for write operations');
599
+ }
600
+ return this.contract.write.decreaseApproval([_spender, _subtractedValue], options);
601
+ }
602
+ /**
603
+ * renounceOwnership
604
+ * nonpayable
605
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
606
+ */
607
+ async renounceOwnership(options) {
608
+ if (!this.contract.write) {
609
+ throw new Error('Wallet client is required for write operations');
610
+ }
611
+ return this.contract.write.renounceOwnership(options);
612
+ }
613
+ /**
614
+ * finishMinting
615
+ * nonpayable
616
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
617
+ */
618
+ async finishMinting(options) {
619
+ if (!this.contract.write) {
620
+ throw new Error('Wallet client is required for write operations');
621
+ }
622
+ return this.contract.write.finishMinting(options);
623
+ }
624
+ /**
625
+ * transfer
626
+ * nonpayable
627
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
628
+ */
629
+ async transfer(_to, _value, options) {
630
+ if (!this.contract.write) {
631
+ throw new Error('Wallet client is required for write operations');
632
+ }
633
+ return this.contract.write.transfer([_to, _value], options);
634
+ }
635
+ /**
636
+ * increaseApproval
637
+ * nonpayable
638
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
639
+ */
640
+ async increaseApproval(_spender, _addedValue, options) {
641
+ if (!this.contract.write) {
642
+ throw new Error('Wallet client is required for write operations');
643
+ }
644
+ return this.contract.write.increaseApproval([_spender, _addedValue], options);
645
+ }
646
+ /**
647
+ * transferOwnership
648
+ * nonpayable
649
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
650
+ */
651
+ async transferOwnership(_newOwner, options) {
652
+ if (!this.contract.write) {
653
+ throw new Error('Wallet client is required for write operations');
654
+ }
655
+ return this.contract.write.transferOwnership([_newOwner], options);
656
+ }
657
+ /**
658
+ * Simulate contract write operations (dry-run without sending transaction)
659
+ *
660
+ * @example
661
+ * const result = await contract.simulate.transfer('0x...', 1000n);
662
+ * console.log('Gas estimate:', result.request.gas);
663
+ * console.log('Would succeed:', result.result);
664
+ */
665
+ get simulate() {
666
+ const contract = this.contract;
667
+ if (!contract.simulate) {
668
+ throw new Error('Public client is required for simulation');
669
+ }
670
+ return {
671
+ /**
672
+ * Simulate approve
673
+ * Returns gas estimate and result without sending transaction
674
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
675
+ */
676
+ async approve(_spender, _value, options) {
677
+ return contract.simulate.approve([_spender, _value], options);
678
+ },
679
+ /**
680
+ * Simulate transferFrom
681
+ * Returns gas estimate and result without sending transaction
682
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
683
+ */
684
+ async transferFrom(_from, _to, _value, options) {
685
+ return contract.simulate.transferFrom([_from, _to, _value], options);
686
+ },
687
+ /**
688
+ * Simulate mint
689
+ * Returns gas estimate and result without sending transaction
690
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
691
+ */
692
+ async mint(_to, _amount, options) {
693
+ return contract.simulate.mint([_to, _amount], options);
694
+ },
695
+ /**
696
+ * Simulate decreaseApproval
697
+ * Returns gas estimate and result without sending transaction
698
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
699
+ */
700
+ async decreaseApproval(_spender, _subtractedValue, options) {
701
+ return contract.simulate.decreaseApproval([_spender, _subtractedValue], options);
702
+ },
703
+ /**
704
+ * Simulate renounceOwnership
705
+ * Returns gas estimate and result without sending transaction
706
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
707
+ */
708
+ async renounceOwnership(options) {
709
+ return contract.simulate.renounceOwnership(options);
710
+ },
711
+ /**
712
+ * Simulate finishMinting
713
+ * Returns gas estimate and result without sending transaction
714
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
715
+ */
716
+ async finishMinting(options) {
717
+ return contract.simulate.finishMinting(options);
718
+ },
719
+ /**
720
+ * Simulate transfer
721
+ * Returns gas estimate and result without sending transaction
722
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
723
+ */
724
+ async transfer(_to, _value, options) {
725
+ return contract.simulate.transfer([_to, _value], options);
726
+ },
727
+ /**
728
+ * Simulate increaseApproval
729
+ * Returns gas estimate and result without sending transaction
730
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
731
+ */
732
+ async increaseApproval(_spender, _addedValue, options) {
733
+ return contract.simulate.increaseApproval([_spender, _addedValue], options);
734
+ },
735
+ /**
736
+ * Simulate transferOwnership
737
+ * Returns gas estimate and result without sending transaction
738
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
739
+ */
740
+ async transferOwnership(_newOwner, options) {
741
+ return contract.simulate.transferOwnership([_newOwner], options);
742
+ }
743
+ };
744
+ }
745
+ /**
746
+ * Watch contract events
747
+ *
748
+ * @example
749
+ * // Watch all Transfer events
750
+ * const unwatch = contract.watch.Transfer((event) => {
751
+ * console.log('Transfer:', event);
752
+ * });
753
+ *
754
+ * // Stop watching
755
+ * unwatch();
756
+ */
757
+ get watch() {
758
+ return {
759
+ /**
760
+ * Watch Mint events
761
+ * @param callback Function to call when event is emitted
762
+ * @param filter Optional filter for indexed parameters
763
+ * @returns Unwatch function to stop listening
764
+ */
765
+ Mint: (callback, filter) => {
766
+ return this.publicClient.watchContractEvent({
767
+ address: this.contractAddress,
768
+ abi: exports.APFC_jsonAbi,
769
+ eventName: 'Mint',
770
+ args: filter,
771
+ onLogs: (logs) => {
772
+ logs.forEach((log) => {
773
+ callback(log.args);
774
+ });
775
+ },
776
+ });
777
+ },
778
+ /**
779
+ * Watch MintFinished events
780
+ * @param callback Function to call when event is emitted
781
+ * @param filter Optional filter for indexed parameters
782
+ * @returns Unwatch function to stop listening
783
+ */
784
+ MintFinished: (callback) => {
785
+ return this.publicClient.watchContractEvent({
786
+ address: this.contractAddress,
787
+ abi: exports.APFC_jsonAbi,
788
+ eventName: 'MintFinished',
789
+ onLogs: (logs) => {
790
+ logs.forEach((log) => {
791
+ callback(log.args);
792
+ });
793
+ },
794
+ });
795
+ },
796
+ /**
797
+ * Watch OwnershipRenounced events
798
+ * @param callback Function to call when event is emitted
799
+ * @param filter Optional filter for indexed parameters
800
+ * @returns Unwatch function to stop listening
801
+ */
802
+ OwnershipRenounced: (callback, filter) => {
803
+ return this.publicClient.watchContractEvent({
804
+ address: this.contractAddress,
805
+ abi: exports.APFC_jsonAbi,
806
+ eventName: 'OwnershipRenounced',
807
+ args: filter,
808
+ onLogs: (logs) => {
809
+ logs.forEach((log) => {
810
+ callback(log.args);
811
+ });
812
+ },
813
+ });
814
+ },
815
+ /**
816
+ * Watch OwnershipTransferred events
817
+ * @param callback Function to call when event is emitted
818
+ * @param filter Optional filter for indexed parameters
819
+ * @returns Unwatch function to stop listening
820
+ */
821
+ OwnershipTransferred: (callback, filter) => {
822
+ return this.publicClient.watchContractEvent({
823
+ address: this.contractAddress,
824
+ abi: exports.APFC_jsonAbi,
825
+ eventName: 'OwnershipTransferred',
826
+ args: filter,
827
+ onLogs: (logs) => {
828
+ logs.forEach((log) => {
829
+ callback(log.args);
830
+ });
831
+ },
832
+ });
833
+ },
834
+ /**
835
+ * Watch Approval events
836
+ * @param callback Function to call when event is emitted
837
+ * @param filter Optional filter for indexed parameters
838
+ * @returns Unwatch function to stop listening
839
+ */
840
+ Approval: (callback, filter) => {
841
+ return this.publicClient.watchContractEvent({
842
+ address: this.contractAddress,
843
+ abi: exports.APFC_jsonAbi,
844
+ eventName: 'Approval',
845
+ args: filter,
846
+ onLogs: (logs) => {
847
+ logs.forEach((log) => {
848
+ callback(log.args);
849
+ });
850
+ },
851
+ });
852
+ },
853
+ /**
854
+ * Watch Transfer events
855
+ * @param callback Function to call when event is emitted
856
+ * @param filter Optional filter for indexed parameters
857
+ * @returns Unwatch function to stop listening
858
+ */
859
+ Transfer: (callback, filter) => {
860
+ return this.publicClient.watchContractEvent({
861
+ address: this.contractAddress,
862
+ abi: exports.APFC_jsonAbi,
863
+ eventName: 'Transfer',
864
+ args: filter,
865
+ onLogs: (logs) => {
866
+ logs.forEach((log) => {
867
+ callback(log.args);
868
+ });
869
+ },
870
+ });
871
+ }
872
+ };
873
+ }
874
+ }
875
+ exports.APFC_json = APFC_json;