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