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