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