@gitmyabi/mtbill 0.0.0-stage → 1.0.0

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