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