@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.mjs
CHANGED
|
@@ -340,7 +340,18 @@ var HubVaultSymbols = [
|
|
|
340
340
|
"QQQ",
|
|
341
341
|
"SGOV",
|
|
342
342
|
"USO",
|
|
343
|
-
"SLV"
|
|
343
|
+
"SLV",
|
|
344
|
+
"GOOGL",
|
|
345
|
+
"AMZN",
|
|
346
|
+
"MSFT",
|
|
347
|
+
"META",
|
|
348
|
+
"CRCL",
|
|
349
|
+
"COIN",
|
|
350
|
+
"PLTR",
|
|
351
|
+
"TSM",
|
|
352
|
+
"AMD",
|
|
353
|
+
"INTC",
|
|
354
|
+
"BABA"
|
|
344
355
|
];
|
|
345
356
|
var SodaTokens = {
|
|
346
357
|
sodaBNB: {
|
|
@@ -733,6 +744,116 @@ var SodaTokens = {
|
|
|
733
744
|
chainKey: ChainKeys.SONIC_MAINNET,
|
|
734
745
|
hubAsset: "0x690B92c27ac80015E57DB8cc02A81255814f49A2",
|
|
735
746
|
vault: "0x690B92c27ac80015E57DB8cc02A81255814f49A2"
|
|
747
|
+
},
|
|
748
|
+
GOOGL: {
|
|
749
|
+
symbol: "GOOGL",
|
|
750
|
+
isRwa: true,
|
|
751
|
+
name: "Alphabet Class A \u2022 Robinhood Token",
|
|
752
|
+
decimals: 18,
|
|
753
|
+
address: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3",
|
|
754
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
755
|
+
hubAsset: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3",
|
|
756
|
+
vault: "0xBdB4445a05726E26C26EA30dF0C1970DF4Cf4Be3"
|
|
757
|
+
},
|
|
758
|
+
AMZN: {
|
|
759
|
+
symbol: "AMZN",
|
|
760
|
+
isRwa: true,
|
|
761
|
+
name: "Amazon \u2022 Robinhood Token",
|
|
762
|
+
decimals: 18,
|
|
763
|
+
address: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba",
|
|
764
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
765
|
+
hubAsset: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba",
|
|
766
|
+
vault: "0xc467cAC3e69C2eb41Cc9b32Aa1A7a54F942243Ba"
|
|
767
|
+
},
|
|
768
|
+
MSFT: {
|
|
769
|
+
symbol: "MSFT",
|
|
770
|
+
isRwa: true,
|
|
771
|
+
name: "Microsoft \u2022 Robinhood Token",
|
|
772
|
+
decimals: 18,
|
|
773
|
+
address: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC",
|
|
774
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
775
|
+
hubAsset: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC",
|
|
776
|
+
vault: "0x66A3bc5a66D3c66dc42031775Ea3eedc37347FeC"
|
|
777
|
+
},
|
|
778
|
+
META: {
|
|
779
|
+
symbol: "META",
|
|
780
|
+
isRwa: true,
|
|
781
|
+
name: "Meta Platforms \u2022 Robinhood Token",
|
|
782
|
+
decimals: 18,
|
|
783
|
+
address: "0xB7686E0a03542230927CAC76Fe7566656439F3c6",
|
|
784
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
785
|
+
hubAsset: "0xB7686E0a03542230927CAC76Fe7566656439F3c6",
|
|
786
|
+
vault: "0xB7686E0a03542230927CAC76Fe7566656439F3c6"
|
|
787
|
+
},
|
|
788
|
+
CRCL: {
|
|
789
|
+
symbol: "CRCL",
|
|
790
|
+
isRwa: true,
|
|
791
|
+
name: "Circle Internet Group \u2022 Robinhood Token",
|
|
792
|
+
decimals: 18,
|
|
793
|
+
address: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d",
|
|
794
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
795
|
+
hubAsset: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d",
|
|
796
|
+
vault: "0x1e264ceEEb59F7425D64362Bf12A5b2648B6e66d"
|
|
797
|
+
},
|
|
798
|
+
COIN: {
|
|
799
|
+
symbol: "COIN",
|
|
800
|
+
isRwa: true,
|
|
801
|
+
name: "Coinbase \u2022 Robinhood Token",
|
|
802
|
+
decimals: 18,
|
|
803
|
+
address: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c",
|
|
804
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
805
|
+
hubAsset: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c",
|
|
806
|
+
vault: "0x5540d60F879F5D470bF9Ed7d23FFd59Acc10da0c"
|
|
807
|
+
},
|
|
808
|
+
PLTR: {
|
|
809
|
+
symbol: "PLTR",
|
|
810
|
+
isRwa: true,
|
|
811
|
+
name: "Palantir Technologies \u2022 Robinhood Token",
|
|
812
|
+
decimals: 18,
|
|
813
|
+
address: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC",
|
|
814
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
815
|
+
hubAsset: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC",
|
|
816
|
+
vault: "0xA24710Ab6A5e1ef3a7CF3a0333d8bE2bf22782DC"
|
|
817
|
+
},
|
|
818
|
+
TSM: {
|
|
819
|
+
symbol: "TSM",
|
|
820
|
+
isRwa: true,
|
|
821
|
+
name: "Taiwan Semiconductor Manufacturing \u2022 Robinhood Token",
|
|
822
|
+
decimals: 18,
|
|
823
|
+
address: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e",
|
|
824
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
825
|
+
hubAsset: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e",
|
|
826
|
+
vault: "0xAF9992b0cA54e014ff1EC7fA77AADE973Dba793e"
|
|
827
|
+
},
|
|
828
|
+
AMD: {
|
|
829
|
+
symbol: "AMD",
|
|
830
|
+
isRwa: true,
|
|
831
|
+
name: "AMD \u2022 Robinhood Token",
|
|
832
|
+
decimals: 18,
|
|
833
|
+
address: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B",
|
|
834
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
835
|
+
hubAsset: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B",
|
|
836
|
+
vault: "0xc8124Db156d8F6C7446C040c503FFEAe82383D1B"
|
|
837
|
+
},
|
|
838
|
+
INTC: {
|
|
839
|
+
symbol: "INTC",
|
|
840
|
+
isRwa: true,
|
|
841
|
+
name: "Intel \u2022 Robinhood Token",
|
|
842
|
+
decimals: 18,
|
|
843
|
+
address: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053",
|
|
844
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
845
|
+
hubAsset: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053",
|
|
846
|
+
vault: "0x5352F9Bf2f58720f8a8CC4D4eDEE56700Bd3d053"
|
|
847
|
+
},
|
|
848
|
+
BABA: {
|
|
849
|
+
symbol: "BABA",
|
|
850
|
+
isRwa: true,
|
|
851
|
+
name: "Alibaba \u2022 Robinhood Token",
|
|
852
|
+
decimals: 18,
|
|
853
|
+
address: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf",
|
|
854
|
+
chainKey: ChainKeys.SONIC_MAINNET,
|
|
855
|
+
hubAsset: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf",
|
|
856
|
+
vault: "0x1BeD0547D76F6424e9A3465b36F6dcDCF798A5cf"
|
|
736
857
|
}
|
|
737
858
|
};
|
|
738
859
|
var LsodaSymbols = ["lsodaWEETH", "lsodaWSTETH", "lsodaJITOSOL", "lsodaSUSDS"];
|
|
@@ -2491,6 +2612,116 @@ var stellarSupportedTokens = {
|
|
|
2491
2612
|
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2492
2613
|
hubAsset: "0x7eaF987431ce072feBEB2124fEB4d1cEf8Cf4e2e",
|
|
2493
2614
|
vault: SodaTokens.SLV.address
|
|
2615
|
+
},
|
|
2616
|
+
GOOGL: {
|
|
2617
|
+
symbol: "GOOGL",
|
|
2618
|
+
isRwa: true,
|
|
2619
|
+
name: "Alphabet Class A",
|
|
2620
|
+
decimals: 7,
|
|
2621
|
+
address: "CCZLQHO22HLQARS26KNSJ4DU3FCFG45VG6RZQOQDQ4MHTSUVGRX57VWD",
|
|
2622
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2623
|
+
hubAsset: "0x3DE82bcf9D6a1CE8CB9b9eBCD6fC2916c548CD19",
|
|
2624
|
+
vault: SodaTokens.GOOGL.address
|
|
2625
|
+
},
|
|
2626
|
+
AMZN: {
|
|
2627
|
+
symbol: "AMZN",
|
|
2628
|
+
isRwa: true,
|
|
2629
|
+
name: "Amazon",
|
|
2630
|
+
decimals: 7,
|
|
2631
|
+
address: "CBN6JFMCVKXOIRRERGPH7CGY7RIIHGRLVSFJCD3KBMYSUEZAQR3MJ7TF",
|
|
2632
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2633
|
+
hubAsset: "0x30A6383A1d39b40B038EB82fd0F1fb7F77580623",
|
|
2634
|
+
vault: SodaTokens.AMZN.address
|
|
2635
|
+
},
|
|
2636
|
+
MSFT: {
|
|
2637
|
+
symbol: "MSFT",
|
|
2638
|
+
isRwa: true,
|
|
2639
|
+
name: "Microsoft",
|
|
2640
|
+
decimals: 7,
|
|
2641
|
+
address: "CA53FXC2RF3BNIGLCPE3PNS3SZ2AONVRKH46AIHPEJOA54LGI2DYSOAD",
|
|
2642
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2643
|
+
hubAsset: "0xDb89f97afc524c95a02a001aE16fe946e2f2e4A6",
|
|
2644
|
+
vault: SodaTokens.MSFT.address
|
|
2645
|
+
},
|
|
2646
|
+
META: {
|
|
2647
|
+
symbol: "META",
|
|
2648
|
+
isRwa: true,
|
|
2649
|
+
name: "Meta",
|
|
2650
|
+
decimals: 7,
|
|
2651
|
+
address: "CA4AXIRO72PC566XUIYVN2365347I7TVGYULXW7QDVCIXBOEFFRXGP67",
|
|
2652
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2653
|
+
hubAsset: "0xd2ff91513Cc08b5Bf4A07F1829A04273Bb902445",
|
|
2654
|
+
vault: SodaTokens.META.address
|
|
2655
|
+
},
|
|
2656
|
+
CRCL: {
|
|
2657
|
+
symbol: "CRCL",
|
|
2658
|
+
isRwa: true,
|
|
2659
|
+
name: "Circle",
|
|
2660
|
+
decimals: 7,
|
|
2661
|
+
address: "CDMRGHCY23UVTFYYW6U2NBYGME2VVPDO6OJXLZMM7FNGVFX3V42SAA4C",
|
|
2662
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2663
|
+
hubAsset: "0x1599b2754f0fC9429b3CDA12823B19eb2463F1cc",
|
|
2664
|
+
vault: SodaTokens.CRCL.address
|
|
2665
|
+
},
|
|
2666
|
+
COIN: {
|
|
2667
|
+
symbol: "COIN",
|
|
2668
|
+
isRwa: true,
|
|
2669
|
+
name: "Coinbase",
|
|
2670
|
+
decimals: 7,
|
|
2671
|
+
address: "CAKCNNQFIYAQBU7RXWPW3ZH4IWDXGMXUB6WTGCEZSI2EZ6WSTCCCEFHO",
|
|
2672
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2673
|
+
hubAsset: "0xaaB281239e25d7E637b4053C832D9b3b495c0261",
|
|
2674
|
+
vault: SodaTokens.COIN.address
|
|
2675
|
+
},
|
|
2676
|
+
PLTR: {
|
|
2677
|
+
symbol: "PLTR",
|
|
2678
|
+
isRwa: true,
|
|
2679
|
+
name: "Palantir",
|
|
2680
|
+
decimals: 7,
|
|
2681
|
+
address: "CC3EVVVQAB2BZFAJHPZWVRANTVVS37OJXNJKR2DVPAMG5FOYRPIIGCEV",
|
|
2682
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2683
|
+
hubAsset: "0x948195294e506cd42C00418269ab0E53EFAE5171",
|
|
2684
|
+
vault: SodaTokens.PLTR.address
|
|
2685
|
+
},
|
|
2686
|
+
TSM: {
|
|
2687
|
+
symbol: "TSM",
|
|
2688
|
+
isRwa: true,
|
|
2689
|
+
name: "Taiwan Semiconductor",
|
|
2690
|
+
decimals: 7,
|
|
2691
|
+
address: "CBZFBO44J4RSRZZ7PT7BHLLID6L7C4HL77YLVFCNIIXZQKVLNL6VEAD6",
|
|
2692
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2693
|
+
hubAsset: "0x276a0aB35C5eBD286076F69c58dA6AbB22c326Bf",
|
|
2694
|
+
vault: SodaTokens.TSM.address
|
|
2695
|
+
},
|
|
2696
|
+
AMD: {
|
|
2697
|
+
symbol: "AMD",
|
|
2698
|
+
isRwa: true,
|
|
2699
|
+
name: "AMD",
|
|
2700
|
+
decimals: 7,
|
|
2701
|
+
address: "CCIE4OXPJUPLNRLGAENNSDEZTQUXTXKAPU322Z3HMATZSR2S2DAAGYQD",
|
|
2702
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2703
|
+
hubAsset: "0x16a8d54d04Ee9cbcC57Fe7C4838bEA83294Fb646",
|
|
2704
|
+
vault: SodaTokens.AMD.address
|
|
2705
|
+
},
|
|
2706
|
+
INTC: {
|
|
2707
|
+
symbol: "INTC",
|
|
2708
|
+
isRwa: true,
|
|
2709
|
+
name: "Intel",
|
|
2710
|
+
decimals: 7,
|
|
2711
|
+
address: "CBD7GPTTHNFWBX7CYOM7O3N2TCZIAYT6FT4LCAXKX4JCZ3ZJL2IF7E4B",
|
|
2712
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2713
|
+
hubAsset: "0x34FC8F280c7C345A9aFC6E00F652F75b1fB2bd22",
|
|
2714
|
+
vault: SodaTokens.INTC.address
|
|
2715
|
+
},
|
|
2716
|
+
BABA: {
|
|
2717
|
+
symbol: "BABA",
|
|
2718
|
+
isRwa: true,
|
|
2719
|
+
name: "Alibaba",
|
|
2720
|
+
decimals: 7,
|
|
2721
|
+
address: "CDARDTMGSEXTYJDSKDEAA52DCYX3OZEP7SOLSF5CT3QSSAGBETWH7LO3",
|
|
2722
|
+
chainKey: ChainKeys.STELLAR_MAINNET,
|
|
2723
|
+
hubAsset: "0x83ac05C492188B46dd15d5611dEEFA6b23c7D479",
|
|
2724
|
+
vault: SodaTokens.BABA.address
|
|
2494
2725
|
}
|
|
2495
2726
|
};
|
|
2496
2727
|
var suiSupportedTokens = {
|
|
@@ -3304,6 +3535,116 @@ var hederaSupportedTokens = {
|
|
|
3304
3535
|
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3305
3536
|
hubAsset: "0x914672C5336f5E00126e431368005f7C22aCe952",
|
|
3306
3537
|
vault: SodaTokens.SLV.address
|
|
3538
|
+
},
|
|
3539
|
+
GOOGL: {
|
|
3540
|
+
symbol: "GOOGL",
|
|
3541
|
+
isRwa: true,
|
|
3542
|
+
name: "Alphabet Class A",
|
|
3543
|
+
decimals: 8,
|
|
3544
|
+
address: "0x0000000000000000000000000000000000a605ce",
|
|
3545
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3546
|
+
hubAsset: "0xA4942e1edE99034b11657C8a0978f8E2342980b4",
|
|
3547
|
+
vault: SodaTokens.GOOGL.address
|
|
3548
|
+
},
|
|
3549
|
+
AMZN: {
|
|
3550
|
+
symbol: "AMZN",
|
|
3551
|
+
isRwa: true,
|
|
3552
|
+
name: "Amazon",
|
|
3553
|
+
decimals: 8,
|
|
3554
|
+
address: "0x0000000000000000000000000000000000a605d0",
|
|
3555
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3556
|
+
hubAsset: "0x13E3E4eaaa02bbD0A32094c6C7078D4ABa24cd04",
|
|
3557
|
+
vault: SodaTokens.AMZN.address
|
|
3558
|
+
},
|
|
3559
|
+
MSFT: {
|
|
3560
|
+
symbol: "MSFT",
|
|
3561
|
+
isRwa: true,
|
|
3562
|
+
name: "Microsoft",
|
|
3563
|
+
decimals: 8,
|
|
3564
|
+
address: "0x0000000000000000000000000000000000a605d2",
|
|
3565
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3566
|
+
hubAsset: "0x5b9838715bbeFF2E8752961C418f64CAB3e7B2eD",
|
|
3567
|
+
vault: SodaTokens.MSFT.address
|
|
3568
|
+
},
|
|
3569
|
+
META: {
|
|
3570
|
+
symbol: "META",
|
|
3571
|
+
isRwa: true,
|
|
3572
|
+
name: "Meta",
|
|
3573
|
+
decimals: 8,
|
|
3574
|
+
address: "0x0000000000000000000000000000000000a605d3",
|
|
3575
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3576
|
+
hubAsset: "0xbe8a7cAFABe2399b4d751A5545017cc09D83FFc9",
|
|
3577
|
+
vault: SodaTokens.META.address
|
|
3578
|
+
},
|
|
3579
|
+
CRCL: {
|
|
3580
|
+
symbol: "CRCL",
|
|
3581
|
+
isRwa: true,
|
|
3582
|
+
name: "Circle",
|
|
3583
|
+
decimals: 8,
|
|
3584
|
+
address: "0x0000000000000000000000000000000000a605d4",
|
|
3585
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3586
|
+
hubAsset: "0x13c16a6a19a637fBf370CcA8d7f4bD38d207b620",
|
|
3587
|
+
vault: SodaTokens.CRCL.address
|
|
3588
|
+
},
|
|
3589
|
+
COIN: {
|
|
3590
|
+
symbol: "COIN",
|
|
3591
|
+
isRwa: true,
|
|
3592
|
+
name: "Coinbase",
|
|
3593
|
+
decimals: 8,
|
|
3594
|
+
address: "0x0000000000000000000000000000000000a605d6",
|
|
3595
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3596
|
+
hubAsset: "0x4d82303a0cf66f3D98E8140a1668567E748685De",
|
|
3597
|
+
vault: SodaTokens.COIN.address
|
|
3598
|
+
},
|
|
3599
|
+
PLTR: {
|
|
3600
|
+
symbol: "PLTR",
|
|
3601
|
+
isRwa: true,
|
|
3602
|
+
name: "Palantir",
|
|
3603
|
+
decimals: 8,
|
|
3604
|
+
address: "0x0000000000000000000000000000000000a605d7",
|
|
3605
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3606
|
+
hubAsset: "0xEC98d565853064667Ec5512bc6B7183D54b9EF40",
|
|
3607
|
+
vault: SodaTokens.PLTR.address
|
|
3608
|
+
},
|
|
3609
|
+
TSM: {
|
|
3610
|
+
symbol: "TSM",
|
|
3611
|
+
isRwa: true,
|
|
3612
|
+
name: "Taiwan Semiconductor",
|
|
3613
|
+
decimals: 8,
|
|
3614
|
+
address: "0x0000000000000000000000000000000000a605d9",
|
|
3615
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3616
|
+
hubAsset: "0x87FB178434B5832Df1Defa3E3E51dA3e4F1ECb10",
|
|
3617
|
+
vault: SodaTokens.TSM.address
|
|
3618
|
+
},
|
|
3619
|
+
AMD: {
|
|
3620
|
+
symbol: "AMD",
|
|
3621
|
+
isRwa: true,
|
|
3622
|
+
name: "AMD",
|
|
3623
|
+
decimals: 8,
|
|
3624
|
+
address: "0x0000000000000000000000000000000000a605db",
|
|
3625
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3626
|
+
hubAsset: "0x26b9C3af52e764b8362cDD273b443E576F960e36",
|
|
3627
|
+
vault: SodaTokens.AMD.address
|
|
3628
|
+
},
|
|
3629
|
+
INTC: {
|
|
3630
|
+
symbol: "INTC",
|
|
3631
|
+
isRwa: true,
|
|
3632
|
+
name: "Intel",
|
|
3633
|
+
decimals: 8,
|
|
3634
|
+
address: "0x0000000000000000000000000000000000a605dc",
|
|
3635
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3636
|
+
hubAsset: "0xb4Fe614a0566e64A0352645485BB4EbCaf8F3a9E",
|
|
3637
|
+
vault: SodaTokens.INTC.address
|
|
3638
|
+
},
|
|
3639
|
+
BABA: {
|
|
3640
|
+
symbol: "BABA",
|
|
3641
|
+
isRwa: true,
|
|
3642
|
+
name: "Alibaba",
|
|
3643
|
+
decimals: 8,
|
|
3644
|
+
address: "0x0000000000000000000000000000000000a605dd",
|
|
3645
|
+
chainKey: ChainKeys.HEDERA_MAINNET,
|
|
3646
|
+
hubAsset: "0x5e69df859F7c2b170E5fdAdbD59d06C2CD287753",
|
|
3647
|
+
vault: SodaTokens.BABA.address
|
|
3307
3648
|
}
|
|
3308
3649
|
};
|
|
3309
3650
|
var robinhoodSupportedTokens = {
|
|
@@ -3477,6 +3818,116 @@ var robinhoodSupportedTokens = {
|
|
|
3477
3818
|
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3478
3819
|
hubAsset: "0x17348849806c8b1b5d1d3abbcb527d05d21d09d5",
|
|
3479
3820
|
vault: SodaTokens.SLV.address
|
|
3821
|
+
},
|
|
3822
|
+
GOOGL: {
|
|
3823
|
+
symbol: "GOOGL",
|
|
3824
|
+
isRwa: true,
|
|
3825
|
+
name: "Alphabet Class A",
|
|
3826
|
+
decimals: 18,
|
|
3827
|
+
address: "0x2e0847E8910a9732eB3fb1bb4b70a580ADAD4FE3",
|
|
3828
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3829
|
+
hubAsset: "0xb99725463347b57cb6b38e3670e79bae68361178",
|
|
3830
|
+
vault: SodaTokens.GOOGL.address
|
|
3831
|
+
},
|
|
3832
|
+
AMZN: {
|
|
3833
|
+
symbol: "AMZN",
|
|
3834
|
+
isRwa: true,
|
|
3835
|
+
name: "Amazon",
|
|
3836
|
+
decimals: 18,
|
|
3837
|
+
address: "0x12f190a9F9d7D37a250758b26824B97CE941bF54",
|
|
3838
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3839
|
+
hubAsset: "0x191b01f7816f927eede6603bae14979a80880f2e",
|
|
3840
|
+
vault: SodaTokens.AMZN.address
|
|
3841
|
+
},
|
|
3842
|
+
MSFT: {
|
|
3843
|
+
symbol: "MSFT",
|
|
3844
|
+
isRwa: true,
|
|
3845
|
+
name: "Microsoft",
|
|
3846
|
+
decimals: 18,
|
|
3847
|
+
address: "0xe93237C50D904957Cf27E7B1133b510C669c2e74",
|
|
3848
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3849
|
+
hubAsset: "0x54cd74d27c647cccc7d151c198a82a8f3371ca35",
|
|
3850
|
+
vault: SodaTokens.MSFT.address
|
|
3851
|
+
},
|
|
3852
|
+
META: {
|
|
3853
|
+
symbol: "META",
|
|
3854
|
+
isRwa: true,
|
|
3855
|
+
name: "Meta",
|
|
3856
|
+
decimals: 18,
|
|
3857
|
+
address: "0xc0D6457C16Cc70d6790Dd43521C899C87ce02f35",
|
|
3858
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3859
|
+
hubAsset: "0xf5661eefaebb0ed9f33c543fa606ad77646eb1f9",
|
|
3860
|
+
vault: SodaTokens.META.address
|
|
3861
|
+
},
|
|
3862
|
+
CRCL: {
|
|
3863
|
+
symbol: "CRCL",
|
|
3864
|
+
isRwa: true,
|
|
3865
|
+
name: "Circle",
|
|
3866
|
+
decimals: 18,
|
|
3867
|
+
address: "0xdF0992E440dD0be65BD8439b609d6D4366bf1CB5",
|
|
3868
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3869
|
+
hubAsset: "0x18f4018af0bf9fc42cbf8c0b458a838bc2dccf43",
|
|
3870
|
+
vault: SodaTokens.CRCL.address
|
|
3871
|
+
},
|
|
3872
|
+
COIN: {
|
|
3873
|
+
symbol: "COIN",
|
|
3874
|
+
isRwa: true,
|
|
3875
|
+
name: "Coinbase",
|
|
3876
|
+
decimals: 18,
|
|
3877
|
+
address: "0x6330D8C3178a418788dF01a47479c0ce7CCF450b",
|
|
3878
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3879
|
+
hubAsset: "0x91789d24454c40c753bdd5bc7ada7bb91848d13c",
|
|
3880
|
+
vault: SodaTokens.COIN.address
|
|
3881
|
+
},
|
|
3882
|
+
PLTR: {
|
|
3883
|
+
symbol: "PLTR",
|
|
3884
|
+
isRwa: true,
|
|
3885
|
+
name: "Palantir",
|
|
3886
|
+
decimals: 18,
|
|
3887
|
+
address: "0x894E1EC2D74FFE5AEF8Dc8A9e84686acCB964F2A",
|
|
3888
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3889
|
+
hubAsset: "0x99864e96d71860e6e5d25887a10da823685af1ee",
|
|
3890
|
+
vault: SodaTokens.PLTR.address
|
|
3891
|
+
},
|
|
3892
|
+
TSM: {
|
|
3893
|
+
symbol: "TSM",
|
|
3894
|
+
isRwa: true,
|
|
3895
|
+
name: "Taiwan Semiconductor",
|
|
3896
|
+
decimals: 18,
|
|
3897
|
+
address: "0x58FfE4a942d3885bAa22D7520691F611EF09e7AA",
|
|
3898
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3899
|
+
hubAsset: "0x5912b35ed196b129f4ad36ffd8717f2913df09bf",
|
|
3900
|
+
vault: SodaTokens.TSM.address
|
|
3901
|
+
},
|
|
3902
|
+
AMD: {
|
|
3903
|
+
symbol: "AMD",
|
|
3904
|
+
isRwa: true,
|
|
3905
|
+
name: "AMD",
|
|
3906
|
+
decimals: 18,
|
|
3907
|
+
address: "0x86923f96303D656E4aa86D9d42D1e57ad2023fdC",
|
|
3908
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3909
|
+
hubAsset: "0x433d44c65f20e4a776aed6c23838739d3155a692",
|
|
3910
|
+
vault: SodaTokens.AMD.address
|
|
3911
|
+
},
|
|
3912
|
+
INTC: {
|
|
3913
|
+
symbol: "INTC",
|
|
3914
|
+
isRwa: true,
|
|
3915
|
+
name: "Intel",
|
|
3916
|
+
decimals: 18,
|
|
3917
|
+
address: "0xc72b96e0E48ecd4DC75E1e45396e26300BC39681",
|
|
3918
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3919
|
+
hubAsset: "0xd20c60e725317c7873964a6b1d345b2507526e59",
|
|
3920
|
+
vault: SodaTokens.INTC.address
|
|
3921
|
+
},
|
|
3922
|
+
BABA: {
|
|
3923
|
+
symbol: "BABA",
|
|
3924
|
+
isRwa: true,
|
|
3925
|
+
name: "Alibaba",
|
|
3926
|
+
decimals: 18,
|
|
3927
|
+
address: "0xad25Ac6C84D497db898fa1E8387bf6Af3532a1c4",
|
|
3928
|
+
chainKey: ChainKeys.ROBINHOOD_MAINNET,
|
|
3929
|
+
hubAsset: "0xf721a074bd9fc05ba1f7cb432149a74acfb49d73",
|
|
3930
|
+
vault: SodaTokens.BABA.address
|
|
3480
3931
|
}
|
|
3481
3932
|
};
|
|
3482
3933
|
var stacksSupportedTokens = {
|
|
@@ -4315,6 +4766,61 @@ var spokeChainConfig = {
|
|
|
4315
4766
|
assetCode: "SLV",
|
|
4316
4767
|
contractId: "CBY3U32O5T2B555HNJLX6C6HW3O2FLRSJGH472UOOHT6H6ZMGMSSZTLW",
|
|
4317
4768
|
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
assetCode: "GOOGL",
|
|
4772
|
+
contractId: "CCZLQHO22HLQARS26KNSJ4DU3FCFG45VG6RZQOQDQ4MHTSUVGRX57VWD",
|
|
4773
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4774
|
+
},
|
|
4775
|
+
{
|
|
4776
|
+
assetCode: "AMZN",
|
|
4777
|
+
contractId: "CBN6JFMCVKXOIRRERGPH7CGY7RIIHGRLVSFJCD3KBMYSUEZAQR3MJ7TF",
|
|
4778
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4779
|
+
},
|
|
4780
|
+
{
|
|
4781
|
+
assetCode: "MSFT",
|
|
4782
|
+
contractId: "CA53FXC2RF3BNIGLCPE3PNS3SZ2AONVRKH46AIHPEJOA54LGI2DYSOAD",
|
|
4783
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4784
|
+
},
|
|
4785
|
+
{
|
|
4786
|
+
assetCode: "META",
|
|
4787
|
+
contractId: "CA4AXIRO72PC566XUIYVN2365347I7TVGYULXW7QDVCIXBOEFFRXGP67",
|
|
4788
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4789
|
+
},
|
|
4790
|
+
{
|
|
4791
|
+
assetCode: "CRCL",
|
|
4792
|
+
contractId: "CDMRGHCY23UVTFYYW6U2NBYGME2VVPDO6OJXLZMM7FNGVFX3V42SAA4C",
|
|
4793
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4794
|
+
},
|
|
4795
|
+
{
|
|
4796
|
+
assetCode: "COIN",
|
|
4797
|
+
contractId: "CAKCNNQFIYAQBU7RXWPW3ZH4IWDXGMXUB6WTGCEZSI2EZ6WSTCCCEFHO",
|
|
4798
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4799
|
+
},
|
|
4800
|
+
{
|
|
4801
|
+
assetCode: "PLTR",
|
|
4802
|
+
contractId: "CC3EVVVQAB2BZFAJHPZWVRANTVVS37OJXNJKR2DVPAMG5FOYRPIIGCEV",
|
|
4803
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4804
|
+
},
|
|
4805
|
+
{
|
|
4806
|
+
assetCode: "TSM",
|
|
4807
|
+
contractId: "CBZFBO44J4RSRZZ7PT7BHLLID6L7C4HL77YLVFCNIIXZQKVLNL6VEAD6",
|
|
4808
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4809
|
+
},
|
|
4810
|
+
{
|
|
4811
|
+
assetCode: "AMD",
|
|
4812
|
+
contractId: "CCIE4OXPJUPLNRLGAENNSDEZTQUXTXKAPU322Z3HMATZSR2S2DAAGYQD",
|
|
4813
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4814
|
+
},
|
|
4815
|
+
{
|
|
4816
|
+
assetCode: "INTC",
|
|
4817
|
+
contractId: "CBD7GPTTHNFWBX7CYOM7O3N2TCZIAYT6FT4LCAXKX4JCZ3ZJL2IF7E4B",
|
|
4818
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4819
|
+
},
|
|
4820
|
+
{
|
|
4821
|
+
assetCode: "BABA",
|
|
4822
|
+
contractId: "CDARDTMGSEXTYJDSKDEAA52DCYX3OZEP7SOLSF5CT3QSSAGBETWH7LO3",
|
|
4823
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
4318
4824
|
}
|
|
4319
4825
|
],
|
|
4320
4826
|
supportedTokens: stellarSupportedTokens,
|
|
@@ -5011,7 +5517,18 @@ var swapSupportedTokens = {
|
|
|
5011
5517
|
SodaTokens.QQQ,
|
|
5012
5518
|
SodaTokens.SGOV,
|
|
5013
5519
|
SodaTokens.USO,
|
|
5014
|
-
SodaTokens.SLV
|
|
5520
|
+
SodaTokens.SLV,
|
|
5521
|
+
SodaTokens.GOOGL,
|
|
5522
|
+
SodaTokens.AMZN,
|
|
5523
|
+
SodaTokens.MSFT,
|
|
5524
|
+
SodaTokens.META,
|
|
5525
|
+
SodaTokens.CRCL,
|
|
5526
|
+
SodaTokens.COIN,
|
|
5527
|
+
SodaTokens.PLTR,
|
|
5528
|
+
SodaTokens.TSM,
|
|
5529
|
+
SodaTokens.AMD,
|
|
5530
|
+
SodaTokens.INTC,
|
|
5531
|
+
SodaTokens.BABA
|
|
5015
5532
|
],
|
|
5016
5533
|
[ChainKeys.AVALANCHE_MAINNET]: [
|
|
5017
5534
|
spokeChainConfig[ChainKeys.AVALANCHE_MAINNET].supportedTokens.AVAX,
|
|
@@ -5186,7 +5703,18 @@ var swapSupportedTokens = {
|
|
|
5186
5703
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.QQQ,
|
|
5187
5704
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SGOV,
|
|
5188
5705
|
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.USO,
|
|
5189
|
-
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SLV
|
|
5706
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SLV,
|
|
5707
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.GOOGL,
|
|
5708
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.AMZN,
|
|
5709
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.MSFT,
|
|
5710
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.META,
|
|
5711
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.CRCL,
|
|
5712
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.COIN,
|
|
5713
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.PLTR,
|
|
5714
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.TSM,
|
|
5715
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.AMD,
|
|
5716
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.INTC,
|
|
5717
|
+
spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.BABA
|
|
5190
5718
|
],
|
|
5191
5719
|
[ChainKeys.SUI_MAINNET]: [
|
|
5192
5720
|
spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.SUI,
|
|
@@ -5306,7 +5834,18 @@ var swapSupportedTokens = {
|
|
|
5306
5834
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.QQQ,
|
|
5307
5835
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SGOV,
|
|
5308
5836
|
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.USO,
|
|
5309
|
-
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SLV
|
|
5837
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.SLV,
|
|
5838
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.GOOGL,
|
|
5839
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.AMZN,
|
|
5840
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.MSFT,
|
|
5841
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.META,
|
|
5842
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.CRCL,
|
|
5843
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.COIN,
|
|
5844
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.PLTR,
|
|
5845
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.TSM,
|
|
5846
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.AMD,
|
|
5847
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.INTC,
|
|
5848
|
+
spokeChainConfig[ChainKeys.HEDERA_MAINNET].supportedTokens.BABA
|
|
5310
5849
|
],
|
|
5311
5850
|
[ChainKeys.ROBINHOOD_MAINNET]: [
|
|
5312
5851
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.ETH,
|
|
@@ -5327,7 +5866,18 @@ var swapSupportedTokens = {
|
|
|
5327
5866
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.QQQ,
|
|
5328
5867
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SGOV,
|
|
5329
5868
|
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.USO,
|
|
5330
|
-
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SLV
|
|
5869
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.SLV,
|
|
5870
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.GOOGL,
|
|
5871
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.AMZN,
|
|
5872
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.MSFT,
|
|
5873
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.META,
|
|
5874
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.CRCL,
|
|
5875
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.COIN,
|
|
5876
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.PLTR,
|
|
5877
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.TSM,
|
|
5878
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.AMD,
|
|
5879
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.INTC,
|
|
5880
|
+
spokeChainConfig[ChainKeys.ROBINHOOD_MAINNET].supportedTokens.BABA
|
|
5331
5881
|
]
|
|
5332
5882
|
};
|
|
5333
5883
|
var stagingSwapSupportedTokens = {
|
|
@@ -5672,7 +6222,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
|
|
|
5672
6222
|
}
|
|
5673
6223
|
|
|
5674
6224
|
// ../types/dist/index.js
|
|
5675
|
-
var CONFIG_VERSION =
|
|
6225
|
+
var CONFIG_VERSION = 2020007;
|
|
5676
6226
|
var RC_STABLE = 99;
|
|
5677
6227
|
var MIN_CONFIG_VERSION = 1e6;
|
|
5678
6228
|
var MAX_CONFIG_VERSION = 99999999;
|
|
@@ -5925,12 +6475,12 @@ function canonicalizeBitcoinAddress(address$1) {
|
|
|
5925
6475
|
}
|
|
5926
6476
|
}
|
|
5927
6477
|
function normalizePsbtToBase64(signedPsbt) {
|
|
5928
|
-
const
|
|
5929
|
-
return
|
|
6478
|
+
const isHex3 = /^[0-9a-fA-F]+$/.test(signedPsbt);
|
|
6479
|
+
return isHex3 ? Buffer.from(signedPsbt, "hex").toString("base64") : signedPsbt;
|
|
5930
6480
|
}
|
|
5931
6481
|
function normalizeSignatureToBase64(signature) {
|
|
5932
|
-
const
|
|
5933
|
-
return
|
|
6482
|
+
const isHex3 = /^[0-9a-fA-F]+$/.test(signature);
|
|
6483
|
+
return isHex3 ? Buffer.from(signature, "hex").toString("base64") : signature;
|
|
5934
6484
|
}
|
|
5935
6485
|
function isNativeBitcoinTransfer(config, chainKey, token) {
|
|
5936
6486
|
return isBitcoinChainKeyType(chainKey) && !!token && isNativeBitcoinToken(config.getChainConfig(chainKey), token.address);
|
|
@@ -15746,10 +16296,12 @@ var ConfigService = class {
|
|
|
15746
16296
|
get bridgeUseBackendSubmitTx() {
|
|
15747
16297
|
return this.bridge.useBackendSubmitTx ?? this.sodax.bridgeOptions?.useBackendSubmitTx ?? true;
|
|
15748
16298
|
}
|
|
15749
|
-
//
|
|
15750
|
-
//
|
|
16299
|
+
// Same ON default as the two above, and for the same reason: any backend non-success falls back
|
|
16300
|
+
// to the client-side relay, so the default costs a rejected attempt at worst. No deprecated
|
|
16301
|
+
// second-precedence key here — leverage yield arrived after `swapsOptions` / `bridgeOptions` were
|
|
16302
|
+
// already deprecated, so it never had one.
|
|
15751
16303
|
get leverageYieldUseBackendSubmitTx() {
|
|
15752
|
-
return this.leverageYield.useBackendSubmitTx ??
|
|
16304
|
+
return this.leverageYield.useBackendSubmitTx ?? true;
|
|
15753
16305
|
}
|
|
15754
16306
|
get dex() {
|
|
15755
16307
|
return this.sodax.dex;
|
|
@@ -29056,6 +29608,39 @@ var EvmHubProvider = class {
|
|
|
29056
29608
|
}
|
|
29057
29609
|
};
|
|
29058
29610
|
|
|
29611
|
+
// src/backendApi/detailedStatusRouting.ts
|
|
29612
|
+
var DETAILED_STATUS_NOT_DELIVERED = "relay_not_delivered";
|
|
29613
|
+
function isBackendSubmitTxAbandoned(data) {
|
|
29614
|
+
return data.status === "failed" || Boolean(data.abandonedAt);
|
|
29615
|
+
}
|
|
29616
|
+
async function resolveDeliveredPacket(params) {
|
|
29617
|
+
const { srcChainKey, srcTxHash, relayerApiEndpoint, backendAnswered } = params;
|
|
29618
|
+
const relayChainId = getIntentRelayChainId(srcChainKey);
|
|
29619
|
+
const packets = await getTransactionPackets(
|
|
29620
|
+
{ action: "get_transaction_packets", params: { chain_id: relayChainId.toString(), tx_hash: srcTxHash } },
|
|
29621
|
+
relayerApiEndpoint,
|
|
29622
|
+
RELAY_REQUEST_TIMEOUT_MS
|
|
29623
|
+
);
|
|
29624
|
+
if (!packets.ok) {
|
|
29625
|
+
const notIndexed = packets.error instanceof HttpRelayError && packets.error.status === 404;
|
|
29626
|
+
return { ok: false, cause: packets.error, budgetable: notIndexed && backendAnswered };
|
|
29627
|
+
}
|
|
29628
|
+
if (!packets.value?.success || !Array.isArray(packets.value.data)) {
|
|
29629
|
+
return { ok: false, cause: new Error("relay returned no usable transaction packets"), budgetable: false };
|
|
29630
|
+
}
|
|
29631
|
+
const delivered = packets.value.data.find(
|
|
29632
|
+
(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
|
|
29633
|
+
);
|
|
29634
|
+
if (!delivered) {
|
|
29635
|
+
return {
|
|
29636
|
+
ok: false,
|
|
29637
|
+
cause: new Error("relay has not delivered a packet for this source tx yet"),
|
|
29638
|
+
budgetable: backendAnswered
|
|
29639
|
+
};
|
|
29640
|
+
}
|
|
29641
|
+
return { ok: true, packet: delivered };
|
|
29642
|
+
}
|
|
29643
|
+
|
|
29059
29644
|
// src/backendApi/api-utils.ts
|
|
29060
29645
|
var API_KEY_HEADER = "x-api-key";
|
|
29061
29646
|
function apiKeyHeader(apiKey) {
|
|
@@ -29680,12 +30265,6 @@ function estimateSwapSpeedTier({ srcToken, dstToken }, isSodaAssetRelated) {
|
|
|
29680
30265
|
return { tier: secondsToTier(estimatedSeconds), estimatedSeconds };
|
|
29681
30266
|
}
|
|
29682
30267
|
|
|
29683
|
-
// src/swap/detailedStatus.ts
|
|
29684
|
-
var DETAILED_STATUS_NOT_DELIVERED = "relay_not_delivered";
|
|
29685
|
-
function isBackendSubmitTxAbandoned(data) {
|
|
29686
|
-
return data.status === "failed" || Boolean(data.abandonedAt);
|
|
29687
|
-
}
|
|
29688
|
-
|
|
29689
30268
|
// src/swap/errors.ts
|
|
29690
30269
|
var swapInvariant = createInvariant("swap");
|
|
29691
30270
|
var POST_EXECUTION_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
@@ -29889,6 +30468,14 @@ var SwapService = class {
|
|
|
29889
30468
|
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
29890
30469
|
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
29891
30470
|
}
|
|
30471
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
30472
|
+
return {
|
|
30473
|
+
ok: false,
|
|
30474
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
30475
|
+
status: record.error.context?.status
|
|
30476
|
+
})
|
|
30477
|
+
};
|
|
30478
|
+
}
|
|
29892
30479
|
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
29893
30480
|
const dstTxHash = await this.resolveHubTxHash(params, backendAnswered);
|
|
29894
30481
|
if (!dstTxHash.ok) return dstTxHash;
|
|
@@ -29910,48 +30497,23 @@ var SwapService = class {
|
|
|
29910
30497
|
* is simply "no hash yet".
|
|
29911
30498
|
*/
|
|
29912
30499
|
async resolveHubTxHash(key, backendAnswered) {
|
|
29913
|
-
const missReason = backendAnswered ? DETAILED_STATUS_NOT_DELIVERED : void 0;
|
|
29914
30500
|
let hubTxHash = key.srcTxHash;
|
|
29915
30501
|
if (!isHubChainKeyType(key.srcChainKey)) {
|
|
29916
|
-
const
|
|
29917
|
-
|
|
29918
|
-
|
|
29919
|
-
|
|
29920
|
-
|
|
29921
|
-
|
|
29922
|
-
|
|
29923
|
-
RELAY_REQUEST_TIMEOUT_MS
|
|
29924
|
-
);
|
|
29925
|
-
if (!packets.ok) {
|
|
29926
|
-
const notIndexed = packets.error instanceof HttpRelayError && packets.error.status === 404;
|
|
29927
|
-
return {
|
|
29928
|
-
ok: false,
|
|
29929
|
-
error: this.detailedStatusLookupFailed(packets.error, key.srcChainKey, notIndexed ? missReason : void 0)
|
|
29930
|
-
};
|
|
29931
|
-
}
|
|
29932
|
-
if (!packets.value?.success || !Array.isArray(packets.value.data)) {
|
|
29933
|
-
return {
|
|
29934
|
-
ok: false,
|
|
29935
|
-
error: this.detailedStatusLookupFailed(
|
|
29936
|
-
new Error("relay returned no usable transaction packets"),
|
|
29937
|
-
key.srcChainKey
|
|
29938
|
-
)
|
|
29939
|
-
};
|
|
29940
|
-
}
|
|
29941
|
-
const delivered = packets.value.data.find(
|
|
29942
|
-
(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
|
|
29943
|
-
);
|
|
29944
|
-
if (!delivered) {
|
|
30502
|
+
const delivered = await resolveDeliveredPacket({
|
|
30503
|
+
srcChainKey: key.srcChainKey,
|
|
30504
|
+
srcTxHash: key.srcTxHash,
|
|
30505
|
+
relayerApiEndpoint: this.relayerApiEndpoint,
|
|
30506
|
+
backendAnswered
|
|
30507
|
+
});
|
|
30508
|
+
if (!delivered.ok) {
|
|
29945
30509
|
return {
|
|
29946
30510
|
ok: false,
|
|
29947
|
-
error: this.detailedStatusLookupFailed(
|
|
29948
|
-
|
|
29949
|
-
|
|
29950
|
-
missReason
|
|
29951
|
-
)
|
|
30511
|
+
error: this.detailedStatusLookupFailed(delivered.cause, key.srcChainKey, {
|
|
30512
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
30513
|
+
})
|
|
29952
30514
|
};
|
|
29953
30515
|
}
|
|
29954
|
-
hubTxHash = delivered.dst_tx_hash;
|
|
30516
|
+
hubTxHash = delivered.packet.dst_tx_hash;
|
|
29955
30517
|
}
|
|
29956
30518
|
if (isHex(hubTxHash)) return { ok: true, value: hubTxHash };
|
|
29957
30519
|
return {
|
|
@@ -29965,10 +30527,12 @@ var SwapService = class {
|
|
|
29965
30527
|
/**
|
|
29966
30528
|
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound
|
|
29967
30529
|
* with a retry budget. Leaving it off marks a dependency that is failing right now, which a
|
|
29968
|
-
* caller should keep retrying rather than give up on.
|
|
30530
|
+
* caller should keep retrying rather than give up on. `status` is lifted for a rejected key so
|
|
30531
|
+
* `isAuthFailure` recognises the wrapped error; it reads `context.status` and does not walk the
|
|
30532
|
+
* cause chain.
|
|
29969
30533
|
*/
|
|
29970
|
-
detailedStatusLookupFailed(cause, srcChainKey,
|
|
29971
|
-
return lookupFailed("swap", "getDetailedStatus", cause, { srcChainKey, action: "swap",
|
|
30534
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
30535
|
+
return lookupFailed("swap", "getDetailedStatus", cause, { srcChainKey, action: "swap", ...extra });
|
|
29972
30536
|
}
|
|
29973
30537
|
/**
|
|
29974
30538
|
* Notifies the solver API that an intent has been registered on the hub chain, triggering
|
|
@@ -35579,6 +36143,80 @@ var BridgeService = class {
|
|
|
35579
36143
|
}
|
|
35580
36144
|
return encodeContractCalls(calls);
|
|
35581
36145
|
}
|
|
36146
|
+
/**
|
|
36147
|
+
* Answers "what is the status of this bridge?" from the **source-chain** tx — the one identifier a
|
|
36148
|
+
* caller always holds. It does not define a new status: it routes to whichever of the two existing
|
|
36149
|
+
* sources can answer, and returns that source's payload unmodified.
|
|
36150
|
+
*
|
|
36151
|
+
* `sodax.api.bridge.getSubmitTxStatus` cannot answer for every bridge. Sometimes there is no
|
|
36152
|
+
* record — `useBackendSubmitTx: false`, or the submit itself never landed. More often the record
|
|
36153
|
+
* exists but is stale: the backend path POSTs the tx first and only falls back to the client-side
|
|
36154
|
+
* relay once that stalls, so a fallback-completed bridge leaves behind whatever state the backend
|
|
36155
|
+
* last reached, including a record it abandoned outright. Neither shape reflects what happened.
|
|
36156
|
+
*
|
|
36157
|
+
* 1. Read the backend record; return it while it is still in play.
|
|
36158
|
+
* 2. Otherwise return the delivered relay packet, which is terminal by construction.
|
|
36159
|
+
*
|
|
36160
|
+
* A rejected API key is the one failure that does **not** fall through to step 2: the status route
|
|
36161
|
+
* is key-guarded, so degrading would bury a 401/403 behind a relay error and leave a poller
|
|
36162
|
+
* retrying a request only a corrected key can satisfy. It surfaces with `context.status` instead,
|
|
36163
|
+
* which is what `isAuthFailure` reads.
|
|
36164
|
+
*
|
|
36165
|
+
* A point-in-time read; poll it yourself, or use dapp-kit's `useBridgeDetailedStatus`.
|
|
36166
|
+
*
|
|
36167
|
+
* @param params - `srcChainKey` and `srcTxHash` of the source-chain bridge transaction.
|
|
36168
|
+
* @param config - Optional per-request override for the backend read (e.g. a per-action API key).
|
|
36169
|
+
* The relay leg is unauthenticated and takes none.
|
|
36170
|
+
* @returns A `Result` containing a {@link DetailedBridgeStatus}. Fails with `LOOKUP_FAILED` when no
|
|
36171
|
+
* source can answer yet — usually the relay has not delivered the packet. Branch on
|
|
36172
|
+
* `error.context.reason`: `DETAILED_STATUS_NOT_DELIVERED` is the ambiguous miss a caller should
|
|
36173
|
+
* bound with a retry budget; anything else is a dependency failing right now, so keep retrying.
|
|
36174
|
+
*/
|
|
36175
|
+
async getDetailedStatus(params, config) {
|
|
36176
|
+
try {
|
|
36177
|
+
const record = await this.backendApi.bridge.getSubmitTxStatus(
|
|
36178
|
+
{ txHash: params.srcTxHash, srcChainKey: params.srcChainKey },
|
|
36179
|
+
config
|
|
36180
|
+
);
|
|
36181
|
+
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
36182
|
+
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
36183
|
+
}
|
|
36184
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
36185
|
+
return {
|
|
36186
|
+
ok: false,
|
|
36187
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
36188
|
+
status: record.error.context?.status
|
|
36189
|
+
})
|
|
36190
|
+
};
|
|
36191
|
+
}
|
|
36192
|
+
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
36193
|
+
const delivered = await resolveDeliveredPacket({
|
|
36194
|
+
srcChainKey: params.srcChainKey,
|
|
36195
|
+
srcTxHash: params.srcTxHash,
|
|
36196
|
+
relayerApiEndpoint: this.config.relay.relayerApiEndpoint,
|
|
36197
|
+
backendAnswered
|
|
36198
|
+
});
|
|
36199
|
+
if (!delivered.ok) {
|
|
36200
|
+
return {
|
|
36201
|
+
ok: false,
|
|
36202
|
+
error: this.detailedStatusLookupFailed(delivered.cause, params.srcChainKey, {
|
|
36203
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
36204
|
+
})
|
|
36205
|
+
};
|
|
36206
|
+
}
|
|
36207
|
+
return { ok: true, value: { source: "relay", data: delivered.packet } };
|
|
36208
|
+
} catch (error) {
|
|
36209
|
+
return { ok: false, error: this.detailedStatusLookupFailed(error, params.srcChainKey) };
|
|
36210
|
+
}
|
|
36211
|
+
}
|
|
36212
|
+
/**
|
|
36213
|
+
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound with
|
|
36214
|
+
* a retry budget. `status` is lifted for a rejected key so `isAuthFailure` recognises the wrapped
|
|
36215
|
+
* error; it reads `context.status` and does not walk the cause chain.
|
|
36216
|
+
*/
|
|
36217
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
36218
|
+
return lookupFailed("bridge", "getDetailedStatus", cause, { srcChainKey, action: "bridge", ...extra });
|
|
36219
|
+
}
|
|
35582
36220
|
/**
|
|
35583
36221
|
* Returns the maximum amount that can currently be bridged between two tokens,
|
|
35584
36222
|
* taking into account both deposit capacity on the source side and withdrawal liquidity
|
|
@@ -43803,6 +44441,8 @@ var leveragePositionAbi = parseAbi([
|
|
|
43803
44441
|
"function settle()"
|
|
43804
44442
|
]);
|
|
43805
44443
|
var INTENT_DEADLINE_BUFFER_SECONDS = 5 * 60;
|
|
44444
|
+
var RECONCILE_TIMEOUT_MS2 = 5e3;
|
|
44445
|
+
var DETAILED_STATUS_SOLVER_TIMEOUT_MS2 = 5e3;
|
|
43806
44446
|
var BITCOIN_UNSUPPORTED_MESSAGE = "Bitcoin is not a supported source chain for leverage positions; use a supported spoke or the hub";
|
|
43807
44447
|
var ANY_SOLVER_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
43808
44448
|
var MAX_WITHDRAW_DUST_BUFFER = 1000n;
|
|
@@ -43840,9 +44480,9 @@ var LeverageYieldService = class {
|
|
|
43840
44480
|
spoke;
|
|
43841
44481
|
backendApi;
|
|
43842
44482
|
/**
|
|
43843
|
-
* Effective backend submit-tx flow (`leverageYield.useBackendSubmitTx`, default
|
|
43844
|
-
* `ConfigService`, like `config.leverageYieldPartnerFee`, so the config
|
|
43845
|
-
* never disagree.
|
|
44483
|
+
* Effective backend submit-tx flow (`leverageYield.useBackendSubmitTx`, default ON; opt out with
|
|
44484
|
+
* `false`). Read live off `ConfigService`, like `config.leverageYieldPartnerFee`, so the config
|
|
44485
|
+
* object and the behavior can never disagree.
|
|
43846
44486
|
*/
|
|
43847
44487
|
get useBackendSubmitTx() {
|
|
43848
44488
|
return this.config.leverageYieldUseBackendSubmitTx;
|
|
@@ -44334,10 +44974,11 @@ var LeverageYieldService = class {
|
|
|
44334
44974
|
);
|
|
44335
44975
|
}
|
|
44336
44976
|
/**
|
|
44337
|
-
* Client-side vault-swap completion (the
|
|
44977
|
+
* Client-side vault-swap completion (the opt-out path, and the fallback): verify the broadcast
|
|
44978
|
+
* intent tx landed,
|
|
44338
44979
|
* relay it to the hub (Sonic) — or use it directly when the source IS the hub — then notify the
|
|
44339
44980
|
* solver via {@link LeverageYieldService.notifySolver} and build the {@link VaultSwapResponse}.
|
|
44340
|
-
* Extracted from `vaultSwap()` so the
|
|
44981
|
+
* Extracted from `vaultSwap()` so the default backend 2-step path ({@link LeverageYieldService.submitTx})
|
|
44341
44982
|
* can fall back to it on any non-success. Leverage-yield copy of `SwapService.fallbackSwapSteps`.
|
|
44342
44983
|
*/
|
|
44343
44984
|
async fallbackVaultSwapSteps(_params, created, timeoutMs) {
|
|
@@ -44395,7 +45036,8 @@ var LeverageYieldService = class {
|
|
|
44395
45036
|
};
|
|
44396
45037
|
}
|
|
44397
45038
|
/**
|
|
44398
|
-
* Backend 2-step vault-swap path (opt
|
|
45039
|
+
* Backend 2-step vault-swap path (the default; opt out with `leverageYield.useBackendSubmitTx:
|
|
45040
|
+
* false`): hand the
|
|
44399
45041
|
* broadcast intent tx to the leverage-yield API (`POST /leverage-yield/submit-tx`); the backend
|
|
44400
45042
|
* relays + post-executes server-side. Polls `getSubmitTxStatus` until `solved`, then reconstructs
|
|
44401
45043
|
* the same {@link VaultSwapResponse} the client-side path returns.
|
|
@@ -44434,6 +45076,10 @@ var LeverageYieldService = class {
|
|
|
44434
45076
|
operation: _params.hubWalletSwap ? "withdraw" : "deposit"
|
|
44435
45077
|
},
|
|
44436
45078
|
statusQuery: { txHash: spokeTxHash, srcChainKey },
|
|
45079
|
+
// Per-action key wins over the instance one for both legs of the attempt — the submit POST
|
|
45080
|
+
// and its status polls. Undefined leaves the configured key in place; the same per-action
|
|
45081
|
+
// override `extras.partnerFee` already has, travelling per call.
|
|
45082
|
+
overrideConfig: { apiKey: _params.extras?.apiKey },
|
|
44437
45083
|
// A vault deposit/withdraw IS a solver swap, so terminal success is `solved` — not bridge's
|
|
44438
45084
|
// `executed`.
|
|
44439
45085
|
terminalStatus: "solved",
|
|
@@ -44517,22 +45163,22 @@ var LeverageYieldService = class {
|
|
|
44517
45163
|
* A `NOT_FOUND` status usually means the notification never landed rather than that the intent
|
|
44518
45164
|
* does not exist — an intent created on the hub is invisible to the solver until it is told.
|
|
44519
45165
|
*
|
|
45166
|
+
* Reports the solver verbatim. It does NOT reconcile a `NOT_FOUND` against the backend's durable
|
|
45167
|
+
* record the way {@link LeverageYieldService.getDetailedStatus} does — a restarted solver answers
|
|
45168
|
+
* `NOT_FOUND` for intents it already filled, and that read resolves it. Keeping this one
|
|
45169
|
+
* unreconciled is deliberate: it has shipped with this contract, and folding the reconcile in
|
|
45170
|
+
* would turn a `NOT_FOUND` behind an unreadable backend into an error for every existing caller.
|
|
45171
|
+
* Prefer `getDetailedStatus` when you hold the source tx hash.
|
|
45172
|
+
*
|
|
44520
45173
|
* @param request - `{ intent_tx_hash }` — the hub-chain (Sonic) tx hash the intent was
|
|
44521
45174
|
* registered in. For a position that is the tx that called the factory or the position.
|
|
44522
45175
|
*/
|
|
44523
45176
|
async getIntentStatus(request) {
|
|
44524
45177
|
try {
|
|
44525
|
-
const result = await
|
|
44526
|
-
request,
|
|
44527
|
-
this.config.solver,
|
|
44528
|
-
this.config.logger,
|
|
44529
|
-
void 0,
|
|
44530
|
-
this.config.apiKey
|
|
44531
|
-
);
|
|
45178
|
+
const result = await this.solverStatus(request);
|
|
44532
45179
|
if (result.ok) return result;
|
|
44533
45180
|
const detail = result.error?.detail ?? {
|
|
44534
|
-
code:
|
|
44535
|
-
// SolverIntentErrorCode.UNKNOWN
|
|
45181
|
+
code: SolverIntentErrorCode.UNKNOWN,
|
|
44536
45182
|
message: "Solver returned malformed error response"
|
|
44537
45183
|
};
|
|
44538
45184
|
return {
|
|
@@ -44552,6 +45198,164 @@ var LeverageYieldService = class {
|
|
|
44552
45198
|
return { ok: false, error: executionFailed("leverageYield", error, { phase: "lookup" }) };
|
|
44553
45199
|
}
|
|
44554
45200
|
}
|
|
45201
|
+
/**
|
|
45202
|
+
* The raw solver read, in the solver's own vocabulary. Both public status surfaces start here; the
|
|
45203
|
+
* api key is the 5th argument, and leaving it out let a keyed partner notify and then fail to poll.
|
|
45204
|
+
*/
|
|
45205
|
+
async solverStatus(request, timeoutMs, apiKey) {
|
|
45206
|
+
return SolverApiService.getStatus(
|
|
45207
|
+
request,
|
|
45208
|
+
this.config.solver,
|
|
45209
|
+
this.config.logger,
|
|
45210
|
+
timeoutMs,
|
|
45211
|
+
apiKey || this.config.apiKey
|
|
45212
|
+
);
|
|
45213
|
+
}
|
|
45214
|
+
/**
|
|
45215
|
+
* {@link LeverageYieldService.solverStatus} plus the durable-record reconcile, for
|
|
45216
|
+
* {@link LeverageYieldService.getDetailedStatus}. Deliberately not shared with
|
|
45217
|
+
* {@link LeverageYieldService.getIntentStatus}: the reconcile turns a `NOT_FOUND` behind an
|
|
45218
|
+
* unreadable backend into an error, which is right for a polled read that would otherwise spend a
|
|
45219
|
+
* budget on an unverified miss, and wrong to impose on a surface that already ships without it.
|
|
45220
|
+
*
|
|
45221
|
+
* `timeoutMs` bounds the solver request alone. The reconcile carries its own
|
|
45222
|
+
* {@link RECONCILE_TIMEOUT_MS}, so a bounded call can cost both.
|
|
45223
|
+
*/
|
|
45224
|
+
async resolveSolverStatus(request, timeoutMs, apiKey) {
|
|
45225
|
+
const solverResult = await this.solverStatus(request, timeoutMs, apiKey);
|
|
45226
|
+
const forgotten = !solverResult.ok || solverResult.value.status === SolverIntentStatusCode.NOT_FOUND;
|
|
45227
|
+
if (!forgotten) return solverResult;
|
|
45228
|
+
const timeout = Math.min(RECONCILE_TIMEOUT_MS2, this.backendApi.requestTimeoutMs);
|
|
45229
|
+
const intent = await this.backendApi.getIntentByTxHash(request.intent_tx_hash, { timeout, apiKey });
|
|
45230
|
+
const settled = intent.ok ? intent.value.events.filter(isFillEvent).find((fill) => fill.intentState.remainingInput === "0") : void 0;
|
|
45231
|
+
if (settled) return { ok: true, value: { status: SolverIntentStatusCode.SOLVED, fill_tx_hash: settled.txHash } };
|
|
45232
|
+
const backendAnswered = intent.ok || isSodaxError(intent.error) && intent.error.context?.status === 404;
|
|
45233
|
+
if (solverResult.ok && !backendAnswered) {
|
|
45234
|
+
return {
|
|
45235
|
+
ok: false,
|
|
45236
|
+
error: {
|
|
45237
|
+
detail: {
|
|
45238
|
+
code: SolverIntentErrorCode.UNKNOWN,
|
|
45239
|
+
message: "solver reported NOT_FOUND and the durable intent record could not be read to verify it"
|
|
45240
|
+
}
|
|
45241
|
+
}
|
|
45242
|
+
};
|
|
45243
|
+
}
|
|
45244
|
+
return solverResult;
|
|
45245
|
+
}
|
|
45246
|
+
/**
|
|
45247
|
+
* Reads a vault swap's status from its source-chain transaction — the identifier a caller always
|
|
45248
|
+
* holds after `vaultSwap()`.
|
|
45249
|
+
*
|
|
45250
|
+
* **Routes; does not translate.** Returns the backend submit-tx record while it is in play,
|
|
45251
|
+
* otherwise the solver's answer via the hub tx hash resolved from the relay packet. The result is
|
|
45252
|
+
* tagged with `source` (discriminate on it) and carries that source's payload unmodified.
|
|
45253
|
+
*
|
|
45254
|
+
* `sodax.api.leverageYield.getSubmitTxStatus` cannot answer for every vault swap. Sometimes there
|
|
45255
|
+
* is no record — `useBackendSubmitTx: false`, or the submit was rejected. More often the record
|
|
45256
|
+
* exists but is stale: the backend path POSTs first and falls back to the client-side relay once
|
|
45257
|
+
* that stalls, so a fallback-completed vault swap leaves behind whatever state the backend last
|
|
45258
|
+
* reached, including a record it abandoned outright.
|
|
45259
|
+
*
|
|
45260
|
+
* **Any** unusable backend response routes to the solver — a 404, a transport or server error, or
|
|
45261
|
+
* a record the backend gave up on. A rejected API key is the exception: it is not a source with
|
|
45262
|
+
* nothing to say, it is a configuration problem only a corrected key resolves, so routing it on
|
|
45263
|
+
* would bury it behind a relay or solver error and leave a poller retrying a request that cannot
|
|
45264
|
+
* succeed. The same rule the swap and bridge siblings apply. It holds here even though
|
|
45265
|
+
* `GET /leverage-yield/submit-tx/status` declares no scope of its own: whether a key is checked
|
|
45266
|
+
* is a per-deployment setting, so this must not assume the read is unauthenticated.
|
|
45267
|
+
*
|
|
45268
|
+
* A point-in-time read; poll it yourself, or use dapp-kit's `useLeverageYieldDetailedStatus`.
|
|
45269
|
+
*
|
|
45270
|
+
* @param params - `srcChainKey` and `srcTxHash` of the source-chain vault-swap transaction.
|
|
45271
|
+
* @param config - Optional per-request override. Its `apiKey` reaches every keyed leg — the
|
|
45272
|
+
* submit-tx record read, the solver read, and the durable-intent read a solver `NOT_FOUND` falls
|
|
45273
|
+
* back to — so one override keys the whole call. The relay leg is unauthenticated and takes none.
|
|
45274
|
+
* @returns A `Result` containing a {@link DetailedLeverageYieldStatus}. Fails with `LOOKUP_FAILED`
|
|
45275
|
+
* when no source can answer yet. Branch on `error.context.reason`:
|
|
45276
|
+
* `DETAILED_STATUS_NOT_DELIVERED` is the ambiguous miss a caller should bound with a retry
|
|
45277
|
+
* budget; anything else is a dependency failing right now, so keep retrying.
|
|
45278
|
+
*/
|
|
45279
|
+
async getDetailedStatus(params, config) {
|
|
45280
|
+
try {
|
|
45281
|
+
const record = await this.backendApi.leverageYield.getSubmitTxStatus(
|
|
45282
|
+
{ txHash: params.srcTxHash, srcChainKey: params.srcChainKey },
|
|
45283
|
+
config
|
|
45284
|
+
);
|
|
45285
|
+
if (record.ok && record.value.success && !isBackendSubmitTxAbandoned(record.value.data)) {
|
|
45286
|
+
return { ok: true, value: { source: "backend", data: record.value.data } };
|
|
45287
|
+
}
|
|
45288
|
+
if (!record.ok && isSodaxError(record.error) && isAuthFailure(record.error)) {
|
|
45289
|
+
return {
|
|
45290
|
+
ok: false,
|
|
45291
|
+
error: this.detailedStatusLookupFailed(record.error, params.srcChainKey, {
|
|
45292
|
+
status: record.error.context?.status
|
|
45293
|
+
})
|
|
45294
|
+
};
|
|
45295
|
+
}
|
|
45296
|
+
const backendAnswered = record.ok || isSodaxError(record.error) && record.error.context?.status === 404;
|
|
45297
|
+
const dstTxHash = await this.resolveHubTxHash(params, backendAnswered);
|
|
45298
|
+
if (!dstTxHash.ok) return dstTxHash;
|
|
45299
|
+
const solver = await this.resolveSolverStatus(
|
|
45300
|
+
{ intent_tx_hash: dstTxHash.value },
|
|
45301
|
+
DETAILED_STATUS_SOLVER_TIMEOUT_MS2,
|
|
45302
|
+
config?.apiKey
|
|
45303
|
+
);
|
|
45304
|
+
if (!solver.ok) {
|
|
45305
|
+
return { ok: false, error: this.detailedStatusLookupFailed(solver.error, params.srcChainKey) };
|
|
45306
|
+
}
|
|
45307
|
+
return { ok: true, value: { source: "solver", dstTxHash: dstTxHash.value, data: solver.value } };
|
|
45308
|
+
} catch (error) {
|
|
45309
|
+
return { ok: false, error: this.detailedStatusLookupFailed(error, params.srcChainKey) };
|
|
45310
|
+
}
|
|
45311
|
+
}
|
|
45312
|
+
/**
|
|
45313
|
+
* The hub-chain tx hash the solver is keyed on. A hub-source vault swap has no relay leg — the
|
|
45314
|
+
* source tx *is* the hub tx. Otherwise the delivered relay packet carries it, so an undelivered
|
|
45315
|
+
* packet is simply "no hash yet".
|
|
45316
|
+
*/
|
|
45317
|
+
async resolveHubTxHash(key, backendAnswered) {
|
|
45318
|
+
let hubTxHash = key.srcTxHash;
|
|
45319
|
+
if (!isHubChainKeyType(key.srcChainKey)) {
|
|
45320
|
+
const delivered = await resolveDeliveredPacket({
|
|
45321
|
+
srcChainKey: key.srcChainKey,
|
|
45322
|
+
srcTxHash: key.srcTxHash,
|
|
45323
|
+
relayerApiEndpoint: this.config.relay.relayerApiEndpoint,
|
|
45324
|
+
backendAnswered
|
|
45325
|
+
});
|
|
45326
|
+
if (!delivered.ok) {
|
|
45327
|
+
return {
|
|
45328
|
+
ok: false,
|
|
45329
|
+
error: this.detailedStatusLookupFailed(delivered.cause, key.srcChainKey, {
|
|
45330
|
+
reason: delivered.budgetable ? DETAILED_STATUS_NOT_DELIVERED : void 0
|
|
45331
|
+
})
|
|
45332
|
+
};
|
|
45333
|
+
}
|
|
45334
|
+
hubTxHash = delivered.packet.dst_tx_hash;
|
|
45335
|
+
}
|
|
45336
|
+
if (isHex(hubTxHash)) return { ok: true, value: hubTxHash };
|
|
45337
|
+
return {
|
|
45338
|
+
ok: false,
|
|
45339
|
+
error: this.detailedStatusLookupFailed(
|
|
45340
|
+
new Error(`hub tx hash is not a hex string: ${hubTxHash}`),
|
|
45341
|
+
key.srcChainKey
|
|
45342
|
+
)
|
|
45343
|
+
};
|
|
45344
|
+
}
|
|
45345
|
+
/**
|
|
45346
|
+
* `reason` is set only for {@link DETAILED_STATUS_NOT_DELIVERED} — the miss a caller can bound
|
|
45347
|
+
* with a retry budget. Leaving it off marks a dependency that is failing right now, which a
|
|
45348
|
+
* caller should keep retrying rather than give up on. `status` is lifted for a rejected key so
|
|
45349
|
+
* `isAuthFailure` recognises the wrapped error; it reads `context.status` and does not walk the
|
|
45350
|
+
* cause chain.
|
|
45351
|
+
*/
|
|
45352
|
+
detailedStatusLookupFailed(cause, srcChainKey, extra) {
|
|
45353
|
+
return lookupFailed("leverageYield", "getDetailedStatus", cause, {
|
|
45354
|
+
srcChainKey,
|
|
45355
|
+
action: "vaultSwap",
|
|
45356
|
+
...extra
|
|
45357
|
+
});
|
|
45358
|
+
}
|
|
44555
45359
|
/**
|
|
44556
45360
|
* Approves the vault's underlying asset to the leverage vault on Sonic. For callers
|
|
44557
45361
|
* interacting with the vault directly on the hub — the swap-style {@link
|