@gitmyabi/dot 1.0.2 → 1.0.3

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