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