@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,1231 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * BurnableMintableCappedERC20 ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const BurnableMintableCappedERC20Abi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "string",
14
+ "name": "name",
15
+ "type": "string"
16
+ },
17
+ {
18
+ "internalType": "string",
19
+ "name": "symbol",
20
+ "type": "string"
21
+ },
22
+ {
23
+ "internalType": "uint8",
24
+ "name": "decimals",
25
+ "type": "uint8"
26
+ },
27
+ {
28
+ "internalType": "uint256",
29
+ "name": "capacity",
30
+ "type": "uint256"
31
+ }
32
+ ],
33
+ "stateMutability": "nonpayable",
34
+ "type": "constructor"
35
+ },
36
+ {
37
+ "inputs": [],
38
+ "name": "CapExceeded",
39
+ "type": "error"
40
+ },
41
+ {
42
+ "inputs": [],
43
+ "name": "InvalidAccount",
44
+ "type": "error"
45
+ },
46
+ {
47
+ "inputs": [],
48
+ "name": "InvalidOwner",
49
+ "type": "error"
50
+ },
51
+ {
52
+ "inputs": [],
53
+ "name": "InvalidS",
54
+ "type": "error"
55
+ },
56
+ {
57
+ "inputs": [],
58
+ "name": "InvalidSignature",
59
+ "type": "error"
60
+ },
61
+ {
62
+ "inputs": [],
63
+ "name": "InvalidV",
64
+ "type": "error"
65
+ },
66
+ {
67
+ "inputs": [],
68
+ "name": "NotOwner",
69
+ "type": "error"
70
+ },
71
+ {
72
+ "inputs": [],
73
+ "name": "PermitExpired",
74
+ "type": "error"
75
+ },
76
+ {
77
+ "anonymous": false,
78
+ "inputs": [
79
+ {
80
+ "indexed": true,
81
+ "internalType": "address",
82
+ "name": "owner",
83
+ "type": "address"
84
+ },
85
+ {
86
+ "indexed": true,
87
+ "internalType": "address",
88
+ "name": "spender",
89
+ "type": "address"
90
+ },
91
+ {
92
+ "indexed": false,
93
+ "internalType": "uint256",
94
+ "name": "value",
95
+ "type": "uint256"
96
+ }
97
+ ],
98
+ "name": "Approval",
99
+ "type": "event"
100
+ },
101
+ {
102
+ "anonymous": false,
103
+ "inputs": [
104
+ {
105
+ "indexed": true,
106
+ "internalType": "address",
107
+ "name": "previousOwner",
108
+ "type": "address"
109
+ },
110
+ {
111
+ "indexed": true,
112
+ "internalType": "address",
113
+ "name": "newOwner",
114
+ "type": "address"
115
+ }
116
+ ],
117
+ "name": "OwnershipTransferred",
118
+ "type": "event"
119
+ },
120
+ {
121
+ "anonymous": false,
122
+ "inputs": [
123
+ {
124
+ "indexed": true,
125
+ "internalType": "address",
126
+ "name": "from",
127
+ "type": "address"
128
+ },
129
+ {
130
+ "indexed": true,
131
+ "internalType": "address",
132
+ "name": "to",
133
+ "type": "address"
134
+ },
135
+ {
136
+ "indexed": false,
137
+ "internalType": "uint256",
138
+ "name": "value",
139
+ "type": "uint256"
140
+ }
141
+ ],
142
+ "name": "Transfer",
143
+ "type": "event"
144
+ },
145
+ {
146
+ "inputs": [],
147
+ "name": "DOMAIN_SEPARATOR",
148
+ "outputs": [
149
+ {
150
+ "internalType": "bytes32",
151
+ "name": "",
152
+ "type": "bytes32"
153
+ }
154
+ ],
155
+ "stateMutability": "view",
156
+ "type": "function"
157
+ },
158
+ {
159
+ "inputs": [
160
+ {
161
+ "internalType": "address",
162
+ "name": "",
163
+ "type": "address"
164
+ },
165
+ {
166
+ "internalType": "address",
167
+ "name": "",
168
+ "type": "address"
169
+ }
170
+ ],
171
+ "name": "allowance",
172
+ "outputs": [
173
+ {
174
+ "internalType": "uint256",
175
+ "name": "",
176
+ "type": "uint256"
177
+ }
178
+ ],
179
+ "stateMutability": "view",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "inputs": [
184
+ {
185
+ "internalType": "address",
186
+ "name": "spender",
187
+ "type": "address"
188
+ },
189
+ {
190
+ "internalType": "uint256",
191
+ "name": "amount",
192
+ "type": "uint256"
193
+ }
194
+ ],
195
+ "name": "approve",
196
+ "outputs": [
197
+ {
198
+ "internalType": "bool",
199
+ "name": "",
200
+ "type": "bool"
201
+ }
202
+ ],
203
+ "stateMutability": "nonpayable",
204
+ "type": "function"
205
+ },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "address",
210
+ "name": "",
211
+ "type": "address"
212
+ }
213
+ ],
214
+ "name": "balanceOf",
215
+ "outputs": [
216
+ {
217
+ "internalType": "uint256",
218
+ "name": "",
219
+ "type": "uint256"
220
+ }
221
+ ],
222
+ "stateMutability": "view",
223
+ "type": "function"
224
+ },
225
+ {
226
+ "inputs": [
227
+ {
228
+ "internalType": "bytes32",
229
+ "name": "salt",
230
+ "type": "bytes32"
231
+ }
232
+ ],
233
+ "name": "burn",
234
+ "outputs": [],
235
+ "stateMutability": "nonpayable",
236
+ "type": "function"
237
+ },
238
+ {
239
+ "inputs": [
240
+ {
241
+ "internalType": "address",
242
+ "name": "account",
243
+ "type": "address"
244
+ },
245
+ {
246
+ "internalType": "uint256",
247
+ "name": "amount",
248
+ "type": "uint256"
249
+ }
250
+ ],
251
+ "name": "burnFrom",
252
+ "outputs": [],
253
+ "stateMutability": "nonpayable",
254
+ "type": "function"
255
+ },
256
+ {
257
+ "inputs": [],
258
+ "name": "cap",
259
+ "outputs": [
260
+ {
261
+ "internalType": "uint256",
262
+ "name": "",
263
+ "type": "uint256"
264
+ }
265
+ ],
266
+ "stateMutability": "view",
267
+ "type": "function"
268
+ },
269
+ {
270
+ "inputs": [],
271
+ "name": "decimals",
272
+ "outputs": [
273
+ {
274
+ "internalType": "uint8",
275
+ "name": "",
276
+ "type": "uint8"
277
+ }
278
+ ],
279
+ "stateMutability": "view",
280
+ "type": "function"
281
+ },
282
+ {
283
+ "inputs": [
284
+ {
285
+ "internalType": "address",
286
+ "name": "spender",
287
+ "type": "address"
288
+ },
289
+ {
290
+ "internalType": "uint256",
291
+ "name": "subtractedValue",
292
+ "type": "uint256"
293
+ }
294
+ ],
295
+ "name": "decreaseAllowance",
296
+ "outputs": [
297
+ {
298
+ "internalType": "bool",
299
+ "name": "",
300
+ "type": "bool"
301
+ }
302
+ ],
303
+ "stateMutability": "nonpayable",
304
+ "type": "function"
305
+ },
306
+ {
307
+ "inputs": [
308
+ {
309
+ "internalType": "bytes32",
310
+ "name": "salt",
311
+ "type": "bytes32"
312
+ }
313
+ ],
314
+ "name": "depositAddress",
315
+ "outputs": [
316
+ {
317
+ "internalType": "address",
318
+ "name": "",
319
+ "type": "address"
320
+ }
321
+ ],
322
+ "stateMutability": "view",
323
+ "type": "function"
324
+ },
325
+ {
326
+ "inputs": [
327
+ {
328
+ "internalType": "address",
329
+ "name": "spender",
330
+ "type": "address"
331
+ },
332
+ {
333
+ "internalType": "uint256",
334
+ "name": "addedValue",
335
+ "type": "uint256"
336
+ }
337
+ ],
338
+ "name": "increaseAllowance",
339
+ "outputs": [
340
+ {
341
+ "internalType": "bool",
342
+ "name": "",
343
+ "type": "bool"
344
+ }
345
+ ],
346
+ "stateMutability": "nonpayable",
347
+ "type": "function"
348
+ },
349
+ {
350
+ "inputs": [
351
+ {
352
+ "internalType": "address",
353
+ "name": "account",
354
+ "type": "address"
355
+ },
356
+ {
357
+ "internalType": "uint256",
358
+ "name": "amount",
359
+ "type": "uint256"
360
+ }
361
+ ],
362
+ "name": "mint",
363
+ "outputs": [],
364
+ "stateMutability": "nonpayable",
365
+ "type": "function"
366
+ },
367
+ {
368
+ "inputs": [],
369
+ "name": "name",
370
+ "outputs": [
371
+ {
372
+ "internalType": "string",
373
+ "name": "",
374
+ "type": "string"
375
+ }
376
+ ],
377
+ "stateMutability": "view",
378
+ "type": "function"
379
+ },
380
+ {
381
+ "inputs": [
382
+ {
383
+ "internalType": "address",
384
+ "name": "",
385
+ "type": "address"
386
+ }
387
+ ],
388
+ "name": "nonces",
389
+ "outputs": [
390
+ {
391
+ "internalType": "uint256",
392
+ "name": "",
393
+ "type": "uint256"
394
+ }
395
+ ],
396
+ "stateMutability": "view",
397
+ "type": "function"
398
+ },
399
+ {
400
+ "inputs": [],
401
+ "name": "owner",
402
+ "outputs": [
403
+ {
404
+ "internalType": "address",
405
+ "name": "",
406
+ "type": "address"
407
+ }
408
+ ],
409
+ "stateMutability": "view",
410
+ "type": "function"
411
+ },
412
+ {
413
+ "inputs": [
414
+ {
415
+ "internalType": "address",
416
+ "name": "issuer",
417
+ "type": "address"
418
+ },
419
+ {
420
+ "internalType": "address",
421
+ "name": "spender",
422
+ "type": "address"
423
+ },
424
+ {
425
+ "internalType": "uint256",
426
+ "name": "value",
427
+ "type": "uint256"
428
+ },
429
+ {
430
+ "internalType": "uint256",
431
+ "name": "deadline",
432
+ "type": "uint256"
433
+ },
434
+ {
435
+ "internalType": "uint8",
436
+ "name": "v",
437
+ "type": "uint8"
438
+ },
439
+ {
440
+ "internalType": "bytes32",
441
+ "name": "r",
442
+ "type": "bytes32"
443
+ },
444
+ {
445
+ "internalType": "bytes32",
446
+ "name": "s",
447
+ "type": "bytes32"
448
+ }
449
+ ],
450
+ "name": "permit",
451
+ "outputs": [],
452
+ "stateMutability": "nonpayable",
453
+ "type": "function"
454
+ },
455
+ {
456
+ "inputs": [],
457
+ "name": "symbol",
458
+ "outputs": [
459
+ {
460
+ "internalType": "string",
461
+ "name": "",
462
+ "type": "string"
463
+ }
464
+ ],
465
+ "stateMutability": "view",
466
+ "type": "function"
467
+ },
468
+ {
469
+ "inputs": [],
470
+ "name": "totalSupply",
471
+ "outputs": [
472
+ {
473
+ "internalType": "uint256",
474
+ "name": "",
475
+ "type": "uint256"
476
+ }
477
+ ],
478
+ "stateMutability": "view",
479
+ "type": "function"
480
+ },
481
+ {
482
+ "inputs": [
483
+ {
484
+ "internalType": "address",
485
+ "name": "recipient",
486
+ "type": "address"
487
+ },
488
+ {
489
+ "internalType": "uint256",
490
+ "name": "amount",
491
+ "type": "uint256"
492
+ }
493
+ ],
494
+ "name": "transfer",
495
+ "outputs": [
496
+ {
497
+ "internalType": "bool",
498
+ "name": "",
499
+ "type": "bool"
500
+ }
501
+ ],
502
+ "stateMutability": "nonpayable",
503
+ "type": "function"
504
+ },
505
+ {
506
+ "inputs": [
507
+ {
508
+ "internalType": "address",
509
+ "name": "sender",
510
+ "type": "address"
511
+ },
512
+ {
513
+ "internalType": "address",
514
+ "name": "recipient",
515
+ "type": "address"
516
+ },
517
+ {
518
+ "internalType": "uint256",
519
+ "name": "amount",
520
+ "type": "uint256"
521
+ }
522
+ ],
523
+ "name": "transferFrom",
524
+ "outputs": [
525
+ {
526
+ "internalType": "bool",
527
+ "name": "",
528
+ "type": "bool"
529
+ }
530
+ ],
531
+ "stateMutability": "nonpayable",
532
+ "type": "function"
533
+ },
534
+ {
535
+ "inputs": [
536
+ {
537
+ "internalType": "address",
538
+ "name": "newOwner",
539
+ "type": "address"
540
+ }
541
+ ],
542
+ "name": "transferOwnership",
543
+ "outputs": [],
544
+ "stateMutability": "nonpayable",
545
+ "type": "function"
546
+ }
547
+ ] as const satisfies Abi;
548
+
549
+ /**
550
+ * Type-safe ABI for BurnableMintableCappedERC20
551
+ */
552
+ export type BurnableMintableCappedERC20Abi = typeof BurnableMintableCappedERC20Abi;
553
+
554
+ /**
555
+ * Contract instance type for BurnableMintableCappedERC20
556
+ */
557
+ // Use any for contract type to avoid complex viem type issues
558
+ // The runtime behavior is type-safe through viem's ABI typing
559
+ export type BurnableMintableCappedERC20Contract = any;
560
+
561
+ /**
562
+ * BurnableMintableCappedERC20 Contract Class
563
+ *
564
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
565
+ *
566
+ * @example
567
+ * ```typescript
568
+ * import { createPublicClient, createWalletClient, http } from 'viem';
569
+ * import { mainnet } from 'viem/chains';
570
+ * import { BurnableMintableCappedERC20 } from 'BurnableMintableCappedERC20';
571
+ *
572
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
573
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
574
+ *
575
+ * const contract = new BurnableMintableCappedERC20('0x...', { publicClient, walletClient });
576
+ *
577
+ * // Read functions
578
+ * const result = await contract.balanceOf('0x...');
579
+ *
580
+ * // Write functions
581
+ * const hash = await contract.transfer('0x...', 1000n);
582
+ *
583
+ * // Simulate transactions (dry-run)
584
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
585
+ * console.log('Gas estimate:', simulation.request.gas);
586
+ *
587
+ * // Watch events
588
+ * const unwatch = contract.watch.Transfer((event) => {
589
+ * console.log('Transfer event:', event);
590
+ * });
591
+ * ```
592
+ */
593
+ export class BurnableMintableCappedERC20 {
594
+ private contract: BurnableMintableCappedERC20Contract;
595
+ private contractAddress: Address;
596
+ private publicClient: PublicClient;
597
+
598
+ constructor(
599
+ address: Address,
600
+ clients: {
601
+ publicClient: PublicClient;
602
+ walletClient?: WalletClient;
603
+ }
604
+ ) {
605
+ this.contractAddress = address;
606
+ this.publicClient = clients.publicClient;
607
+ this.contract = getContract({
608
+ address,
609
+ abi: BurnableMintableCappedERC20Abi,
610
+ client: {
611
+ public: clients.publicClient,
612
+ wallet: clients.walletClient,
613
+ },
614
+ });
615
+ }
616
+
617
+ /**
618
+ * Get the contract address
619
+ */
620
+ get address(): Address {
621
+ return this.contractAddress;
622
+ }
623
+
624
+ /**
625
+ * Get the underlying viem contract instance.
626
+ */
627
+ getContract(): BurnableMintableCappedERC20Contract {
628
+ return this.contract;
629
+ }
630
+
631
+ /**
632
+ * DOMAIN_SEPARATOR
633
+ * view
634
+ */
635
+ async DOMAIN_SEPARATOR(): Promise<`0x${string}`> {
636
+ return this.contract.read.DOMAIN_SEPARATOR() as Promise<`0x${string}`>;
637
+ }
638
+
639
+ /**
640
+ * allowance
641
+ * view
642
+ */
643
+ async allowance(arg0: `0x${string}`, arg1: `0x${string}`): Promise<bigint> {
644
+ return this.contract.read.allowance([arg0, arg1] as const) as Promise<bigint>;
645
+ }
646
+
647
+ /**
648
+ * balanceOf
649
+ * view
650
+ */
651
+ async balanceOf(arg0: `0x${string}`): Promise<bigint> {
652
+ return this.contract.read.balanceOf([arg0] as const) as Promise<bigint>;
653
+ }
654
+
655
+ /**
656
+ * cap
657
+ * view
658
+ */
659
+ async cap(): Promise<bigint> {
660
+ return this.contract.read.cap() as Promise<bigint>;
661
+ }
662
+
663
+ /**
664
+ * decimals
665
+ * view
666
+ */
667
+ async decimals(): Promise<bigint> {
668
+ return this.contract.read.decimals() as Promise<bigint>;
669
+ }
670
+
671
+ /**
672
+ * depositAddress
673
+ * view
674
+ */
675
+ async depositAddress(salt: `0x${string}`): Promise<`0x${string}`> {
676
+ return this.contract.read.depositAddress([salt] as const) as Promise<`0x${string}`>;
677
+ }
678
+
679
+ /**
680
+ * name
681
+ * view
682
+ */
683
+ async name(): Promise<string> {
684
+ return this.contract.read.name() as Promise<string>;
685
+ }
686
+
687
+ /**
688
+ * nonces
689
+ * view
690
+ */
691
+ async nonces(arg0: `0x${string}`): Promise<bigint> {
692
+ return this.contract.read.nonces([arg0] as const) as Promise<bigint>;
693
+ }
694
+
695
+ /**
696
+ * owner
697
+ * view
698
+ */
699
+ async owner(): Promise<`0x${string}`> {
700
+ return this.contract.read.owner() as Promise<`0x${string}`>;
701
+ }
702
+
703
+ /**
704
+ * symbol
705
+ * view
706
+ */
707
+ async symbol(): Promise<string> {
708
+ return this.contract.read.symbol() as Promise<string>;
709
+ }
710
+
711
+ /**
712
+ * totalSupply
713
+ * view
714
+ */
715
+ async totalSupply(): Promise<bigint> {
716
+ return this.contract.read.totalSupply() as Promise<bigint>;
717
+ }
718
+
719
+ /**
720
+ * approve
721
+ * nonpayable
722
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
723
+ */
724
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
725
+ accessList?: import('viem').AccessList;
726
+ authorizationList?: import('viem').AuthorizationList;
727
+ chain?: import('viem').Chain | null;
728
+ dataSuffix?: `0x${string}`;
729
+ gas?: bigint;
730
+ gasPrice?: bigint;
731
+ maxFeePerGas?: bigint;
732
+ maxPriorityFeePerGas?: bigint;
733
+ nonce?: number;
734
+ value?: bigint;
735
+ }): Promise<`0x${string}`> {
736
+ if (!this.contract.write) {
737
+ throw new Error('Wallet client is required for write operations');
738
+ }
739
+ return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
740
+ }
741
+
742
+ /**
743
+ * burn
744
+ * nonpayable
745
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
746
+ */
747
+ async burn(salt: `0x${string}`, options?: {
748
+ accessList?: import('viem').AccessList;
749
+ authorizationList?: import('viem').AuthorizationList;
750
+ chain?: import('viem').Chain | null;
751
+ dataSuffix?: `0x${string}`;
752
+ gas?: bigint;
753
+ gasPrice?: bigint;
754
+ maxFeePerGas?: bigint;
755
+ maxPriorityFeePerGas?: bigint;
756
+ nonce?: number;
757
+ value?: bigint;
758
+ }): Promise<`0x${string}`> {
759
+ if (!this.contract.write) {
760
+ throw new Error('Wallet client is required for write operations');
761
+ }
762
+ return this.contract.write.burn([salt] as const, options) as Promise<`0x${string}`>;
763
+ }
764
+
765
+ /**
766
+ * burnFrom
767
+ * nonpayable
768
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
769
+ */
770
+ async burnFrom(account: `0x${string}`, amount: bigint, options?: {
771
+ accessList?: import('viem').AccessList;
772
+ authorizationList?: import('viem').AuthorizationList;
773
+ chain?: import('viem').Chain | null;
774
+ dataSuffix?: `0x${string}`;
775
+ gas?: bigint;
776
+ gasPrice?: bigint;
777
+ maxFeePerGas?: bigint;
778
+ maxPriorityFeePerGas?: bigint;
779
+ nonce?: number;
780
+ value?: bigint;
781
+ }): Promise<`0x${string}`> {
782
+ if (!this.contract.write) {
783
+ throw new Error('Wallet client is required for write operations');
784
+ }
785
+ return this.contract.write.burnFrom([account, amount] as const, options) as Promise<`0x${string}`>;
786
+ }
787
+
788
+ /**
789
+ * decreaseAllowance
790
+ * nonpayable
791
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
792
+ */
793
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
794
+ accessList?: import('viem').AccessList;
795
+ authorizationList?: import('viem').AuthorizationList;
796
+ chain?: import('viem').Chain | null;
797
+ dataSuffix?: `0x${string}`;
798
+ gas?: bigint;
799
+ gasPrice?: bigint;
800
+ maxFeePerGas?: bigint;
801
+ maxPriorityFeePerGas?: bigint;
802
+ nonce?: number;
803
+ value?: bigint;
804
+ }): Promise<`0x${string}`> {
805
+ if (!this.contract.write) {
806
+ throw new Error('Wallet client is required for write operations');
807
+ }
808
+ return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
809
+ }
810
+
811
+ /**
812
+ * increaseAllowance
813
+ * nonpayable
814
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
815
+ */
816
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
817
+ accessList?: import('viem').AccessList;
818
+ authorizationList?: import('viem').AuthorizationList;
819
+ chain?: import('viem').Chain | null;
820
+ dataSuffix?: `0x${string}`;
821
+ gas?: bigint;
822
+ gasPrice?: bigint;
823
+ maxFeePerGas?: bigint;
824
+ maxPriorityFeePerGas?: bigint;
825
+ nonce?: number;
826
+ value?: bigint;
827
+ }): Promise<`0x${string}`> {
828
+ if (!this.contract.write) {
829
+ throw new Error('Wallet client is required for write operations');
830
+ }
831
+ return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
832
+ }
833
+
834
+ /**
835
+ * mint
836
+ * nonpayable
837
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
838
+ */
839
+ async mint(account: `0x${string}`, amount: bigint, options?: {
840
+ accessList?: import('viem').AccessList;
841
+ authorizationList?: import('viem').AuthorizationList;
842
+ chain?: import('viem').Chain | null;
843
+ dataSuffix?: `0x${string}`;
844
+ gas?: bigint;
845
+ gasPrice?: bigint;
846
+ maxFeePerGas?: bigint;
847
+ maxPriorityFeePerGas?: bigint;
848
+ nonce?: number;
849
+ value?: bigint;
850
+ }): Promise<`0x${string}`> {
851
+ if (!this.contract.write) {
852
+ throw new Error('Wallet client is required for write operations');
853
+ }
854
+ return this.contract.write.mint([account, amount] as const, options) as Promise<`0x${string}`>;
855
+ }
856
+
857
+ /**
858
+ * permit
859
+ * nonpayable
860
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
861
+ */
862
+ async permit(issuer: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
863
+ accessList?: import('viem').AccessList;
864
+ authorizationList?: import('viem').AuthorizationList;
865
+ chain?: import('viem').Chain | null;
866
+ dataSuffix?: `0x${string}`;
867
+ gas?: bigint;
868
+ gasPrice?: bigint;
869
+ maxFeePerGas?: bigint;
870
+ maxPriorityFeePerGas?: bigint;
871
+ nonce?: number;
872
+ value?: bigint;
873
+ }): Promise<`0x${string}`> {
874
+ if (!this.contract.write) {
875
+ throw new Error('Wallet client is required for write operations');
876
+ }
877
+ return this.contract.write.permit([issuer, spender, value, deadline, v, r, s] as const, options) as Promise<`0x${string}`>;
878
+ }
879
+
880
+ /**
881
+ * transfer
882
+ * nonpayable
883
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
884
+ */
885
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
886
+ accessList?: import('viem').AccessList;
887
+ authorizationList?: import('viem').AuthorizationList;
888
+ chain?: import('viem').Chain | null;
889
+ dataSuffix?: `0x${string}`;
890
+ gas?: bigint;
891
+ gasPrice?: bigint;
892
+ maxFeePerGas?: bigint;
893
+ maxPriorityFeePerGas?: bigint;
894
+ nonce?: number;
895
+ value?: bigint;
896
+ }): Promise<`0x${string}`> {
897
+ if (!this.contract.write) {
898
+ throw new Error('Wallet client is required for write operations');
899
+ }
900
+ return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
901
+ }
902
+
903
+ /**
904
+ * transferFrom
905
+ * nonpayable
906
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
907
+ */
908
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
909
+ accessList?: import('viem').AccessList;
910
+ authorizationList?: import('viem').AuthorizationList;
911
+ chain?: import('viem').Chain | null;
912
+ dataSuffix?: `0x${string}`;
913
+ gas?: bigint;
914
+ gasPrice?: bigint;
915
+ maxFeePerGas?: bigint;
916
+ maxPriorityFeePerGas?: bigint;
917
+ nonce?: number;
918
+ value?: bigint;
919
+ }): Promise<`0x${string}`> {
920
+ if (!this.contract.write) {
921
+ throw new Error('Wallet client is required for write operations');
922
+ }
923
+ return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
924
+ }
925
+
926
+ /**
927
+ * transferOwnership
928
+ * nonpayable
929
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
930
+ */
931
+ async transferOwnership(newOwner: `0x${string}`, options?: {
932
+ accessList?: import('viem').AccessList;
933
+ authorizationList?: import('viem').AuthorizationList;
934
+ chain?: import('viem').Chain | null;
935
+ dataSuffix?: `0x${string}`;
936
+ gas?: bigint;
937
+ gasPrice?: bigint;
938
+ maxFeePerGas?: bigint;
939
+ maxPriorityFeePerGas?: bigint;
940
+ nonce?: number;
941
+ value?: bigint;
942
+ }): Promise<`0x${string}`> {
943
+ if (!this.contract.write) {
944
+ throw new Error('Wallet client is required for write operations');
945
+ }
946
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
947
+ }
948
+
949
+
950
+
951
+ /**
952
+ * Simulate contract write operations (dry-run without sending transaction)
953
+ *
954
+ * @example
955
+ * const result = await contract.simulate.transfer('0x...', 1000n);
956
+ * console.log('Gas estimate:', result.request.gas);
957
+ * console.log('Would succeed:', result.result);
958
+ */
959
+ get simulate() {
960
+ const contract = this.contract;
961
+ if (!contract.simulate) {
962
+ throw new Error('Public client is required for simulation');
963
+ }
964
+ return {
965
+ /**
966
+ * Simulate approve
967
+ * Returns gas estimate and result without sending transaction
968
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
969
+ */
970
+ async approve(spender: `0x${string}`, amount: bigint, options?: {
971
+ accessList?: import('viem').AccessList;
972
+ authorizationList?: import('viem').AuthorizationList;
973
+ chain?: import('viem').Chain | null;
974
+ dataSuffix?: `0x${string}`;
975
+ gas?: bigint;
976
+ gasPrice?: bigint;
977
+ maxFeePerGas?: bigint;
978
+ maxPriorityFeePerGas?: bigint;
979
+ nonce?: number;
980
+ value?: bigint;
981
+ }): Promise<boolean> {
982
+ return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
983
+ },
984
+ /**
985
+ * Simulate burn
986
+ * Returns gas estimate and result without sending transaction
987
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
988
+ */
989
+ async burn(salt: `0x${string}`, options?: {
990
+ accessList?: import('viem').AccessList;
991
+ authorizationList?: import('viem').AuthorizationList;
992
+ chain?: import('viem').Chain | null;
993
+ dataSuffix?: `0x${string}`;
994
+ gas?: bigint;
995
+ gasPrice?: bigint;
996
+ maxFeePerGas?: bigint;
997
+ maxPriorityFeePerGas?: bigint;
998
+ nonce?: number;
999
+ value?: bigint;
1000
+ }): Promise<void> {
1001
+ return contract.simulate.burn([salt] as const, options) as Promise<void>;
1002
+ },
1003
+ /**
1004
+ * Simulate burnFrom
1005
+ * Returns gas estimate and result without sending transaction
1006
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1007
+ */
1008
+ async burnFrom(account: `0x${string}`, amount: bigint, options?: {
1009
+ accessList?: import('viem').AccessList;
1010
+ authorizationList?: import('viem').AuthorizationList;
1011
+ chain?: import('viem').Chain | null;
1012
+ dataSuffix?: `0x${string}`;
1013
+ gas?: bigint;
1014
+ gasPrice?: bigint;
1015
+ maxFeePerGas?: bigint;
1016
+ maxPriorityFeePerGas?: bigint;
1017
+ nonce?: number;
1018
+ value?: bigint;
1019
+ }): Promise<void> {
1020
+ return contract.simulate.burnFrom([account, amount] as const, options) as Promise<void>;
1021
+ },
1022
+ /**
1023
+ * Simulate decreaseAllowance
1024
+ * Returns gas estimate and result without sending transaction
1025
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1026
+ */
1027
+ async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
1028
+ accessList?: import('viem').AccessList;
1029
+ authorizationList?: import('viem').AuthorizationList;
1030
+ chain?: import('viem').Chain | null;
1031
+ dataSuffix?: `0x${string}`;
1032
+ gas?: bigint;
1033
+ gasPrice?: bigint;
1034
+ maxFeePerGas?: bigint;
1035
+ maxPriorityFeePerGas?: bigint;
1036
+ nonce?: number;
1037
+ value?: bigint;
1038
+ }): Promise<boolean> {
1039
+ return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
1040
+ },
1041
+ /**
1042
+ * Simulate increaseAllowance
1043
+ * Returns gas estimate and result without sending transaction
1044
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1045
+ */
1046
+ async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
1047
+ accessList?: import('viem').AccessList;
1048
+ authorizationList?: import('viem').AuthorizationList;
1049
+ chain?: import('viem').Chain | null;
1050
+ dataSuffix?: `0x${string}`;
1051
+ gas?: bigint;
1052
+ gasPrice?: bigint;
1053
+ maxFeePerGas?: bigint;
1054
+ maxPriorityFeePerGas?: bigint;
1055
+ nonce?: number;
1056
+ value?: bigint;
1057
+ }): Promise<boolean> {
1058
+ return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
1059
+ },
1060
+ /**
1061
+ * Simulate mint
1062
+ * Returns gas estimate and result without sending transaction
1063
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1064
+ */
1065
+ async mint(account: `0x${string}`, amount: bigint, options?: {
1066
+ accessList?: import('viem').AccessList;
1067
+ authorizationList?: import('viem').AuthorizationList;
1068
+ chain?: import('viem').Chain | null;
1069
+ dataSuffix?: `0x${string}`;
1070
+ gas?: bigint;
1071
+ gasPrice?: bigint;
1072
+ maxFeePerGas?: bigint;
1073
+ maxPriorityFeePerGas?: bigint;
1074
+ nonce?: number;
1075
+ value?: bigint;
1076
+ }): Promise<void> {
1077
+ return contract.simulate.mint([account, amount] as const, options) as Promise<void>;
1078
+ },
1079
+ /**
1080
+ * Simulate permit
1081
+ * Returns gas estimate and result without sending transaction
1082
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1083
+ */
1084
+ async permit(issuer: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
1085
+ accessList?: import('viem').AccessList;
1086
+ authorizationList?: import('viem').AuthorizationList;
1087
+ chain?: import('viem').Chain | null;
1088
+ dataSuffix?: `0x${string}`;
1089
+ gas?: bigint;
1090
+ gasPrice?: bigint;
1091
+ maxFeePerGas?: bigint;
1092
+ maxPriorityFeePerGas?: bigint;
1093
+ nonce?: number;
1094
+ value?: bigint;
1095
+ }): Promise<void> {
1096
+ return contract.simulate.permit([issuer, spender, value, deadline, v, r, s] as const, options) as Promise<void>;
1097
+ },
1098
+ /**
1099
+ * Simulate transfer
1100
+ * Returns gas estimate and result without sending transaction
1101
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1102
+ */
1103
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
1104
+ accessList?: import('viem').AccessList;
1105
+ authorizationList?: import('viem').AuthorizationList;
1106
+ chain?: import('viem').Chain | null;
1107
+ dataSuffix?: `0x${string}`;
1108
+ gas?: bigint;
1109
+ gasPrice?: bigint;
1110
+ maxFeePerGas?: bigint;
1111
+ maxPriorityFeePerGas?: bigint;
1112
+ nonce?: number;
1113
+ value?: bigint;
1114
+ }): Promise<boolean> {
1115
+ return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
1116
+ },
1117
+ /**
1118
+ * Simulate transferFrom
1119
+ * Returns gas estimate and result without sending transaction
1120
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1121
+ */
1122
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
1123
+ accessList?: import('viem').AccessList;
1124
+ authorizationList?: import('viem').AuthorizationList;
1125
+ chain?: import('viem').Chain | null;
1126
+ dataSuffix?: `0x${string}`;
1127
+ gas?: bigint;
1128
+ gasPrice?: bigint;
1129
+ maxFeePerGas?: bigint;
1130
+ maxPriorityFeePerGas?: bigint;
1131
+ nonce?: number;
1132
+ value?: bigint;
1133
+ }): Promise<boolean> {
1134
+ return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
1135
+ },
1136
+ /**
1137
+ * Simulate transferOwnership
1138
+ * Returns gas estimate and result without sending transaction
1139
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1140
+ */
1141
+ async transferOwnership(newOwner: `0x${string}`, options?: {
1142
+ accessList?: import('viem').AccessList;
1143
+ authorizationList?: import('viem').AuthorizationList;
1144
+ chain?: import('viem').Chain | null;
1145
+ dataSuffix?: `0x${string}`;
1146
+ gas?: bigint;
1147
+ gasPrice?: bigint;
1148
+ maxFeePerGas?: bigint;
1149
+ maxPriorityFeePerGas?: bigint;
1150
+ nonce?: number;
1151
+ value?: bigint;
1152
+ }): Promise<void> {
1153
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
1154
+ }
1155
+ };
1156
+ }
1157
+
1158
+ /**
1159
+ * Watch contract events
1160
+ *
1161
+ * @example
1162
+ * // Watch all Transfer events
1163
+ * const unwatch = contract.watch.Transfer((event) => {
1164
+ * console.log('Transfer:', event);
1165
+ * });
1166
+ *
1167
+ * // Stop watching
1168
+ * unwatch();
1169
+ */
1170
+ get watch() {
1171
+ return {
1172
+ /**
1173
+ * Watch Approval events
1174
+ * @param callback Function to call when event is emitted
1175
+ * @param filter Optional filter for indexed parameters
1176
+ * @returns Unwatch function to stop listening
1177
+ */
1178
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
1179
+ return this.publicClient.watchContractEvent({
1180
+ address: this.contractAddress,
1181
+ abi: BurnableMintableCappedERC20Abi,
1182
+ eventName: 'Approval',
1183
+ args: filter as any,
1184
+ onLogs: (logs: any[]) => {
1185
+ logs.forEach((log: any) => {
1186
+ callback(log.args as any);
1187
+ });
1188
+ },
1189
+ }) as () => void;
1190
+ },
1191
+ /**
1192
+ * Watch OwnershipTransferred events
1193
+ * @param callback Function to call when event is emitted
1194
+ * @param filter Optional filter for indexed parameters
1195
+ * @returns Unwatch function to stop listening
1196
+ */
1197
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
1198
+ return this.publicClient.watchContractEvent({
1199
+ address: this.contractAddress,
1200
+ abi: BurnableMintableCappedERC20Abi,
1201
+ eventName: 'OwnershipTransferred',
1202
+ args: filter as any,
1203
+ onLogs: (logs: any[]) => {
1204
+ logs.forEach((log: any) => {
1205
+ callback(log.args as any);
1206
+ });
1207
+ },
1208
+ }) as () => void;
1209
+ },
1210
+ /**
1211
+ * Watch Transfer events
1212
+ * @param callback Function to call when event is emitted
1213
+ * @param filter Optional filter for indexed parameters
1214
+ * @returns Unwatch function to stop listening
1215
+ */
1216
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
1217
+ return this.publicClient.watchContractEvent({
1218
+ address: this.contractAddress,
1219
+ abi: BurnableMintableCappedERC20Abi,
1220
+ eventName: 'Transfer',
1221
+ args: filter as any,
1222
+ onLogs: (logs: any[]) => {
1223
+ logs.forEach((log: any) => {
1224
+ callback(log.args as any);
1225
+ });
1226
+ },
1227
+ }) as () => void;
1228
+ }
1229
+ };
1230
+ }
1231
+ }