@gitmyabi-stg/amp 0.0.1

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