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