@gitmyabi-stg/usdn 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,2402 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * Usdn ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const UsdnAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "minter",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "rebaser",
20
+ "type": "address"
21
+ }
22
+ ],
23
+ "stateMutability": "nonpayable",
24
+ "type": "constructor"
25
+ },
26
+ {
27
+ "inputs": [],
28
+ "name": "AccessControlBadConfirmation",
29
+ "type": "error"
30
+ },
31
+ {
32
+ "inputs": [
33
+ {
34
+ "internalType": "address",
35
+ "name": "account",
36
+ "type": "address"
37
+ },
38
+ {
39
+ "internalType": "bytes32",
40
+ "name": "neededRole",
41
+ "type": "bytes32"
42
+ }
43
+ ],
44
+ "name": "AccessControlUnauthorizedAccount",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [],
49
+ "name": "ECDSAInvalidSignature",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [
54
+ {
55
+ "internalType": "uint256",
56
+ "name": "length",
57
+ "type": "uint256"
58
+ }
59
+ ],
60
+ "name": "ECDSAInvalidSignatureLength",
61
+ "type": "error"
62
+ },
63
+ {
64
+ "inputs": [
65
+ {
66
+ "internalType": "bytes32",
67
+ "name": "s",
68
+ "type": "bytes32"
69
+ }
70
+ ],
71
+ "name": "ECDSAInvalidSignatureS",
72
+ "type": "error"
73
+ },
74
+ {
75
+ "inputs": [
76
+ {
77
+ "internalType": "address",
78
+ "name": "spender",
79
+ "type": "address"
80
+ },
81
+ {
82
+ "internalType": "uint256",
83
+ "name": "allowance",
84
+ "type": "uint256"
85
+ },
86
+ {
87
+ "internalType": "uint256",
88
+ "name": "needed",
89
+ "type": "uint256"
90
+ }
91
+ ],
92
+ "name": "ERC20InsufficientAllowance",
93
+ "type": "error"
94
+ },
95
+ {
96
+ "inputs": [
97
+ {
98
+ "internalType": "address",
99
+ "name": "sender",
100
+ "type": "address"
101
+ },
102
+ {
103
+ "internalType": "uint256",
104
+ "name": "balance",
105
+ "type": "uint256"
106
+ },
107
+ {
108
+ "internalType": "uint256",
109
+ "name": "needed",
110
+ "type": "uint256"
111
+ }
112
+ ],
113
+ "name": "ERC20InsufficientBalance",
114
+ "type": "error"
115
+ },
116
+ {
117
+ "inputs": [
118
+ {
119
+ "internalType": "address",
120
+ "name": "approver",
121
+ "type": "address"
122
+ }
123
+ ],
124
+ "name": "ERC20InvalidApprover",
125
+ "type": "error"
126
+ },
127
+ {
128
+ "inputs": [
129
+ {
130
+ "internalType": "address",
131
+ "name": "receiver",
132
+ "type": "address"
133
+ }
134
+ ],
135
+ "name": "ERC20InvalidReceiver",
136
+ "type": "error"
137
+ },
138
+ {
139
+ "inputs": [
140
+ {
141
+ "internalType": "address",
142
+ "name": "sender",
143
+ "type": "address"
144
+ }
145
+ ],
146
+ "name": "ERC20InvalidSender",
147
+ "type": "error"
148
+ },
149
+ {
150
+ "inputs": [
151
+ {
152
+ "internalType": "address",
153
+ "name": "spender",
154
+ "type": "address"
155
+ }
156
+ ],
157
+ "name": "ERC20InvalidSpender",
158
+ "type": "error"
159
+ },
160
+ {
161
+ "inputs": [
162
+ {
163
+ "internalType": "uint256",
164
+ "name": "deadline",
165
+ "type": "uint256"
166
+ }
167
+ ],
168
+ "name": "ERC2612ExpiredSignature",
169
+ "type": "error"
170
+ },
171
+ {
172
+ "inputs": [
173
+ {
174
+ "internalType": "address",
175
+ "name": "signer",
176
+ "type": "address"
177
+ },
178
+ {
179
+ "internalType": "address",
180
+ "name": "owner",
181
+ "type": "address"
182
+ }
183
+ ],
184
+ "name": "ERC2612InvalidSigner",
185
+ "type": "error"
186
+ },
187
+ {
188
+ "inputs": [
189
+ {
190
+ "internalType": "address",
191
+ "name": "account",
192
+ "type": "address"
193
+ },
194
+ {
195
+ "internalType": "uint256",
196
+ "name": "currentNonce",
197
+ "type": "uint256"
198
+ }
199
+ ],
200
+ "name": "InvalidAccountNonce",
201
+ "type": "error"
202
+ },
203
+ {
204
+ "inputs": [],
205
+ "name": "InvalidShortString",
206
+ "type": "error"
207
+ },
208
+ {
209
+ "inputs": [
210
+ {
211
+ "internalType": "string",
212
+ "name": "str",
213
+ "type": "string"
214
+ }
215
+ ],
216
+ "name": "StringTooLong",
217
+ "type": "error"
218
+ },
219
+ {
220
+ "inputs": [
221
+ {
222
+ "internalType": "address",
223
+ "name": "sender",
224
+ "type": "address"
225
+ },
226
+ {
227
+ "internalType": "uint256",
228
+ "name": "balance",
229
+ "type": "uint256"
230
+ },
231
+ {
232
+ "internalType": "uint256",
233
+ "name": "needed",
234
+ "type": "uint256"
235
+ }
236
+ ],
237
+ "name": "UsdnInsufficientSharesBalance",
238
+ "type": "error"
239
+ },
240
+ {
241
+ "inputs": [],
242
+ "name": "UsdnInvalidDivisor",
243
+ "type": "error"
244
+ },
245
+ {
246
+ "inputs": [
247
+ {
248
+ "internalType": "uint256",
249
+ "name": "value",
250
+ "type": "uint256"
251
+ }
252
+ ],
253
+ "name": "UsdnMaxTokensExceeded",
254
+ "type": "error"
255
+ },
256
+ {
257
+ "anonymous": false,
258
+ "inputs": [
259
+ {
260
+ "indexed": true,
261
+ "internalType": "address",
262
+ "name": "owner",
263
+ "type": "address"
264
+ },
265
+ {
266
+ "indexed": true,
267
+ "internalType": "address",
268
+ "name": "spender",
269
+ "type": "address"
270
+ },
271
+ {
272
+ "indexed": false,
273
+ "internalType": "uint256",
274
+ "name": "value",
275
+ "type": "uint256"
276
+ }
277
+ ],
278
+ "name": "Approval",
279
+ "type": "event"
280
+ },
281
+ {
282
+ "anonymous": false,
283
+ "inputs": [],
284
+ "name": "EIP712DomainChanged",
285
+ "type": "event"
286
+ },
287
+ {
288
+ "anonymous": false,
289
+ "inputs": [
290
+ {
291
+ "indexed": false,
292
+ "internalType": "uint256",
293
+ "name": "oldDivisor",
294
+ "type": "uint256"
295
+ },
296
+ {
297
+ "indexed": false,
298
+ "internalType": "uint256",
299
+ "name": "newDivisor",
300
+ "type": "uint256"
301
+ }
302
+ ],
303
+ "name": "Rebase",
304
+ "type": "event"
305
+ },
306
+ {
307
+ "anonymous": false,
308
+ "inputs": [
309
+ {
310
+ "indexed": false,
311
+ "internalType": "contract IRebaseCallback",
312
+ "name": "newHandler",
313
+ "type": "address"
314
+ }
315
+ ],
316
+ "name": "RebaseHandlerUpdated",
317
+ "type": "event"
318
+ },
319
+ {
320
+ "anonymous": false,
321
+ "inputs": [
322
+ {
323
+ "indexed": true,
324
+ "internalType": "bytes32",
325
+ "name": "role",
326
+ "type": "bytes32"
327
+ },
328
+ {
329
+ "indexed": true,
330
+ "internalType": "bytes32",
331
+ "name": "previousAdminRole",
332
+ "type": "bytes32"
333
+ },
334
+ {
335
+ "indexed": true,
336
+ "internalType": "bytes32",
337
+ "name": "newAdminRole",
338
+ "type": "bytes32"
339
+ }
340
+ ],
341
+ "name": "RoleAdminChanged",
342
+ "type": "event"
343
+ },
344
+ {
345
+ "anonymous": false,
346
+ "inputs": [
347
+ {
348
+ "indexed": true,
349
+ "internalType": "bytes32",
350
+ "name": "role",
351
+ "type": "bytes32"
352
+ },
353
+ {
354
+ "indexed": true,
355
+ "internalType": "address",
356
+ "name": "account",
357
+ "type": "address"
358
+ },
359
+ {
360
+ "indexed": true,
361
+ "internalType": "address",
362
+ "name": "sender",
363
+ "type": "address"
364
+ }
365
+ ],
366
+ "name": "RoleGranted",
367
+ "type": "event"
368
+ },
369
+ {
370
+ "anonymous": false,
371
+ "inputs": [
372
+ {
373
+ "indexed": true,
374
+ "internalType": "bytes32",
375
+ "name": "role",
376
+ "type": "bytes32"
377
+ },
378
+ {
379
+ "indexed": true,
380
+ "internalType": "address",
381
+ "name": "account",
382
+ "type": "address"
383
+ },
384
+ {
385
+ "indexed": true,
386
+ "internalType": "address",
387
+ "name": "sender",
388
+ "type": "address"
389
+ }
390
+ ],
391
+ "name": "RoleRevoked",
392
+ "type": "event"
393
+ },
394
+ {
395
+ "anonymous": false,
396
+ "inputs": [
397
+ {
398
+ "indexed": true,
399
+ "internalType": "address",
400
+ "name": "from",
401
+ "type": "address"
402
+ },
403
+ {
404
+ "indexed": true,
405
+ "internalType": "address",
406
+ "name": "to",
407
+ "type": "address"
408
+ },
409
+ {
410
+ "indexed": false,
411
+ "internalType": "uint256",
412
+ "name": "value",
413
+ "type": "uint256"
414
+ }
415
+ ],
416
+ "name": "Transfer",
417
+ "type": "event"
418
+ },
419
+ {
420
+ "inputs": [],
421
+ "name": "DEFAULT_ADMIN_ROLE",
422
+ "outputs": [
423
+ {
424
+ "internalType": "bytes32",
425
+ "name": "",
426
+ "type": "bytes32"
427
+ }
428
+ ],
429
+ "stateMutability": "view",
430
+ "type": "function"
431
+ },
432
+ {
433
+ "inputs": [],
434
+ "name": "DOMAIN_SEPARATOR",
435
+ "outputs": [
436
+ {
437
+ "internalType": "bytes32",
438
+ "name": "",
439
+ "type": "bytes32"
440
+ }
441
+ ],
442
+ "stateMutability": "view",
443
+ "type": "function"
444
+ },
445
+ {
446
+ "inputs": [],
447
+ "name": "MAX_DIVISOR",
448
+ "outputs": [
449
+ {
450
+ "internalType": "uint256",
451
+ "name": "",
452
+ "type": "uint256"
453
+ }
454
+ ],
455
+ "stateMutability": "view",
456
+ "type": "function"
457
+ },
458
+ {
459
+ "inputs": [],
460
+ "name": "MINTER_ROLE",
461
+ "outputs": [
462
+ {
463
+ "internalType": "bytes32",
464
+ "name": "",
465
+ "type": "bytes32"
466
+ }
467
+ ],
468
+ "stateMutability": "view",
469
+ "type": "function"
470
+ },
471
+ {
472
+ "inputs": [],
473
+ "name": "MIN_DIVISOR",
474
+ "outputs": [
475
+ {
476
+ "internalType": "uint256",
477
+ "name": "",
478
+ "type": "uint256"
479
+ }
480
+ ],
481
+ "stateMutability": "view",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [],
486
+ "name": "REBASER_ROLE",
487
+ "outputs": [
488
+ {
489
+ "internalType": "bytes32",
490
+ "name": "",
491
+ "type": "bytes32"
492
+ }
493
+ ],
494
+ "stateMutability": "view",
495
+ "type": "function"
496
+ },
497
+ {
498
+ "inputs": [
499
+ {
500
+ "internalType": "address",
501
+ "name": "owner",
502
+ "type": "address"
503
+ },
504
+ {
505
+ "internalType": "address",
506
+ "name": "spender",
507
+ "type": "address"
508
+ }
509
+ ],
510
+ "name": "allowance",
511
+ "outputs": [
512
+ {
513
+ "internalType": "uint256",
514
+ "name": "",
515
+ "type": "uint256"
516
+ }
517
+ ],
518
+ "stateMutability": "view",
519
+ "type": "function"
520
+ },
521
+ {
522
+ "inputs": [
523
+ {
524
+ "internalType": "address",
525
+ "name": "spender",
526
+ "type": "address"
527
+ },
528
+ {
529
+ "internalType": "uint256",
530
+ "name": "value",
531
+ "type": "uint256"
532
+ }
533
+ ],
534
+ "name": "approve",
535
+ "outputs": [
536
+ {
537
+ "internalType": "bool",
538
+ "name": "",
539
+ "type": "bool"
540
+ }
541
+ ],
542
+ "stateMutability": "nonpayable",
543
+ "type": "function"
544
+ },
545
+ {
546
+ "inputs": [
547
+ {
548
+ "internalType": "address",
549
+ "name": "account",
550
+ "type": "address"
551
+ }
552
+ ],
553
+ "name": "balanceOf",
554
+ "outputs": [
555
+ {
556
+ "internalType": "uint256",
557
+ "name": "balance_",
558
+ "type": "uint256"
559
+ }
560
+ ],
561
+ "stateMutability": "view",
562
+ "type": "function"
563
+ },
564
+ {
565
+ "inputs": [
566
+ {
567
+ "internalType": "uint256",
568
+ "name": "value",
569
+ "type": "uint256"
570
+ }
571
+ ],
572
+ "name": "burn",
573
+ "outputs": [],
574
+ "stateMutability": "nonpayable",
575
+ "type": "function"
576
+ },
577
+ {
578
+ "inputs": [
579
+ {
580
+ "internalType": "address",
581
+ "name": "account",
582
+ "type": "address"
583
+ },
584
+ {
585
+ "internalType": "uint256",
586
+ "name": "value",
587
+ "type": "uint256"
588
+ }
589
+ ],
590
+ "name": "burnFrom",
591
+ "outputs": [],
592
+ "stateMutability": "nonpayable",
593
+ "type": "function"
594
+ },
595
+ {
596
+ "inputs": [
597
+ {
598
+ "internalType": "uint256",
599
+ "name": "value",
600
+ "type": "uint256"
601
+ }
602
+ ],
603
+ "name": "burnShares",
604
+ "outputs": [],
605
+ "stateMutability": "nonpayable",
606
+ "type": "function"
607
+ },
608
+ {
609
+ "inputs": [
610
+ {
611
+ "internalType": "address",
612
+ "name": "account",
613
+ "type": "address"
614
+ },
615
+ {
616
+ "internalType": "uint256",
617
+ "name": "value",
618
+ "type": "uint256"
619
+ }
620
+ ],
621
+ "name": "burnSharesFrom",
622
+ "outputs": [],
623
+ "stateMutability": "nonpayable",
624
+ "type": "function"
625
+ },
626
+ {
627
+ "inputs": [
628
+ {
629
+ "internalType": "uint256",
630
+ "name": "amountTokens",
631
+ "type": "uint256"
632
+ }
633
+ ],
634
+ "name": "convertToShares",
635
+ "outputs": [
636
+ {
637
+ "internalType": "uint256",
638
+ "name": "shares_",
639
+ "type": "uint256"
640
+ }
641
+ ],
642
+ "stateMutability": "view",
643
+ "type": "function"
644
+ },
645
+ {
646
+ "inputs": [
647
+ {
648
+ "internalType": "uint256",
649
+ "name": "amountShares",
650
+ "type": "uint256"
651
+ }
652
+ ],
653
+ "name": "convertToTokens",
654
+ "outputs": [
655
+ {
656
+ "internalType": "uint256",
657
+ "name": "tokens_",
658
+ "type": "uint256"
659
+ }
660
+ ],
661
+ "stateMutability": "view",
662
+ "type": "function"
663
+ },
664
+ {
665
+ "inputs": [
666
+ {
667
+ "internalType": "uint256",
668
+ "name": "amountShares",
669
+ "type": "uint256"
670
+ }
671
+ ],
672
+ "name": "convertToTokensRoundUp",
673
+ "outputs": [
674
+ {
675
+ "internalType": "uint256",
676
+ "name": "tokens_",
677
+ "type": "uint256"
678
+ }
679
+ ],
680
+ "stateMutability": "view",
681
+ "type": "function"
682
+ },
683
+ {
684
+ "inputs": [],
685
+ "name": "decimals",
686
+ "outputs": [
687
+ {
688
+ "internalType": "uint8",
689
+ "name": "",
690
+ "type": "uint8"
691
+ }
692
+ ],
693
+ "stateMutability": "view",
694
+ "type": "function"
695
+ },
696
+ {
697
+ "inputs": [],
698
+ "name": "divisor",
699
+ "outputs": [
700
+ {
701
+ "internalType": "uint256",
702
+ "name": "divisor_",
703
+ "type": "uint256"
704
+ }
705
+ ],
706
+ "stateMutability": "view",
707
+ "type": "function"
708
+ },
709
+ {
710
+ "inputs": [],
711
+ "name": "eip712Domain",
712
+ "outputs": [
713
+ {
714
+ "internalType": "bytes1",
715
+ "name": "fields",
716
+ "type": "bytes1"
717
+ },
718
+ {
719
+ "internalType": "string",
720
+ "name": "name",
721
+ "type": "string"
722
+ },
723
+ {
724
+ "internalType": "string",
725
+ "name": "version",
726
+ "type": "string"
727
+ },
728
+ {
729
+ "internalType": "uint256",
730
+ "name": "chainId",
731
+ "type": "uint256"
732
+ },
733
+ {
734
+ "internalType": "address",
735
+ "name": "verifyingContract",
736
+ "type": "address"
737
+ },
738
+ {
739
+ "internalType": "bytes32",
740
+ "name": "salt",
741
+ "type": "bytes32"
742
+ },
743
+ {
744
+ "internalType": "uint256[]",
745
+ "name": "extensions",
746
+ "type": "uint256[]"
747
+ }
748
+ ],
749
+ "stateMutability": "view",
750
+ "type": "function"
751
+ },
752
+ {
753
+ "inputs": [
754
+ {
755
+ "internalType": "bytes32",
756
+ "name": "role",
757
+ "type": "bytes32"
758
+ }
759
+ ],
760
+ "name": "getRoleAdmin",
761
+ "outputs": [
762
+ {
763
+ "internalType": "bytes32",
764
+ "name": "",
765
+ "type": "bytes32"
766
+ }
767
+ ],
768
+ "stateMutability": "view",
769
+ "type": "function"
770
+ },
771
+ {
772
+ "inputs": [
773
+ {
774
+ "internalType": "bytes32",
775
+ "name": "role",
776
+ "type": "bytes32"
777
+ },
778
+ {
779
+ "internalType": "address",
780
+ "name": "account",
781
+ "type": "address"
782
+ }
783
+ ],
784
+ "name": "grantRole",
785
+ "outputs": [],
786
+ "stateMutability": "nonpayable",
787
+ "type": "function"
788
+ },
789
+ {
790
+ "inputs": [
791
+ {
792
+ "internalType": "bytes32",
793
+ "name": "role",
794
+ "type": "bytes32"
795
+ },
796
+ {
797
+ "internalType": "address",
798
+ "name": "account",
799
+ "type": "address"
800
+ }
801
+ ],
802
+ "name": "hasRole",
803
+ "outputs": [
804
+ {
805
+ "internalType": "bool",
806
+ "name": "",
807
+ "type": "bool"
808
+ }
809
+ ],
810
+ "stateMutability": "view",
811
+ "type": "function"
812
+ },
813
+ {
814
+ "inputs": [],
815
+ "name": "maxTokens",
816
+ "outputs": [
817
+ {
818
+ "internalType": "uint256",
819
+ "name": "maxTokens_",
820
+ "type": "uint256"
821
+ }
822
+ ],
823
+ "stateMutability": "view",
824
+ "type": "function"
825
+ },
826
+ {
827
+ "inputs": [
828
+ {
829
+ "internalType": "address",
830
+ "name": "to",
831
+ "type": "address"
832
+ },
833
+ {
834
+ "internalType": "uint256",
835
+ "name": "amount",
836
+ "type": "uint256"
837
+ }
838
+ ],
839
+ "name": "mint",
840
+ "outputs": [],
841
+ "stateMutability": "nonpayable",
842
+ "type": "function"
843
+ },
844
+ {
845
+ "inputs": [
846
+ {
847
+ "internalType": "address",
848
+ "name": "to",
849
+ "type": "address"
850
+ },
851
+ {
852
+ "internalType": "uint256",
853
+ "name": "amount",
854
+ "type": "uint256"
855
+ }
856
+ ],
857
+ "name": "mintShares",
858
+ "outputs": [
859
+ {
860
+ "internalType": "uint256",
861
+ "name": "mintedTokens_",
862
+ "type": "uint256"
863
+ }
864
+ ],
865
+ "stateMutability": "nonpayable",
866
+ "type": "function"
867
+ },
868
+ {
869
+ "inputs": [],
870
+ "name": "name",
871
+ "outputs": [
872
+ {
873
+ "internalType": "string",
874
+ "name": "",
875
+ "type": "string"
876
+ }
877
+ ],
878
+ "stateMutability": "view",
879
+ "type": "function"
880
+ },
881
+ {
882
+ "inputs": [
883
+ {
884
+ "internalType": "address",
885
+ "name": "owner",
886
+ "type": "address"
887
+ }
888
+ ],
889
+ "name": "nonces",
890
+ "outputs": [
891
+ {
892
+ "internalType": "uint256",
893
+ "name": "",
894
+ "type": "uint256"
895
+ }
896
+ ],
897
+ "stateMutability": "view",
898
+ "type": "function"
899
+ },
900
+ {
901
+ "inputs": [
902
+ {
903
+ "internalType": "address",
904
+ "name": "owner",
905
+ "type": "address"
906
+ },
907
+ {
908
+ "internalType": "address",
909
+ "name": "spender",
910
+ "type": "address"
911
+ },
912
+ {
913
+ "internalType": "uint256",
914
+ "name": "value",
915
+ "type": "uint256"
916
+ },
917
+ {
918
+ "internalType": "uint256",
919
+ "name": "deadline",
920
+ "type": "uint256"
921
+ },
922
+ {
923
+ "internalType": "uint8",
924
+ "name": "v",
925
+ "type": "uint8"
926
+ },
927
+ {
928
+ "internalType": "bytes32",
929
+ "name": "r",
930
+ "type": "bytes32"
931
+ },
932
+ {
933
+ "internalType": "bytes32",
934
+ "name": "s",
935
+ "type": "bytes32"
936
+ }
937
+ ],
938
+ "name": "permit",
939
+ "outputs": [],
940
+ "stateMutability": "nonpayable",
941
+ "type": "function"
942
+ },
943
+ {
944
+ "inputs": [
945
+ {
946
+ "internalType": "uint256",
947
+ "name": "newDivisor",
948
+ "type": "uint256"
949
+ }
950
+ ],
951
+ "name": "rebase",
952
+ "outputs": [
953
+ {
954
+ "internalType": "bool",
955
+ "name": "rebased_",
956
+ "type": "bool"
957
+ },
958
+ {
959
+ "internalType": "uint256",
960
+ "name": "oldDivisor_",
961
+ "type": "uint256"
962
+ },
963
+ {
964
+ "internalType": "bytes",
965
+ "name": "callbackResult_",
966
+ "type": "bytes"
967
+ }
968
+ ],
969
+ "stateMutability": "nonpayable",
970
+ "type": "function"
971
+ },
972
+ {
973
+ "inputs": [],
974
+ "name": "rebaseHandler",
975
+ "outputs": [
976
+ {
977
+ "internalType": "contract IRebaseCallback",
978
+ "name": "rebaseHandler_",
979
+ "type": "address"
980
+ }
981
+ ],
982
+ "stateMutability": "view",
983
+ "type": "function"
984
+ },
985
+ {
986
+ "inputs": [
987
+ {
988
+ "internalType": "bytes32",
989
+ "name": "role",
990
+ "type": "bytes32"
991
+ },
992
+ {
993
+ "internalType": "address",
994
+ "name": "callerConfirmation",
995
+ "type": "address"
996
+ }
997
+ ],
998
+ "name": "renounceRole",
999
+ "outputs": [],
1000
+ "stateMutability": "nonpayable",
1001
+ "type": "function"
1002
+ },
1003
+ {
1004
+ "inputs": [
1005
+ {
1006
+ "internalType": "bytes32",
1007
+ "name": "role",
1008
+ "type": "bytes32"
1009
+ },
1010
+ {
1011
+ "internalType": "address",
1012
+ "name": "account",
1013
+ "type": "address"
1014
+ }
1015
+ ],
1016
+ "name": "revokeRole",
1017
+ "outputs": [],
1018
+ "stateMutability": "nonpayable",
1019
+ "type": "function"
1020
+ },
1021
+ {
1022
+ "inputs": [
1023
+ {
1024
+ "internalType": "contract IRebaseCallback",
1025
+ "name": "newHandler",
1026
+ "type": "address"
1027
+ }
1028
+ ],
1029
+ "name": "setRebaseHandler",
1030
+ "outputs": [],
1031
+ "stateMutability": "nonpayable",
1032
+ "type": "function"
1033
+ },
1034
+ {
1035
+ "inputs": [
1036
+ {
1037
+ "internalType": "address",
1038
+ "name": "account",
1039
+ "type": "address"
1040
+ }
1041
+ ],
1042
+ "name": "sharesOf",
1043
+ "outputs": [
1044
+ {
1045
+ "internalType": "uint256",
1046
+ "name": "shares_",
1047
+ "type": "uint256"
1048
+ }
1049
+ ],
1050
+ "stateMutability": "view",
1051
+ "type": "function"
1052
+ },
1053
+ {
1054
+ "inputs": [
1055
+ {
1056
+ "internalType": "bytes4",
1057
+ "name": "interfaceId",
1058
+ "type": "bytes4"
1059
+ }
1060
+ ],
1061
+ "name": "supportsInterface",
1062
+ "outputs": [
1063
+ {
1064
+ "internalType": "bool",
1065
+ "name": "",
1066
+ "type": "bool"
1067
+ }
1068
+ ],
1069
+ "stateMutability": "view",
1070
+ "type": "function"
1071
+ },
1072
+ {
1073
+ "inputs": [],
1074
+ "name": "symbol",
1075
+ "outputs": [
1076
+ {
1077
+ "internalType": "string",
1078
+ "name": "",
1079
+ "type": "string"
1080
+ }
1081
+ ],
1082
+ "stateMutability": "view",
1083
+ "type": "function"
1084
+ },
1085
+ {
1086
+ "inputs": [],
1087
+ "name": "totalShares",
1088
+ "outputs": [
1089
+ {
1090
+ "internalType": "uint256",
1091
+ "name": "shares_",
1092
+ "type": "uint256"
1093
+ }
1094
+ ],
1095
+ "stateMutability": "view",
1096
+ "type": "function"
1097
+ },
1098
+ {
1099
+ "inputs": [],
1100
+ "name": "totalSupply",
1101
+ "outputs": [
1102
+ {
1103
+ "internalType": "uint256",
1104
+ "name": "totalSupply_",
1105
+ "type": "uint256"
1106
+ }
1107
+ ],
1108
+ "stateMutability": "view",
1109
+ "type": "function"
1110
+ },
1111
+ {
1112
+ "inputs": [
1113
+ {
1114
+ "internalType": "address",
1115
+ "name": "to",
1116
+ "type": "address"
1117
+ },
1118
+ {
1119
+ "internalType": "uint256",
1120
+ "name": "value",
1121
+ "type": "uint256"
1122
+ }
1123
+ ],
1124
+ "name": "transfer",
1125
+ "outputs": [
1126
+ {
1127
+ "internalType": "bool",
1128
+ "name": "",
1129
+ "type": "bool"
1130
+ }
1131
+ ],
1132
+ "stateMutability": "nonpayable",
1133
+ "type": "function"
1134
+ },
1135
+ {
1136
+ "inputs": [
1137
+ {
1138
+ "internalType": "address",
1139
+ "name": "from",
1140
+ "type": "address"
1141
+ },
1142
+ {
1143
+ "internalType": "address",
1144
+ "name": "to",
1145
+ "type": "address"
1146
+ },
1147
+ {
1148
+ "internalType": "uint256",
1149
+ "name": "value",
1150
+ "type": "uint256"
1151
+ }
1152
+ ],
1153
+ "name": "transferFrom",
1154
+ "outputs": [
1155
+ {
1156
+ "internalType": "bool",
1157
+ "name": "",
1158
+ "type": "bool"
1159
+ }
1160
+ ],
1161
+ "stateMutability": "nonpayable",
1162
+ "type": "function"
1163
+ },
1164
+ {
1165
+ "inputs": [
1166
+ {
1167
+ "internalType": "address",
1168
+ "name": "to",
1169
+ "type": "address"
1170
+ },
1171
+ {
1172
+ "internalType": "uint256",
1173
+ "name": "value",
1174
+ "type": "uint256"
1175
+ }
1176
+ ],
1177
+ "name": "transferShares",
1178
+ "outputs": [
1179
+ {
1180
+ "internalType": "bool",
1181
+ "name": "success_",
1182
+ "type": "bool"
1183
+ }
1184
+ ],
1185
+ "stateMutability": "nonpayable",
1186
+ "type": "function"
1187
+ },
1188
+ {
1189
+ "inputs": [
1190
+ {
1191
+ "internalType": "address",
1192
+ "name": "from",
1193
+ "type": "address"
1194
+ },
1195
+ {
1196
+ "internalType": "address",
1197
+ "name": "to",
1198
+ "type": "address"
1199
+ },
1200
+ {
1201
+ "internalType": "uint256",
1202
+ "name": "value",
1203
+ "type": "uint256"
1204
+ }
1205
+ ],
1206
+ "name": "transferSharesFrom",
1207
+ "outputs": [
1208
+ {
1209
+ "internalType": "bool",
1210
+ "name": "success_",
1211
+ "type": "bool"
1212
+ }
1213
+ ],
1214
+ "stateMutability": "nonpayable",
1215
+ "type": "function"
1216
+ }
1217
+ ] as const satisfies Abi;
1218
+
1219
+ /**
1220
+ * Type-safe ABI for Usdn
1221
+ */
1222
+ export type UsdnAbi = typeof UsdnAbi;
1223
+
1224
+ /**
1225
+ * Contract instance type for Usdn
1226
+ */
1227
+ // Use any for contract type to avoid complex viem type issues
1228
+ // The runtime behavior is type-safe through viem's ABI typing
1229
+ export type UsdnContract = any;
1230
+
1231
+ /**
1232
+ * Usdn Contract Class
1233
+ *
1234
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1235
+ *
1236
+ * @example
1237
+ * ```typescript
1238
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1239
+ * import { mainnet } from 'viem/chains';
1240
+ * import { Usdn } from 'Usdn';
1241
+ *
1242
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1243
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1244
+ *
1245
+ * const contract = new Usdn('0x...', { publicClient, walletClient });
1246
+ *
1247
+ * // Read functions
1248
+ * const result = await contract.balanceOf('0x...');
1249
+ *
1250
+ * // Write functions
1251
+ * const hash = await contract.transfer('0x...', 1000n);
1252
+ *
1253
+ * // Simulate transactions (dry-run)
1254
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1255
+ * console.log('Gas estimate:', simulation.request.gas);
1256
+ *
1257
+ * // Watch events
1258
+ * const unwatch = contract.watch.Transfer((event) => {
1259
+ * console.log('Transfer event:', event);
1260
+ * });
1261
+ * ```
1262
+ */
1263
+ export class Usdn {
1264
+ private contract: UsdnContract;
1265
+ private contractAddress: Address;
1266
+ private publicClient: PublicClient;
1267
+
1268
+ constructor(
1269
+ address: Address,
1270
+ clients: {
1271
+ publicClient: PublicClient;
1272
+ walletClient?: WalletClient;
1273
+ }
1274
+ ) {
1275
+ this.contractAddress = address;
1276
+ this.publicClient = clients.publicClient;
1277
+ this.contract = getContract({
1278
+ address,
1279
+ abi: UsdnAbi,
1280
+ client: {
1281
+ public: clients.publicClient,
1282
+ wallet: clients.walletClient,
1283
+ },
1284
+ });
1285
+ }
1286
+
1287
+ /**
1288
+ * Get the contract address
1289
+ */
1290
+ get address(): Address {
1291
+ return this.contractAddress;
1292
+ }
1293
+
1294
+ /**
1295
+ * Get the underlying viem contract instance.
1296
+ */
1297
+ getContract(): UsdnContract {
1298
+ return this.contract;
1299
+ }
1300
+
1301
+ /**
1302
+ * DEFAULT_ADMIN_ROLE
1303
+ * view
1304
+ */
1305
+ async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
1306
+ return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
1307
+ }
1308
+
1309
+ /**
1310
+ * DOMAIN_SEPARATOR
1311
+ * view
1312
+ */
1313
+ async DOMAIN_SEPARATOR(): Promise<`0x${string}`> {
1314
+ return this.contract.read.DOMAIN_SEPARATOR() as Promise<`0x${string}`>;
1315
+ }
1316
+
1317
+ /**
1318
+ * MAX_DIVISOR
1319
+ * view
1320
+ */
1321
+ async MAX_DIVISOR(): Promise<bigint> {
1322
+ return this.contract.read.MAX_DIVISOR() as Promise<bigint>;
1323
+ }
1324
+
1325
+ /**
1326
+ * MINTER_ROLE
1327
+ * view
1328
+ */
1329
+ async MINTER_ROLE(): Promise<`0x${string}`> {
1330
+ return this.contract.read.MINTER_ROLE() as Promise<`0x${string}`>;
1331
+ }
1332
+
1333
+ /**
1334
+ * MIN_DIVISOR
1335
+ * view
1336
+ */
1337
+ async MIN_DIVISOR(): Promise<bigint> {
1338
+ return this.contract.read.MIN_DIVISOR() as Promise<bigint>;
1339
+ }
1340
+
1341
+ /**
1342
+ * REBASER_ROLE
1343
+ * view
1344
+ */
1345
+ async REBASER_ROLE(): Promise<`0x${string}`> {
1346
+ return this.contract.read.REBASER_ROLE() as Promise<`0x${string}`>;
1347
+ }
1348
+
1349
+ /**
1350
+ * allowance
1351
+ * view
1352
+ */
1353
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
1354
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
1355
+ }
1356
+
1357
+ /**
1358
+ * balanceOf
1359
+ * view
1360
+ */
1361
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
1362
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
1363
+ }
1364
+
1365
+ /**
1366
+ * convertToShares
1367
+ * view
1368
+ */
1369
+ async convertToShares(amountTokens: bigint): Promise<bigint> {
1370
+ return this.contract.read.convertToShares([amountTokens] as const) as Promise<bigint>;
1371
+ }
1372
+
1373
+ /**
1374
+ * convertToTokens
1375
+ * view
1376
+ */
1377
+ async convertToTokens(amountShares: bigint): Promise<bigint> {
1378
+ return this.contract.read.convertToTokens([amountShares] as const) as Promise<bigint>;
1379
+ }
1380
+
1381
+ /**
1382
+ * convertToTokensRoundUp
1383
+ * view
1384
+ */
1385
+ async convertToTokensRoundUp(amountShares: bigint): Promise<bigint> {
1386
+ return this.contract.read.convertToTokensRoundUp([amountShares] as const) as Promise<bigint>;
1387
+ }
1388
+
1389
+ /**
1390
+ * decimals
1391
+ * view
1392
+ */
1393
+ async decimals(): Promise<bigint> {
1394
+ return this.contract.read.decimals() as Promise<bigint>;
1395
+ }
1396
+
1397
+ /**
1398
+ * divisor
1399
+ * view
1400
+ */
1401
+ async divisor(): Promise<bigint> {
1402
+ return this.contract.read.divisor() as Promise<bigint>;
1403
+ }
1404
+
1405
+ /**
1406
+ * eip712Domain
1407
+ * view
1408
+ */
1409
+ async eip712Domain(): Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]> {
1410
+ return this.contract.read.eip712Domain() as Promise<[`0x${string}`, string, string, bigint, `0x${string}`, `0x${string}`, bigint[]]>;
1411
+ }
1412
+
1413
+ /**
1414
+ * getRoleAdmin
1415
+ * view
1416
+ */
1417
+ async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
1418
+ return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
1419
+ }
1420
+
1421
+ /**
1422
+ * hasRole
1423
+ * view
1424
+ */
1425
+ async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
1426
+ return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
1427
+ }
1428
+
1429
+ /**
1430
+ * maxTokens
1431
+ * view
1432
+ */
1433
+ async maxTokens(): Promise<bigint> {
1434
+ return this.contract.read.maxTokens() as Promise<bigint>;
1435
+ }
1436
+
1437
+ /**
1438
+ * name
1439
+ * view
1440
+ */
1441
+ async name(): Promise<string> {
1442
+ return this.contract.read.name() as Promise<string>;
1443
+ }
1444
+
1445
+ /**
1446
+ * nonces
1447
+ * view
1448
+ */
1449
+ async nonces(owner: `0x${string}`): Promise<bigint> {
1450
+ return this.contract.read.nonces([owner] as const) as Promise<bigint>;
1451
+ }
1452
+
1453
+ /**
1454
+ * rebaseHandler
1455
+ * view
1456
+ */
1457
+ async rebaseHandler(): Promise<`0x${string}`> {
1458
+ return this.contract.read.rebaseHandler() as Promise<`0x${string}`>;
1459
+ }
1460
+
1461
+ /**
1462
+ * sharesOf
1463
+ * view
1464
+ */
1465
+ async sharesOf(account: `0x${string}`): Promise<bigint> {
1466
+ return this.contract.read.sharesOf([account] as const) as Promise<bigint>;
1467
+ }
1468
+
1469
+ /**
1470
+ * supportsInterface
1471
+ * view
1472
+ */
1473
+ async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
1474
+ return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
1475
+ }
1476
+
1477
+ /**
1478
+ * symbol
1479
+ * view
1480
+ */
1481
+ async symbol(): Promise<string> {
1482
+ return this.contract.read.symbol() as Promise<string>;
1483
+ }
1484
+
1485
+ /**
1486
+ * totalShares
1487
+ * view
1488
+ */
1489
+ async totalShares(): Promise<bigint> {
1490
+ return this.contract.read.totalShares() as Promise<bigint>;
1491
+ }
1492
+
1493
+ /**
1494
+ * totalSupply
1495
+ * view
1496
+ */
1497
+ async totalSupply(): Promise<bigint> {
1498
+ return this.contract.read.totalSupply() as Promise<bigint>;
1499
+ }
1500
+
1501
+ /**
1502
+ * approve
1503
+ * nonpayable
1504
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1505
+ */
1506
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1507
+ accessList?: import('viem').AccessList;
1508
+ authorizationList?: import('viem').AuthorizationList;
1509
+ chain?: import('viem').Chain | null;
1510
+ dataSuffix?: `0x${string}`;
1511
+ gas?: bigint;
1512
+ gasPrice?: bigint;
1513
+ maxFeePerGas?: bigint;
1514
+ maxPriorityFeePerGas?: bigint;
1515
+ nonce?: number;
1516
+ value?: bigint;
1517
+ }): Promise<`0x${string}`> {
1518
+ if (!this.contract.write) {
1519
+ throw new Error('Wallet client is required for write operations');
1520
+ }
1521
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
1522
+ }
1523
+
1524
+ /**
1525
+ * burn
1526
+ * nonpayable
1527
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1528
+ */
1529
+ async burn(value: bigint, options?: {
1530
+ accessList?: import('viem').AccessList;
1531
+ authorizationList?: import('viem').AuthorizationList;
1532
+ chain?: import('viem').Chain | null;
1533
+ dataSuffix?: `0x${string}`;
1534
+ gas?: bigint;
1535
+ gasPrice?: bigint;
1536
+ maxFeePerGas?: bigint;
1537
+ maxPriorityFeePerGas?: bigint;
1538
+ nonce?: number;
1539
+ value?: bigint;
1540
+ }): Promise<`0x${string}`> {
1541
+ if (!this.contract.write) {
1542
+ throw new Error('Wallet client is required for write operations');
1543
+ }
1544
+ return this.contract.write.burn([value] as const, options) as Promise<`0x${string}`>;
1545
+ }
1546
+
1547
+ /**
1548
+ * burnFrom
1549
+ * nonpayable
1550
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1551
+ */
1552
+ async burnFrom(account: `0x${string}`, value: bigint, options?: {
1553
+ accessList?: import('viem').AccessList;
1554
+ authorizationList?: import('viem').AuthorizationList;
1555
+ chain?: import('viem').Chain | null;
1556
+ dataSuffix?: `0x${string}`;
1557
+ gas?: bigint;
1558
+ gasPrice?: bigint;
1559
+ maxFeePerGas?: bigint;
1560
+ maxPriorityFeePerGas?: bigint;
1561
+ nonce?: number;
1562
+ value?: bigint;
1563
+ }): Promise<`0x${string}`> {
1564
+ if (!this.contract.write) {
1565
+ throw new Error('Wallet client is required for write operations');
1566
+ }
1567
+ return this.contract.write.burnFrom([account, value] as const, options) as Promise<`0x${string}`>;
1568
+ }
1569
+
1570
+ /**
1571
+ * burnShares
1572
+ * nonpayable
1573
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1574
+ */
1575
+ async burnShares(value: bigint, options?: {
1576
+ accessList?: import('viem').AccessList;
1577
+ authorizationList?: import('viem').AuthorizationList;
1578
+ chain?: import('viem').Chain | null;
1579
+ dataSuffix?: `0x${string}`;
1580
+ gas?: bigint;
1581
+ gasPrice?: bigint;
1582
+ maxFeePerGas?: bigint;
1583
+ maxPriorityFeePerGas?: bigint;
1584
+ nonce?: number;
1585
+ value?: bigint;
1586
+ }): Promise<`0x${string}`> {
1587
+ if (!this.contract.write) {
1588
+ throw new Error('Wallet client is required for write operations');
1589
+ }
1590
+ return this.contract.write.burnShares([value] as const, options) as Promise<`0x${string}`>;
1591
+ }
1592
+
1593
+ /**
1594
+ * burnSharesFrom
1595
+ * nonpayable
1596
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1597
+ */
1598
+ async burnSharesFrom(account: `0x${string}`, value: bigint, options?: {
1599
+ accessList?: import('viem').AccessList;
1600
+ authorizationList?: import('viem').AuthorizationList;
1601
+ chain?: import('viem').Chain | null;
1602
+ dataSuffix?: `0x${string}`;
1603
+ gas?: bigint;
1604
+ gasPrice?: bigint;
1605
+ maxFeePerGas?: bigint;
1606
+ maxPriorityFeePerGas?: bigint;
1607
+ nonce?: number;
1608
+ value?: bigint;
1609
+ }): Promise<`0x${string}`> {
1610
+ if (!this.contract.write) {
1611
+ throw new Error('Wallet client is required for write operations');
1612
+ }
1613
+ return this.contract.write.burnSharesFrom([account, value] as const, options) as Promise<`0x${string}`>;
1614
+ }
1615
+
1616
+ /**
1617
+ * grantRole
1618
+ * nonpayable
1619
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1620
+ */
1621
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
1622
+ accessList?: import('viem').AccessList;
1623
+ authorizationList?: import('viem').AuthorizationList;
1624
+ chain?: import('viem').Chain | null;
1625
+ dataSuffix?: `0x${string}`;
1626
+ gas?: bigint;
1627
+ gasPrice?: bigint;
1628
+ maxFeePerGas?: bigint;
1629
+ maxPriorityFeePerGas?: bigint;
1630
+ nonce?: number;
1631
+ value?: bigint;
1632
+ }): Promise<`0x${string}`> {
1633
+ if (!this.contract.write) {
1634
+ throw new Error('Wallet client is required for write operations');
1635
+ }
1636
+ return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
1637
+ }
1638
+
1639
+ /**
1640
+ * mint
1641
+ * nonpayable
1642
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1643
+ */
1644
+ async mint(to: `0x${string}`, amount: bigint, options?: {
1645
+ accessList?: import('viem').AccessList;
1646
+ authorizationList?: import('viem').AuthorizationList;
1647
+ chain?: import('viem').Chain | null;
1648
+ dataSuffix?: `0x${string}`;
1649
+ gas?: bigint;
1650
+ gasPrice?: bigint;
1651
+ maxFeePerGas?: bigint;
1652
+ maxPriorityFeePerGas?: bigint;
1653
+ nonce?: number;
1654
+ value?: bigint;
1655
+ }): Promise<`0x${string}`> {
1656
+ if (!this.contract.write) {
1657
+ throw new Error('Wallet client is required for write operations');
1658
+ }
1659
+ return this.contract.write.mint([to, amount] as const, options) as Promise<`0x${string}`>;
1660
+ }
1661
+
1662
+ /**
1663
+ * mintShares
1664
+ * nonpayable
1665
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1666
+ */
1667
+ async mintShares(to: `0x${string}`, amount: bigint, options?: {
1668
+ accessList?: import('viem').AccessList;
1669
+ authorizationList?: import('viem').AuthorizationList;
1670
+ chain?: import('viem').Chain | null;
1671
+ dataSuffix?: `0x${string}`;
1672
+ gas?: bigint;
1673
+ gasPrice?: bigint;
1674
+ maxFeePerGas?: bigint;
1675
+ maxPriorityFeePerGas?: bigint;
1676
+ nonce?: number;
1677
+ value?: bigint;
1678
+ }): Promise<`0x${string}`> {
1679
+ if (!this.contract.write) {
1680
+ throw new Error('Wallet client is required for write operations');
1681
+ }
1682
+ return this.contract.write.mintShares([to, amount] as const, options) as Promise<`0x${string}`>;
1683
+ }
1684
+
1685
+ /**
1686
+ * permit
1687
+ * nonpayable
1688
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1689
+ */
1690
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
1691
+ accessList?: import('viem').AccessList;
1692
+ authorizationList?: import('viem').AuthorizationList;
1693
+ chain?: import('viem').Chain | null;
1694
+ dataSuffix?: `0x${string}`;
1695
+ gas?: bigint;
1696
+ gasPrice?: bigint;
1697
+ maxFeePerGas?: bigint;
1698
+ maxPriorityFeePerGas?: bigint;
1699
+ nonce?: number;
1700
+ value?: bigint;
1701
+ }): Promise<`0x${string}`> {
1702
+ if (!this.contract.write) {
1703
+ throw new Error('Wallet client is required for write operations');
1704
+ }
1705
+ return this.contract.write.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<`0x${string}`>;
1706
+ }
1707
+
1708
+ /**
1709
+ * rebase
1710
+ * nonpayable
1711
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1712
+ */
1713
+ async rebase(newDivisor: bigint, options?: {
1714
+ accessList?: import('viem').AccessList;
1715
+ authorizationList?: import('viem').AuthorizationList;
1716
+ chain?: import('viem').Chain | null;
1717
+ dataSuffix?: `0x${string}`;
1718
+ gas?: bigint;
1719
+ gasPrice?: bigint;
1720
+ maxFeePerGas?: bigint;
1721
+ maxPriorityFeePerGas?: bigint;
1722
+ nonce?: number;
1723
+ value?: bigint;
1724
+ }): Promise<`0x${string}`> {
1725
+ if (!this.contract.write) {
1726
+ throw new Error('Wallet client is required for write operations');
1727
+ }
1728
+ return this.contract.write.rebase([newDivisor] as const, options) as Promise<`0x${string}`>;
1729
+ }
1730
+
1731
+ /**
1732
+ * renounceRole
1733
+ * nonpayable
1734
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1735
+ */
1736
+ async renounceRole(role: `0x${string}`, callerConfirmation: `0x${string}`, options?: {
1737
+ accessList?: import('viem').AccessList;
1738
+ authorizationList?: import('viem').AuthorizationList;
1739
+ chain?: import('viem').Chain | null;
1740
+ dataSuffix?: `0x${string}`;
1741
+ gas?: bigint;
1742
+ gasPrice?: bigint;
1743
+ maxFeePerGas?: bigint;
1744
+ maxPriorityFeePerGas?: bigint;
1745
+ nonce?: number;
1746
+ value?: bigint;
1747
+ }): Promise<`0x${string}`> {
1748
+ if (!this.contract.write) {
1749
+ throw new Error('Wallet client is required for write operations');
1750
+ }
1751
+ return this.contract.write.renounceRole([role, callerConfirmation] as const, options) as Promise<`0x${string}`>;
1752
+ }
1753
+
1754
+ /**
1755
+ * revokeRole
1756
+ * nonpayable
1757
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1758
+ */
1759
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
1760
+ accessList?: import('viem').AccessList;
1761
+ authorizationList?: import('viem').AuthorizationList;
1762
+ chain?: import('viem').Chain | null;
1763
+ dataSuffix?: `0x${string}`;
1764
+ gas?: bigint;
1765
+ gasPrice?: bigint;
1766
+ maxFeePerGas?: bigint;
1767
+ maxPriorityFeePerGas?: bigint;
1768
+ nonce?: number;
1769
+ value?: bigint;
1770
+ }): Promise<`0x${string}`> {
1771
+ if (!this.contract.write) {
1772
+ throw new Error('Wallet client is required for write operations');
1773
+ }
1774
+ return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
1775
+ }
1776
+
1777
+ /**
1778
+ * setRebaseHandler
1779
+ * nonpayable
1780
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1781
+ */
1782
+ async setRebaseHandler(newHandler: `0x${string}`, options?: {
1783
+ accessList?: import('viem').AccessList;
1784
+ authorizationList?: import('viem').AuthorizationList;
1785
+ chain?: import('viem').Chain | null;
1786
+ dataSuffix?: `0x${string}`;
1787
+ gas?: bigint;
1788
+ gasPrice?: bigint;
1789
+ maxFeePerGas?: bigint;
1790
+ maxPriorityFeePerGas?: bigint;
1791
+ nonce?: number;
1792
+ value?: bigint;
1793
+ }): Promise<`0x${string}`> {
1794
+ if (!this.contract.write) {
1795
+ throw new Error('Wallet client is required for write operations');
1796
+ }
1797
+ return this.contract.write.setRebaseHandler([newHandler] as const, options) as Promise<`0x${string}`>;
1798
+ }
1799
+
1800
+ /**
1801
+ * transfer
1802
+ * nonpayable
1803
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1804
+ */
1805
+ async transfer(to: `0x${string}`, value: bigint, options?: {
1806
+ accessList?: import('viem').AccessList;
1807
+ authorizationList?: import('viem').AuthorizationList;
1808
+ chain?: import('viem').Chain | null;
1809
+ dataSuffix?: `0x${string}`;
1810
+ gas?: bigint;
1811
+ gasPrice?: bigint;
1812
+ maxFeePerGas?: bigint;
1813
+ maxPriorityFeePerGas?: bigint;
1814
+ nonce?: number;
1815
+ value?: bigint;
1816
+ }): Promise<`0x${string}`> {
1817
+ if (!this.contract.write) {
1818
+ throw new Error('Wallet client is required for write operations');
1819
+ }
1820
+ return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
1821
+ }
1822
+
1823
+ /**
1824
+ * transferFrom
1825
+ * nonpayable
1826
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1827
+ */
1828
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1829
+ accessList?: import('viem').AccessList;
1830
+ authorizationList?: import('viem').AuthorizationList;
1831
+ chain?: import('viem').Chain | null;
1832
+ dataSuffix?: `0x${string}`;
1833
+ gas?: bigint;
1834
+ gasPrice?: bigint;
1835
+ maxFeePerGas?: bigint;
1836
+ maxPriorityFeePerGas?: bigint;
1837
+ nonce?: number;
1838
+ value?: bigint;
1839
+ }): Promise<`0x${string}`> {
1840
+ if (!this.contract.write) {
1841
+ throw new Error('Wallet client is required for write operations');
1842
+ }
1843
+ return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
1844
+ }
1845
+
1846
+ /**
1847
+ * transferShares
1848
+ * nonpayable
1849
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1850
+ */
1851
+ async transferShares(to: `0x${string}`, value: bigint, options?: {
1852
+ accessList?: import('viem').AccessList;
1853
+ authorizationList?: import('viem').AuthorizationList;
1854
+ chain?: import('viem').Chain | null;
1855
+ dataSuffix?: `0x${string}`;
1856
+ gas?: bigint;
1857
+ gasPrice?: bigint;
1858
+ maxFeePerGas?: bigint;
1859
+ maxPriorityFeePerGas?: bigint;
1860
+ nonce?: number;
1861
+ value?: bigint;
1862
+ }): Promise<`0x${string}`> {
1863
+ if (!this.contract.write) {
1864
+ throw new Error('Wallet client is required for write operations');
1865
+ }
1866
+ return this.contract.write.transferShares([to, value] as const, options) as Promise<`0x${string}`>;
1867
+ }
1868
+
1869
+ /**
1870
+ * transferSharesFrom
1871
+ * nonpayable
1872
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1873
+ */
1874
+ async transferSharesFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
1875
+ accessList?: import('viem').AccessList;
1876
+ authorizationList?: import('viem').AuthorizationList;
1877
+ chain?: import('viem').Chain | null;
1878
+ dataSuffix?: `0x${string}`;
1879
+ gas?: bigint;
1880
+ gasPrice?: bigint;
1881
+ maxFeePerGas?: bigint;
1882
+ maxPriorityFeePerGas?: bigint;
1883
+ nonce?: number;
1884
+ value?: bigint;
1885
+ }): Promise<`0x${string}`> {
1886
+ if (!this.contract.write) {
1887
+ throw new Error('Wallet client is required for write operations');
1888
+ }
1889
+ return this.contract.write.transferSharesFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
1890
+ }
1891
+
1892
+
1893
+
1894
+ /**
1895
+ * Simulate contract write operations (dry-run without sending transaction)
1896
+ *
1897
+ * @example
1898
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1899
+ * console.log('Gas estimate:', result.request.gas);
1900
+ * console.log('Would succeed:', result.result);
1901
+ */
1902
+ get simulate() {
1903
+ const contract = this.contract;
1904
+ if (!contract.simulate) {
1905
+ throw new Error('Public client is required for simulation');
1906
+ }
1907
+ return {
1908
+ /**
1909
+ * Simulate approve
1910
+ * Returns gas estimate and result without sending transaction
1911
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1912
+ */
1913
+ async approve(spender: `0x${string}`, value: bigint, options?: {
1914
+ accessList?: import('viem').AccessList;
1915
+ authorizationList?: import('viem').AuthorizationList;
1916
+ chain?: import('viem').Chain | null;
1917
+ dataSuffix?: `0x${string}`;
1918
+ gas?: bigint;
1919
+ gasPrice?: bigint;
1920
+ maxFeePerGas?: bigint;
1921
+ maxPriorityFeePerGas?: bigint;
1922
+ nonce?: number;
1923
+ value?: bigint;
1924
+ }): Promise<boolean> {
1925
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
1926
+ },
1927
+ /**
1928
+ * Simulate burn
1929
+ * Returns gas estimate and result without sending transaction
1930
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1931
+ */
1932
+ async burn(value: bigint, options?: {
1933
+ accessList?: import('viem').AccessList;
1934
+ authorizationList?: import('viem').AuthorizationList;
1935
+ chain?: import('viem').Chain | null;
1936
+ dataSuffix?: `0x${string}`;
1937
+ gas?: bigint;
1938
+ gasPrice?: bigint;
1939
+ maxFeePerGas?: bigint;
1940
+ maxPriorityFeePerGas?: bigint;
1941
+ nonce?: number;
1942
+ value?: bigint;
1943
+ }): Promise<void> {
1944
+ return contract.simulate.burn([value] as const, options) as Promise<void>;
1945
+ },
1946
+ /**
1947
+ * Simulate burnFrom
1948
+ * Returns gas estimate and result without sending transaction
1949
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1950
+ */
1951
+ async burnFrom(account: `0x${string}`, value: bigint, options?: {
1952
+ accessList?: import('viem').AccessList;
1953
+ authorizationList?: import('viem').AuthorizationList;
1954
+ chain?: import('viem').Chain | null;
1955
+ dataSuffix?: `0x${string}`;
1956
+ gas?: bigint;
1957
+ gasPrice?: bigint;
1958
+ maxFeePerGas?: bigint;
1959
+ maxPriorityFeePerGas?: bigint;
1960
+ nonce?: number;
1961
+ value?: bigint;
1962
+ }): Promise<void> {
1963
+ return contract.simulate.burnFrom([account, value] as const, options) as Promise<void>;
1964
+ },
1965
+ /**
1966
+ * Simulate burnShares
1967
+ * Returns gas estimate and result without sending transaction
1968
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1969
+ */
1970
+ async burnShares(value: bigint, options?: {
1971
+ accessList?: import('viem').AccessList;
1972
+ authorizationList?: import('viem').AuthorizationList;
1973
+ chain?: import('viem').Chain | null;
1974
+ dataSuffix?: `0x${string}`;
1975
+ gas?: bigint;
1976
+ gasPrice?: bigint;
1977
+ maxFeePerGas?: bigint;
1978
+ maxPriorityFeePerGas?: bigint;
1979
+ nonce?: number;
1980
+ value?: bigint;
1981
+ }): Promise<void> {
1982
+ return contract.simulate.burnShares([value] as const, options) as Promise<void>;
1983
+ },
1984
+ /**
1985
+ * Simulate burnSharesFrom
1986
+ * Returns gas estimate and result without sending transaction
1987
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1988
+ */
1989
+ async burnSharesFrom(account: `0x${string}`, value: bigint, options?: {
1990
+ accessList?: import('viem').AccessList;
1991
+ authorizationList?: import('viem').AuthorizationList;
1992
+ chain?: import('viem').Chain | null;
1993
+ dataSuffix?: `0x${string}`;
1994
+ gas?: bigint;
1995
+ gasPrice?: bigint;
1996
+ maxFeePerGas?: bigint;
1997
+ maxPriorityFeePerGas?: bigint;
1998
+ nonce?: number;
1999
+ value?: bigint;
2000
+ }): Promise<void> {
2001
+ return contract.simulate.burnSharesFrom([account, value] as const, options) as Promise<void>;
2002
+ },
2003
+ /**
2004
+ * Simulate grantRole
2005
+ * Returns gas estimate and result without sending transaction
2006
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2007
+ */
2008
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
2009
+ accessList?: import('viem').AccessList;
2010
+ authorizationList?: import('viem').AuthorizationList;
2011
+ chain?: import('viem').Chain | null;
2012
+ dataSuffix?: `0x${string}`;
2013
+ gas?: bigint;
2014
+ gasPrice?: bigint;
2015
+ maxFeePerGas?: bigint;
2016
+ maxPriorityFeePerGas?: bigint;
2017
+ nonce?: number;
2018
+ value?: bigint;
2019
+ }): Promise<void> {
2020
+ return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
2021
+ },
2022
+ /**
2023
+ * Simulate mint
2024
+ * Returns gas estimate and result without sending transaction
2025
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2026
+ */
2027
+ async mint(to: `0x${string}`, amount: bigint, options?: {
2028
+ accessList?: import('viem').AccessList;
2029
+ authorizationList?: import('viem').AuthorizationList;
2030
+ chain?: import('viem').Chain | null;
2031
+ dataSuffix?: `0x${string}`;
2032
+ gas?: bigint;
2033
+ gasPrice?: bigint;
2034
+ maxFeePerGas?: bigint;
2035
+ maxPriorityFeePerGas?: bigint;
2036
+ nonce?: number;
2037
+ value?: bigint;
2038
+ }): Promise<void> {
2039
+ return contract.simulate.mint([to, amount] as const, options) as Promise<void>;
2040
+ },
2041
+ /**
2042
+ * Simulate mintShares
2043
+ * Returns gas estimate and result without sending transaction
2044
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2045
+ */
2046
+ async mintShares(to: `0x${string}`, amount: bigint, options?: {
2047
+ accessList?: import('viem').AccessList;
2048
+ authorizationList?: import('viem').AuthorizationList;
2049
+ chain?: import('viem').Chain | null;
2050
+ dataSuffix?: `0x${string}`;
2051
+ gas?: bigint;
2052
+ gasPrice?: bigint;
2053
+ maxFeePerGas?: bigint;
2054
+ maxPriorityFeePerGas?: bigint;
2055
+ nonce?: number;
2056
+ value?: bigint;
2057
+ }): Promise<bigint> {
2058
+ return contract.simulate.mintShares([to, amount] as const, options) as Promise<bigint>;
2059
+ },
2060
+ /**
2061
+ * Simulate permit
2062
+ * Returns gas estimate and result without sending transaction
2063
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2064
+ */
2065
+ async permit(owner: `0x${string}`, spender: `0x${string}`, value: bigint, deadline: bigint, v: bigint, r: `0x${string}`, s: `0x${string}`, options?: {
2066
+ accessList?: import('viem').AccessList;
2067
+ authorizationList?: import('viem').AuthorizationList;
2068
+ chain?: import('viem').Chain | null;
2069
+ dataSuffix?: `0x${string}`;
2070
+ gas?: bigint;
2071
+ gasPrice?: bigint;
2072
+ maxFeePerGas?: bigint;
2073
+ maxPriorityFeePerGas?: bigint;
2074
+ nonce?: number;
2075
+ value?: bigint;
2076
+ }): Promise<void> {
2077
+ return contract.simulate.permit([owner, spender, value, deadline, v, r, s] as const, options) as Promise<void>;
2078
+ },
2079
+ /**
2080
+ * Simulate rebase
2081
+ * Returns gas estimate and result without sending transaction
2082
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2083
+ */
2084
+ async rebase(newDivisor: bigint, options?: {
2085
+ accessList?: import('viem').AccessList;
2086
+ authorizationList?: import('viem').AuthorizationList;
2087
+ chain?: import('viem').Chain | null;
2088
+ dataSuffix?: `0x${string}`;
2089
+ gas?: bigint;
2090
+ gasPrice?: bigint;
2091
+ maxFeePerGas?: bigint;
2092
+ maxPriorityFeePerGas?: bigint;
2093
+ nonce?: number;
2094
+ value?: bigint;
2095
+ }): Promise<[boolean, bigint, `0x${string}`]> {
2096
+ return contract.simulate.rebase([newDivisor] as const, options) as Promise<[boolean, bigint, `0x${string}`]>;
2097
+ },
2098
+ /**
2099
+ * Simulate renounceRole
2100
+ * Returns gas estimate and result without sending transaction
2101
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2102
+ */
2103
+ async renounceRole(role: `0x${string}`, callerConfirmation: `0x${string}`, options?: {
2104
+ accessList?: import('viem').AccessList;
2105
+ authorizationList?: import('viem').AuthorizationList;
2106
+ chain?: import('viem').Chain | null;
2107
+ dataSuffix?: `0x${string}`;
2108
+ gas?: bigint;
2109
+ gasPrice?: bigint;
2110
+ maxFeePerGas?: bigint;
2111
+ maxPriorityFeePerGas?: bigint;
2112
+ nonce?: number;
2113
+ value?: bigint;
2114
+ }): Promise<void> {
2115
+ return contract.simulate.renounceRole([role, callerConfirmation] as const, options) as Promise<void>;
2116
+ },
2117
+ /**
2118
+ * Simulate revokeRole
2119
+ * Returns gas estimate and result without sending transaction
2120
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2121
+ */
2122
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
2123
+ accessList?: import('viem').AccessList;
2124
+ authorizationList?: import('viem').AuthorizationList;
2125
+ chain?: import('viem').Chain | null;
2126
+ dataSuffix?: `0x${string}`;
2127
+ gas?: bigint;
2128
+ gasPrice?: bigint;
2129
+ maxFeePerGas?: bigint;
2130
+ maxPriorityFeePerGas?: bigint;
2131
+ nonce?: number;
2132
+ value?: bigint;
2133
+ }): Promise<void> {
2134
+ return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
2135
+ },
2136
+ /**
2137
+ * Simulate setRebaseHandler
2138
+ * Returns gas estimate and result without sending transaction
2139
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2140
+ */
2141
+ async setRebaseHandler(newHandler: `0x${string}`, options?: {
2142
+ accessList?: import('viem').AccessList;
2143
+ authorizationList?: import('viem').AuthorizationList;
2144
+ chain?: import('viem').Chain | null;
2145
+ dataSuffix?: `0x${string}`;
2146
+ gas?: bigint;
2147
+ gasPrice?: bigint;
2148
+ maxFeePerGas?: bigint;
2149
+ maxPriorityFeePerGas?: bigint;
2150
+ nonce?: number;
2151
+ value?: bigint;
2152
+ }): Promise<void> {
2153
+ return contract.simulate.setRebaseHandler([newHandler] as const, options) as Promise<void>;
2154
+ },
2155
+ /**
2156
+ * Simulate transfer
2157
+ * Returns gas estimate and result without sending transaction
2158
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2159
+ */
2160
+ async transfer(to: `0x${string}`, value: bigint, options?: {
2161
+ accessList?: import('viem').AccessList;
2162
+ authorizationList?: import('viem').AuthorizationList;
2163
+ chain?: import('viem').Chain | null;
2164
+ dataSuffix?: `0x${string}`;
2165
+ gas?: bigint;
2166
+ gasPrice?: bigint;
2167
+ maxFeePerGas?: bigint;
2168
+ maxPriorityFeePerGas?: bigint;
2169
+ nonce?: number;
2170
+ value?: bigint;
2171
+ }): Promise<boolean> {
2172
+ return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
2173
+ },
2174
+ /**
2175
+ * Simulate transferFrom
2176
+ * Returns gas estimate and result without sending transaction
2177
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2178
+ */
2179
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2180
+ accessList?: import('viem').AccessList;
2181
+ authorizationList?: import('viem').AuthorizationList;
2182
+ chain?: import('viem').Chain | null;
2183
+ dataSuffix?: `0x${string}`;
2184
+ gas?: bigint;
2185
+ gasPrice?: bigint;
2186
+ maxFeePerGas?: bigint;
2187
+ maxPriorityFeePerGas?: bigint;
2188
+ nonce?: number;
2189
+ value?: bigint;
2190
+ }): Promise<boolean> {
2191
+ return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
2192
+ },
2193
+ /**
2194
+ * Simulate transferShares
2195
+ * Returns gas estimate and result without sending transaction
2196
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2197
+ */
2198
+ async transferShares(to: `0x${string}`, value: bigint, options?: {
2199
+ accessList?: import('viem').AccessList;
2200
+ authorizationList?: import('viem').AuthorizationList;
2201
+ chain?: import('viem').Chain | null;
2202
+ dataSuffix?: `0x${string}`;
2203
+ gas?: bigint;
2204
+ gasPrice?: bigint;
2205
+ maxFeePerGas?: bigint;
2206
+ maxPriorityFeePerGas?: bigint;
2207
+ nonce?: number;
2208
+ value?: bigint;
2209
+ }): Promise<boolean> {
2210
+ return contract.simulate.transferShares([to, value] as const, options) as Promise<boolean>;
2211
+ },
2212
+ /**
2213
+ * Simulate transferSharesFrom
2214
+ * Returns gas estimate and result without sending transaction
2215
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2216
+ */
2217
+ async transferSharesFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2218
+ accessList?: import('viem').AccessList;
2219
+ authorizationList?: import('viem').AuthorizationList;
2220
+ chain?: import('viem').Chain | null;
2221
+ dataSuffix?: `0x${string}`;
2222
+ gas?: bigint;
2223
+ gasPrice?: bigint;
2224
+ maxFeePerGas?: bigint;
2225
+ maxPriorityFeePerGas?: bigint;
2226
+ nonce?: number;
2227
+ value?: bigint;
2228
+ }): Promise<boolean> {
2229
+ return contract.simulate.transferSharesFrom([from, to, value] as const, options) as Promise<boolean>;
2230
+ }
2231
+ };
2232
+ }
2233
+
2234
+ /**
2235
+ * Watch contract events
2236
+ *
2237
+ * @example
2238
+ * // Watch all Transfer events
2239
+ * const unwatch = contract.watch.Transfer((event) => {
2240
+ * console.log('Transfer:', event);
2241
+ * });
2242
+ *
2243
+ * // Stop watching
2244
+ * unwatch();
2245
+ */
2246
+ get watch() {
2247
+ return {
2248
+ /**
2249
+ * Watch Approval events
2250
+ * @param callback Function to call when event is emitted
2251
+ * @param filter Optional filter for indexed parameters
2252
+ * @returns Unwatch function to stop listening
2253
+ */
2254
+ 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 }) => {
2255
+ return this.publicClient.watchContractEvent({
2256
+ address: this.contractAddress,
2257
+ abi: UsdnAbi,
2258
+ eventName: 'Approval',
2259
+ args: filter as any,
2260
+ onLogs: (logs: any[]) => {
2261
+ logs.forEach((log: any) => {
2262
+ callback(log.args as any);
2263
+ });
2264
+ },
2265
+ }) as () => void;
2266
+ },
2267
+ /**
2268
+ * Watch EIP712DomainChanged events
2269
+ * @param callback Function to call when event is emitted
2270
+ * @param filter Optional filter for indexed parameters
2271
+ * @returns Unwatch function to stop listening
2272
+ */
2273
+ EIP712DomainChanged: (callback: (event: { }) => void) => {
2274
+ return this.publicClient.watchContractEvent({
2275
+ address: this.contractAddress,
2276
+ abi: UsdnAbi,
2277
+ eventName: 'EIP712DomainChanged',
2278
+
2279
+ onLogs: (logs: any[]) => {
2280
+ logs.forEach((log: any) => {
2281
+ callback(log.args as any);
2282
+ });
2283
+ },
2284
+ }) as () => void;
2285
+ },
2286
+ /**
2287
+ * Watch Rebase events
2288
+ * @param callback Function to call when event is emitted
2289
+ * @param filter Optional filter for indexed parameters
2290
+ * @returns Unwatch function to stop listening
2291
+ */
2292
+ Rebase: (callback: (event: { oldDivisor: bigint; newDivisor: bigint }) => void) => {
2293
+ return this.publicClient.watchContractEvent({
2294
+ address: this.contractAddress,
2295
+ abi: UsdnAbi,
2296
+ eventName: 'Rebase',
2297
+
2298
+ onLogs: (logs: any[]) => {
2299
+ logs.forEach((log: any) => {
2300
+ callback(log.args as any);
2301
+ });
2302
+ },
2303
+ }) as () => void;
2304
+ },
2305
+ /**
2306
+ * Watch RebaseHandlerUpdated events
2307
+ * @param callback Function to call when event is emitted
2308
+ * @param filter Optional filter for indexed parameters
2309
+ * @returns Unwatch function to stop listening
2310
+ */
2311
+ RebaseHandlerUpdated: (callback: (event: { newHandler: `0x${string}` }) => void) => {
2312
+ return this.publicClient.watchContractEvent({
2313
+ address: this.contractAddress,
2314
+ abi: UsdnAbi,
2315
+ eventName: 'RebaseHandlerUpdated',
2316
+
2317
+ onLogs: (logs: any[]) => {
2318
+ logs.forEach((log: any) => {
2319
+ callback(log.args as any);
2320
+ });
2321
+ },
2322
+ }) as () => void;
2323
+ },
2324
+ /**
2325
+ * Watch RoleAdminChanged events
2326
+ * @param callback Function to call when event is emitted
2327
+ * @param filter Optional filter for indexed parameters
2328
+ * @returns Unwatch function to stop listening
2329
+ */
2330
+ RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; previousAdminRole?: `0x${string}` | `0x${string}`[] | null; newAdminRole?: `0x${string}` | `0x${string}`[] | null }) => {
2331
+ return this.publicClient.watchContractEvent({
2332
+ address: this.contractAddress,
2333
+ abi: UsdnAbi,
2334
+ eventName: 'RoleAdminChanged',
2335
+ args: filter as any,
2336
+ onLogs: (logs: any[]) => {
2337
+ logs.forEach((log: any) => {
2338
+ callback(log.args as any);
2339
+ });
2340
+ },
2341
+ }) as () => void;
2342
+ },
2343
+ /**
2344
+ * Watch RoleGranted events
2345
+ * @param callback Function to call when event is emitted
2346
+ * @param filter Optional filter for indexed parameters
2347
+ * @returns Unwatch function to stop listening
2348
+ */
2349
+ RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
2350
+ return this.publicClient.watchContractEvent({
2351
+ address: this.contractAddress,
2352
+ abi: UsdnAbi,
2353
+ eventName: 'RoleGranted',
2354
+ args: filter as any,
2355
+ onLogs: (logs: any[]) => {
2356
+ logs.forEach((log: any) => {
2357
+ callback(log.args as any);
2358
+ });
2359
+ },
2360
+ }) as () => void;
2361
+ },
2362
+ /**
2363
+ * Watch RoleRevoked events
2364
+ * @param callback Function to call when event is emitted
2365
+ * @param filter Optional filter for indexed parameters
2366
+ * @returns Unwatch function to stop listening
2367
+ */
2368
+ RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
2369
+ return this.publicClient.watchContractEvent({
2370
+ address: this.contractAddress,
2371
+ abi: UsdnAbi,
2372
+ eventName: 'RoleRevoked',
2373
+ args: filter as any,
2374
+ onLogs: (logs: any[]) => {
2375
+ logs.forEach((log: any) => {
2376
+ callback(log.args as any);
2377
+ });
2378
+ },
2379
+ }) as () => void;
2380
+ },
2381
+ /**
2382
+ * Watch Transfer events
2383
+ * @param callback Function to call when event is emitted
2384
+ * @param filter Optional filter for indexed parameters
2385
+ * @returns Unwatch function to stop listening
2386
+ */
2387
+ 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 }) => {
2388
+ return this.publicClient.watchContractEvent({
2389
+ address: this.contractAddress,
2390
+ abi: UsdnAbi,
2391
+ eventName: 'Transfer',
2392
+ args: filter as any,
2393
+ onLogs: (logs: any[]) => {
2394
+ logs.forEach((log: any) => {
2395
+ callback(log.args as any);
2396
+ });
2397
+ },
2398
+ }) as () => void;
2399
+ }
2400
+ };
2401
+ }
2402
+ }