@gitmyabi-stg/river 0.0.1

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