@gitmyabi/based 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,2941 @@
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
+ * BasedOFT_json ABI
92
+ *
93
+ * This ABI is typed using viem's type system for full type safety.
94
+ */
95
+ export const BasedOFT_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": "address",
722
+ "name": "from",
723
+ "type": "address"
724
+ },
725
+ {
726
+ "internalType": "uint256",
727
+ "name": "amount",
728
+ "type": "uint256"
729
+ }
730
+ ],
731
+ "name": "burn",
732
+ "outputs": [
733
+ {
734
+ "internalType": "bool",
735
+ "name": "",
736
+ "type": "bool"
737
+ }
738
+ ],
739
+ "stateMutability": "nonpayable",
740
+ "type": "function"
741
+ },
742
+ {
743
+ "inputs": [
744
+ {
745
+ "internalType": "uint32",
746
+ "name": "_eid",
747
+ "type": "uint32"
748
+ },
749
+ {
750
+ "internalType": "uint16",
751
+ "name": "_msgType",
752
+ "type": "uint16"
753
+ },
754
+ {
755
+ "internalType": "bytes",
756
+ "name": "_extraOptions",
757
+ "type": "bytes"
758
+ }
759
+ ],
760
+ "name": "combineOptions",
761
+ "outputs": [
762
+ {
763
+ "internalType": "bytes",
764
+ "name": "",
765
+ "type": "bytes"
766
+ }
767
+ ],
768
+ "stateMutability": "view",
769
+ "type": "function"
770
+ },
771
+ {
772
+ "inputs": [],
773
+ "name": "decimalConversionRate",
774
+ "outputs": [
775
+ {
776
+ "internalType": "uint256",
777
+ "name": "",
778
+ "type": "uint256"
779
+ }
780
+ ],
781
+ "stateMutability": "view",
782
+ "type": "function"
783
+ },
784
+ {
785
+ "inputs": [],
786
+ "name": "decimals",
787
+ "outputs": [
788
+ {
789
+ "internalType": "uint8",
790
+ "name": "",
791
+ "type": "uint8"
792
+ }
793
+ ],
794
+ "stateMutability": "view",
795
+ "type": "function"
796
+ },
797
+ {
798
+ "inputs": [],
799
+ "name": "endpoint",
800
+ "outputs": [
801
+ {
802
+ "internalType": "contract ILayerZeroEndpointV2",
803
+ "name": "",
804
+ "type": "address"
805
+ }
806
+ ],
807
+ "stateMutability": "view",
808
+ "type": "function"
809
+ },
810
+ {
811
+ "inputs": [
812
+ {
813
+ "internalType": "uint32",
814
+ "name": "eid",
815
+ "type": "uint32"
816
+ },
817
+ {
818
+ "internalType": "uint16",
819
+ "name": "msgType",
820
+ "type": "uint16"
821
+ }
822
+ ],
823
+ "name": "enforcedOptions",
824
+ "outputs": [
825
+ {
826
+ "internalType": "bytes",
827
+ "name": "enforcedOption",
828
+ "type": "bytes"
829
+ }
830
+ ],
831
+ "stateMutability": "view",
832
+ "type": "function"
833
+ },
834
+ {
835
+ "inputs": [
836
+ {
837
+ "components": [
838
+ {
839
+ "internalType": "uint32",
840
+ "name": "srcEid",
841
+ "type": "uint32"
842
+ },
843
+ {
844
+ "internalType": "bytes32",
845
+ "name": "sender",
846
+ "type": "bytes32"
847
+ },
848
+ {
849
+ "internalType": "uint64",
850
+ "name": "nonce",
851
+ "type": "uint64"
852
+ }
853
+ ],
854
+ "internalType": "struct Origin",
855
+ "name": "",
856
+ "type": "tuple"
857
+ },
858
+ {
859
+ "internalType": "bytes",
860
+ "name": "",
861
+ "type": "bytes"
862
+ },
863
+ {
864
+ "internalType": "address",
865
+ "name": "_sender",
866
+ "type": "address"
867
+ }
868
+ ],
869
+ "name": "isComposeMsgSender",
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
+ "internalType": "uint32",
884
+ "name": "_eid",
885
+ "type": "uint32"
886
+ },
887
+ {
888
+ "internalType": "bytes32",
889
+ "name": "_peer",
890
+ "type": "bytes32"
891
+ }
892
+ ],
893
+ "name": "isPeer",
894
+ "outputs": [
895
+ {
896
+ "internalType": "bool",
897
+ "name": "",
898
+ "type": "bool"
899
+ }
900
+ ],
901
+ "stateMutability": "view",
902
+ "type": "function"
903
+ },
904
+ {
905
+ "inputs": [
906
+ {
907
+ "components": [
908
+ {
909
+ "internalType": "uint32",
910
+ "name": "srcEid",
911
+ "type": "uint32"
912
+ },
913
+ {
914
+ "internalType": "bytes32",
915
+ "name": "sender",
916
+ "type": "bytes32"
917
+ },
918
+ {
919
+ "internalType": "uint64",
920
+ "name": "nonce",
921
+ "type": "uint64"
922
+ }
923
+ ],
924
+ "internalType": "struct Origin",
925
+ "name": "_origin",
926
+ "type": "tuple"
927
+ },
928
+ {
929
+ "internalType": "bytes32",
930
+ "name": "_guid",
931
+ "type": "bytes32"
932
+ },
933
+ {
934
+ "internalType": "bytes",
935
+ "name": "_message",
936
+ "type": "bytes"
937
+ },
938
+ {
939
+ "internalType": "address",
940
+ "name": "_executor",
941
+ "type": "address"
942
+ },
943
+ {
944
+ "internalType": "bytes",
945
+ "name": "_extraData",
946
+ "type": "bytes"
947
+ }
948
+ ],
949
+ "name": "lzReceive",
950
+ "outputs": [],
951
+ "stateMutability": "payable",
952
+ "type": "function"
953
+ },
954
+ {
955
+ "inputs": [
956
+ {
957
+ "components": [
958
+ {
959
+ "components": [
960
+ {
961
+ "internalType": "uint32",
962
+ "name": "srcEid",
963
+ "type": "uint32"
964
+ },
965
+ {
966
+ "internalType": "bytes32",
967
+ "name": "sender",
968
+ "type": "bytes32"
969
+ },
970
+ {
971
+ "internalType": "uint64",
972
+ "name": "nonce",
973
+ "type": "uint64"
974
+ }
975
+ ],
976
+ "internalType": "struct Origin",
977
+ "name": "origin",
978
+ "type": "tuple"
979
+ },
980
+ {
981
+ "internalType": "uint32",
982
+ "name": "dstEid",
983
+ "type": "uint32"
984
+ },
985
+ {
986
+ "internalType": "address",
987
+ "name": "receiver",
988
+ "type": "address"
989
+ },
990
+ {
991
+ "internalType": "bytes32",
992
+ "name": "guid",
993
+ "type": "bytes32"
994
+ },
995
+ {
996
+ "internalType": "uint256",
997
+ "name": "value",
998
+ "type": "uint256"
999
+ },
1000
+ {
1001
+ "internalType": "address",
1002
+ "name": "executor",
1003
+ "type": "address"
1004
+ },
1005
+ {
1006
+ "internalType": "bytes",
1007
+ "name": "message",
1008
+ "type": "bytes"
1009
+ },
1010
+ {
1011
+ "internalType": "bytes",
1012
+ "name": "extraData",
1013
+ "type": "bytes"
1014
+ }
1015
+ ],
1016
+ "internalType": "struct InboundPacket[]",
1017
+ "name": "_packets",
1018
+ "type": "tuple[]"
1019
+ }
1020
+ ],
1021
+ "name": "lzReceiveAndRevert",
1022
+ "outputs": [],
1023
+ "stateMutability": "payable",
1024
+ "type": "function"
1025
+ },
1026
+ {
1027
+ "inputs": [
1028
+ {
1029
+ "components": [
1030
+ {
1031
+ "internalType": "uint32",
1032
+ "name": "srcEid",
1033
+ "type": "uint32"
1034
+ },
1035
+ {
1036
+ "internalType": "bytes32",
1037
+ "name": "sender",
1038
+ "type": "bytes32"
1039
+ },
1040
+ {
1041
+ "internalType": "uint64",
1042
+ "name": "nonce",
1043
+ "type": "uint64"
1044
+ }
1045
+ ],
1046
+ "internalType": "struct Origin",
1047
+ "name": "_origin",
1048
+ "type": "tuple"
1049
+ },
1050
+ {
1051
+ "internalType": "bytes32",
1052
+ "name": "_guid",
1053
+ "type": "bytes32"
1054
+ },
1055
+ {
1056
+ "internalType": "bytes",
1057
+ "name": "_message",
1058
+ "type": "bytes"
1059
+ },
1060
+ {
1061
+ "internalType": "address",
1062
+ "name": "_executor",
1063
+ "type": "address"
1064
+ },
1065
+ {
1066
+ "internalType": "bytes",
1067
+ "name": "_extraData",
1068
+ "type": "bytes"
1069
+ }
1070
+ ],
1071
+ "name": "lzReceiveSimulate",
1072
+ "outputs": [],
1073
+ "stateMutability": "payable",
1074
+ "type": "function"
1075
+ },
1076
+ {
1077
+ "inputs": [
1078
+ {
1079
+ "internalType": "address",
1080
+ "name": "to",
1081
+ "type": "address"
1082
+ },
1083
+ {
1084
+ "internalType": "uint256",
1085
+ "name": "amount",
1086
+ "type": "uint256"
1087
+ }
1088
+ ],
1089
+ "name": "mint",
1090
+ "outputs": [
1091
+ {
1092
+ "internalType": "bool",
1093
+ "name": "",
1094
+ "type": "bool"
1095
+ }
1096
+ ],
1097
+ "stateMutability": "nonpayable",
1098
+ "type": "function"
1099
+ },
1100
+ {
1101
+ "inputs": [],
1102
+ "name": "msgInspector",
1103
+ "outputs": [
1104
+ {
1105
+ "internalType": "address",
1106
+ "name": "",
1107
+ "type": "address"
1108
+ }
1109
+ ],
1110
+ "stateMutability": "view",
1111
+ "type": "function"
1112
+ },
1113
+ {
1114
+ "inputs": [],
1115
+ "name": "name",
1116
+ "outputs": [
1117
+ {
1118
+ "internalType": "string",
1119
+ "name": "",
1120
+ "type": "string"
1121
+ }
1122
+ ],
1123
+ "stateMutability": "view",
1124
+ "type": "function"
1125
+ },
1126
+ {
1127
+ "inputs": [
1128
+ {
1129
+ "internalType": "uint32",
1130
+ "name": "",
1131
+ "type": "uint32"
1132
+ },
1133
+ {
1134
+ "internalType": "bytes32",
1135
+ "name": "",
1136
+ "type": "bytes32"
1137
+ }
1138
+ ],
1139
+ "name": "nextNonce",
1140
+ "outputs": [
1141
+ {
1142
+ "internalType": "uint64",
1143
+ "name": "nonce",
1144
+ "type": "uint64"
1145
+ }
1146
+ ],
1147
+ "stateMutability": "view",
1148
+ "type": "function"
1149
+ },
1150
+ {
1151
+ "inputs": [],
1152
+ "name": "oApp",
1153
+ "outputs": [
1154
+ {
1155
+ "internalType": "address",
1156
+ "name": "",
1157
+ "type": "address"
1158
+ }
1159
+ ],
1160
+ "stateMutability": "view",
1161
+ "type": "function"
1162
+ },
1163
+ {
1164
+ "inputs": [],
1165
+ "name": "oAppVersion",
1166
+ "outputs": [
1167
+ {
1168
+ "internalType": "uint64",
1169
+ "name": "senderVersion",
1170
+ "type": "uint64"
1171
+ },
1172
+ {
1173
+ "internalType": "uint64",
1174
+ "name": "receiverVersion",
1175
+ "type": "uint64"
1176
+ }
1177
+ ],
1178
+ "stateMutability": "pure",
1179
+ "type": "function"
1180
+ },
1181
+ {
1182
+ "inputs": [],
1183
+ "name": "oftVersion",
1184
+ "outputs": [
1185
+ {
1186
+ "internalType": "bytes4",
1187
+ "name": "interfaceId",
1188
+ "type": "bytes4"
1189
+ },
1190
+ {
1191
+ "internalType": "uint64",
1192
+ "name": "version",
1193
+ "type": "uint64"
1194
+ }
1195
+ ],
1196
+ "stateMutability": "pure",
1197
+ "type": "function"
1198
+ },
1199
+ {
1200
+ "inputs": [],
1201
+ "name": "owner",
1202
+ "outputs": [
1203
+ {
1204
+ "internalType": "address",
1205
+ "name": "",
1206
+ "type": "address"
1207
+ }
1208
+ ],
1209
+ "stateMutability": "view",
1210
+ "type": "function"
1211
+ },
1212
+ {
1213
+ "inputs": [
1214
+ {
1215
+ "internalType": "uint32",
1216
+ "name": "eid",
1217
+ "type": "uint32"
1218
+ }
1219
+ ],
1220
+ "name": "peers",
1221
+ "outputs": [
1222
+ {
1223
+ "internalType": "bytes32",
1224
+ "name": "peer",
1225
+ "type": "bytes32"
1226
+ }
1227
+ ],
1228
+ "stateMutability": "view",
1229
+ "type": "function"
1230
+ },
1231
+ {
1232
+ "inputs": [],
1233
+ "name": "preCrime",
1234
+ "outputs": [
1235
+ {
1236
+ "internalType": "address",
1237
+ "name": "",
1238
+ "type": "address"
1239
+ }
1240
+ ],
1241
+ "stateMutability": "view",
1242
+ "type": "function"
1243
+ },
1244
+ {
1245
+ "inputs": [
1246
+ {
1247
+ "components": [
1248
+ {
1249
+ "internalType": "uint32",
1250
+ "name": "dstEid",
1251
+ "type": "uint32"
1252
+ },
1253
+ {
1254
+ "internalType": "bytes32",
1255
+ "name": "to",
1256
+ "type": "bytes32"
1257
+ },
1258
+ {
1259
+ "internalType": "uint256",
1260
+ "name": "amountLD",
1261
+ "type": "uint256"
1262
+ },
1263
+ {
1264
+ "internalType": "uint256",
1265
+ "name": "minAmountLD",
1266
+ "type": "uint256"
1267
+ },
1268
+ {
1269
+ "internalType": "bytes",
1270
+ "name": "extraOptions",
1271
+ "type": "bytes"
1272
+ },
1273
+ {
1274
+ "internalType": "bytes",
1275
+ "name": "composeMsg",
1276
+ "type": "bytes"
1277
+ },
1278
+ {
1279
+ "internalType": "bytes",
1280
+ "name": "oftCmd",
1281
+ "type": "bytes"
1282
+ }
1283
+ ],
1284
+ "internalType": "struct SendParam",
1285
+ "name": "_sendParam",
1286
+ "type": "tuple"
1287
+ }
1288
+ ],
1289
+ "name": "quoteOFT",
1290
+ "outputs": [
1291
+ {
1292
+ "components": [
1293
+ {
1294
+ "internalType": "uint256",
1295
+ "name": "minAmountLD",
1296
+ "type": "uint256"
1297
+ },
1298
+ {
1299
+ "internalType": "uint256",
1300
+ "name": "maxAmountLD",
1301
+ "type": "uint256"
1302
+ }
1303
+ ],
1304
+ "internalType": "struct OFTLimit",
1305
+ "name": "oftLimit",
1306
+ "type": "tuple"
1307
+ },
1308
+ {
1309
+ "components": [
1310
+ {
1311
+ "internalType": "int256",
1312
+ "name": "feeAmountLD",
1313
+ "type": "int256"
1314
+ },
1315
+ {
1316
+ "internalType": "string",
1317
+ "name": "description",
1318
+ "type": "string"
1319
+ }
1320
+ ],
1321
+ "internalType": "struct OFTFeeDetail[]",
1322
+ "name": "oftFeeDetails",
1323
+ "type": "tuple[]"
1324
+ },
1325
+ {
1326
+ "components": [
1327
+ {
1328
+ "internalType": "uint256",
1329
+ "name": "amountSentLD",
1330
+ "type": "uint256"
1331
+ },
1332
+ {
1333
+ "internalType": "uint256",
1334
+ "name": "amountReceivedLD",
1335
+ "type": "uint256"
1336
+ }
1337
+ ],
1338
+ "internalType": "struct OFTReceipt",
1339
+ "name": "oftReceipt",
1340
+ "type": "tuple"
1341
+ }
1342
+ ],
1343
+ "stateMutability": "view",
1344
+ "type": "function"
1345
+ },
1346
+ {
1347
+ "inputs": [
1348
+ {
1349
+ "components": [
1350
+ {
1351
+ "internalType": "uint32",
1352
+ "name": "dstEid",
1353
+ "type": "uint32"
1354
+ },
1355
+ {
1356
+ "internalType": "bytes32",
1357
+ "name": "to",
1358
+ "type": "bytes32"
1359
+ },
1360
+ {
1361
+ "internalType": "uint256",
1362
+ "name": "amountLD",
1363
+ "type": "uint256"
1364
+ },
1365
+ {
1366
+ "internalType": "uint256",
1367
+ "name": "minAmountLD",
1368
+ "type": "uint256"
1369
+ },
1370
+ {
1371
+ "internalType": "bytes",
1372
+ "name": "extraOptions",
1373
+ "type": "bytes"
1374
+ },
1375
+ {
1376
+ "internalType": "bytes",
1377
+ "name": "composeMsg",
1378
+ "type": "bytes"
1379
+ },
1380
+ {
1381
+ "internalType": "bytes",
1382
+ "name": "oftCmd",
1383
+ "type": "bytes"
1384
+ }
1385
+ ],
1386
+ "internalType": "struct SendParam",
1387
+ "name": "_sendParam",
1388
+ "type": "tuple"
1389
+ },
1390
+ {
1391
+ "internalType": "bool",
1392
+ "name": "_payInLzToken",
1393
+ "type": "bool"
1394
+ }
1395
+ ],
1396
+ "name": "quoteSend",
1397
+ "outputs": [
1398
+ {
1399
+ "components": [
1400
+ {
1401
+ "internalType": "uint256",
1402
+ "name": "nativeFee",
1403
+ "type": "uint256"
1404
+ },
1405
+ {
1406
+ "internalType": "uint256",
1407
+ "name": "lzTokenFee",
1408
+ "type": "uint256"
1409
+ }
1410
+ ],
1411
+ "internalType": "struct MessagingFee",
1412
+ "name": "msgFee",
1413
+ "type": "tuple"
1414
+ }
1415
+ ],
1416
+ "stateMutability": "view",
1417
+ "type": "function"
1418
+ },
1419
+ {
1420
+ "inputs": [],
1421
+ "name": "renounceOwnership",
1422
+ "outputs": [],
1423
+ "stateMutability": "nonpayable",
1424
+ "type": "function"
1425
+ },
1426
+ {
1427
+ "inputs": [
1428
+ {
1429
+ "components": [
1430
+ {
1431
+ "internalType": "uint32",
1432
+ "name": "dstEid",
1433
+ "type": "uint32"
1434
+ },
1435
+ {
1436
+ "internalType": "bytes32",
1437
+ "name": "to",
1438
+ "type": "bytes32"
1439
+ },
1440
+ {
1441
+ "internalType": "uint256",
1442
+ "name": "amountLD",
1443
+ "type": "uint256"
1444
+ },
1445
+ {
1446
+ "internalType": "uint256",
1447
+ "name": "minAmountLD",
1448
+ "type": "uint256"
1449
+ },
1450
+ {
1451
+ "internalType": "bytes",
1452
+ "name": "extraOptions",
1453
+ "type": "bytes"
1454
+ },
1455
+ {
1456
+ "internalType": "bytes",
1457
+ "name": "composeMsg",
1458
+ "type": "bytes"
1459
+ },
1460
+ {
1461
+ "internalType": "bytes",
1462
+ "name": "oftCmd",
1463
+ "type": "bytes"
1464
+ }
1465
+ ],
1466
+ "internalType": "struct SendParam",
1467
+ "name": "_sendParam",
1468
+ "type": "tuple"
1469
+ },
1470
+ {
1471
+ "components": [
1472
+ {
1473
+ "internalType": "uint256",
1474
+ "name": "nativeFee",
1475
+ "type": "uint256"
1476
+ },
1477
+ {
1478
+ "internalType": "uint256",
1479
+ "name": "lzTokenFee",
1480
+ "type": "uint256"
1481
+ }
1482
+ ],
1483
+ "internalType": "struct MessagingFee",
1484
+ "name": "_fee",
1485
+ "type": "tuple"
1486
+ },
1487
+ {
1488
+ "internalType": "address",
1489
+ "name": "_refundAddress",
1490
+ "type": "address"
1491
+ }
1492
+ ],
1493
+ "name": "send",
1494
+ "outputs": [
1495
+ {
1496
+ "components": [
1497
+ {
1498
+ "internalType": "bytes32",
1499
+ "name": "guid",
1500
+ "type": "bytes32"
1501
+ },
1502
+ {
1503
+ "internalType": "uint64",
1504
+ "name": "nonce",
1505
+ "type": "uint64"
1506
+ },
1507
+ {
1508
+ "components": [
1509
+ {
1510
+ "internalType": "uint256",
1511
+ "name": "nativeFee",
1512
+ "type": "uint256"
1513
+ },
1514
+ {
1515
+ "internalType": "uint256",
1516
+ "name": "lzTokenFee",
1517
+ "type": "uint256"
1518
+ }
1519
+ ],
1520
+ "internalType": "struct MessagingFee",
1521
+ "name": "fee",
1522
+ "type": "tuple"
1523
+ }
1524
+ ],
1525
+ "internalType": "struct MessagingReceipt",
1526
+ "name": "msgReceipt",
1527
+ "type": "tuple"
1528
+ },
1529
+ {
1530
+ "components": [
1531
+ {
1532
+ "internalType": "uint256",
1533
+ "name": "amountSentLD",
1534
+ "type": "uint256"
1535
+ },
1536
+ {
1537
+ "internalType": "uint256",
1538
+ "name": "amountReceivedLD",
1539
+ "type": "uint256"
1540
+ }
1541
+ ],
1542
+ "internalType": "struct OFTReceipt",
1543
+ "name": "oftReceipt",
1544
+ "type": "tuple"
1545
+ }
1546
+ ],
1547
+ "stateMutability": "payable",
1548
+ "type": "function"
1549
+ },
1550
+ {
1551
+ "inputs": [
1552
+ {
1553
+ "internalType": "address",
1554
+ "name": "_delegate",
1555
+ "type": "address"
1556
+ }
1557
+ ],
1558
+ "name": "setDelegate",
1559
+ "outputs": [],
1560
+ "stateMutability": "nonpayable",
1561
+ "type": "function"
1562
+ },
1563
+ {
1564
+ "inputs": [
1565
+ {
1566
+ "components": [
1567
+ {
1568
+ "internalType": "uint32",
1569
+ "name": "eid",
1570
+ "type": "uint32"
1571
+ },
1572
+ {
1573
+ "internalType": "uint16",
1574
+ "name": "msgType",
1575
+ "type": "uint16"
1576
+ },
1577
+ {
1578
+ "internalType": "bytes",
1579
+ "name": "options",
1580
+ "type": "bytes"
1581
+ }
1582
+ ],
1583
+ "internalType": "struct EnforcedOptionParam[]",
1584
+ "name": "_enforcedOptions",
1585
+ "type": "tuple[]"
1586
+ }
1587
+ ],
1588
+ "name": "setEnforcedOptions",
1589
+ "outputs": [],
1590
+ "stateMutability": "nonpayable",
1591
+ "type": "function"
1592
+ },
1593
+ {
1594
+ "inputs": [
1595
+ {
1596
+ "internalType": "address",
1597
+ "name": "_msgInspector",
1598
+ "type": "address"
1599
+ }
1600
+ ],
1601
+ "name": "setMsgInspector",
1602
+ "outputs": [],
1603
+ "stateMutability": "nonpayable",
1604
+ "type": "function"
1605
+ },
1606
+ {
1607
+ "inputs": [
1608
+ {
1609
+ "internalType": "uint32",
1610
+ "name": "_eid",
1611
+ "type": "uint32"
1612
+ },
1613
+ {
1614
+ "internalType": "bytes32",
1615
+ "name": "_peer",
1616
+ "type": "bytes32"
1617
+ }
1618
+ ],
1619
+ "name": "setPeer",
1620
+ "outputs": [],
1621
+ "stateMutability": "nonpayable",
1622
+ "type": "function"
1623
+ },
1624
+ {
1625
+ "inputs": [
1626
+ {
1627
+ "internalType": "address",
1628
+ "name": "_preCrime",
1629
+ "type": "address"
1630
+ }
1631
+ ],
1632
+ "name": "setPreCrime",
1633
+ "outputs": [],
1634
+ "stateMutability": "nonpayable",
1635
+ "type": "function"
1636
+ },
1637
+ {
1638
+ "inputs": [],
1639
+ "name": "sharedDecimals",
1640
+ "outputs": [
1641
+ {
1642
+ "internalType": "uint8",
1643
+ "name": "",
1644
+ "type": "uint8"
1645
+ }
1646
+ ],
1647
+ "stateMutability": "view",
1648
+ "type": "function"
1649
+ },
1650
+ {
1651
+ "inputs": [],
1652
+ "name": "symbol",
1653
+ "outputs": [
1654
+ {
1655
+ "internalType": "string",
1656
+ "name": "",
1657
+ "type": "string"
1658
+ }
1659
+ ],
1660
+ "stateMutability": "view",
1661
+ "type": "function"
1662
+ },
1663
+ {
1664
+ "inputs": [],
1665
+ "name": "token",
1666
+ "outputs": [
1667
+ {
1668
+ "internalType": "address",
1669
+ "name": "",
1670
+ "type": "address"
1671
+ }
1672
+ ],
1673
+ "stateMutability": "view",
1674
+ "type": "function"
1675
+ },
1676
+ {
1677
+ "inputs": [],
1678
+ "name": "totalSupply",
1679
+ "outputs": [
1680
+ {
1681
+ "internalType": "uint256",
1682
+ "name": "",
1683
+ "type": "uint256"
1684
+ }
1685
+ ],
1686
+ "stateMutability": "view",
1687
+ "type": "function"
1688
+ },
1689
+ {
1690
+ "inputs": [
1691
+ {
1692
+ "internalType": "address",
1693
+ "name": "to",
1694
+ "type": "address"
1695
+ },
1696
+ {
1697
+ "internalType": "uint256",
1698
+ "name": "value",
1699
+ "type": "uint256"
1700
+ }
1701
+ ],
1702
+ "name": "transfer",
1703
+ "outputs": [
1704
+ {
1705
+ "internalType": "bool",
1706
+ "name": "",
1707
+ "type": "bool"
1708
+ }
1709
+ ],
1710
+ "stateMutability": "nonpayable",
1711
+ "type": "function"
1712
+ },
1713
+ {
1714
+ "inputs": [
1715
+ {
1716
+ "internalType": "address",
1717
+ "name": "from",
1718
+ "type": "address"
1719
+ },
1720
+ {
1721
+ "internalType": "address",
1722
+ "name": "to",
1723
+ "type": "address"
1724
+ },
1725
+ {
1726
+ "internalType": "uint256",
1727
+ "name": "value",
1728
+ "type": "uint256"
1729
+ }
1730
+ ],
1731
+ "name": "transferFrom",
1732
+ "outputs": [
1733
+ {
1734
+ "internalType": "bool",
1735
+ "name": "",
1736
+ "type": "bool"
1737
+ }
1738
+ ],
1739
+ "stateMutability": "nonpayable",
1740
+ "type": "function"
1741
+ },
1742
+ {
1743
+ "inputs": [
1744
+ {
1745
+ "internalType": "address",
1746
+ "name": "newOwner",
1747
+ "type": "address"
1748
+ }
1749
+ ],
1750
+ "name": "transferOwnership",
1751
+ "outputs": [],
1752
+ "stateMutability": "nonpayable",
1753
+ "type": "function"
1754
+ }
1755
+ ] as const satisfies Abi;
1756
+
1757
+ /**
1758
+ * Type-safe ABI for BasedOFT_json
1759
+ */
1760
+ export type BasedOFT_jsonAbi = typeof BasedOFT_jsonAbi;
1761
+
1762
+ /**
1763
+ * Contract instance type for BasedOFT_json
1764
+ */
1765
+ // Use any for contract type to avoid complex viem type issues
1766
+ // The runtime behavior is type-safe through viem's ABI typing
1767
+ export type BasedOFT_jsonContract = any;
1768
+
1769
+ /**
1770
+ * BasedOFT_json Contract Class
1771
+ *
1772
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1773
+ *
1774
+ * @example
1775
+ * ```typescript
1776
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1777
+ * import { mainnet } from 'viem/chains';
1778
+ * import { BasedOFT_json } from 'BasedOFT_json';
1779
+ *
1780
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1781
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1782
+ *
1783
+ * const contract = new BasedOFT_json('0x...', { publicClient, walletClient });
1784
+ *
1785
+ * // Read functions
1786
+ * const result = await contract.balanceOf('0x...');
1787
+ *
1788
+ * // Write functions
1789
+ * const hash = await contract.transfer('0x...', 1000n);
1790
+ *
1791
+ * // Simulate transactions (dry-run)
1792
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1793
+ * console.log('Gas estimate:', simulation.request.gas);
1794
+ *
1795
+ * // Watch events
1796
+ * const unwatch = contract.watch.Transfer((event) => {
1797
+ * console.log('Transfer event:', event);
1798
+ * });
1799
+ * ```
1800
+ */
1801
+ export class BasedOFT_json {
1802
+ private contract: BasedOFT_jsonContract;
1803
+ private contractAddress: Address;
1804
+ private publicClient: PublicClient;
1805
+
1806
+ constructor(
1807
+ address: Address,
1808
+ clients: {
1809
+ publicClient: PublicClient;
1810
+ walletClient?: WalletClient;
1811
+ }
1812
+ ) {
1813
+ this.contractAddress = address;
1814
+ this.publicClient = clients.publicClient;
1815
+ this.contract = getContract({
1816
+ address,
1817
+ abi: BasedOFT_jsonAbi,
1818
+ client: {
1819
+ public: clients.publicClient,
1820
+ wallet: clients.walletClient,
1821
+ },
1822
+ });
1823
+ }
1824
+
1825
+ /**
1826
+ * Get the contract address
1827
+ */
1828
+ get address(): Address {
1829
+ return this.contractAddress;
1830
+ }
1831
+
1832
+ /**
1833
+ * Get the underlying viem contract instance
1834
+ */
1835
+ getContract(): BasedOFT_jsonContract {
1836
+ return this.contract;
1837
+ }
1838
+
1839
+ /**
1840
+ * SEND
1841
+ * view
1842
+ */
1843
+ async SEND(): Promise<bigint> {
1844
+ return this.contract.read.SEND() as Promise<bigint>;
1845
+ }
1846
+
1847
+ /**
1848
+ * SEND_AND_CALL
1849
+ * view
1850
+ */
1851
+ async SEND_AND_CALL(): Promise<bigint> {
1852
+ return this.contract.read.SEND_AND_CALL() as Promise<bigint>;
1853
+ }
1854
+
1855
+ /**
1856
+ * allowInitializePath
1857
+ * view
1858
+ */
1859
+ async allowInitializePath(origin: Origin): Promise<boolean> {
1860
+ return this.contract.read.allowInitializePath([origin] as const) as Promise<boolean>;
1861
+ }
1862
+
1863
+ /**
1864
+ * allowance
1865
+ * view
1866
+ */
1867
+ async allowance(owner: `0x${string}`, spender: `0x${string}`): Promise<bigint> {
1868
+ return this.contract.read.allowance([owner, spender] as const) as Promise<bigint>;
1869
+ }
1870
+
1871
+ /**
1872
+ * approvalRequired
1873
+ * pure
1874
+ */
1875
+ async approvalRequired(): Promise<boolean> {
1876
+ return this.contract.read.approvalRequired() as Promise<boolean>;
1877
+ }
1878
+
1879
+ /**
1880
+ * balanceOf
1881
+ * view
1882
+ */
1883
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
1884
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
1885
+ }
1886
+
1887
+ /**
1888
+ * combineOptions
1889
+ * view
1890
+ */
1891
+ async combineOptions(_eid: bigint, _msgType: bigint, _extraOptions: `0x${string}`): Promise<`0x${string}`> {
1892
+ return this.contract.read.combineOptions([_eid, _msgType, _extraOptions] as const) as Promise<`0x${string}`>;
1893
+ }
1894
+
1895
+ /**
1896
+ * decimalConversionRate
1897
+ * view
1898
+ */
1899
+ async decimalConversionRate(): Promise<bigint> {
1900
+ return this.contract.read.decimalConversionRate() as Promise<bigint>;
1901
+ }
1902
+
1903
+ /**
1904
+ * decimals
1905
+ * view
1906
+ */
1907
+ async decimals(): Promise<bigint> {
1908
+ return this.contract.read.decimals() as Promise<bigint>;
1909
+ }
1910
+
1911
+ /**
1912
+ * endpoint
1913
+ * view
1914
+ */
1915
+ async endpoint(): Promise<`0x${string}`> {
1916
+ return this.contract.read.endpoint() as Promise<`0x${string}`>;
1917
+ }
1918
+
1919
+ /**
1920
+ * enforcedOptions
1921
+ * view
1922
+ */
1923
+ async enforcedOptions(eid: bigint, msgType: bigint): Promise<`0x${string}`> {
1924
+ return this.contract.read.enforcedOptions([eid, msgType] as const) as Promise<`0x${string}`>;
1925
+ }
1926
+
1927
+ /**
1928
+ * isComposeMsgSender
1929
+ * view
1930
+ */
1931
+ async isComposeMsgSender(arg0: Origin, arg1: `0x${string}`, _sender: `0x${string}`): Promise<boolean> {
1932
+ return this.contract.read.isComposeMsgSender([arg0, arg1, _sender] as const) as Promise<boolean>;
1933
+ }
1934
+
1935
+ /**
1936
+ * isPeer
1937
+ * view
1938
+ */
1939
+ async isPeer(_eid: bigint, _peer: `0x${string}`): Promise<boolean> {
1940
+ return this.contract.read.isPeer([_eid, _peer] as const) as Promise<boolean>;
1941
+ }
1942
+
1943
+ /**
1944
+ * msgInspector
1945
+ * view
1946
+ */
1947
+ async msgInspector(): Promise<`0x${string}`> {
1948
+ return this.contract.read.msgInspector() as Promise<`0x${string}`>;
1949
+ }
1950
+
1951
+ /**
1952
+ * name
1953
+ * view
1954
+ */
1955
+ async name(): Promise<string> {
1956
+ return this.contract.read.name() as Promise<string>;
1957
+ }
1958
+
1959
+ /**
1960
+ * nextNonce
1961
+ * view
1962
+ */
1963
+ async nextNonce(arg0: bigint, arg1: `0x${string}`): Promise<bigint> {
1964
+ return this.contract.read.nextNonce([arg0, arg1] as const) as Promise<bigint>;
1965
+ }
1966
+
1967
+ /**
1968
+ * oApp
1969
+ * view
1970
+ */
1971
+ async oApp(): Promise<`0x${string}`> {
1972
+ return this.contract.read.oApp() as Promise<`0x${string}`>;
1973
+ }
1974
+
1975
+ /**
1976
+ * oAppVersion
1977
+ * pure
1978
+ */
1979
+ async oAppVersion(): Promise<[bigint, bigint]> {
1980
+ return this.contract.read.oAppVersion() as Promise<[bigint, bigint]>;
1981
+ }
1982
+
1983
+ /**
1984
+ * oftVersion
1985
+ * pure
1986
+ */
1987
+ async oftVersion(): Promise<[`0x${string}`, bigint]> {
1988
+ return this.contract.read.oftVersion() as Promise<[`0x${string}`, bigint]>;
1989
+ }
1990
+
1991
+ /**
1992
+ * owner
1993
+ * view
1994
+ */
1995
+ async owner(): Promise<`0x${string}`> {
1996
+ return this.contract.read.owner() as Promise<`0x${string}`>;
1997
+ }
1998
+
1999
+ /**
2000
+ * peers
2001
+ * view
2002
+ */
2003
+ async peers(eid: bigint): Promise<`0x${string}`> {
2004
+ return this.contract.read.peers([eid] as const) as Promise<`0x${string}`>;
2005
+ }
2006
+
2007
+ /**
2008
+ * preCrime
2009
+ * view
2010
+ */
2011
+ async preCrime(): Promise<`0x${string}`> {
2012
+ return this.contract.read.preCrime() as Promise<`0x${string}`>;
2013
+ }
2014
+
2015
+ /**
2016
+ * quoteOFT
2017
+ * view
2018
+ */
2019
+ async quoteOFT(_sendParam: SendParam): Promise<[OFTLimit, OFTFeeDetail[], OFTReceipt]> {
2020
+ return this.contract.read.quoteOFT([_sendParam] as const) as Promise<[OFTLimit, OFTFeeDetail[], OFTReceipt]>;
2021
+ }
2022
+
2023
+ /**
2024
+ * quoteSend
2025
+ * view
2026
+ */
2027
+ async quoteSend(_sendParam: SendParam, _payInLzToken: boolean): Promise<MessagingFee> {
2028
+ return this.contract.read.quoteSend([_sendParam, _payInLzToken] as const) as Promise<MessagingFee>;
2029
+ }
2030
+
2031
+ /**
2032
+ * sharedDecimals
2033
+ * view
2034
+ */
2035
+ async sharedDecimals(): Promise<bigint> {
2036
+ return this.contract.read.sharedDecimals() as Promise<bigint>;
2037
+ }
2038
+
2039
+ /**
2040
+ * symbol
2041
+ * view
2042
+ */
2043
+ async symbol(): Promise<string> {
2044
+ return this.contract.read.symbol() as Promise<string>;
2045
+ }
2046
+
2047
+ /**
2048
+ * token
2049
+ * view
2050
+ */
2051
+ async token(): Promise<`0x${string}`> {
2052
+ return this.contract.read.token() as Promise<`0x${string}`>;
2053
+ }
2054
+
2055
+ /**
2056
+ * totalSupply
2057
+ * view
2058
+ */
2059
+ async totalSupply(): Promise<bigint> {
2060
+ return this.contract.read.totalSupply() as Promise<bigint>;
2061
+ }
2062
+
2063
+ /**
2064
+ * approve
2065
+ * nonpayable
2066
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2067
+ */
2068
+ async approve(spender: `0x${string}`, value: bigint, options?: {
2069
+ accessList?: import('viem').AccessList;
2070
+ authorizationList?: import('viem').AuthorizationList;
2071
+ chain?: import('viem').Chain | null;
2072
+ dataSuffix?: `0x${string}`;
2073
+ gas?: bigint;
2074
+ gasPrice?: bigint;
2075
+ maxFeePerGas?: bigint;
2076
+ maxPriorityFeePerGas?: bigint;
2077
+ nonce?: number;
2078
+ value?: bigint;
2079
+ }): Promise<`0x${string}`> {
2080
+ if (!this.contract.write) {
2081
+ throw new Error('Wallet client is required for write operations');
2082
+ }
2083
+ return this.contract.write.approve([spender, value] as const, options) as Promise<`0x${string}`>;
2084
+ }
2085
+
2086
+ /**
2087
+ * burn
2088
+ * nonpayable
2089
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2090
+ */
2091
+ async burn(from: `0x${string}`, amount: bigint, options?: {
2092
+ accessList?: import('viem').AccessList;
2093
+ authorizationList?: import('viem').AuthorizationList;
2094
+ chain?: import('viem').Chain | null;
2095
+ dataSuffix?: `0x${string}`;
2096
+ gas?: bigint;
2097
+ gasPrice?: bigint;
2098
+ maxFeePerGas?: bigint;
2099
+ maxPriorityFeePerGas?: bigint;
2100
+ nonce?: number;
2101
+ value?: bigint;
2102
+ }): Promise<`0x${string}`> {
2103
+ if (!this.contract.write) {
2104
+ throw new Error('Wallet client is required for write operations');
2105
+ }
2106
+ return this.contract.write.burn([from, amount] as const, options) as Promise<`0x${string}`>;
2107
+ }
2108
+
2109
+ /**
2110
+ * lzReceive
2111
+ * payable
2112
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2113
+ */
2114
+ async lzReceive(_origin: Origin, _guid: `0x${string}`, _message: `0x${string}`, _executor: `0x${string}`, _extraData: `0x${string}`, options?: {
2115
+ accessList?: import('viem').AccessList;
2116
+ authorizationList?: import('viem').AuthorizationList;
2117
+ chain?: import('viem').Chain | null;
2118
+ dataSuffix?: `0x${string}`;
2119
+ gas?: bigint;
2120
+ gasPrice?: bigint;
2121
+ maxFeePerGas?: bigint;
2122
+ maxPriorityFeePerGas?: bigint;
2123
+ nonce?: number;
2124
+ value?: bigint;
2125
+ }): Promise<`0x${string}`> {
2126
+ if (!this.contract.write) {
2127
+ throw new Error('Wallet client is required for write operations');
2128
+ }
2129
+ return this.contract.write.lzReceive([_origin, _guid, _message, _executor, _extraData] as const, options) as Promise<`0x${string}`>;
2130
+ }
2131
+
2132
+ /**
2133
+ * lzReceiveAndRevert
2134
+ * payable
2135
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2136
+ */
2137
+ async lzReceiveAndRevert(_packets: InboundPacket[], options?: {
2138
+ accessList?: import('viem').AccessList;
2139
+ authorizationList?: import('viem').AuthorizationList;
2140
+ chain?: import('viem').Chain | null;
2141
+ dataSuffix?: `0x${string}`;
2142
+ gas?: bigint;
2143
+ gasPrice?: bigint;
2144
+ maxFeePerGas?: bigint;
2145
+ maxPriorityFeePerGas?: bigint;
2146
+ nonce?: number;
2147
+ value?: bigint;
2148
+ }): Promise<`0x${string}`> {
2149
+ if (!this.contract.write) {
2150
+ throw new Error('Wallet client is required for write operations');
2151
+ }
2152
+ return this.contract.write.lzReceiveAndRevert([_packets] as const, options) as Promise<`0x${string}`>;
2153
+ }
2154
+
2155
+ /**
2156
+ * lzReceiveSimulate
2157
+ * payable
2158
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2159
+ */
2160
+ async lzReceiveSimulate(_origin: Origin, _guid: `0x${string}`, _message: `0x${string}`, _executor: `0x${string}`, _extraData: `0x${string}`, options?: {
2161
+ accessList?: import('viem').AccessList;
2162
+ authorizationList?: import('viem').AuthorizationList;
2163
+ chain?: import('viem').Chain | null;
2164
+ dataSuffix?: `0x${string}`;
2165
+ gas?: bigint;
2166
+ gasPrice?: bigint;
2167
+ maxFeePerGas?: bigint;
2168
+ maxPriorityFeePerGas?: bigint;
2169
+ nonce?: number;
2170
+ value?: bigint;
2171
+ }): Promise<`0x${string}`> {
2172
+ if (!this.contract.write) {
2173
+ throw new Error('Wallet client is required for write operations');
2174
+ }
2175
+ return this.contract.write.lzReceiveSimulate([_origin, _guid, _message, _executor, _extraData] as const, options) as Promise<`0x${string}`>;
2176
+ }
2177
+
2178
+ /**
2179
+ * mint
2180
+ * nonpayable
2181
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2182
+ */
2183
+ async mint(to: `0x${string}`, amount: bigint, options?: {
2184
+ accessList?: import('viem').AccessList;
2185
+ authorizationList?: import('viem').AuthorizationList;
2186
+ chain?: import('viem').Chain | null;
2187
+ dataSuffix?: `0x${string}`;
2188
+ gas?: bigint;
2189
+ gasPrice?: bigint;
2190
+ maxFeePerGas?: bigint;
2191
+ maxPriorityFeePerGas?: bigint;
2192
+ nonce?: number;
2193
+ value?: bigint;
2194
+ }): Promise<`0x${string}`> {
2195
+ if (!this.contract.write) {
2196
+ throw new Error('Wallet client is required for write operations');
2197
+ }
2198
+ return this.contract.write.mint([to, amount] as const, options) as Promise<`0x${string}`>;
2199
+ }
2200
+
2201
+ /**
2202
+ * renounceOwnership
2203
+ * nonpayable
2204
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2205
+ */
2206
+ async renounceOwnership(options?: {
2207
+ accessList?: import('viem').AccessList;
2208
+ authorizationList?: import('viem').AuthorizationList;
2209
+ chain?: import('viem').Chain | null;
2210
+ dataSuffix?: `0x${string}`;
2211
+ gas?: bigint;
2212
+ gasPrice?: bigint;
2213
+ maxFeePerGas?: bigint;
2214
+ maxPriorityFeePerGas?: bigint;
2215
+ nonce?: number;
2216
+ value?: bigint;
2217
+ }): Promise<`0x${string}`> {
2218
+ if (!this.contract.write) {
2219
+ throw new Error('Wallet client is required for write operations');
2220
+ }
2221
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
2222
+ }
2223
+
2224
+ /**
2225
+ * send
2226
+ * payable
2227
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2228
+ */
2229
+ async send(_sendParam: SendParam, _fee: MessagingFee, _refundAddress: `0x${string}`, options?: {
2230
+ accessList?: import('viem').AccessList;
2231
+ authorizationList?: import('viem').AuthorizationList;
2232
+ chain?: import('viem').Chain | null;
2233
+ dataSuffix?: `0x${string}`;
2234
+ gas?: bigint;
2235
+ gasPrice?: bigint;
2236
+ maxFeePerGas?: bigint;
2237
+ maxPriorityFeePerGas?: bigint;
2238
+ nonce?: number;
2239
+ value?: bigint;
2240
+ }): Promise<`0x${string}`> {
2241
+ if (!this.contract.write) {
2242
+ throw new Error('Wallet client is required for write operations');
2243
+ }
2244
+ return this.contract.write.send([_sendParam, _fee, _refundAddress] as const, options) as Promise<`0x${string}`>;
2245
+ }
2246
+
2247
+ /**
2248
+ * setDelegate
2249
+ * nonpayable
2250
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2251
+ */
2252
+ async setDelegate(_delegate: `0x${string}`, options?: {
2253
+ accessList?: import('viem').AccessList;
2254
+ authorizationList?: import('viem').AuthorizationList;
2255
+ chain?: import('viem').Chain | null;
2256
+ dataSuffix?: `0x${string}`;
2257
+ gas?: bigint;
2258
+ gasPrice?: bigint;
2259
+ maxFeePerGas?: bigint;
2260
+ maxPriorityFeePerGas?: bigint;
2261
+ nonce?: number;
2262
+ value?: bigint;
2263
+ }): Promise<`0x${string}`> {
2264
+ if (!this.contract.write) {
2265
+ throw new Error('Wallet client is required for write operations');
2266
+ }
2267
+ return this.contract.write.setDelegate([_delegate] as const, options) as Promise<`0x${string}`>;
2268
+ }
2269
+
2270
+ /**
2271
+ * setEnforcedOptions
2272
+ * nonpayable
2273
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2274
+ */
2275
+ async setEnforcedOptions(_enforcedOptions: EnforcedOptionParam[], options?: {
2276
+ accessList?: import('viem').AccessList;
2277
+ authorizationList?: import('viem').AuthorizationList;
2278
+ chain?: import('viem').Chain | null;
2279
+ dataSuffix?: `0x${string}`;
2280
+ gas?: bigint;
2281
+ gasPrice?: bigint;
2282
+ maxFeePerGas?: bigint;
2283
+ maxPriorityFeePerGas?: bigint;
2284
+ nonce?: number;
2285
+ value?: bigint;
2286
+ }): Promise<`0x${string}`> {
2287
+ if (!this.contract.write) {
2288
+ throw new Error('Wallet client is required for write operations');
2289
+ }
2290
+ return this.contract.write.setEnforcedOptions([_enforcedOptions] as const, options) as Promise<`0x${string}`>;
2291
+ }
2292
+
2293
+ /**
2294
+ * setMsgInspector
2295
+ * nonpayable
2296
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2297
+ */
2298
+ async setMsgInspector(_msgInspector: `0x${string}`, options?: {
2299
+ accessList?: import('viem').AccessList;
2300
+ authorizationList?: import('viem').AuthorizationList;
2301
+ chain?: import('viem').Chain | null;
2302
+ dataSuffix?: `0x${string}`;
2303
+ gas?: bigint;
2304
+ gasPrice?: bigint;
2305
+ maxFeePerGas?: bigint;
2306
+ maxPriorityFeePerGas?: bigint;
2307
+ nonce?: number;
2308
+ value?: bigint;
2309
+ }): Promise<`0x${string}`> {
2310
+ if (!this.contract.write) {
2311
+ throw new Error('Wallet client is required for write operations');
2312
+ }
2313
+ return this.contract.write.setMsgInspector([_msgInspector] as const, options) as Promise<`0x${string}`>;
2314
+ }
2315
+
2316
+ /**
2317
+ * setPeer
2318
+ * nonpayable
2319
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2320
+ */
2321
+ async setPeer(_eid: bigint, _peer: `0x${string}`, options?: {
2322
+ accessList?: import('viem').AccessList;
2323
+ authorizationList?: import('viem').AuthorizationList;
2324
+ chain?: import('viem').Chain | null;
2325
+ dataSuffix?: `0x${string}`;
2326
+ gas?: bigint;
2327
+ gasPrice?: bigint;
2328
+ maxFeePerGas?: bigint;
2329
+ maxPriorityFeePerGas?: bigint;
2330
+ nonce?: number;
2331
+ value?: bigint;
2332
+ }): Promise<`0x${string}`> {
2333
+ if (!this.contract.write) {
2334
+ throw new Error('Wallet client is required for write operations');
2335
+ }
2336
+ return this.contract.write.setPeer([_eid, _peer] as const, options) as Promise<`0x${string}`>;
2337
+ }
2338
+
2339
+ /**
2340
+ * setPreCrime
2341
+ * nonpayable
2342
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2343
+ */
2344
+ async setPreCrime(_preCrime: `0x${string}`, options?: {
2345
+ accessList?: import('viem').AccessList;
2346
+ authorizationList?: import('viem').AuthorizationList;
2347
+ chain?: import('viem').Chain | null;
2348
+ dataSuffix?: `0x${string}`;
2349
+ gas?: bigint;
2350
+ gasPrice?: bigint;
2351
+ maxFeePerGas?: bigint;
2352
+ maxPriorityFeePerGas?: bigint;
2353
+ nonce?: number;
2354
+ value?: bigint;
2355
+ }): Promise<`0x${string}`> {
2356
+ if (!this.contract.write) {
2357
+ throw new Error('Wallet client is required for write operations');
2358
+ }
2359
+ return this.contract.write.setPreCrime([_preCrime] as const, options) as Promise<`0x${string}`>;
2360
+ }
2361
+
2362
+ /**
2363
+ * transfer
2364
+ * nonpayable
2365
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2366
+ */
2367
+ async transfer(to: `0x${string}`, value: bigint, options?: {
2368
+ accessList?: import('viem').AccessList;
2369
+ authorizationList?: import('viem').AuthorizationList;
2370
+ chain?: import('viem').Chain | null;
2371
+ dataSuffix?: `0x${string}`;
2372
+ gas?: bigint;
2373
+ gasPrice?: bigint;
2374
+ maxFeePerGas?: bigint;
2375
+ maxPriorityFeePerGas?: bigint;
2376
+ nonce?: number;
2377
+ value?: bigint;
2378
+ }): Promise<`0x${string}`> {
2379
+ if (!this.contract.write) {
2380
+ throw new Error('Wallet client is required for write operations');
2381
+ }
2382
+ return this.contract.write.transfer([to, value] as const, options) as Promise<`0x${string}`>;
2383
+ }
2384
+
2385
+ /**
2386
+ * transferFrom
2387
+ * nonpayable
2388
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2389
+ */
2390
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2391
+ accessList?: import('viem').AccessList;
2392
+ authorizationList?: import('viem').AuthorizationList;
2393
+ chain?: import('viem').Chain | null;
2394
+ dataSuffix?: `0x${string}`;
2395
+ gas?: bigint;
2396
+ gasPrice?: bigint;
2397
+ maxFeePerGas?: bigint;
2398
+ maxPriorityFeePerGas?: bigint;
2399
+ nonce?: number;
2400
+ value?: bigint;
2401
+ }): Promise<`0x${string}`> {
2402
+ if (!this.contract.write) {
2403
+ throw new Error('Wallet client is required for write operations');
2404
+ }
2405
+ return this.contract.write.transferFrom([from, to, value] as const, options) as Promise<`0x${string}`>;
2406
+ }
2407
+
2408
+ /**
2409
+ * transferOwnership
2410
+ * nonpayable
2411
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2412
+ */
2413
+ async transferOwnership(newOwner: `0x${string}`, options?: {
2414
+ accessList?: import('viem').AccessList;
2415
+ authorizationList?: import('viem').AuthorizationList;
2416
+ chain?: import('viem').Chain | null;
2417
+ dataSuffix?: `0x${string}`;
2418
+ gas?: bigint;
2419
+ gasPrice?: bigint;
2420
+ maxFeePerGas?: bigint;
2421
+ maxPriorityFeePerGas?: bigint;
2422
+ nonce?: number;
2423
+ value?: bigint;
2424
+ }): Promise<`0x${string}`> {
2425
+ if (!this.contract.write) {
2426
+ throw new Error('Wallet client is required for write operations');
2427
+ }
2428
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
2429
+ }
2430
+
2431
+
2432
+
2433
+ /**
2434
+ * Simulate contract write operations (dry-run without sending transaction)
2435
+ *
2436
+ * @example
2437
+ * const result = await contract.simulate.transfer('0x...', 1000n);
2438
+ * console.log('Gas estimate:', result.request.gas);
2439
+ * console.log('Would succeed:', result.result);
2440
+ */
2441
+ get simulate() {
2442
+ const contract = this.contract;
2443
+ if (!contract.simulate) {
2444
+ throw new Error('Public client is required for simulation');
2445
+ }
2446
+ return {
2447
+ /**
2448
+ * Simulate approve
2449
+ * Returns gas estimate and result without sending transaction
2450
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2451
+ */
2452
+ async approve(spender: `0x${string}`, value: bigint, options?: {
2453
+ accessList?: import('viem').AccessList;
2454
+ authorizationList?: import('viem').AuthorizationList;
2455
+ chain?: import('viem').Chain | null;
2456
+ dataSuffix?: `0x${string}`;
2457
+ gas?: bigint;
2458
+ gasPrice?: bigint;
2459
+ maxFeePerGas?: bigint;
2460
+ maxPriorityFeePerGas?: bigint;
2461
+ nonce?: number;
2462
+ value?: bigint;
2463
+ }): Promise<boolean> {
2464
+ return contract.simulate.approve([spender, value] as const, options) as Promise<boolean>;
2465
+ },
2466
+ /**
2467
+ * Simulate burn
2468
+ * Returns gas estimate and result without sending transaction
2469
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2470
+ */
2471
+ async burn(from: `0x${string}`, amount: bigint, options?: {
2472
+ accessList?: import('viem').AccessList;
2473
+ authorizationList?: import('viem').AuthorizationList;
2474
+ chain?: import('viem').Chain | null;
2475
+ dataSuffix?: `0x${string}`;
2476
+ gas?: bigint;
2477
+ gasPrice?: bigint;
2478
+ maxFeePerGas?: bigint;
2479
+ maxPriorityFeePerGas?: bigint;
2480
+ nonce?: number;
2481
+ value?: bigint;
2482
+ }): Promise<boolean> {
2483
+ return contract.simulate.burn([from, amount] as const, options) as Promise<boolean>;
2484
+ },
2485
+ /**
2486
+ * Simulate lzReceive
2487
+ * Returns gas estimate and result without sending transaction
2488
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2489
+ */
2490
+ async lzReceive(_origin: Origin, _guid: `0x${string}`, _message: `0x${string}`, _executor: `0x${string}`, _extraData: `0x${string}`, options?: {
2491
+ accessList?: import('viem').AccessList;
2492
+ authorizationList?: import('viem').AuthorizationList;
2493
+ chain?: import('viem').Chain | null;
2494
+ dataSuffix?: `0x${string}`;
2495
+ gas?: bigint;
2496
+ gasPrice?: bigint;
2497
+ maxFeePerGas?: bigint;
2498
+ maxPriorityFeePerGas?: bigint;
2499
+ nonce?: number;
2500
+ value?: bigint;
2501
+ }): Promise<void> {
2502
+ return contract.simulate.lzReceive([_origin, _guid, _message, _executor, _extraData] as const, options) as Promise<void>;
2503
+ },
2504
+ /**
2505
+ * Simulate lzReceiveAndRevert
2506
+ * Returns gas estimate and result without sending transaction
2507
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2508
+ */
2509
+ async lzReceiveAndRevert(_packets: InboundPacket[], options?: {
2510
+ accessList?: import('viem').AccessList;
2511
+ authorizationList?: import('viem').AuthorizationList;
2512
+ chain?: import('viem').Chain | null;
2513
+ dataSuffix?: `0x${string}`;
2514
+ gas?: bigint;
2515
+ gasPrice?: bigint;
2516
+ maxFeePerGas?: bigint;
2517
+ maxPriorityFeePerGas?: bigint;
2518
+ nonce?: number;
2519
+ value?: bigint;
2520
+ }): Promise<void> {
2521
+ return contract.simulate.lzReceiveAndRevert([_packets] as const, options) as Promise<void>;
2522
+ },
2523
+ /**
2524
+ * Simulate lzReceiveSimulate
2525
+ * Returns gas estimate and result without sending transaction
2526
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2527
+ */
2528
+ async lzReceiveSimulate(_origin: Origin, _guid: `0x${string}`, _message: `0x${string}`, _executor: `0x${string}`, _extraData: `0x${string}`, options?: {
2529
+ accessList?: import('viem').AccessList;
2530
+ authorizationList?: import('viem').AuthorizationList;
2531
+ chain?: import('viem').Chain | null;
2532
+ dataSuffix?: `0x${string}`;
2533
+ gas?: bigint;
2534
+ gasPrice?: bigint;
2535
+ maxFeePerGas?: bigint;
2536
+ maxPriorityFeePerGas?: bigint;
2537
+ nonce?: number;
2538
+ value?: bigint;
2539
+ }): Promise<void> {
2540
+ return contract.simulate.lzReceiveSimulate([_origin, _guid, _message, _executor, _extraData] as const, options) as Promise<void>;
2541
+ },
2542
+ /**
2543
+ * Simulate mint
2544
+ * Returns gas estimate and result without sending transaction
2545
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2546
+ */
2547
+ async mint(to: `0x${string}`, amount: bigint, options?: {
2548
+ accessList?: import('viem').AccessList;
2549
+ authorizationList?: import('viem').AuthorizationList;
2550
+ chain?: import('viem').Chain | null;
2551
+ dataSuffix?: `0x${string}`;
2552
+ gas?: bigint;
2553
+ gasPrice?: bigint;
2554
+ maxFeePerGas?: bigint;
2555
+ maxPriorityFeePerGas?: bigint;
2556
+ nonce?: number;
2557
+ value?: bigint;
2558
+ }): Promise<boolean> {
2559
+ return contract.simulate.mint([to, amount] as const, options) as Promise<boolean>;
2560
+ },
2561
+ /**
2562
+ * Simulate renounceOwnership
2563
+ * Returns gas estimate and result without sending transaction
2564
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2565
+ */
2566
+ async renounceOwnership(options?: {
2567
+ accessList?: import('viem').AccessList;
2568
+ authorizationList?: import('viem').AuthorizationList;
2569
+ chain?: import('viem').Chain | null;
2570
+ dataSuffix?: `0x${string}`;
2571
+ gas?: bigint;
2572
+ gasPrice?: bigint;
2573
+ maxFeePerGas?: bigint;
2574
+ maxPriorityFeePerGas?: bigint;
2575
+ nonce?: number;
2576
+ value?: bigint;
2577
+ }): Promise<void> {
2578
+ return contract.simulate.renounceOwnership(options) as Promise<void>;
2579
+ },
2580
+ /**
2581
+ * Simulate send
2582
+ * Returns gas estimate and result without sending transaction
2583
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2584
+ */
2585
+ async send(_sendParam: SendParam, _fee: MessagingFee, _refundAddress: `0x${string}`, options?: {
2586
+ accessList?: import('viem').AccessList;
2587
+ authorizationList?: import('viem').AuthorizationList;
2588
+ chain?: import('viem').Chain | null;
2589
+ dataSuffix?: `0x${string}`;
2590
+ gas?: bigint;
2591
+ gasPrice?: bigint;
2592
+ maxFeePerGas?: bigint;
2593
+ maxPriorityFeePerGas?: bigint;
2594
+ nonce?: number;
2595
+ value?: bigint;
2596
+ }): Promise<[MessagingReceipt, OFTReceipt]> {
2597
+ return contract.simulate.send([_sendParam, _fee, _refundAddress] as const, options) as Promise<[MessagingReceipt, OFTReceipt]>;
2598
+ },
2599
+ /**
2600
+ * Simulate setDelegate
2601
+ * Returns gas estimate and result without sending transaction
2602
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2603
+ */
2604
+ async setDelegate(_delegate: `0x${string}`, options?: {
2605
+ accessList?: import('viem').AccessList;
2606
+ authorizationList?: import('viem').AuthorizationList;
2607
+ chain?: import('viem').Chain | null;
2608
+ dataSuffix?: `0x${string}`;
2609
+ gas?: bigint;
2610
+ gasPrice?: bigint;
2611
+ maxFeePerGas?: bigint;
2612
+ maxPriorityFeePerGas?: bigint;
2613
+ nonce?: number;
2614
+ value?: bigint;
2615
+ }): Promise<void> {
2616
+ return contract.simulate.setDelegate([_delegate] as const, options) as Promise<void>;
2617
+ },
2618
+ /**
2619
+ * Simulate setEnforcedOptions
2620
+ * Returns gas estimate and result without sending transaction
2621
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2622
+ */
2623
+ async setEnforcedOptions(_enforcedOptions: EnforcedOptionParam[], options?: {
2624
+ accessList?: import('viem').AccessList;
2625
+ authorizationList?: import('viem').AuthorizationList;
2626
+ chain?: import('viem').Chain | null;
2627
+ dataSuffix?: `0x${string}`;
2628
+ gas?: bigint;
2629
+ gasPrice?: bigint;
2630
+ maxFeePerGas?: bigint;
2631
+ maxPriorityFeePerGas?: bigint;
2632
+ nonce?: number;
2633
+ value?: bigint;
2634
+ }): Promise<void> {
2635
+ return contract.simulate.setEnforcedOptions([_enforcedOptions] as const, options) as Promise<void>;
2636
+ },
2637
+ /**
2638
+ * Simulate setMsgInspector
2639
+ * Returns gas estimate and result without sending transaction
2640
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2641
+ */
2642
+ async setMsgInspector(_msgInspector: `0x${string}`, options?: {
2643
+ accessList?: import('viem').AccessList;
2644
+ authorizationList?: import('viem').AuthorizationList;
2645
+ chain?: import('viem').Chain | null;
2646
+ dataSuffix?: `0x${string}`;
2647
+ gas?: bigint;
2648
+ gasPrice?: bigint;
2649
+ maxFeePerGas?: bigint;
2650
+ maxPriorityFeePerGas?: bigint;
2651
+ nonce?: number;
2652
+ value?: bigint;
2653
+ }): Promise<void> {
2654
+ return contract.simulate.setMsgInspector([_msgInspector] as const, options) as Promise<void>;
2655
+ },
2656
+ /**
2657
+ * Simulate setPeer
2658
+ * Returns gas estimate and result without sending transaction
2659
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2660
+ */
2661
+ async setPeer(_eid: bigint, _peer: `0x${string}`, options?: {
2662
+ accessList?: import('viem').AccessList;
2663
+ authorizationList?: import('viem').AuthorizationList;
2664
+ chain?: import('viem').Chain | null;
2665
+ dataSuffix?: `0x${string}`;
2666
+ gas?: bigint;
2667
+ gasPrice?: bigint;
2668
+ maxFeePerGas?: bigint;
2669
+ maxPriorityFeePerGas?: bigint;
2670
+ nonce?: number;
2671
+ value?: bigint;
2672
+ }): Promise<void> {
2673
+ return contract.simulate.setPeer([_eid, _peer] as const, options) as Promise<void>;
2674
+ },
2675
+ /**
2676
+ * Simulate setPreCrime
2677
+ * Returns gas estimate and result without sending transaction
2678
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2679
+ */
2680
+ async setPreCrime(_preCrime: `0x${string}`, options?: {
2681
+ accessList?: import('viem').AccessList;
2682
+ authorizationList?: import('viem').AuthorizationList;
2683
+ chain?: import('viem').Chain | null;
2684
+ dataSuffix?: `0x${string}`;
2685
+ gas?: bigint;
2686
+ gasPrice?: bigint;
2687
+ maxFeePerGas?: bigint;
2688
+ maxPriorityFeePerGas?: bigint;
2689
+ nonce?: number;
2690
+ value?: bigint;
2691
+ }): Promise<void> {
2692
+ return contract.simulate.setPreCrime([_preCrime] as const, options) as Promise<void>;
2693
+ },
2694
+ /**
2695
+ * Simulate transfer
2696
+ * Returns gas estimate and result without sending transaction
2697
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2698
+ */
2699
+ async transfer(to: `0x${string}`, value: bigint, options?: {
2700
+ accessList?: import('viem').AccessList;
2701
+ authorizationList?: import('viem').AuthorizationList;
2702
+ chain?: import('viem').Chain | null;
2703
+ dataSuffix?: `0x${string}`;
2704
+ gas?: bigint;
2705
+ gasPrice?: bigint;
2706
+ maxFeePerGas?: bigint;
2707
+ maxPriorityFeePerGas?: bigint;
2708
+ nonce?: number;
2709
+ value?: bigint;
2710
+ }): Promise<boolean> {
2711
+ return contract.simulate.transfer([to, value] as const, options) as Promise<boolean>;
2712
+ },
2713
+ /**
2714
+ * Simulate transferFrom
2715
+ * Returns gas estimate and result without sending transaction
2716
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2717
+ */
2718
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, value: bigint, options?: {
2719
+ accessList?: import('viem').AccessList;
2720
+ authorizationList?: import('viem').AuthorizationList;
2721
+ chain?: import('viem').Chain | null;
2722
+ dataSuffix?: `0x${string}`;
2723
+ gas?: bigint;
2724
+ gasPrice?: bigint;
2725
+ maxFeePerGas?: bigint;
2726
+ maxPriorityFeePerGas?: bigint;
2727
+ nonce?: number;
2728
+ value?: bigint;
2729
+ }): Promise<boolean> {
2730
+ return contract.simulate.transferFrom([from, to, value] as const, options) as Promise<boolean>;
2731
+ },
2732
+ /**
2733
+ * Simulate transferOwnership
2734
+ * Returns gas estimate and result without sending transaction
2735
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
2736
+ */
2737
+ async transferOwnership(newOwner: `0x${string}`, options?: {
2738
+ accessList?: import('viem').AccessList;
2739
+ authorizationList?: import('viem').AuthorizationList;
2740
+ chain?: import('viem').Chain | null;
2741
+ dataSuffix?: `0x${string}`;
2742
+ gas?: bigint;
2743
+ gasPrice?: bigint;
2744
+ maxFeePerGas?: bigint;
2745
+ maxPriorityFeePerGas?: bigint;
2746
+ nonce?: number;
2747
+ value?: bigint;
2748
+ }): Promise<void> {
2749
+ return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
2750
+ }
2751
+ };
2752
+ }
2753
+
2754
+ /**
2755
+ * Watch contract events
2756
+ *
2757
+ * @example
2758
+ * // Watch all Transfer events
2759
+ * const unwatch = contract.watch.Transfer((event) => {
2760
+ * console.log('Transfer:', event);
2761
+ * });
2762
+ *
2763
+ * // Stop watching
2764
+ * unwatch();
2765
+ */
2766
+ get watch() {
2767
+ return {
2768
+ /**
2769
+ * Watch Approval events
2770
+ * @param callback Function to call when event is emitted
2771
+ * @param filter Optional filter for indexed parameters
2772
+ * @returns Unwatch function to stop listening
2773
+ */
2774
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
2775
+ return this.publicClient.watchContractEvent({
2776
+ address: this.contractAddress,
2777
+ abi: BasedOFT_jsonAbi,
2778
+ eventName: 'Approval',
2779
+ args: filter,
2780
+ onLogs: (logs: any[]) => {
2781
+ logs.forEach((log: any) => {
2782
+ callback(log.args as any);
2783
+ });
2784
+ },
2785
+ }) as () => void;
2786
+ },
2787
+ /**
2788
+ * Watch EnforcedOptionSet events
2789
+ * @param callback Function to call when event is emitted
2790
+ * @param filter Optional filter for indexed parameters
2791
+ * @returns Unwatch function to stop listening
2792
+ */
2793
+ EnforcedOptionSet: (callback: (event: { _enforcedOptions: EnforcedOptionParam[] }) => void) => {
2794
+ return this.publicClient.watchContractEvent({
2795
+ address: this.contractAddress,
2796
+ abi: BasedOFT_jsonAbi,
2797
+ eventName: 'EnforcedOptionSet',
2798
+
2799
+ onLogs: (logs: any[]) => {
2800
+ logs.forEach((log: any) => {
2801
+ callback(log.args as any);
2802
+ });
2803
+ },
2804
+ }) as () => void;
2805
+ },
2806
+ /**
2807
+ * Watch MsgInspectorSet events
2808
+ * @param callback Function to call when event is emitted
2809
+ * @param filter Optional filter for indexed parameters
2810
+ * @returns Unwatch function to stop listening
2811
+ */
2812
+ MsgInspectorSet: (callback: (event: { inspector: `0x${string}` }) => void) => {
2813
+ return this.publicClient.watchContractEvent({
2814
+ address: this.contractAddress,
2815
+ abi: BasedOFT_jsonAbi,
2816
+ eventName: 'MsgInspectorSet',
2817
+
2818
+ onLogs: (logs: any[]) => {
2819
+ logs.forEach((log: any) => {
2820
+ callback(log.args as any);
2821
+ });
2822
+ },
2823
+ }) as () => void;
2824
+ },
2825
+ /**
2826
+ * Watch OFTReceived events
2827
+ * @param callback Function to call when event is emitted
2828
+ * @param filter Optional filter for indexed parameters
2829
+ * @returns Unwatch function to stop listening
2830
+ */
2831
+ OFTReceived: (callback: (event: { guid: `0x${string}`; toAddress: `0x${string}`; srcEid: bigint; amountReceivedLD: bigint }) => void, filter?: { guid: `0x${string}`; toAddress: `0x${string}` }) => {
2832
+ return this.publicClient.watchContractEvent({
2833
+ address: this.contractAddress,
2834
+ abi: BasedOFT_jsonAbi,
2835
+ eventName: 'OFTReceived',
2836
+ args: filter,
2837
+ onLogs: (logs: any[]) => {
2838
+ logs.forEach((log: any) => {
2839
+ callback(log.args as any);
2840
+ });
2841
+ },
2842
+ }) as () => void;
2843
+ },
2844
+ /**
2845
+ * Watch OFTSent events
2846
+ * @param callback Function to call when event is emitted
2847
+ * @param filter Optional filter for indexed parameters
2848
+ * @returns Unwatch function to stop listening
2849
+ */
2850
+ OFTSent: (callback: (event: { guid: `0x${string}`; fromAddress: `0x${string}`; dstEid: bigint; amountSentLD: bigint; amountReceivedLD: bigint }) => void, filter?: { guid: `0x${string}`; fromAddress: `0x${string}` }) => {
2851
+ return this.publicClient.watchContractEvent({
2852
+ address: this.contractAddress,
2853
+ abi: BasedOFT_jsonAbi,
2854
+ eventName: 'OFTSent',
2855
+ args: filter,
2856
+ onLogs: (logs: any[]) => {
2857
+ logs.forEach((log: any) => {
2858
+ callback(log.args as any);
2859
+ });
2860
+ },
2861
+ }) as () => void;
2862
+ },
2863
+ /**
2864
+ * Watch OwnershipTransferred events
2865
+ * @param callback Function to call when event is emitted
2866
+ * @param filter Optional filter for indexed parameters
2867
+ * @returns Unwatch function to stop listening
2868
+ */
2869
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
2870
+ return this.publicClient.watchContractEvent({
2871
+ address: this.contractAddress,
2872
+ abi: BasedOFT_jsonAbi,
2873
+ eventName: 'OwnershipTransferred',
2874
+ args: filter,
2875
+ onLogs: (logs: any[]) => {
2876
+ logs.forEach((log: any) => {
2877
+ callback(log.args as any);
2878
+ });
2879
+ },
2880
+ }) as () => void;
2881
+ },
2882
+ /**
2883
+ * Watch PeerSet events
2884
+ * @param callback Function to call when event is emitted
2885
+ * @param filter Optional filter for indexed parameters
2886
+ * @returns Unwatch function to stop listening
2887
+ */
2888
+ PeerSet: (callback: (event: { eid: bigint; peer: `0x${string}` }) => void) => {
2889
+ return this.publicClient.watchContractEvent({
2890
+ address: this.contractAddress,
2891
+ abi: BasedOFT_jsonAbi,
2892
+ eventName: 'PeerSet',
2893
+
2894
+ onLogs: (logs: any[]) => {
2895
+ logs.forEach((log: any) => {
2896
+ callback(log.args as any);
2897
+ });
2898
+ },
2899
+ }) as () => void;
2900
+ },
2901
+ /**
2902
+ * Watch PreCrimeSet events
2903
+ * @param callback Function to call when event is emitted
2904
+ * @param filter Optional filter for indexed parameters
2905
+ * @returns Unwatch function to stop listening
2906
+ */
2907
+ PreCrimeSet: (callback: (event: { preCrimeAddress: `0x${string}` }) => void) => {
2908
+ return this.publicClient.watchContractEvent({
2909
+ address: this.contractAddress,
2910
+ abi: BasedOFT_jsonAbi,
2911
+ eventName: 'PreCrimeSet',
2912
+
2913
+ onLogs: (logs: any[]) => {
2914
+ logs.forEach((log: any) => {
2915
+ callback(log.args as any);
2916
+ });
2917
+ },
2918
+ }) as () => void;
2919
+ },
2920
+ /**
2921
+ * Watch Transfer events
2922
+ * @param callback Function to call when event is emitted
2923
+ * @param filter Optional filter for indexed parameters
2924
+ * @returns Unwatch function to stop listening
2925
+ */
2926
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
2927
+ return this.publicClient.watchContractEvent({
2928
+ address: this.contractAddress,
2929
+ abi: BasedOFT_jsonAbi,
2930
+ eventName: 'Transfer',
2931
+ args: filter,
2932
+ onLogs: (logs: any[]) => {
2933
+ logs.forEach((log: any) => {
2934
+ callback(log.args as any);
2935
+ });
2936
+ },
2937
+ }) as () => void;
2938
+ }
2939
+ };
2940
+ }
2941
+ }