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