@sodax/sdk 2.2.0-rc.6 → 2.2.0-rc.7
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.
- package/dist/index.cjs +877 -73
- package/dist/index.d.cts +233 -26
- package/dist/index.d.ts +233 -26
- package/dist/index.mjs +877 -73
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -367,7 +367,18 @@ var HubVaultSymbols = [
|
|
|
367
367
|
"QQQ",
|
|
368
368
|
"SGOV",
|
|
369
369
|
"USO",
|
|
370
|
-
"SLV"
|
|
370
|
+
"SLV",
|
|
371
|
+
"GOOGL",
|
|
372
|
+
"AMZN",
|
|
373
|
+
"MSFT",
|
|
374
|
+
"META",
|
|
375
|
+
"CRCL",
|
|
376
|
+
"COIN",
|
|
377
|
+
"PLTR",
|
|
378
|
+
"TSM",
|
|
379
|
+
"AMD",
|
|
380
|
+
"INTC",
|
|
381
|
+
"BABA"
|
|
371
382
|
];
|
|
372
383
|
var SodaTokens = {
|
|
373
384
|
sodaBNB: {
|
|
@@ -760,6 +771,116 @@ var SodaTokens = {
|
|
|
760
771
|
chainKey: ChainKeys.SONIC_MAINNET,
|
|
761
772
|
hubAsset: "0x690B92c27ac80015E57DB8cc02A81255814f49A2",
|
|
762
773
|
vault: "0x690B92c27ac80015E57DB8cc02A81255814f49A2"
|
|
774
|
+
},
|
|
775
|
+
GOOGL: {
|
|
776
|
+
symbol: "GOOGL",
|
|
777
|
+
isRwa: true,
|
|
778
|
+
name: "Alphabet Class A \u2022 Robinhood Token",
|
|
779
|
+
decimals: 18,
|
|
780
|
+
address: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3",
|
|
781
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
782
|
+
hubAsset: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3",
|
|
783
|
+
vault: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3"
|
|
784
|
+
},
|
|
785
|
+
AMZN: {
|
|
786
|
+
symbol: "AMZN",
|
|
787
|
+
isRwa: true,
|
|
788
|
+
name: "Amazon \u2022 Robinhood Token",
|
|
789
|
+
decimals: 18,
|
|
790
|
+
address: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba",
|
|
791
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
792
|
+
hubAsset: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba",
|
|
793
|
+
vault: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba"
|
|
794
|
+
},
|
|
795
|
+
MSFT: {
|
|
796
|
+
symbol: "MSFT",
|
|
797
|
+
isRwa: true,
|
|
798
|
+
name: "Microsoft \u2022 Robinhood Token",
|
|
799
|
+
decimals: 18,
|
|
800
|
+
address: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC",
|
|
801
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
802
|
+
hubAsset: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC",
|
|
803
|
+
vault: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC"
|
|
804
|
+
},
|
|
805
|
+
META: {
|
|
806
|
+
symbol: "META",
|
|
807
|
+
isRwa: true,
|
|
808
|
+
name: "Meta Platforms \u2022 Robinhood Token",
|
|
809
|
+
decimals: 18,
|
|
810
|
+
address: "0xB7686E0a03542230927CAC76Fe7566656439F3c6",
|
|
811
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
812
|
+
hubAsset: "0xB7686E0a03542230927CAC76Fe7566656439F3c6",
|
|
813
|
+
vault: "0xB7686E0a03542230927CAC76Fe7566656439F3c6"
|
|
814
|
+
},
|
|
815
|
+
CRCL: {
|
|
816
|
+
symbol: "CRCL",
|
|
817
|
+
isRwa: true,
|
|
818
|
+
name: "Circle Internet Group \u2022 Robinhood Token",
|
|
819
|
+
decimals: 18,
|
|
820
|
+
address: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d",
|
|
821
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
822
|
+
hubAsset: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d",
|
|
823
|
+
vault: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d"
|
|
824
|
+
},
|
|
825
|
+
COIN: {
|
|
826
|
+
symbol: "COIN",
|
|
827
|
+
isRwa: true,
|
|
828
|
+
name: "Coinbase \u2022 Robinhood Token",
|
|
829
|
+
decimals: 18,
|
|
830
|
+
address: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c",
|
|
831
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
832
|
+
hubAsset: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c",
|
|
833
|
+
vault: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c"
|
|
834
|
+
},
|
|
835
|
+
PLTR: {
|
|
836
|
+
symbol: "PLTR",
|
|
837
|
+
isRwa: true,
|
|
838
|
+
name: "Palantir Technologies \u2022 Robinhood Token",
|
|
839
|
+
decimals: 18,
|
|
840
|
+
address: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC",
|
|
841
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
842
|
+
hubAsset: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC",
|
|
843
|
+
vault: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC"
|
|
844
|
+
},
|
|
845
|
+
TSM: {
|
|
846
|
+
symbol: "TSM",
|
|
847
|
+
isRwa: true,
|
|
848
|
+
name: "Taiwan Semiconductor Manufacturing \u2022 Robinhood Token",
|
|
849
|
+
decimals: 18,
|
|
850
|
+
address: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e",
|
|
851
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
852
|
+
hubAsset: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e",
|
|
853
|
+
vault: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e"
|
|
854
|
+
},
|
|
855
|
+
AMD: {
|
|
856
|
+
symbol: "AMD",
|
|
857
|
+
isRwa: true,
|
|
858
|
+
name: "AMD \u2022 Robinhood Token",
|
|
859
|
+
decimals: 18,
|
|
860
|
+
address: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B",
|
|
861
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
862
|
+
hubAsset: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B",
|
|
863
|
+
vault: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B"
|
|
864
|
+
},
|
|
865
|
+
INTC: {
|
|
866
|
+
symbol: "INTC",
|
|
867
|
+
isRwa: true,
|
|
868
|
+
name: "Intel \u2022 Robinhood Token",
|
|
869
|
+
decimals: 18,
|
|
870
|
+
address: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053",
|
|
871
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
872
|
+
hubAsset: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053",
|
|
873
|
+
vault: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053"
|
|
874
|
+
},
|
|
875
|
+
BABA: {
|
|
876
|
+
symbol: "BABA",
|
|
877
|
+
isRwa: true,
|
|
878
|
+
name: "Alibaba \u2022 Robinhood Token",
|
|
879
|
+
decimals: 18,
|
|
880
|
+
address: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf",
|
|
881
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
882
|
+
hubAsset: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf",
|
|
883
|
+
vault: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf"
|
|
763
884
|
}
|
|
764
885
|
};
|
|
765
886
|
var LsodaSymbols = ["lsodaWEETH", "lsodaWSTETH", "lsodaJITOSOL", "lsodaSUSDS"];
|
|
@@ -2518,6 +2639,116 @@ var stellarSupportedTokens = {
|
|
|
2518
2639
|
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2519
2640
|
hubAsset: "0x7eaF987431ce072feBEB2124fEB4d1cEf8Cf4e2e",
|
|
2520
2641
|
vault: SodaTokens.SLV.address
|
|
2642
|
+
},
|
|
2643
|
+
GOOGL: {
|
|
2644
|
+
symbol: "GOOGL",
|
|
2645
|
+
isRwa: true,
|
|
2646
|
+
name: "Alphabet Class A",
|
|
2647
|
+
decimals: 7,
|
|
2648
|
+
address: "CCZLQHO22HLQARS26KNSJ4DU3FCFG45VG6RZQOQDQ4MHTSUVGRX57VWD",
|
|
2649
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2650
|
+
hubAsset: "0x3DE82bcf9D6a1CE8CB9b9eBCD6fC2916c548CD19",
|
|
2651
|
+
vault: SodaTokens.GOOGL.address
|
|
2652
|
+
},
|
|
2653
|
+
AMZN: {
|
|
2654
|
+
symbol: "AMZN",
|
|
2655
|
+
isRwa: true,
|
|
2656
|
+
name: "Amazon",
|
|
2657
|
+
decimals: 7,
|
|
2658
|
+
address: "CBN6JFMCVKXOIRRERGPH7CGY7RIIHGRLVSFJCD3KBMYSUEZAQR3MJ7TF",
|
|
2659
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2660
|
+
hubAsset: "0x30A6383A1d39b40B038EB82fd0F1fb7F77580623",
|
|
2661
|
+
vault: SodaTokens.AMZN.address
|
|
2662
|
+
},
|
|
2663
|
+
MSFT: {
|
|
2664
|
+
symbol: "MSFT",
|
|
2665
|
+
isRwa: true,
|
|
2666
|
+
name: "Microsoft",
|
|
2667
|
+
decimals: 7,
|
|
2668
|
+
address: "CA53FXC2RF3BNIGLCPE3PNS3SZ2AONVRKH46AIHPEJOA54LGI2DYSOAD",
|
|
2669
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2670
|
+
hubAsset: "0xDb89f97afc524c95a02a001aE16fe946e2f2e4A6",
|
|
2671
|
+
vault: SodaTokens.MSFT.address
|
|
2672
|
+
},
|
|
2673
|
+
META: {
|
|
2674
|
+
symbol: "META",
|
|
2675
|
+
isRwa: true,
|
|
2676
|
+
name: "Meta",
|
|
2677
|
+
decimals: 7,
|
|
2678
|
+
address: "CA4AXIRO72PC566XUIYVN2365347I7TVGYULXW7QDVCIXBOEFFRXGP67",
|
|
2679
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2680
|
+
hubAsset: "0xd2ff91513Cc08b5Bf4A07F1829A04273Bb902445",
|
|
2681
|
+
vault: SodaTokens.META.address
|
|
2682
|
+
},
|
|
2683
|
+
CRCL: {
|
|
2684
|
+
symbol: "CRCL",
|
|
2685
|
+
isRwa: true,
|
|
2686
|
+
name: "Circle",
|
|
2687
|
+
decimals: 7,
|
|
2688
|
+
address: "CDMRGHCY23UVTFYYW6U2NBYGME2VVPDO6OJXLZMM7FNGVFX3V42SAA4C",
|
|
2689
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2690
|
+
hubAsset: "0x1599b2754f0fC9429b3CDA12823B19eb2463F1cc",
|
|
2691
|
+
vault: SodaTokens.CRCL.address
|
|
2692
|
+
},
|
|
2693
|
+
COIN: {
|
|
2694
|
+
symbol: "COIN",
|
|
2695
|
+
isRwa: true,
|
|
2696
|
+
name: "Coinbase",
|
|
2697
|
+
decimals: 7,
|
|
2698
|
+
address: "CAKCNNQFIYAQBU7RXWPW3ZH4IWDXGMXUB6WTGCEZSI2EZ6WSTCCCEFHO",
|
|
2699
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2700
|
+
hubAsset: "0xaaB281239e25d7E637b4053C832D9b3b495c0261",
|
|
2701
|
+
vault: SodaTokens.COIN.address
|
|
2702
|
+
},
|
|
2703
|
+
PLTR: {
|
|
2704
|
+
symbol: "PLTR",
|
|
2705
|
+
isRwa: true,
|
|
2706
|
+
name: "Palantir",
|
|
2707
|
+
decimals: 7,
|
|
2708
|
+
address: "CC3EVVVQAB2BZFAJHPZWVRANTVVS37OJXNJKR2DVPAMG5FOYRPIIGCEV",
|
|
2709
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2710
|
+
hubAsset: "0x948195294e506cd42C00418269ab0E53EFAE5171",
|
|
2711
|
+
vault: SodaTokens.PLTR.address
|
|
2712
|
+
},
|
|
2713
|
+
TSM: {
|
|
2714
|
+
symbol: "TSM",
|
|
2715
|
+
isRwa: true,
|
|
2716
|
+
name: "Taiwan Semiconductor",
|
|
2717
|
+
decimals: 7,
|
|
2718
|
+
address: "CBZFBO44J4RSRZZ7PT7BHLLID6L7C4HL77YLVFCNIIXZQKVLNL6VEAD6",
|
|
2719
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2720
|
+
hubAsset: "0x276a0aB35C5eBD286076F69c58dA6AbB22c326Bf",
|
|
2721
|
+
vault: SodaTokens.TSM.address
|
|
2722
|
+
},
|
|
2723
|
+
AMD: {
|
|
2724
|
+
symbol: "AMD",
|
|
2725
|
+
isRwa: true,
|
|
2726
|
+
name: "AMD",
|
|
2727
|
+
decimals: 7,
|
|
2728
|
+
address: "CCIE4OXPJUPLNRLGAENNSDEZTQUXTXKAPU322Z3HMATZSR2S2DAAGYQD",
|
|
2729
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2730
|
+
hubAsset: "0x16a8d54d04Ee9cbcC57Fe7C4838bEA83294Fb646",
|
|
2731
|
+
vault: SodaTokens.AMD.address
|
|
2732
|
+
},
|
|
2733
|
+
INTC: {
|
|
2734
|
+
symbol: "INTC",
|
|
2735
|
+
isRwa: true,
|
|
2736
|
+
name: "Intel",
|
|
2737
|
+
decimals: 7,
|
|
2738
|
+
address: "CBD7GPTTHNFWBX7CYOM7O3N2TCZIAYT6FT4LCAXKX4JCZ3ZJL2IF7E4B",
|
|
2739
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2740
|
+
hubAsset: "0x34FC8F280c7C345A9aFC6E00F652F75b1fB2bd22",
|
|
2741
|
+
vault: SodaTokens.INTC.address
|
|
2742
|
+
},
|
|
2743
|
+
BABA: {
|
|
2744
|
+
symbol: "BABA",
|
|
2745
|
+
isRwa: true,
|
|
2746
|
+
name: "Alibaba",
|
|
2747
|
+
decimals: 7,
|
|
2748
|
+
address: "CDARDTMGSEXTYJDSKDEAA52DCYX3OZEP7SOLSF5CT3QSSAGBETWH7LO3",
|
|
2749
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2750
|
+
hubAsset: "0x83ac05C492188B46dd15d5611dEEFA6b23c7D479",
|
|
2751
|
+
vault: SodaTokens.BABA.address
|
|
2521
2752
|
}
|
|
2522
2753
|
};
|
|
2523
2754
|
var suiSupportedTokens = {
|
|
@@ -3331,6 +3562,116 @@ var hederaSupportedTokens = {
|
|
|
3331
3562
|
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3332
3563
|
hubAsset: "0x914672C5336f5E00126e431368005f7C22aCe952",
|
|
3333
3564
|
vault: SodaTokens.SLV.address
|
|
3565
|
+
},
|
|
3566
|
+
GOOGL: {
|
|
3567
|
+
symbol: "GOOGL",
|
|
3568
|
+
isRwa: true,
|
|
3569
|
+
name: "Alphabet Class A",
|
|
3570
|
+
decimals: 8,
|
|
3571
|
+
address: "0x0000000000000000000000000000000000a605ce",
|
|
3572
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3573
|
+
hubAsset: "0xA4942e1edE99034b11657C8a0978f8E2342980b4",
|
|
3574
|
+
vault: SodaTokens.GOOGL.address
|
|
3575
|
+
},
|
|
3576
|
+
AMZN: {
|
|
3577
|
+
symbol: "AMZN",
|
|
3578
|
+
isRwa: true,
|
|
3579
|
+
name: "Amazon",
|
|
3580
|
+
decimals: 8,
|
|
3581
|
+
address: "0x0000000000000000000000000000000000a605d0",
|
|
3582
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3583
|
+
hubAsset: "0x13E3E4eaaa02bbD0A32094c6C7078D4ABa24cd04",
|
|
3584
|
+
vault: SodaTokens.AMZN.address
|
|
3585
|
+
},
|
|
3586
|
+
MSFT: {
|
|
3587
|
+
symbol: "MSFT",
|
|
3588
|
+
isRwa: true,
|
|
3589
|
+
name: "Microsoft",
|
|
3590
|
+
decimals: 8,
|
|
3591
|
+
address: "0x0000000000000000000000000000000000a605d2",
|
|
3592
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3593
|
+
hubAsset: "0x5b9838715bbeFF2E8752961C418f64CAB3e7B2eD",
|
|
3594
|
+
vault: SodaTokens.MSFT.address
|
|
3595
|
+
},
|
|
3596
|
+
META: {
|
|
3597
|
+
symbol: "META",
|
|
3598
|
+
isRwa: true,
|
|
3599
|
+
name: "Meta",
|
|
3600
|
+
decimals: 8,
|
|
3601
|
+
address: "0x0000000000000000000000000000000000a605d3",
|
|
3602
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3603
|
+
hubAsset: "0xbe8a7cAFABe2399b4d751A5545017cc09D83FFc9",
|
|
3604
|
+
vault: SodaTokens.META.address
|
|
3605
|
+
},
|
|
3606
|
+
CRCL: {
|
|
3607
|
+
symbol: "CRCL",
|
|
3608
|
+
isRwa: true,
|
|
3609
|
+
name: "Circle",
|
|
3610
|
+
decimals: 8,
|
|
3611
|
+
address: "0x0000000000000000000000000000000000a605d4",
|
|
3612
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3613
|
+
hubAsset: "0x13c16a6a19a637fBf370CcA8d7f4bD38d207b620",
|
|
3614
|
+
vault: SodaTokens.CRCL.address
|
|
3615
|
+
},
|
|
3616
|
+
COIN: {
|
|
3617
|
+
symbol: "COIN",
|
|
3618
|
+
isRwa: true,
|
|
3619
|
+
name: "Coinbase",
|
|
3620
|
+
decimals: 8,
|
|
3621
|
+
address: "0x0000000000000000000000000000000000a605d6",
|
|
3622
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3623
|
+
hubAsset: "0x4d82303a0cf66f3D98E8140a1668567E748685De",
|
|
3624
|
+
vault: SodaTokens.COIN.address
|
|
3625
|
+
},
|
|
3626
|
+
PLTR: {
|
|
3627
|
+
symbol: "PLTR",
|
|
3628
|
+
isRwa: true,
|
|
3629
|
+
name: "Palantir",
|
|
3630
|
+
decimals: 8,
|
|
3631
|
+
address: "0x0000000000000000000000000000000000a605d7",
|
|
3632
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3633
|
+
hubAsset: "0xEC98d565853064667Ec5512bc6B7183D54b9EF40",
|
|
3634
|
+
vault: SodaTokens.PLTR.address
|
|
3635
|
+
},
|
|
3636
|
+
TSM: {
|
|
3637
|
+
symbol: "TSM",
|
|
3638
|
+
isRwa: true,
|
|
3639
|
+
name: "Taiwan Semiconductor",
|
|
3640
|
+
decimals: 8,
|
|
3641
|
+
address: "0x0000000000000000000000000000000000a605d9",
|
|
3642
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3643
|
+
hubAsset: "0x87FB178434B5832Df1Defa3E3E51dA3e4F1ECb10",
|
|
3644
|
+
vault: SodaTokens.TSM.address
|
|
3645
|
+
},
|
|
3646
|
+
AMD: {
|
|
3647
|
+
symbol: "AMD",
|
|
3648
|
+
isRwa: true,
|
|
3649
|
+
name: "AMD",
|
|
3650
|
+
decimals: 8,
|
|
3651
|
+
address: "0x0000000000000000000000000000000000a605db",
|
|
3652
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3653
|
+
hubAsset: "0x26b9C3af52e764b8362cDD273b443E576F960e36",
|
|
3654
|
+
vault: SodaTokens.AMD.address
|
|
3655
|
+
},
|
|
3656
|
+
INTC: {
|
|
3657
|
+
symbol: "INTC",
|
|
3658
|
+
isRwa: true,
|
|
3659
|
+
name: "Intel",
|
|
3660
|
+
decimals: 8,
|
|
3661
|
+
address: "0x0000000000000000000000000000000000a605dc",
|
|
3662
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3663
|
+
hubAsset: "0xb4Fe614a0566e64A0352645485BB4EbCaf8F3a9E",
|
|
3664
|
+
vault: SodaTokens.INTC.address
|
|
3665
|
+
},
|
|
3666
|
+
BABA: {
|
|
3667
|
+
symbol: "BABA",
|
|
3668
|
+
isRwa: true,
|
|
3669
|
+
name: "Alibaba",
|
|
3670
|
+
decimals: 8,
|
|
3671
|
+
address: "0x0000000000000000000000000000000000a605dd",
|
|
3672
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3673
|
+
hubAsset: "0x5e69df859F7c2b170E5fdAdbD59d06C2CD287753",
|
|
3674
|
+
vault: SodaTokens.BABA.address
|
|
3334
3675
|
}
|
|
3335
3676
|
};
|
|
3336
3677
|
var robinhoodSupportedTokens = {
|
|
@@ -3504,6 +3845,116 @@ var robinhoodSupportedTokens = {
|
|
|
3504
3845
|
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3505
3846
|
hubAsset: "0x17348849806c8b1b5d1d3abbcb527d05d21d09d5",
|
|
3506
3847
|
vault: SodaTokens.SLV.address
|
|
3848
|
+
},
|
|
3849
|
+
GOOGL: {
|
|
3850
|
+
symbol: "GOOGL",
|
|
3851
|
+
isRwa: true,
|
|
3852
|
+
name: "Alphabet Class A",
|
|
3853
|
+
decimals: 18,
|
|
3854
|
+
address: "0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",
|
|
3855
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3856
|
+
hubAsset: "0xb99725463347b57cb6b38e3670e79bae68361178",
|
|
3857
|
+
vault: SodaTokens.GOOGL.address
|
|
3858
|
+
},
|
|
3859
|
+
AMZN: {
|
|
3860
|
+
symbol: "AMZN",
|
|
3861
|
+
isRwa: true,
|
|
3862
|
+
name: "Amazon",
|
|
3863
|
+
decimals: 18,
|
|
3864
|
+
address: "0x12f190a9F9d7D37a250758b26824B97CE941bF54",
|
|
3865
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3866
|
+
hubAsset: "0x191b01f7816f927eede6603bae14979a80880f2e",
|
|
3867
|
+
vault: SodaTokens.AMZN.address
|
|
3868
|
+
},
|
|
3869
|
+
MSFT: {
|
|
3870
|
+
symbol: "MSFT",
|
|
3871
|
+
isRwa: true,
|
|
3872
|
+
name: "Microsoft",
|
|
3873
|
+
decimals: 18,
|
|
3874
|
+
address: "0xe93237C50D904957Cf27E7B1133b510C669c2e74",
|
|
3875
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3876
|
+
hubAsset: "0x54cd74d27c647cccc7d151c198a82a8f3371ca35",
|
|
3877
|
+
vault: SodaTokens.MSFT.address
|
|
3878
|
+
},
|
|
3879
|
+
META: {
|
|
3880
|
+
symbol: "META",
|
|
3881
|
+
isRwa: true,
|
|
3882
|
+
name: "Meta",
|
|
3883
|
+
decimals: 18,
|
|
3884
|
+
address: "0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",
|
|
3885
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3886
|
+
hubAsset: "0xf5661eefaebb0ed9f33c543fa606ad77646eb1f9",
|
|
3887
|
+
vault: SodaTokens.META.address
|
|
3888
|
+
},
|
|
3889
|
+
CRCL: {
|
|
3890
|
+
symbol: "CRCL",
|
|
3891
|
+
isRwa: true,
|
|
3892
|
+
name: "Circle",
|
|
3893
|
+
decimals: 18,
|
|
3894
|
+
address: "0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",
|
|
3895
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3896
|
+
hubAsset: "0x18f4018af0bf9fc42cbf8c0b458a838bc2dccf43",
|
|
3897
|
+
vault: SodaTokens.CRCL.address
|
|
3898
|
+
},
|
|
3899
|
+
COIN: {
|
|
3900
|
+
symbol: "COIN",
|
|
3901
|
+
isRwa: true,
|
|
3902
|
+
name: "Coinbase",
|
|
3903
|
+
decimals: 18,
|
|
3904
|
+
address: "0x6330D8C3178a418788dF01a47479c0ce7CCF450b",
|
|
3905
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3906
|
+
hubAsset: "0x91789d24454c40c753bdd5bc7ada7bb91848d13c",
|
|
3907
|
+
vault: SodaTokens.COIN.address
|
|
3908
|
+
},
|
|
3909
|
+
PLTR: {
|
|
3910
|
+
symbol: "PLTR",
|
|
3911
|
+
isRwa: true,
|
|
3912
|
+
name: "Palantir",
|
|
3913
|
+
decimals: 18,
|
|
3914
|
+
address: "0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",
|
|
3915
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3916
|
+
hubAsset: "0x99864e96d71860e6e5d25887a10da823685af1ee",
|
|
3917
|
+
vault: SodaTokens.PLTR.address
|
|
3918
|
+
},
|
|
3919
|
+
TSM: {
|
|
3920
|
+
symbol: "TSM",
|
|
3921
|
+
isRwa: true,
|
|
3922
|
+
name: "Taiwan Semiconductor",
|
|
3923
|
+
decimals: 18,
|
|
3924
|
+
address: "0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",
|
|
3925
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3926
|
+
hubAsset: "0x5912b35ed196b129f4ad36ffd8717f2913df09bf",
|
|
3927
|
+
vault: SodaTokens.TSM.address
|
|
3928
|
+
},
|
|
3929
|
+
AMD: {
|
|
3930
|
+
symbol: "AMD",
|
|
3931
|
+
isRwa: true,
|
|
3932
|
+
name: "AMD",
|
|
3933
|
+
decimals: 18,
|
|
3934
|
+
address: "0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",
|
|
3935
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3936
|
+
hubAsset: "0x433d44c65f20e4a776aed6c23838739d3155a692",
|
|
3937
|
+
vault: SodaTokens.AMD.address
|
|
3938
|
+
},
|
|
3939
|
+
INTC: {
|
|
3940
|
+
symbol: "INTC",
|
|
3941
|
+
isRwa: true,
|
|
3942
|
+
name: "Intel",
|
|
3943
|
+
decimals: 18,
|
|
3944
|
+
address: "0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",
|
|
3945
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3946
|
+
hubAsset: "0xd20c60e725317c7873964a6b1d345b2507526e59",
|
|
3947
|
+
vault: SodaTokens.INTC.address
|
|
3948
|
+
},
|
|
3949
|
+
BABA: {
|
|
3950
|
+
symbol: "BABA",
|
|
3951
|
+
isRwa: true,
|
|
3952
|
+
name: "Alibaba",
|
|
3953
|
+
decimals: 18,
|
|
3954
|
+
address: "0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",
|
|
3955
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3956
|
+
hubAsset: "0xf721a074bd9fc05ba1f7cb432149a74acfb49d73",
|
|
3957
|
+
vault: SodaTokens.BABA.address
|
|
3507
3958
|
}
|
|
3508
3959
|
};
|
|
3509
3960
|
var stacksSupportedTokens = {
|
|
@@ -4342,6 +4793,61 @@ var spokeChainConfig = {
|
|
|
4342
4793
|
assetCode: "SLV",
|
|
4343
4794
|
contractId: "CBY3U32O5T2B555HNJLX6C6HW3O2FLRSJGH472UOOHT6H6ZMGMSSZTLW",
|
|
4344
4795
|
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
assetCode: "GOOGL",
|
|
4799
|
+
contractId: "CCZLQHO22HLQARS26KNSJ4DU3FCFG45VG6RZQOQDQ4MHTSUVGRX57VWD",
|
|
4800
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4801
|
+
},
|
|
4802
|
+
{
|
|
4803
|
+
assetCode: "AMZN",
|
|
4804
|
+
contractId: "CBN6JFMCVKXOIRRERGPH7CGY7RIIHGRLVSFJCD3KBMYSUEZAQR3MJ7TF",
|
|
4805
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4806
|
+
},
|
|
4807
|
+
{
|
|
4808
|
+
assetCode: "MSFT",
|
|
4809
|
+
contractId: "CA53FXC2RF3BNIGLCPE3PNS3SZ2AONVRKH46AIHPEJOA54LGI2DYSOAD",
|
|
4810
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4811
|
+
},
|
|
4812
|
+
{
|
|
4813
|
+
assetCode: "META",
|
|
4814
|
+
contractId: "CA4AXIRO72PC566XUIYVN2365347I7TVGYULXW7QDVCIXBOEFFRXGP67",
|
|
4815
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4816
|
+
},
|
|
4817
|
+
{
|
|
4818
|
+
assetCode: "CRCL",
|
|
4819
|
+
contractId: "CDMRGHCY23UVTFYYW6U2NBYGME2VVPDO6OJXLZMM7FNGVFX3V42SAA4C",
|
|
4820
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4821
|
+
},
|
|
4822
|
+
{
|
|
4823
|
+
assetCode: "COIN",
|
|
4824
|
+
contractId: "CAKCNNQFIYAQBU7RXWPW3ZH4IWDXGMXUB6WTGCEZSI2EZ6WSTCCCEFHO",
|
|
4825
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4826
|
+
},
|
|
4827
|
+
{
|
|
4828
|
+
assetCode: "PLTR",
|
|
4829
|
+
contractId: "CC3EVVVQAB2BZFAJHPZWVRANTVVS37OJXNJKR2DVPAMG5FOYRPIIGCEV",
|
|
4830
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4831
|
+
},
|
|
4832
|
+
{
|
|
4833
|
+
assetCode: "TSM",
|
|
4834
|
+
contractId: "CBZFBO44J4RSRZZ7PT7BHLLID6L7C4HL77YLVFCNIIXZQKVLNL6VEAD6",
|
|
4835
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4836
|
+
},
|
|
4837
|
+
{
|
|
4838
|
+
assetCode: "AMD",
|
|
4839
|
+
contractId: "CCIE4OXPJUPLNRLGAENNSDEZTQUXTXKAPU322Z3HMATZSR2S2DAAGYQD",
|
|
4840
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4841
|
+
},
|
|
4842
|
+
{
|
|
4843
|
+
assetCode: "INTC",
|
|
4844
|
+
contractId: "CBD7GPTTHNFWBX7CYOM7O3N2TCZIAYT6FT4LCAXKX4JCZ3ZJL2IF7E4B",
|
|
4845
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4846
|
+
},
|
|
4847
|
+
{
|
|
4848
|
+
assetCode: "BABA",
|
|
4849
|
+
contractId: "CDARDTMGSEXTYJDSKDEAA52DCYX3OZEP7SOLSF5CT3QSSAGBETWH7LO3",
|
|
4850
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4345
4851
|
}
|
|
4346
4852
|
],
|
|
4347
4853
|
supportedTokens: stellarSupportedTokens,
|
|
@@ -5038,7 +5544,18 @@ var swapSupportedTokens = {
|
|
|
5038
5544
|
SodaTokens.QQQ,
|
|
5039
5545
|
SodaTokens.SGOV,
|
|
5040
5546
|
SodaTokens.USO,
|
|
5041
|
-
SodaTokens.SLV
|
|
5547
|
+
SodaTokens.SLV,
|
|
5548
|
+
SodaTokens.GOOGL,
|
|
5549
|
+
SodaTokens.AMZN,
|
|
5550
|
+
SodaTokens.MSFT,
|
|
5551
|
+
SodaTokens.META,
|
|
5552
|
+
SodaTokens.CRCL,
|
|
5553
|
+
SodaTokens.COIN,
|
|
5554
|
+
SodaTokens.PLTR,
|
|
5555
|
+
SodaTokens.TSM,
|
|
5556
|
+
SodaTokens.AMD,
|
|
5557
|
+
SodaTokens.INTC,
|
|
5558
|
+
SodaTokens.BABA
|
|
5042
5559
|
],
|
|
5043
5560
|
[ChainKeys.AVALANCHE_MAINNET]: [
|
|
5044
5561
|
spokeChainConfig[ChainKeys.AVALANCHE_MAINNET].supportedTokens.AVAX,
|
|
@@ -5213,7 +5730,18 @@ var swapSupportedTokens = {
|
|
|
5213
5730
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.QQQ,
|
|
5214
5731
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SGOV,
|
|
5215
5732
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.USO,
|
|
5216
|
-
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SLV
|
|
5733
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SLV,
|
|
5734
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.GOOGL,
|
|
5735
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.AMZN,
|
|
5736
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.MSFT,
|
|
5737
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.META,
|
|
5738
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.CRCL,
|
|
5739
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.COIN,
|
|
5740
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.PLTR,
|
|
5741
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.TSM,
|
|
5742
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.AMD,
|
|
5743
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.INTC,
|
|
5744
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.BABA
|
|
5217
5745
|
],
|
|
5218
5746
|
[ChainKeys.SUI_MAINNET]: [
|
|
5219
5747
|
spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.SUI,
|
|
@@ -5333,7 +5861,18 @@ var swapSupportedTokens = {
|
|
|
5333
5861
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.QQQ,
|
|
5334
5862
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SGOV,
|
|
5335
5863
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.USO,
|
|
5336
|
-
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SLV
|
|
5864
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SLV,
|
|
5865
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.GOOGL,
|
|
5866
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.AMZN,
|
|
5867
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.MSFT,
|
|
5868
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.META,
|
|
5869
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.CRCL,
|
|
5870
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.COIN,
|
|
5871
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.PLTR,
|
|
5872
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.TSM,
|
|
5873
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.AMD,
|
|
5874
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.INTC,
|
|
5875
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.BABA
|
|
5337
5876
|
],
|
|
5338
5877
|
[ChainKeys.ROBINHOOD_MAINNET]: [
|
|
5339
5878
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.ETH,
|
|
@@ -5354,7 +5893,18 @@ var swapSupportedTokens = {
|
|
|
5354
5893
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.QQQ,
|
|
5355
5894
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SGOV,
|
|
5356
5895
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.USO,
|
|
5357
|
-
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SLV
|
|
5896
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SLV,
|
|
5897
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.GOOGL,
|
|
5898
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.AMZN,
|
|
5899
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.MSFT,
|
|
5900
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.META,
|
|
5901
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.CRCL,
|
|
5902
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.COIN,
|
|
5903
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.PLTR,
|
|
5904
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.TSM,
|
|
5905
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.AMD,
|
|
5906
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.INTC,
|
|
5907
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.BABA
|
|
5358
5908
|
]
|
|
5359
5909
|
};
|
|
5360
5910
|
var stagingSwapSupportedTokens = {
|
|
@@ -5699,7 +6249,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
|
|
|
5699
6249
|
}
|
|
5700
6250
|
|
|
5701
6251
|
// ../types/dist/index.js
|
|
5702
|
-
var CONFIG_VERSION =
|
|
6252
|
+
var CONFIG_VERSION = 2020007;
|
|
5703
6253
|
var RC_STABLE = 99;
|
|
5704
6254
|
var MIN_CONFIG_VERSION = 1e6;
|
|
5705
6255
|
var MAX_CONFIG_VERSION = 99999999;
|
|
@@ -5952,12 +6502,12 @@ function canonicalizeBitcoinAddress(address) {
|
|
|
5952
6502
|
}
|
|
5953
6503
|
}
|
|
5954
6504
|
function normalizePsbtToBase64(signedPsbt) {
|
|
5955
|
-
const
|
|
5956
|
-
return
|
|
6505
|
+
const isHex3 = /^[0-9a-fA-F]+$/.test(signedPsbt);
|
|
6506
|
+
return isHex3 ? Buffer.from(signedPsbt, "hex").toString("base64") : signedPsbt;
|
|
5957
6507
|
}
|
|
5958
6508
|
function normalizeSignatureToBase64(signature) {
|
|
5959
|
-
const
|
|
5960
|
-
return
|
|
6509
|
+
const isHex3 = /^[0-9a-fA-F]+$/.test(signature);
|
|
6510
|
+
return isHex3 ? Buffer.from(signature, "hex").toString("base64") : signature;
|
|
5961
6511
|
}
|
|
5962
6512
|
function isNativeBitcoinTransfer(config, chainKey, token) {
|
|
5963
6513
|
return isBitcoinChainKeyType(chainKey) && !!token && isNativeBitcoinToken(config.getChainConfig(chainKey), token.address);
|
|
@@ -15773,10 +16323,12 @@ var ConfigService = class {
|
|
|
15773
16323
|
get bridgeUseBackendSubmitTx() {
|
|
15774
16324
|
return this.bridge.useBackendSubmitTx ?? this.sodax.bridgeOptions?.useBackendSubmitTx ?? true;
|
|
15775
16325
|
}
|
|
15776
|
-
//
|
|
15777
|
-
//
|
|
16326
|
+
// Same ON default as the two above, and for the same reason: any backend non-success falls back
|
|
16327
|
+
// to the client-side relay, so the default costs a rejected attempt at worst. No deprecated
|
|
16328
|
+
// second-precedence key here — leverage yield arrived after `swapsOptions` / `bridgeOptions` were
|
|
16329
|
+
// already deprecated, so it never had one.
|
|
15778
16330
|
get leverageYieldUseBackendSubmitTx() {
|
|
15779
|
-
return this.leverageYield.useBackendSubmitTx ??
|
|
16331
|
+
return this.leverageYield.useBackendSubmitTx ?? true;
|
|
15780
16332
|
}
|
|
15781
16333
|
get dex() {
|
|
15782
16334
|
return this.sodax.dex;
|
|
@@ -29083,6 +29635,39 @@ var EvmHubProvider = class {
|
|
|
29083
29635
|
}
|
|
29084
29636
|
};
|
|
29085
29637
|
|
|
29638
|
+
// src/backendApi/detailedStatusRouting.ts
|
|
29639
|
+
var DETAILED_STATUS_NOT_DELIVERED = "relay_not_delivered";
|
|
29640
|
+
function isBackendSubmitTxAbandoned(data) {
|
|
29641
|
+
return data.status === "failed" || Boolean(data.abandonedAt);
|
|
29642
|
+
}
|
|
29643
|
+
async function resolveDeliveredPacket(params) {
|
|
29644
|
+
const { srcChainKey, srcTxHash, relayerApiEndpoint, backendAnswered } = params;
|
|
29645
|
+
const relayChainId = getIntentRelayChainId(srcChainKey);
|
|
29646
|
+
const packets = await getTransactionPackets(
|
|
29647
|
+
{ action: "get_transaction_packets", params: { chain_id: relayChainId.toString(), tx_hash: srcTxHash } },
|
|
29648
|
+
relayerApiEndpoint,
|
|
29649
|
+
RELAY_REQUEST_TIMEOUT_MS
|
|
29650
|
+
);
|
|
29651
|
+
if (!packets.ok) {
|
|
29652
|
+
const notIndexed = packets.error instanceof HttpRelayError && packets.error.status === 404;
|
|
29653
|
+
return { ok: false, cause: packets.error, budgetable: notIndexed && backendAnswered };
|
|
29654
|
+
}
|
|
29655
|
+
if (!packets.value?.success || !Array.isArray(packets.value.data)) {
|
|
29656
|
+
return { ok: false, cause: new Error("relay returned no usable transaction packets"), budgetable: false };
|
|
29657
|
+
}
|
|
29658
|
+
const delivered = packets.value.data.find(
|
|
29659
|
+
(packet) => typeof packet?.src_tx_hash === "string" && packet.src_tx_hash.toLowerCase() === srcTxHash.toLowerCase() && packet.src_chain_id === Number(relayChainId) && packet.status === "executed" && typeof packet.dst_tx_hash === "string" && packet.dst_tx_hash.length > 0
|
|
29660
|
+
);
|
|
29661
|
+
if (!delivered) {
|
|
29662
|
+
return {
|
|
29663
|
+
ok: false,
|
|
29664
|
+
cause: new Error("relay has not delivered a packet for this source tx yet"),
|
|
29665
|
+
budgetable: backendAnswered
|
|
29666
|
+
};
|
|
29667
|
+
}
|
|
29668
|
+
return { ok: true, packet: delivered };
|
|
29669
|
+
}
|
|
29670
|
+
|
|
29086
29671
|
// src/backendApi/api-utils.ts
|
|
29087
29672
|
var API_KEY_HEADER = "x-api-key";
|
|
29088
29673
|
function apiKeyHeader(apiKey) {
|
|
@@ -29707,12 +30292,6 @@ function estimateSwapSpeedTier({ srcToken, dstToken }, isSodaAssetRelated) {
|
|
|
29707
30292
|
return { tier: secondsToTier(estimatedSeconds), estimatedSeconds };
|
|
29708
30293
|
}
|
|
29709
30294
|
|
|
29710
|
-
// src/swap/detailedStatus.ts
|
|
29711
|
-
var DETAILED_STATUS_NOT_DELIVERED = "relay_not_delivered";
|
|
29712
|
-
function isBackendSubmitTxAbandoned(data) {
|
|
29713
|
-
return data.status === "failed" || Boolean(data.abandonedAt);
|
|
29714
|
-
}
|
|
29715
|
-
|
|
29716
30295
|
// src/swap/errors.ts
|
|
29717
30296
|
var swapInvariant = createInvariant("swap");
|
|
29718
30297
|
var POST_EXECUTION_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
@@ -29916,6 +30495,14 @@ var SwapService = class {
|
|
|
29916
30495
|
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
29917
30496
|
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
29918
30497
|
}
|
|
30498
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
30499
|
+
return {
|
|
30500
|
+
ok: false,
|
|
30501
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
30502
|
+
status: record.error.context?.status
|
|
30503
|
+
})
|
|
30504
|
+
};
|
|
30505
|
+
}
|
|
29919
30506
|
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
29920
30507
|
const dstTxHash = await this.resolveHubTxHash(params, backendAnswered);
|
|
29921
30508
|
if (!dstTxHash.ok) return dstTxHash;
|
|
@@ -29937,48 +30524,23 @@ var SwapService = class {
|
|
|
29937
30524
|
* is simply "no hash yet".
|
|
29938
30525
|
*/
|
|
29939
30526
|
async resolveHubTxHash(key, backendAnswered) {
|
|
29940
|
-
const missReason = backendAnswered ? DETAILED_STATUS_NOT_DELIVERED : void 0;
|
|
29941
30527
|
let hubTxHash = key.srcTxHash;
|
|
29942
30528
|
if (!isHubChainKeyType(key.srcChainKey)) {
|
|
29943
|
-
const
|
|
29944
|
-
|
|
29945
|
-
|
|
29946
|
-
|
|
29947
|
-
|
|
29948
|
-
|
|
29949
|
-
|
|
29950
|
-
RELAY_REQUEST_TIMEOUT_MS
|
|
29951
|
-
);
|
|
29952
|
-
if (!packets.ok) {
|
|
29953
|
-
const notIndexed = packets.error instanceof HttpRelayError && packets.error.status === 404;
|
|
29954
|
-
return {
|
|
29955
|
-
ok: false,
|
|
29956
|
-
error: this.detailedStatusLookupFailed(packets.error, key.srcChainKey, notIndexed ? missReason : void 0)
|
|
29957
|
-
};
|
|
29958
|
-
}
|
|
29959
|
-
if (!packets.value?.success || !Array.isArray(packets.value.data)) {
|
|
29960
|
-
return {
|
|
29961
|
-
ok: false,
|
|
29962
|
-
error: this.detailedStatusLookupFailed(
|
|
29963
|
-
new Error("relay returned no usable transaction packets"),
|
|
29964
|
-
key.srcChainKey
|
|
29965
|
-
)
|
|
29966
|
-
};
|
|
29967
|
-
}
|
|
29968
|
-
const delivered = packets.value.data.find(
|
|
29969
|
-
(packet) => typeof packet?.src_tx_hash === "string" && packet.src_tx_hash.toLowerCase() === key.srcTxHash.toLowerCase() && packet.src_chain_id === Number(relayChainId) && packet.status === "executed" && typeof packet.dst_tx_hash === "string" && packet.dst_tx_hash.length > 0
|
|
29970
|
-
);
|
|
29971
|
-
if (!delivered) {
|
|
30529
|
+
const delivered = await resolveDeliveredPacket({
|
|
30530
|
+
srcChainKey: key.srcChainKey,
|
|
30531
|
+
srcTxHash: key.srcTxHash,
|
|
30532
|
+
relayerApiEndpoint: this.relayerApiEndpoint,
|
|
30533
|
+
backendAnswered
|
|
30534
|
+
});
|
|
30535
|
+
if (!delivered.ok) {
|
|
29972
30536
|
return {
|
|
29973
30537
|
ok: false,
|
|
29974
|
-
error: this.detailedStatusLookupFailed(
|
|
29975
|
-
|
|
29976
|
-
|
|
29977
|
-
missReason
|
|
29978
|
-
)
|
|
30538
|
+
error: this.detailedStatusLookupFailed(delivered.cause, key.srcChainKey, {
|
|
30539
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
30540
|
+
})
|
|
29979
30541
|
};
|
|
29980
30542
|
}
|
|
29981
|
-
hubTxHash = delivered.dst_tx_hash;
|
|
30543
|
+
hubTxHash = delivered.packet.dst_tx_hash;
|
|
29982
30544
|
}
|
|
29983
30545
|
if (viem.isHex(hubTxHash)) return { ok: true, value: hubTxHash };
|
|
29984
30546
|
return {
|
|
@@ -29992,10 +30554,12 @@ var SwapService = class {
|
|
|
29992
30554
|
/**
|
|
29993
30555
|
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound
|
|
29994
30556
|
* with a retry budget. Leaving it off marks a dependency that is failing right now, which a
|
|
29995
|
-
* caller should keep retrying rather than give up on.
|
|
30557
|
+
* caller should keep retrying rather than give up on. `status` is lifted for a rejected key so
|
|
30558
|
+
* `isAuthFailure` recognises the wrapped error; it reads `context.status` and does not walk the
|
|
30559
|
+
* cause chain.
|
|
29996
30560
|
*/
|
|
29997
|
-
detailedStatusLookupFailed(cause, srcChainKey,
|
|
29998
|
-
return lookupFailed("swap", "getDetailedStatus", cause, { srcChainKey, action: "swap",
|
|
30561
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
30562
|
+
return lookupFailed("swap", "getDetailedStatus", cause, { srcChainKey, action: "swap", ...extra });
|
|
29999
30563
|
}
|
|
30000
30564
|
/**
|
|
30001
30565
|
* Notifies the solver API that an intent has been registered on the hub chain, triggering
|
|
@@ -35606,6 +36170,80 @@ var BridgeService = class {
|
|
|
35606
36170
|
}
|
|
35607
36171
|
return encodeContractCalls(calls);
|
|
35608
36172
|
}
|
|
36173
|
+
/**
|
|
36174
|
+
* Answers "what is the status of this bridge?" from the **source-chain** tx — the one identifier a
|
|
36175
|
+
* caller always holds. It does not define a new status: it routes to whichever of the two existing
|
|
36176
|
+
* sources can answer, and returns that source's payload unmodified.
|
|
36177
|
+
*
|
|
36178
|
+
* `sodax.api.bridge.getSubmitTxStatus` cannot answer for every bridge. Sometimes there is no
|
|
36179
|
+
* record — `useBackendSubmitTx: false`, or the submit itself never landed. More often the record
|
|
36180
|
+
* exists but is stale: the backend path POSTs the tx first and only falls back to the client-side
|
|
36181
|
+
* relay once that stalls, so a fallback-completed bridge leaves behind whatever state the backend
|
|
36182
|
+
* last reached, including a record it abandoned outright. Neither shape reflects what happened.
|
|
36183
|
+
*
|
|
36184
|
+
* 1. Read the backend record; return it while it is still in play.
|
|
36185
|
+
* 2. Otherwise return the delivered relay packet, which is terminal by construction.
|
|
36186
|
+
*
|
|
36187
|
+
* A rejected API key is the one failure that does **not** fall through to step 2: the status route
|
|
36188
|
+
* is key-guarded, so degrading would bury a 401/403 behind a relay error and leave a poller
|
|
36189
|
+
* retrying a request only a corrected key can satisfy. It surfaces with `context.status` instead,
|
|
36190
|
+
* which is what `isAuthFailure` reads.
|
|
36191
|
+
*
|
|
36192
|
+
* A point-in-time read; poll it yourself, or use dapp-kit's `useBridgeDetailedStatus`.
|
|
36193
|
+
*
|
|
36194
|
+
* @param params - `srcChainKey` and `srcTxHash` of the source-chain bridge transaction.
|
|
36195
|
+
* @param config - Optional per-request override for the backend read (e.g. a per-action API key).
|
|
36196
|
+
* The relay leg is unauthenticated and takes none.
|
|
36197
|
+
* @returns A `Result` containing a {@link DetailedBridgeStatus}. Fails with `LOOKUP_FAILED` when no
|
|
36198
|
+
* source can answer yet — usually the relay has not delivered the packet. Branch on
|
|
36199
|
+
* `error.context.reason`: `DETAILED_STATUS_NOT_DELIVERED` is the ambiguous miss a caller should
|
|
36200
|
+
* bound with a retry budget; anything else is a dependency failing right now, so keep retrying.
|
|
36201
|
+
*/
|
|
36202
|
+
async getDetailedStatus(params, config) {
|
|
36203
|
+
try {
|
|
36204
|
+
const record = await this.backendApi.bridge.getSubmitTxStatus(
|
|
36205
|
+
{ txHash: params.srcTxHash, srcChainKey: params.srcChainKey },
|
|
36206
|
+
config
|
|
36207
|
+
);
|
|
36208
|
+
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
36209
|
+
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
36210
|
+
}
|
|
36211
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
36212
|
+
return {
|
|
36213
|
+
ok: false,
|
|
36214
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
36215
|
+
status: record.error.context?.status
|
|
36216
|
+
})
|
|
36217
|
+
};
|
|
36218
|
+
}
|
|
36219
|
+
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
36220
|
+
const delivered = await resolveDeliveredPacket({
|
|
36221
|
+
srcChainKey: params.srcChainKey,
|
|
36222
|
+
srcTxHash: params.srcTxHash,
|
|
36223
|
+
relayerApiEndpoint: this.config.relay.relayerApiEndpoint,
|
|
36224
|
+
backendAnswered
|
|
36225
|
+
});
|
|
36226
|
+
if (!delivered.ok) {
|
|
36227
|
+
return {
|
|
36228
|
+
ok: false,
|
|
36229
|
+
error: this.detailedStatusLookupFailed(delivered.cause, params.srcChainKey, {
|
|
36230
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
36231
|
+
})
|
|
36232
|
+
};
|
|
36233
|
+
}
|
|
36234
|
+
return { ok: true, value: { source: "relay", data: delivered.packet } };
|
|
36235
|
+
} catch (error) {
|
|
36236
|
+
return { ok: false, error: this.detailedStatusLookupFailed(error, params.srcChainKey) };
|
|
36237
|
+
}
|
|
36238
|
+
}
|
|
36239
|
+
/**
|
|
36240
|
+
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound with
|
|
36241
|
+
* a retry budget. `status` is lifted for a rejected key so `isAuthFailure` recognises the wrapped
|
|
36242
|
+
* error; it reads `context.status` and does not walk the cause chain.
|
|
36243
|
+
*/
|
|
36244
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
36245
|
+
return lookupFailed("bridge", "getDetailedStatus", cause, { srcChainKey, action: "bridge", ...extra });
|
|
36246
|
+
}
|
|
35609
36247
|
/**
|
|
35610
36248
|
* Returns the maximum amount that can currently be bridged between two tokens,
|
|
35611
36249
|
* taking into account both deposit capacity on the source side and withdrawal liquidity
|
|
@@ -43830,6 +44468,8 @@ var leveragePositionAbi = viem.parseAbi([
|
|
|
43830
44468
|
"function settle()"
|
|
43831
44469
|
]);
|
|
43832
44470
|
var INTENT_DEADLINE_BUFFER_SECONDS = 5 * 60;
|
|
44471
|
+
var RECONCILE_TIMEOUT_MS2 = 5e3;
|
|
44472
|
+
var DETAILED_STATUS_SOLVER_TIMEOUT_MS2 = 5e3;
|
|
43833
44473
|
var BITCOIN_UNSUPPORTED_MESSAGE = "Bitcoin is not a supported source chain for leverage positions; use a supported spoke or the hub";
|
|
43834
44474
|
var ANY_SOLVER_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
43835
44475
|
var MAX_WITHDRAW_DUST_BUFFER = 1000n;
|
|
@@ -43867,9 +44507,9 @@ var LeverageYieldService = class {
|
|
|
43867
44507
|
spoke;
|
|
43868
44508
|
backendApi;
|
|
43869
44509
|
/**
|
|
43870
|
-
* Effective backend submit-tx flow (`leverageYield.useBackendSubmitTx`, default
|
|
43871
|
-
* `ConfigService`, like `config.leverageYieldPartnerFee`, so the config
|
|
43872
|
-
* never disagree.
|
|
44510
|
+
* Effective backend submit-tx flow (`leverageYield.useBackendSubmitTx`, default ON; opt out with
|
|
44511
|
+
* `false`). Read live off `ConfigService`, like `config.leverageYieldPartnerFee`, so the config
|
|
44512
|
+
* object and the behavior can never disagree.
|
|
43873
44513
|
*/
|
|
43874
44514
|
get useBackendSubmitTx() {
|
|
43875
44515
|
return this.config.leverageYieldUseBackendSubmitTx;
|
|
@@ -44361,10 +45001,11 @@ var LeverageYieldService = class {
|
|
|
44361
45001
|
);
|
|
44362
45002
|
}
|
|
44363
45003
|
/**
|
|
44364
|
-
* Client-side vault-swap completion (the
|
|
45004
|
+
* Client-side vault-swap completion (the opt-out path, and the fallback): verify the broadcast
|
|
45005
|
+
* intent tx landed,
|
|
44365
45006
|
* relay it to the hub (Sonic) — or use it directly when the source IS the hub — then notify the
|
|
44366
45007
|
* solver via {@link LeverageYieldService.notifySolver} and build the {@link VaultSwapResponse}.
|
|
44367
|
-
* Extracted from `vaultSwap()` so the
|
|
45008
|
+
* Extracted from `vaultSwap()` so the default backend 2-step path ({@link LeverageYieldService.submitTx})
|
|
44368
45009
|
* can fall back to it on any non-success. Leverage-yield copy of `SwapService.fallbackSwapSteps`.
|
|
44369
45010
|
*/
|
|
44370
45011
|
async fallbackVaultSwapSteps(_params, created, timeoutMs) {
|
|
@@ -44422,7 +45063,8 @@ var LeverageYieldService = class {
|
|
|
44422
45063
|
};
|
|
44423
45064
|
}
|
|
44424
45065
|
/**
|
|
44425
|
-
* Backend 2-step vault-swap path (opt
|
|
45066
|
+
* Backend 2-step vault-swap path (the default; opt out with `leverageYield.useBackendSubmitTx:
|
|
45067
|
+
* false`): hand the
|
|
44426
45068
|
* broadcast intent tx to the leverage-yield API (`POST /leverage-yield/submit-tx`); the backend
|
|
44427
45069
|
* relays + post-executes server-side. Polls `getSubmitTxStatus` until `solved`, then reconstructs
|
|
44428
45070
|
* the same {@link VaultSwapResponse} the client-side path returns.
|
|
@@ -44461,6 +45103,10 @@ var LeverageYieldService = class {
|
|
|
44461
45103
|
operation: _params.hubWalletSwap ? "withdraw" : "deposit"
|
|
44462
45104
|
},
|
|
44463
45105
|
statusQuery: { txHash: spokeTxHash, srcChainKey },
|
|
45106
|
+
// Per-action key wins over the instance one for both legs of the attempt — the submit POST
|
|
45107
|
+
// and its status polls. Undefined leaves the configured key in place; the same per-action
|
|
45108
|
+
// override `extras.partnerFee` already has, travelling per call.
|
|
45109
|
+
overrideConfig: { apiKey: _params.extras?.apiKey },
|
|
44464
45110
|
// A vault deposit/withdraw IS a solver swap, so terminal success is `solved` — not bridge's
|
|
44465
45111
|
// `executed`.
|
|
44466
45112
|
terminalStatus: "solved",
|
|
@@ -44544,22 +45190,22 @@ var LeverageYieldService = class {
|
|
|
44544
45190
|
* A `NOT_FOUND` status usually means the notification never landed rather than that the intent
|
|
44545
45191
|
* does not exist — an intent created on the hub is invisible to the solver until it is told.
|
|
44546
45192
|
*
|
|
45193
|
+
* Reports the solver verbatim. It does NOT reconcile a `NOT_FOUND` against the backend's durable
|
|
45194
|
+
* record the way {@link LeverageYieldService.getDetailedStatus} does — a restarted solver answers
|
|
45195
|
+
* `NOT_FOUND` for intents it already filled, and that read resolves it. Keeping this one
|
|
45196
|
+
* unreconciled is deliberate: it has shipped with this contract, and folding the reconcile in
|
|
45197
|
+
* would turn a `NOT_FOUND` behind an unreadable backend into an error for every existing caller.
|
|
45198
|
+
* Prefer `getDetailedStatus` when you hold the source tx hash.
|
|
45199
|
+
*
|
|
44547
45200
|
* @param request - `{ intent_tx_hash }` — the hub-chain (Sonic) tx hash the intent was
|
|
44548
45201
|
* registered in. For a position that is the tx that called the factory or the position.
|
|
44549
45202
|
*/
|
|
44550
45203
|
async getIntentStatus(request) {
|
|
44551
45204
|
try {
|
|
44552
|
-
const result = await
|
|
44553
|
-
request,
|
|
44554
|
-
this.config.solver,
|
|
44555
|
-
this.config.logger,
|
|
44556
|
-
void 0,
|
|
44557
|
-
this.config.apiKey
|
|
44558
|
-
);
|
|
45205
|
+
const result = await this.solverStatus(request);
|
|
44559
45206
|
if (result.ok) return result;
|
|
44560
45207
|
const detail = result.error?.detail ?? {
|
|
44561
|
-
code:
|
|
44562
|
-
// SolverIntentErrorCode.UNKNOWN
|
|
45208
|
+
code: exports.SolverIntentErrorCode.UNKNOWN,
|
|
44563
45209
|
message: "Solver returned malformed error response"
|
|
44564
45210
|
};
|
|
44565
45211
|
return {
|
|
@@ -44579,6 +45225,164 @@ var LeverageYieldService = class {
|
|
|
44579
45225
|
return { ok: false, error: executionFailed("leverageYield", error, { phase: "lookup" }) };
|
|
44580
45226
|
}
|
|
44581
45227
|
}
|
|
45228
|
+
/**
|
|
45229
|
+
* The raw solver read, in the solver's own vocabulary. Both public status surfaces start here; the
|
|
45230
|
+
* api key is the 5th argument, and leaving it out let a keyed partner notify and then fail to poll.
|
|
45231
|
+
*/
|
|
45232
|
+
async solverStatus(request, timeoutMs, apiKey) {
|
|
45233
|
+
return SolverApiService.getStatus(
|
|
45234
|
+
request,
|
|
45235
|
+
this.config.solver,
|
|
45236
|
+
this.config.logger,
|
|
45237
|
+
timeoutMs,
|
|
45238
|
+
apiKey || this.config.apiKey
|
|
45239
|
+
);
|
|
45240
|
+
}
|
|
45241
|
+
/**
|
|
45242
|
+
* {@link LeverageYieldService.solverStatus} plus the durable-record reconcile, for
|
|
45243
|
+
* {@link LeverageYieldService.getDetailedStatus}. Deliberately not shared with
|
|
45244
|
+
* {@link LeverageYieldService.getIntentStatus}: the reconcile turns a `NOT_FOUND` behind an
|
|
45245
|
+
* unreadable backend into an error, which is right for a polled read that would otherwise spend a
|
|
45246
|
+
* budget on an unverified miss, and wrong to impose on a surface that already ships without it.
|
|
45247
|
+
*
|
|
45248
|
+
* `timeoutMs` bounds the solver request alone. The reconcile carries its own
|
|
45249
|
+
* {@link RECONCILE_TIMEOUT_MS}, so a bounded call can cost both.
|
|
45250
|
+
*/
|
|
45251
|
+
async resolveSolverStatus(request, timeoutMs, apiKey) {
|
|
45252
|
+
const solverResult = await this.solverStatus(request, timeoutMs, apiKey);
|
|
45253
|
+
const forgotten = !solverResult.ok || solverResult.value.status === exports.SolverIntentStatusCode.NOT_FOUND;
|
|
45254
|
+
if (!forgotten) return solverResult;
|
|
45255
|
+
const timeout = Math.min(RECONCILE_TIMEOUT_MS2, this.backendApi.requestTimeoutMs);
|
|
45256
|
+
const intent = await this.backendApi.getIntentByTxHash(request.intent_tx_hash, { timeout, apiKey });
|
|
45257
|
+
const settled = intent.ok ? intent.value.events.filter(isFillEvent).find((fill) => fill.intentState.remainingInput === "0") : void 0;
|
|
45258
|
+
if (settled) return { ok: true, value: { status: exports.SolverIntentStatusCode.SOLVED, fill_tx_hash: settled.txHash } };
|
|
45259
|
+
const backendAnswered = intent.ok || isSodaxError(intent.error) && intent.error.context?.status === 404;
|
|
45260
|
+
if (solverResult.ok && !backendAnswered) {
|
|
45261
|
+
return {
|
|
45262
|
+
ok: false,
|
|
45263
|
+
error: {
|
|
45264
|
+
detail: {
|
|
45265
|
+
code: exports.SolverIntentErrorCode.UNKNOWN,
|
|
45266
|
+
message: "solver reported NOT_FOUND and the durable intent record could not be read to verify it"
|
|
45267
|
+
}
|
|
45268
|
+
}
|
|
45269
|
+
};
|
|
45270
|
+
}
|
|
45271
|
+
return solverResult;
|
|
45272
|
+
}
|
|
45273
|
+
/**
|
|
45274
|
+
* Reads a vault swap's status from its source-chain transaction — the identifier a caller always
|
|
45275
|
+
* holds after `vaultSwap()`.
|
|
45276
|
+
*
|
|
45277
|
+
* **Routes; does not translate.** Returns the backend submit-tx record while it is in play,
|
|
45278
|
+
* otherwise the solver's answer via the hub tx hash resolved from the relay packet. The result is
|
|
45279
|
+
* tagged with `source` (discriminate on it) and carries that source's payload unmodified.
|
|
45280
|
+
*
|
|
45281
|
+
* `sodax.api.leverageYield.getSubmitTxStatus` cannot answer for every vault swap. Sometimes there
|
|
45282
|
+
* is no record — `useBackendSubmitTx: false`, or the submit was rejected. More often the record
|
|
45283
|
+
* exists but is stale: the backend path POSTs first and falls back to the client-side relay once
|
|
45284
|
+
* that stalls, so a fallback-completed vault swap leaves behind whatever state the backend last
|
|
45285
|
+
* reached, including a record it abandoned outright.
|
|
45286
|
+
*
|
|
45287
|
+
* **Any** unusable backend response routes to the solver — a 404, a transport or server error, or
|
|
45288
|
+
* a record the backend gave up on. A rejected API key is the exception: it is not a source with
|
|
45289
|
+
* nothing to say, it is a configuration problem only a corrected key resolves, so routing it on
|
|
45290
|
+
* would bury it behind a relay or solver error and leave a poller retrying a request that cannot
|
|
45291
|
+
* succeed. The same rule the swap and bridge siblings apply. It holds here even though
|
|
45292
|
+
* `GET /leverage-yield/submit-tx/status` declares no scope of its own: whether a key is checked
|
|
45293
|
+
* is a per-deployment setting, so this must not assume the read is unauthenticated.
|
|
45294
|
+
*
|
|
45295
|
+
* A point-in-time read; poll it yourself, or use dapp-kit's `useLeverageYieldDetailedStatus`.
|
|
45296
|
+
*
|
|
45297
|
+
* @param params - `srcChainKey` and `srcTxHash` of the source-chain vault-swap transaction.
|
|
45298
|
+
* @param config - Optional per-request override. Its `apiKey` reaches every keyed leg — the
|
|
45299
|
+
* submit-tx record read, the solver read, and the durable-intent read a solver `NOT_FOUND` falls
|
|
45300
|
+
* back to — so one override keys the whole call. The relay leg is unauthenticated and takes none.
|
|
45301
|
+
* @returns A `Result` containing a {@link DetailedLeverageYieldStatus}. Fails with `LOOKUP_FAILED`
|
|
45302
|
+
* when no source can answer yet. Branch on `error.context.reason`:
|
|
45303
|
+
* `DETAILED_STATUS_NOT_DELIVERED` is the ambiguous miss a caller should bound with a retry
|
|
45304
|
+
* budget; anything else is a dependency failing right now, so keep retrying.
|
|
45305
|
+
*/
|
|
45306
|
+
async getDetailedStatus(params, config) {
|
|
45307
|
+
try {
|
|
45308
|
+
const record = await this.backendApi.leverageYield.getSubmitTxStatus(
|
|
45309
|
+
{ txHash: params.srcTxHash, srcChainKey: params.srcChainKey },
|
|
45310
|
+
config
|
|
45311
|
+
);
|
|
45312
|
+
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
45313
|
+
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
45314
|
+
}
|
|
45315
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
45316
|
+
return {
|
|
45317
|
+
ok: false,
|
|
45318
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
45319
|
+
status: record.error.context?.status
|
|
45320
|
+
})
|
|
45321
|
+
};
|
|
45322
|
+
}
|
|
45323
|
+
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
45324
|
+
const dstTxHash = await this.resolveHubTxHash(params, backendAnswered);
|
|
45325
|
+
if (!dstTxHash.ok) return dstTxHash;
|
|
45326
|
+
const solver = await this.resolveSolverStatus(
|
|
45327
|
+
{ intent_tx_hash: dstTxHash.value },
|
|
45328
|
+
DETAILED_STATUS_SOLVER_TIMEOUT_MS2,
|
|
45329
|
+
config?.apiKey
|
|
45330
|
+
);
|
|
45331
|
+
if (!solver.ok) {
|
|
45332
|
+
return { ok: false, error: this.detailedStatusLookupFailed(solver.error, params.srcChainKey) };
|
|
45333
|
+
}
|
|
45334
|
+
return { ok: true, value: { source: "solver", dstTxHash: dstTxHash.value, data: solver.value } };
|
|
45335
|
+
} catch (error) {
|
|
45336
|
+
return { ok: false, error: this.detailedStatusLookupFailed(error, params.srcChainKey) };
|
|
45337
|
+
}
|
|
45338
|
+
}
|
|
45339
|
+
/**
|
|
45340
|
+
* The hub-chain tx hash the solver is keyed on. A hub-source vault swap has no relay leg — the
|
|
45341
|
+
* source tx *is* the hub tx. Otherwise the delivered relay packet carries it, so an undelivered
|
|
45342
|
+
* packet is simply "no hash yet".
|
|
45343
|
+
*/
|
|
45344
|
+
async resolveHubTxHash(key, backendAnswered) {
|
|
45345
|
+
let hubTxHash = key.srcTxHash;
|
|
45346
|
+
if (!isHubChainKeyType(key.srcChainKey)) {
|
|
45347
|
+
const delivered = await resolveDeliveredPacket({
|
|
45348
|
+
srcChainKey: key.srcChainKey,
|
|
45349
|
+
srcTxHash: key.srcTxHash,
|
|
45350
|
+
relayerApiEndpoint: this.config.relay.relayerApiEndpoint,
|
|
45351
|
+
backendAnswered
|
|
45352
|
+
});
|
|
45353
|
+
if (!delivered.ok) {
|
|
45354
|
+
return {
|
|
45355
|
+
ok: false,
|
|
45356
|
+
error: this.detailedStatusLookupFailed(delivered.cause, key.srcChainKey, {
|
|
45357
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
45358
|
+
})
|
|
45359
|
+
};
|
|
45360
|
+
}
|
|
45361
|
+
hubTxHash = delivered.packet.dst_tx_hash;
|
|
45362
|
+
}
|
|
45363
|
+
if (viem.isHex(hubTxHash)) return { ok: true, value: hubTxHash };
|
|
45364
|
+
return {
|
|
45365
|
+
ok: false,
|
|
45366
|
+
error: this.detailedStatusLookupFailed(
|
|
45367
|
+
new Error(`hub tx hash is not a hex string: ${hubTxHash}`),
|
|
45368
|
+
key.srcChainKey
|
|
45369
|
+
)
|
|
45370
|
+
};
|
|
45371
|
+
}
|
|
45372
|
+
/**
|
|
45373
|
+
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound
|
|
45374
|
+
* with a retry budget. Leaving it off marks a dependency that is failing right now, which a
|
|
45375
|
+
* caller should keep retrying rather than give up on. `status` is lifted for a rejected key so
|
|
45376
|
+
* `isAuthFailure` recognises the wrapped error; it reads `context.status` and does not walk the
|
|
45377
|
+
* cause chain.
|
|
45378
|
+
*/
|
|
45379
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
45380
|
+
return lookupFailed("leverageYield", "getDetailedStatus", cause, {
|
|
45381
|
+
srcChainKey,
|
|
45382
|
+
action: "vaultSwap",
|
|
45383
|
+
...extra
|
|
45384
|
+
});
|
|
45385
|
+
}
|
|
44582
45386
|
/**
|
|
44583
45387
|
* Approves the vault's underlying asset to the leverage vault on Sonic. For callers
|
|
44584
45388
|
* interacting with the vault directly on the hub — the swap-style {@link
|