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