@sodax/sdk 0.0.1-rc.36 → 0.0.1-rc.38
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/README.md +11 -0
- package/dist/index.cjs +540 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +370 -76
- package/dist/index.d.ts +370 -76
- package/dist/index.mjs +535 -127
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var chains = require('viem/chains');
|
|
|
5
5
|
var types = require('@sodax/types');
|
|
6
6
|
var sdkTs = require('@injectivelabs/sdk-ts');
|
|
7
7
|
var networks = require('@injectivelabs/networks');
|
|
8
|
-
var
|
|
8
|
+
var iconSdkJs = require('icon-sdk-js');
|
|
9
9
|
var stellarSdk = require('@stellar/stellar-sdk');
|
|
10
10
|
var bcs = require('@mysten/sui/bcs');
|
|
11
11
|
var client = require('@mysten/sui/client');
|
|
@@ -39,7 +39,6 @@ function _interopNamespace(e) {
|
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var IconSdkRaw__namespace = /*#__PURE__*/_interopNamespace(IconSdkRaw);
|
|
43
42
|
var rlp__namespace = /*#__PURE__*/_interopNamespace(rlp);
|
|
44
43
|
var anchor__namespace = /*#__PURE__*/_interopNamespace(anchor);
|
|
45
44
|
var BN__default = /*#__PURE__*/_interopDefault(BN);
|
|
@@ -6148,22 +6147,6 @@ var DEFAULT_BACKEND_API_HEADERS = {
|
|
|
6148
6147
|
Accept: "application/json"
|
|
6149
6148
|
};
|
|
6150
6149
|
var VAULT_TOKEN_DECIMALS = 18;
|
|
6151
|
-
var INTENT_RELAY_CHAIN_IDS = {
|
|
6152
|
-
AVAX: 6n,
|
|
6153
|
-
SUI: 21n,
|
|
6154
|
-
SONIC: 146n,
|
|
6155
|
-
STELLAR: 27n,
|
|
6156
|
-
INJ: 19n,
|
|
6157
|
-
SOL: 1n,
|
|
6158
|
-
ICON: 1768124270n,
|
|
6159
|
-
BASE: 30n,
|
|
6160
|
-
BINANCE: 4n,
|
|
6161
|
-
OPTIMISM: 24n,
|
|
6162
|
-
POLYGON: 5n,
|
|
6163
|
-
ARBITRUM: 23n,
|
|
6164
|
-
NIBIRU: 7235938n,
|
|
6165
|
-
HYPER: 26745n
|
|
6166
|
-
};
|
|
6167
6150
|
var EVM_CHAIN_IDS = [
|
|
6168
6151
|
types.AVALANCHE_MAINNET_CHAIN_ID,
|
|
6169
6152
|
types.ARBITRUM_MAINNET_CHAIN_ID,
|
|
@@ -6173,34 +6156,25 @@ var EVM_CHAIN_IDS = [
|
|
|
6173
6156
|
types.OPTIMISM_MAINNET_CHAIN_ID,
|
|
6174
6157
|
types.POLYGON_MAINNET_CHAIN_ID,
|
|
6175
6158
|
types.NIBIRU_MAINNET_CHAIN_ID,
|
|
6176
|
-
types.HYPEREVM_MAINNET_CHAIN_ID
|
|
6177
|
-
|
|
6178
|
-
var EVM_SPOKE_CHAIN_IDS = [
|
|
6179
|
-
types.AVALANCHE_MAINNET_CHAIN_ID,
|
|
6180
|
-
types.ARBITRUM_MAINNET_CHAIN_ID,
|
|
6181
|
-
types.BASE_MAINNET_CHAIN_ID,
|
|
6182
|
-
types.BSC_MAINNET_CHAIN_ID,
|
|
6183
|
-
types.OPTIMISM_MAINNET_CHAIN_ID,
|
|
6184
|
-
types.POLYGON_MAINNET_CHAIN_ID,
|
|
6185
|
-
types.NIBIRU_MAINNET_CHAIN_ID,
|
|
6186
|
-
types.SONIC_MAINNET_CHAIN_ID,
|
|
6187
|
-
types.HYPEREVM_MAINNET_CHAIN_ID
|
|
6159
|
+
types.HYPEREVM_MAINNET_CHAIN_ID,
|
|
6160
|
+
types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6188
6161
|
];
|
|
6189
6162
|
var ChainIdToIntentRelayChainId = {
|
|
6190
|
-
[types.AVALANCHE_MAINNET_CHAIN_ID]:
|
|
6191
|
-
[types.ARBITRUM_MAINNET_CHAIN_ID]:
|
|
6192
|
-
[types.BASE_MAINNET_CHAIN_ID]:
|
|
6193
|
-
[types.BSC_MAINNET_CHAIN_ID]:
|
|
6194
|
-
[types.INJECTIVE_MAINNET_CHAIN_ID]:
|
|
6195
|
-
[types.SONIC_MAINNET_CHAIN_ID]:
|
|
6196
|
-
[types.OPTIMISM_MAINNET_CHAIN_ID]:
|
|
6197
|
-
[types.POLYGON_MAINNET_CHAIN_ID]:
|
|
6198
|
-
[types.SOLANA_MAINNET_CHAIN_ID]:
|
|
6199
|
-
[types.SUI_MAINNET_CHAIN_ID]:
|
|
6200
|
-
[types.STELLAR_MAINNET_CHAIN_ID]:
|
|
6201
|
-
[types.ICON_MAINNET_CHAIN_ID]:
|
|
6202
|
-
[types.NIBIRU_MAINNET_CHAIN_ID]:
|
|
6203
|
-
[types.HYPEREVM_MAINNET_CHAIN_ID]:
|
|
6163
|
+
[types.AVALANCHE_MAINNET_CHAIN_ID]: 6n,
|
|
6164
|
+
[types.ARBITRUM_MAINNET_CHAIN_ID]: 23n,
|
|
6165
|
+
[types.BASE_MAINNET_CHAIN_ID]: 30n,
|
|
6166
|
+
[types.BSC_MAINNET_CHAIN_ID]: 4n,
|
|
6167
|
+
[types.INJECTIVE_MAINNET_CHAIN_ID]: 19n,
|
|
6168
|
+
[types.SONIC_MAINNET_CHAIN_ID]: 146n,
|
|
6169
|
+
[types.OPTIMISM_MAINNET_CHAIN_ID]: 24n,
|
|
6170
|
+
[types.POLYGON_MAINNET_CHAIN_ID]: 5n,
|
|
6171
|
+
[types.SOLANA_MAINNET_CHAIN_ID]: 1n,
|
|
6172
|
+
[types.SUI_MAINNET_CHAIN_ID]: 21n,
|
|
6173
|
+
[types.STELLAR_MAINNET_CHAIN_ID]: 27n,
|
|
6174
|
+
[types.ICON_MAINNET_CHAIN_ID]: 1768124270n,
|
|
6175
|
+
[types.NIBIRU_MAINNET_CHAIN_ID]: 7235938n,
|
|
6176
|
+
[types.HYPEREVM_MAINNET_CHAIN_ID]: 26745n,
|
|
6177
|
+
[types.LIGHTLINK_MAINNET_CHAIN_ID]: 27756n
|
|
6204
6178
|
};
|
|
6205
6179
|
var getIntentRelayChainId = (chainId) => ChainIdToIntentRelayChainId[chainId];
|
|
6206
6180
|
var hyper = /* @__PURE__ */ viem.defineChain({
|
|
@@ -6247,6 +6221,8 @@ function getEvmViemChain(id) {
|
|
|
6247
6221
|
return chains.nibiru;
|
|
6248
6222
|
case types.HYPEREVM_MAINNET_CHAIN_ID:
|
|
6249
6223
|
return hyper;
|
|
6224
|
+
case types.LIGHTLINK_MAINNET_CHAIN_ID:
|
|
6225
|
+
return chains.lightlinkPhoenix;
|
|
6250
6226
|
default:
|
|
6251
6227
|
throw new Error(`Unsupported EVM chain ID: ${id}`);
|
|
6252
6228
|
}
|
|
@@ -6962,6 +6938,119 @@ var spokeChainConfig = {
|
|
|
6962
6938
|
}
|
|
6963
6939
|
}
|
|
6964
6940
|
},
|
|
6941
|
+
[types.LIGHTLINK_MAINNET_CHAIN_ID]: {
|
|
6942
|
+
chain: {
|
|
6943
|
+
name: "lightlink phoenix",
|
|
6944
|
+
id: types.LIGHTLINK_MAINNET_CHAIN_ID,
|
|
6945
|
+
type: "EVM"
|
|
6946
|
+
},
|
|
6947
|
+
addresses: {
|
|
6948
|
+
assetManager: "0x4A1C82744cDDeE675A255fB289Cb0917A482e7C7",
|
|
6949
|
+
connection: "0x6D2126DB97dd88AfA85127253807D04A066b6746"
|
|
6950
|
+
},
|
|
6951
|
+
nativeToken: "0x0000000000000000000000000000000000000000",
|
|
6952
|
+
bnUSD: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7",
|
|
6953
|
+
supportedTokens: {
|
|
6954
|
+
ETH: {
|
|
6955
|
+
symbol: "ETH",
|
|
6956
|
+
name: "ETH",
|
|
6957
|
+
decimals: 18,
|
|
6958
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
6959
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6960
|
+
},
|
|
6961
|
+
bnUSD: {
|
|
6962
|
+
symbol: "bnUSD",
|
|
6963
|
+
name: "bnUSD",
|
|
6964
|
+
decimals: 18,
|
|
6965
|
+
address: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7",
|
|
6966
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6967
|
+
},
|
|
6968
|
+
SODA: {
|
|
6969
|
+
symbol: "SODA",
|
|
6970
|
+
name: "SODAX",
|
|
6971
|
+
decimals: 18,
|
|
6972
|
+
address: "0x6BC8C37cba91F76E68C9e6d689A9C21E4d32079B",
|
|
6973
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6974
|
+
},
|
|
6975
|
+
USDC: {
|
|
6976
|
+
symbol: "USDC",
|
|
6977
|
+
name: "USD Coin",
|
|
6978
|
+
decimals: 6,
|
|
6979
|
+
address: "0xbCF8C1B03bBDDA88D579330BDF236B58F8bb2cFd",
|
|
6980
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6981
|
+
},
|
|
6982
|
+
"BTC.LL": {
|
|
6983
|
+
symbol: "BTC.LL",
|
|
6984
|
+
name: "Bitcoin LightLINK",
|
|
6985
|
+
decimals: 18,
|
|
6986
|
+
address: "0x5E921D8B7709b409132628258A53449D1fD82341",
|
|
6987
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6988
|
+
},
|
|
6989
|
+
"AVAX.LL": {
|
|
6990
|
+
symbol: "AVAX.LL",
|
|
6991
|
+
name: "Avalanche LightLINK",
|
|
6992
|
+
decimals: 18,
|
|
6993
|
+
address: "0x373d9c5390535e9e30185E52826d45b76df09aBb",
|
|
6994
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
6995
|
+
},
|
|
6996
|
+
"BNB.LL": {
|
|
6997
|
+
symbol: "BNB.LL",
|
|
6998
|
+
name: "BNB LightLINK",
|
|
6999
|
+
decimals: 18,
|
|
7000
|
+
address: "0xe80c2B7674dCdF47b199697E2c61730231b8da89",
|
|
7001
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7002
|
+
},
|
|
7003
|
+
"SOL.LL": {
|
|
7004
|
+
symbol: "SOL.LL",
|
|
7005
|
+
name: "Solana LightLINK",
|
|
7006
|
+
decimals: 18,
|
|
7007
|
+
address: "0xba9af7029Ae5c1054Fc367d5D6a47Dc3D5c0D6bA",
|
|
7008
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7009
|
+
},
|
|
7010
|
+
"XLM.LL": {
|
|
7011
|
+
symbol: "XLM.LL",
|
|
7012
|
+
name: "Stellar LightLINK",
|
|
7013
|
+
decimals: 18,
|
|
7014
|
+
address: "0x03beDD719b6d8de11f5B2671b2f30085a626F8Da",
|
|
7015
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7016
|
+
},
|
|
7017
|
+
"INJ.LL": {
|
|
7018
|
+
symbol: "INJ.LL",
|
|
7019
|
+
name: "Injective LightLINK",
|
|
7020
|
+
decimals: 18,
|
|
7021
|
+
address: "0x8a4C8B1A899Fa9D9246a112E8D43EC0C97b77B8C",
|
|
7022
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7023
|
+
},
|
|
7024
|
+
"SUI.LL": {
|
|
7025
|
+
symbol: "SUI.LL",
|
|
7026
|
+
name: "Sui LightLINK",
|
|
7027
|
+
decimals: 18,
|
|
7028
|
+
address: "0x59e68e2F5147F74F27FD173397a7419C1e5d9999",
|
|
7029
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7030
|
+
},
|
|
7031
|
+
"S.LL": {
|
|
7032
|
+
symbol: "S.LL",
|
|
7033
|
+
name: "Sonic LightLINK",
|
|
7034
|
+
decimals: 18,
|
|
7035
|
+
address: "0xb3A47798CB6585Ea0d31a7986f2a04b25C60247f",
|
|
7036
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7037
|
+
},
|
|
7038
|
+
"POL.LL": {
|
|
7039
|
+
symbol: "POL.LL",
|
|
7040
|
+
name: "Polygon LightLINK",
|
|
7041
|
+
decimals: 18,
|
|
7042
|
+
address: "0xE963bfb4757fC8Ae66BC68E11e636f8fbafAfCb4",
|
|
7043
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7044
|
+
},
|
|
7045
|
+
"HYPE.LL": {
|
|
7046
|
+
symbol: "HYPE.LL",
|
|
7047
|
+
name: "HyperEVM LightLINK",
|
|
7048
|
+
decimals: 18,
|
|
7049
|
+
address: "0x127b64fb645279F8aca786c507b94dde81F02d16",
|
|
7050
|
+
xChainId: types.LIGHTLINK_MAINNET_CHAIN_ID
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
7053
|
+
},
|
|
6965
7054
|
[types.INJECTIVE_MAINNET_CHAIN_ID]: {
|
|
6966
7055
|
addresses: {
|
|
6967
7056
|
assetManager: "inj1dg6tm62uup53wn2kn97caeqfwt0sukx3qjk8rw",
|
|
@@ -7023,6 +7112,23 @@ var spokeChainConfig = {
|
|
|
7023
7112
|
rateLimit: "CB6G3ULISTTBPXUN3BI6ADHQGWJEN7BPQINHL45TCB6TDFM5QWU24HAY",
|
|
7024
7113
|
testToken: ""
|
|
7025
7114
|
},
|
|
7115
|
+
trustlineConfigs: [
|
|
7116
|
+
{
|
|
7117
|
+
assetCode: "USDC",
|
|
7118
|
+
contractId: "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
|
|
7119
|
+
assetIssuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
|
|
7120
|
+
},
|
|
7121
|
+
{
|
|
7122
|
+
assetCode: "bnUSD",
|
|
7123
|
+
contractId: "CD6YBFFWMU2UJHX2NGRJ7RN76IJVTCC7MRA46DUBXNB7E6W7H7JRJ2CX",
|
|
7124
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
7125
|
+
},
|
|
7126
|
+
{
|
|
7127
|
+
assetCode: "SODA",
|
|
7128
|
+
contractId: "CAH5LKJC2ZB4RVUVEVL2QWJWNJLHQE2UF767ILLQ5EQ4O3OURR2XIUGM",
|
|
7129
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
7130
|
+
}
|
|
7131
|
+
],
|
|
7026
7132
|
supportedTokens: {
|
|
7027
7133
|
bnUSD: {
|
|
7028
7134
|
symbol: "bnUSD",
|
|
@@ -7238,7 +7344,8 @@ var hubVaults = {
|
|
|
7238
7344
|
address: "0x62ecc3eeb80a162c57624b3ff80313fe69f5203e",
|
|
7239
7345
|
reserves: [
|
|
7240
7346
|
// hub asset addresses contained in the vault
|
|
7241
|
-
"0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"
|
|
7347
|
+
"0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38",
|
|
7348
|
+
"0xb592d2631ccf245119532e025d11188cfadb6777"
|
|
7242
7349
|
]
|
|
7243
7350
|
},
|
|
7244
7351
|
[SodaTokens.sodaNIBI.symbol]: {
|
|
@@ -7333,8 +7440,10 @@ var hubVaults = {
|
|
|
7333
7440
|
// Arbitrum ETH hub asset
|
|
7334
7441
|
"0x57fc2ac5701e463ae261adbd6c99fbeb48ce5293",
|
|
7335
7442
|
// BSC ETH hub asset
|
|
7336
|
-
"0x50c42deacd8fc9773493ed674b675be577f2634b"
|
|
7443
|
+
"0x50c42deacd8fc9773493ed674b675be577f2634b",
|
|
7337
7444
|
// Sonic WETH hub asset
|
|
7445
|
+
"0x19920ef8fe1a9d51fdb0914abbb2f970c74dca68"
|
|
7446
|
+
// Lightlink ETH hub asset
|
|
7338
7447
|
]
|
|
7339
7448
|
},
|
|
7340
7449
|
[SodaTokens.sodaBTC.symbol]: {
|
|
@@ -7443,7 +7552,7 @@ var bnUSDLegacySpokeChainIds = [
|
|
|
7443
7552
|
types.SUI_MAINNET_CHAIN_ID,
|
|
7444
7553
|
types.STELLAR_MAINNET_CHAIN_ID
|
|
7445
7554
|
];
|
|
7446
|
-
var newbnUSDSpokeChainIds = types.
|
|
7555
|
+
var newbnUSDSpokeChainIds = types.CHAIN_IDS.filter((chainId) => chainId !== types.ICON_MAINNET_CHAIN_ID);
|
|
7447
7556
|
var bnUSDLegacyTokens = [
|
|
7448
7557
|
spokeChainConfig[types.ICON_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
7449
7558
|
spokeChainConfig[types.SUI_MAINNET_CHAIN_ID].supportedTokens.legacybnUSD,
|
|
@@ -7477,14 +7586,14 @@ var getAllLegacybnUSDTokens = () => {
|
|
|
7477
7586
|
var hubAssets = {
|
|
7478
7587
|
[types.SONIC_MAINNET_CHAIN_ID]: {
|
|
7479
7588
|
[spokeChainConfig[types.SONIC_MAINNET_CHAIN_ID].nativeToken]: {
|
|
7480
|
-
asset: spokeChainConfig[types.SONIC_MAINNET_CHAIN_ID].supportedTokens.
|
|
7589
|
+
asset: spokeChainConfig[types.SONIC_MAINNET_CHAIN_ID].supportedTokens.wS.address,
|
|
7481
7590
|
decimal: 18,
|
|
7482
7591
|
symbol: "S",
|
|
7483
7592
|
name: "Sonic",
|
|
7484
7593
|
vault: hubVaults.sodaS.address
|
|
7485
7594
|
},
|
|
7486
7595
|
[spokeChainConfig[types.SONIC_MAINNET_CHAIN_ID].bnUSD]: {
|
|
7487
|
-
asset:
|
|
7596
|
+
asset: spokeChainConfig[types.SONIC_MAINNET_CHAIN_ID].bnUSD,
|
|
7488
7597
|
decimal: 18,
|
|
7489
7598
|
symbol: "bnUSD",
|
|
7490
7599
|
name: "bnUSD",
|
|
@@ -7857,6 +7966,106 @@ var hubAssets = {
|
|
|
7857
7966
|
vault: hubVaults.sodaSODA.address
|
|
7858
7967
|
}
|
|
7859
7968
|
},
|
|
7969
|
+
[types.LIGHTLINK_MAINNET_CHAIN_ID]: {
|
|
7970
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].nativeToken]: {
|
|
7971
|
+
asset: "0x19920ef8fe1a9d51fdb0914abbb2f970c74dca68",
|
|
7972
|
+
decimal: 18,
|
|
7973
|
+
symbol: "ETH",
|
|
7974
|
+
name: "ETH",
|
|
7975
|
+
vault: hubVaults.sodaETH.address
|
|
7976
|
+
},
|
|
7977
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].bnUSD]: {
|
|
7978
|
+
asset: "0x14ab2ab7a76838b9205488efc3f700d0632ce8c7",
|
|
7979
|
+
decimal: 18,
|
|
7980
|
+
symbol: "bnUSD",
|
|
7981
|
+
name: "bnUSD",
|
|
7982
|
+
vault: hubVaults.bnUSD.address
|
|
7983
|
+
},
|
|
7984
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.SODA.address]: {
|
|
7985
|
+
asset: "0xe4faab621fb6716e32057b7ea7356219936519ac",
|
|
7986
|
+
decimal: 18,
|
|
7987
|
+
symbol: "SODA",
|
|
7988
|
+
name: "SODAX",
|
|
7989
|
+
vault: hubVaults.sodaSODA.address
|
|
7990
|
+
},
|
|
7991
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.USDC.address]: {
|
|
7992
|
+
asset: "0xe5159e2a89aeec2fc63d6c25adda3541670af101",
|
|
7993
|
+
decimal: 6,
|
|
7994
|
+
symbol: "USDC",
|
|
7995
|
+
name: "USD Coin",
|
|
7996
|
+
vault: hubVaults.sodaUSDC.address
|
|
7997
|
+
},
|
|
7998
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BTC.LL"].address]: {
|
|
7999
|
+
asset: "0x54582cdb0c145398b532e34f0851ffc1bbc88b4e",
|
|
8000
|
+
decimal: 18,
|
|
8001
|
+
symbol: "BTC.LL",
|
|
8002
|
+
name: "Bitcoin LightLINK",
|
|
8003
|
+
vault: hubVaults.sodaBTC.address
|
|
8004
|
+
},
|
|
8005
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["AVAX.LL"].address]: {
|
|
8006
|
+
asset: "0x415ff3ea8c905ef65cd82665c5534d0e4ff9221a",
|
|
8007
|
+
decimal: 18,
|
|
8008
|
+
symbol: "AVAX.LL",
|
|
8009
|
+
name: "Avalanche LightLINK",
|
|
8010
|
+
vault: hubVaults.sodaAVAX.address
|
|
8011
|
+
},
|
|
8012
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BNB.LL"].address]: {
|
|
8013
|
+
asset: "0xd32e524da9d64db4c37a50f1ee197b591e97dc05",
|
|
8014
|
+
decimal: 18,
|
|
8015
|
+
symbol: "BNB.LL",
|
|
8016
|
+
name: "BNB LightLINK",
|
|
8017
|
+
vault: hubVaults.sodaBNB.address
|
|
8018
|
+
},
|
|
8019
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SOL.LL"].address]: {
|
|
8020
|
+
asset: "0xd70c16f1e2c4207dc4c44bc69c8a1b82b50cf9e2",
|
|
8021
|
+
decimal: 18,
|
|
8022
|
+
symbol: "SOL.LL",
|
|
8023
|
+
name: "Solana LightLINK",
|
|
8024
|
+
vault: hubVaults.sodaSOL.address
|
|
8025
|
+
},
|
|
8026
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["XLM.LL"].address]: {
|
|
8027
|
+
asset: "0x18008b18964bc2c90521a7596ff9988743c97fd4",
|
|
8028
|
+
decimal: 18,
|
|
8029
|
+
symbol: "XLM.LL",
|
|
8030
|
+
name: "Stellar LightLINK",
|
|
8031
|
+
vault: hubVaults.sodaXLM.address
|
|
8032
|
+
},
|
|
8033
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["INJ.LL"].address]: {
|
|
8034
|
+
asset: "0xb036daab0c772b080babb84b8695c3ca858925b6",
|
|
8035
|
+
decimal: 18,
|
|
8036
|
+
symbol: "INJ.LL",
|
|
8037
|
+
name: "Injective LightLINK",
|
|
8038
|
+
vault: hubVaults.sodaINJ.address
|
|
8039
|
+
},
|
|
8040
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SUI.LL"].address]: {
|
|
8041
|
+
asset: "0x425852cca84e5f44d7b8ebb964b21bde585b4571",
|
|
8042
|
+
decimal: 18,
|
|
8043
|
+
symbol: "SUI.LL",
|
|
8044
|
+
name: "Sui LightLINK",
|
|
8045
|
+
vault: hubVaults.sodaSUI.address
|
|
8046
|
+
},
|
|
8047
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["S.LL"].address]: {
|
|
8048
|
+
asset: "0xb592d2631ccf245119532e025d11188cfadb6777",
|
|
8049
|
+
decimal: 18,
|
|
8050
|
+
symbol: "S.LL",
|
|
8051
|
+
name: "Sonic LightLINK",
|
|
8052
|
+
vault: hubVaults.sodaS.address
|
|
8053
|
+
},
|
|
8054
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["POL.LL"].address]: {
|
|
8055
|
+
asset: "0x15ba35f87f259b9b50d53a2fec271bb10020b090",
|
|
8056
|
+
decimal: 18,
|
|
8057
|
+
symbol: "POL.LL",
|
|
8058
|
+
name: "Polygon LightLINK",
|
|
8059
|
+
vault: hubVaults.sodaPOL.address
|
|
8060
|
+
},
|
|
8061
|
+
[spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["HYPE.LL"].address]: {
|
|
8062
|
+
asset: "0xea7e97b4597f724844426c32248ba80bd29c75f8",
|
|
8063
|
+
decimal: 18,
|
|
8064
|
+
symbol: "HYPE.LL",
|
|
8065
|
+
name: "HyperEVM LightLINK",
|
|
8066
|
+
vault: hubVaults.sodaHYPE.address
|
|
8067
|
+
}
|
|
8068
|
+
},
|
|
7860
8069
|
[types.INJECTIVE_MAINNET_CHAIN_ID]: {
|
|
7861
8070
|
[spokeChainConfig[types.INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.INJ.address]: {
|
|
7862
8071
|
asset: "0xd375590b4955f6ea5623f799153f9b787a3bd319",
|
|
@@ -8053,7 +8262,7 @@ var hubAssets = {
|
|
|
8053
8262
|
decimal: 18,
|
|
8054
8263
|
symbol: "wICX",
|
|
8055
8264
|
name: "ICON",
|
|
8056
|
-
vault: "
|
|
8265
|
+
vault: "0x"
|
|
8057
8266
|
},
|
|
8058
8267
|
[spokeChainConfig[types.ICON_MAINNET_CHAIN_ID].bnUSD]: {
|
|
8059
8268
|
asset: "0x654dddf32a9a2ac53f5fb54bf1e93f66791f8047",
|
|
@@ -8134,6 +8343,7 @@ var solverSupportedTokens = {
|
|
|
8134
8343
|
spokeChainConfig[types.BSC_MAINNET_CHAIN_ID].supportedTokens.USDC
|
|
8135
8344
|
],
|
|
8136
8345
|
[types.HYPEREVM_MAINNET_CHAIN_ID]: [],
|
|
8346
|
+
[types.LIGHTLINK_MAINNET_CHAIN_ID]: [],
|
|
8137
8347
|
[types.SOLANA_MAINNET_CHAIN_ID]: [
|
|
8138
8348
|
spokeChainConfig[types.SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
|
|
8139
8349
|
spokeChainConfig[types.SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
@@ -8243,6 +8453,21 @@ var moneyMarketSupportedTokens = {
|
|
|
8243
8453
|
spokeChainConfig[types.HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
8244
8454
|
spokeChainConfig[types.HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.SODA
|
|
8245
8455
|
],
|
|
8456
|
+
[types.LIGHTLINK_MAINNET_CHAIN_ID]: [
|
|
8457
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.ETH,
|
|
8458
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
8459
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.USDC,
|
|
8460
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["AVAX.LL"],
|
|
8461
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BNB.LL"],
|
|
8462
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SOL.LL"],
|
|
8463
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["XLM.LL"],
|
|
8464
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["INJ.LL"],
|
|
8465
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SUI.LL"],
|
|
8466
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["S.LL"],
|
|
8467
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["POL.LL"],
|
|
8468
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["HYPE.LL"],
|
|
8469
|
+
spokeChainConfig[types.LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.SODA
|
|
8470
|
+
],
|
|
8246
8471
|
[types.SOLANA_MAINNET_CHAIN_ID]: [
|
|
8247
8472
|
spokeChainConfig[types.SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
|
|
8248
8473
|
spokeChainConfig[types.SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
@@ -8319,7 +8544,7 @@ var supportedHubAssets = new Set(
|
|
|
8319
8544
|
var supportedSodaAssets = new Set(
|
|
8320
8545
|
Object.values(hubAssets).flatMap((assets) => Object.values(assets).map((info) => info.vault.toLowerCase()))
|
|
8321
8546
|
);
|
|
8322
|
-
var spokeChainIdsSet = new Set(types.
|
|
8547
|
+
var spokeChainIdsSet = new Set(types.CHAIN_IDS);
|
|
8323
8548
|
var getOriginalAssetInfoFromVault = (chainId, vault) => {
|
|
8324
8549
|
const assets = hubAssets[chainId];
|
|
8325
8550
|
if (!assets) {
|
|
@@ -8342,7 +8567,7 @@ var isValidHubAsset = (hubAsset) => supportedHubAssets.has(hubAsset.toLowerCase(
|
|
|
8342
8567
|
var isValidVault = (vault) => supportedSodaAssets.has(vault.toLowerCase());
|
|
8343
8568
|
var isValidChainHubAsset = (chainId, hubAsset) => chainIdToHubAssetsMap.get(chainId)?.has(hubAsset.toLowerCase()) ?? false;
|
|
8344
8569
|
var isValidSpokeChainId = (chainId) => spokeChainIdsSet.has(chainId);
|
|
8345
|
-
var isValidIntentRelayChainId = (chainId) => Object.values(
|
|
8570
|
+
var isValidIntentRelayChainId = (chainId) => Object.values(ChainIdToIntentRelayChainId).some((id) => id === chainId);
|
|
8346
8571
|
var supportedHubChains = Object.keys(hubChainConfig);
|
|
8347
8572
|
var supportedSpokeChains = Object.keys(spokeChainConfig);
|
|
8348
8573
|
var intentRelayChainIdToSpokeChainIdMap = new Map(
|
|
@@ -8500,7 +8725,6 @@ var InjectiveSpokeProvider = class {
|
|
|
8500
8725
|
return num.toString();
|
|
8501
8726
|
}
|
|
8502
8727
|
};
|
|
8503
|
-
var IconSdk = "default" in IconSdkRaw__namespace.default ? IconSdkRaw__namespace.default : IconSdkRaw__namespace;
|
|
8504
8728
|
var IconSpokeProvider = class {
|
|
8505
8729
|
walletProvider;
|
|
8506
8730
|
chainConfig;
|
|
@@ -8509,7 +8733,7 @@ var IconSpokeProvider = class {
|
|
|
8509
8733
|
constructor(walletProvider, chainConfig, rpcUrl = "https://ctz.solidwallet.io/api/v3", debugRpcUrl = "https://ctz.solidwallet.io/api/v3d") {
|
|
8510
8734
|
this.walletProvider = walletProvider;
|
|
8511
8735
|
this.chainConfig = chainConfig;
|
|
8512
|
-
this.iconService = new
|
|
8736
|
+
this.iconService = new iconSdkJs.IconService(new iconSdkJs.IconService.HttpProvider(rpcUrl));
|
|
8513
8737
|
this.debugRpcUrl = debugRpcUrl;
|
|
8514
8738
|
}
|
|
8515
8739
|
};
|
|
@@ -8579,42 +8803,6 @@ var EvmSpokeProvider = class {
|
|
|
8579
8803
|
}
|
|
8580
8804
|
}
|
|
8581
8805
|
};
|
|
8582
|
-
var CustomStellarAccount = class {
|
|
8583
|
-
accountId;
|
|
8584
|
-
sequenceNumber;
|
|
8585
|
-
startingSequenceNumber;
|
|
8586
|
-
constructor({ account_id, sequence }) {
|
|
8587
|
-
this.accountId = account_id;
|
|
8588
|
-
this.sequenceNumber = BigInt(sequence);
|
|
8589
|
-
this.startingSequenceNumber = BigInt(sequence);
|
|
8590
|
-
}
|
|
8591
|
-
getSequenceNumber() {
|
|
8592
|
-
return this.sequenceNumber;
|
|
8593
|
-
}
|
|
8594
|
-
getStartingSequenceNumber() {
|
|
8595
|
-
return this.startingSequenceNumber;
|
|
8596
|
-
}
|
|
8597
|
-
getAccountId() {
|
|
8598
|
-
return this.accountId;
|
|
8599
|
-
}
|
|
8600
|
-
getAccountClone() {
|
|
8601
|
-
return new stellarSdk.Account(this.accountId, this.sequenceNumber.toString());
|
|
8602
|
-
}
|
|
8603
|
-
incrementSequenceNumber() {
|
|
8604
|
-
this.sequenceNumber++;
|
|
8605
|
-
}
|
|
8606
|
-
decrementSequenceNumber() {
|
|
8607
|
-
if (this.sequenceNumber > this.startingSequenceNumber) {
|
|
8608
|
-
this.sequenceNumber--;
|
|
8609
|
-
}
|
|
8610
|
-
throw new Error(
|
|
8611
|
-
`Sequence number cannot be decremented below the starting sequence number: ${this.startingSequenceNumber}`
|
|
8612
|
-
);
|
|
8613
|
-
}
|
|
8614
|
-
resetSequenceNumber() {
|
|
8615
|
-
this.sequenceNumber = this.startingSequenceNumber;
|
|
8616
|
-
}
|
|
8617
|
-
};
|
|
8618
8806
|
var CustomSorobanServer = class extends stellarSdk.SorobanRpc.Server {
|
|
8619
8807
|
customHeaders;
|
|
8620
8808
|
constructor(serverUrl, customHeaders) {
|
|
@@ -8707,6 +8895,44 @@ var CustomSorobanServer = class extends stellarSdk.SorobanRpc.Server {
|
|
|
8707
8895
|
return response.json().then((json) => json.result);
|
|
8708
8896
|
}
|
|
8709
8897
|
};
|
|
8898
|
+
|
|
8899
|
+
// src/entities/stellar/StellarSpokeProvider.ts
|
|
8900
|
+
var CustomStellarAccount = class {
|
|
8901
|
+
accountId;
|
|
8902
|
+
sequenceNumber;
|
|
8903
|
+
startingSequenceNumber;
|
|
8904
|
+
constructor({ account_id, sequence }) {
|
|
8905
|
+
this.accountId = account_id;
|
|
8906
|
+
this.sequenceNumber = BigInt(sequence);
|
|
8907
|
+
this.startingSequenceNumber = BigInt(sequence);
|
|
8908
|
+
}
|
|
8909
|
+
getSequenceNumber() {
|
|
8910
|
+
return this.sequenceNumber;
|
|
8911
|
+
}
|
|
8912
|
+
getStartingSequenceNumber() {
|
|
8913
|
+
return this.startingSequenceNumber;
|
|
8914
|
+
}
|
|
8915
|
+
getAccountId() {
|
|
8916
|
+
return this.accountId;
|
|
8917
|
+
}
|
|
8918
|
+
getAccountClone() {
|
|
8919
|
+
return new stellarSdk.Account(this.accountId, this.sequenceNumber.toString());
|
|
8920
|
+
}
|
|
8921
|
+
incrementSequenceNumber() {
|
|
8922
|
+
this.sequenceNumber++;
|
|
8923
|
+
}
|
|
8924
|
+
decrementSequenceNumber() {
|
|
8925
|
+
if (this.sequenceNumber > this.startingSequenceNumber) {
|
|
8926
|
+
this.sequenceNumber--;
|
|
8927
|
+
}
|
|
8928
|
+
throw new Error(
|
|
8929
|
+
`Sequence number cannot be decremented below the starting sequence number: ${this.startingSequenceNumber}`
|
|
8930
|
+
);
|
|
8931
|
+
}
|
|
8932
|
+
resetSequenceNumber() {
|
|
8933
|
+
this.sequenceNumber = this.startingSequenceNumber;
|
|
8934
|
+
}
|
|
8935
|
+
};
|
|
8710
8936
|
var StellarSpokeProvider = class {
|
|
8711
8937
|
server;
|
|
8712
8938
|
sorobanServer;
|
|
@@ -10102,8 +10328,6 @@ async function estimateStepCost(rawTx, debugRpcUrl) {
|
|
|
10102
10328
|
}
|
|
10103
10329
|
|
|
10104
10330
|
// src/services/spoke/IconSpokeService.ts
|
|
10105
|
-
var IconSdk2 = "default" in IconSdkRaw__namespace.default ? IconSdkRaw__namespace.default : IconSdkRaw__namespace;
|
|
10106
|
-
var { Converter, CallTransactionBuilder, CallBuilder } = IconSdk2;
|
|
10107
10331
|
var IconSpokeService = class _IconSpokeService {
|
|
10108
10332
|
constructor() {
|
|
10109
10333
|
}
|
|
@@ -10142,7 +10366,7 @@ var IconSpokeService = class _IconSpokeService {
|
|
|
10142
10366
|
* @returns {Promise<bigint>} The balance of the token
|
|
10143
10367
|
*/
|
|
10144
10368
|
static async getDeposit(token, spokeProvider) {
|
|
10145
|
-
const transaction = new CallBuilder().to(token).method("balanceOf").params({ _owner: spokeProvider.chainConfig.addresses.assetManager }).build();
|
|
10369
|
+
const transaction = new iconSdkJs.CallBuilder().to(token).method("balanceOf").params({ _owner: spokeProvider.chainConfig.addresses.assetManager }).build();
|
|
10146
10370
|
const result = await spokeProvider.iconService.call(transaction).execute();
|
|
10147
10371
|
return BigInt(result.value);
|
|
10148
10372
|
}
|
|
@@ -10201,8 +10425,8 @@ var IconSpokeService = class _IconSpokeService {
|
|
|
10201
10425
|
const value = isNativeToken(spokeProvider.chainConfig.chain.id, token) ? BigIntToHex(amount) : "0x0";
|
|
10202
10426
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
10203
10427
|
const to = isNativeToken(spokeProvider.chainConfig.chain.id, token) ? spokeProvider.chainConfig.addresses.wICX : token;
|
|
10204
|
-
const rawTransaction = Converter.toRawTransaction(
|
|
10205
|
-
new CallTransactionBuilder().from(walletAddress).to(to).stepLimit(Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).value(value).method("transfer").params(params).build()
|
|
10428
|
+
const rawTransaction = iconSdkJs.Converter.toRawTransaction(
|
|
10429
|
+
new iconSdkJs.CallTransactionBuilder().from(walletAddress).to(to).stepLimit(iconSdkJs.Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).value(value).method("transfer").params(params).build()
|
|
10206
10430
|
);
|
|
10207
10431
|
if (raw) {
|
|
10208
10432
|
return rawTransaction;
|
|
@@ -10226,9 +10450,9 @@ var IconSpokeService = class _IconSpokeService {
|
|
|
10226
10450
|
payload
|
|
10227
10451
|
};
|
|
10228
10452
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
10229
|
-
const transaction = new CallTransactionBuilder().from(walletAddress).to(spokeProvider.chainConfig.addresses.connection).stepLimit(Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).method("sendMessage").params(params).build();
|
|
10453
|
+
const transaction = new iconSdkJs.CallTransactionBuilder().from(walletAddress).to(spokeProvider.chainConfig.addresses.connection).stepLimit(iconSdkJs.Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).method("sendMessage").params(params).build();
|
|
10230
10454
|
if (raw) {
|
|
10231
|
-
return Converter.toRawTransaction(transaction);
|
|
10455
|
+
return iconSdkJs.Converter.toRawTransaction(transaction);
|
|
10232
10456
|
}
|
|
10233
10457
|
return spokeProvider.walletProvider.sendTransaction({
|
|
10234
10458
|
from: walletAddress,
|
|
@@ -10538,6 +10762,83 @@ var SolanaSpokeService = class _SolanaSpokeService {
|
|
|
10538
10762
|
var StellarSpokeService = class _StellarSpokeService {
|
|
10539
10763
|
constructor() {
|
|
10540
10764
|
}
|
|
10765
|
+
/**
|
|
10766
|
+
* Check if the user has sufficent trustline established for the token.
|
|
10767
|
+
* @param token - The token address to check the trustline for.
|
|
10768
|
+
* @param amount - The amount of tokens to check the trustline for.
|
|
10769
|
+
* @param spokeProvider - The Stellar spoke provider.
|
|
10770
|
+
* @returns True if the user has sufficent trustline established for the token, false otherwise.
|
|
10771
|
+
*/
|
|
10772
|
+
static async hasSufficientTrustline(token, amount, spokeProvider) {
|
|
10773
|
+
if (token.toLowerCase() === spokeProvider.chainConfig.nativeToken.toLowerCase() || token.toLowerCase() === spokeChainConfig[types.STELLAR_MAINNET_CHAIN_ID].supportedTokens.legacybnUSD.address.toLowerCase()) {
|
|
10774
|
+
return true;
|
|
10775
|
+
}
|
|
10776
|
+
const trustlineConfig = spokeProvider.chainConfig.trustlineConfigs.find(
|
|
10777
|
+
(config) => config.contractId.toLowerCase() === token.toLowerCase()
|
|
10778
|
+
);
|
|
10779
|
+
if (!trustlineConfig) {
|
|
10780
|
+
throw new Error(`Trustline config not found for token: ${token}`);
|
|
10781
|
+
}
|
|
10782
|
+
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
10783
|
+
const { balances } = await spokeProvider.server.accounts().accountId(walletAddress).call();
|
|
10784
|
+
const tokenBalance = balances.find(
|
|
10785
|
+
(balance2) => "limit" in balance2 && "balance" in balance2 && "asset_code" in balance2 && trustlineConfig.assetCode.toLowerCase() === balance2.asset_code?.toLowerCase() && "asset_issuer" in balance2 && trustlineConfig.assetIssuer.toLowerCase() === balance2.asset_issuer?.toLowerCase()
|
|
10786
|
+
);
|
|
10787
|
+
if (!tokenBalance) {
|
|
10788
|
+
console.error(`No token balances found for token: ${token}`);
|
|
10789
|
+
return false;
|
|
10790
|
+
}
|
|
10791
|
+
const limit = parseToStroops(tokenBalance.limit);
|
|
10792
|
+
const balance = parseToStroops(tokenBalance.balance);
|
|
10793
|
+
const availableTrustAmount = limit - balance;
|
|
10794
|
+
return availableTrustAmount >= amount;
|
|
10795
|
+
}
|
|
10796
|
+
/**
|
|
10797
|
+
* Request a trustline for a given token and amount.
|
|
10798
|
+
* @param token - The token address to request the trustline for.
|
|
10799
|
+
* @param amount - The amount of tokens to request the trustline for.
|
|
10800
|
+
* @param spokeProvider - The spoke provider.
|
|
10801
|
+
* @param raw - Whether to return the raw transaction data.
|
|
10802
|
+
* @returns The transaction result.
|
|
10803
|
+
*/
|
|
10804
|
+
static async requestTrustline(token, amount, spokeProvider, raw) {
|
|
10805
|
+
try {
|
|
10806
|
+
const asset = spokeProvider.chainConfig.trustlineConfigs.find(
|
|
10807
|
+
(t) => t.contractId.toLowerCase() === token.toLowerCase()
|
|
10808
|
+
);
|
|
10809
|
+
if (!asset) {
|
|
10810
|
+
throw new Error(`Asset ${token} not found. Cannot proceed with trustline.`);
|
|
10811
|
+
}
|
|
10812
|
+
const [network, walletAddress] = await Promise.all([
|
|
10813
|
+
spokeProvider.sorobanServer.getNetwork(),
|
|
10814
|
+
spokeProvider.walletProvider.getWalletAddress()
|
|
10815
|
+
]);
|
|
10816
|
+
const accountResponse = await spokeProvider.server.loadAccount(walletAddress);
|
|
10817
|
+
const stellarAccount = new CustomStellarAccount(accountResponse);
|
|
10818
|
+
const transaction = new stellarSdk.TransactionBuilder(stellarAccount.getAccountClone(), {
|
|
10819
|
+
fee: stellarSdk.BASE_FEE,
|
|
10820
|
+
networkPassphrase: network.passphrase
|
|
10821
|
+
}).addOperation(
|
|
10822
|
+
stellarSdk.Operation.changeTrust({
|
|
10823
|
+
asset: new stellarSdk.Asset(asset?.assetCode, asset?.assetIssuer)
|
|
10824
|
+
})
|
|
10825
|
+
).setTimeout(STELLAR_DEFAULT_TX_TIMEOUT_SECONDS).build();
|
|
10826
|
+
if (raw) {
|
|
10827
|
+
const transactionXdr = transaction.toXDR();
|
|
10828
|
+
return {
|
|
10829
|
+
from: walletAddress,
|
|
10830
|
+
to: spokeProvider.chainConfig.addresses.assetManager,
|
|
10831
|
+
value: amount,
|
|
10832
|
+
data: transactionXdr
|
|
10833
|
+
};
|
|
10834
|
+
}
|
|
10835
|
+
const hash = await spokeProvider.signAndSendTransaction(transaction);
|
|
10836
|
+
return `${hash}`;
|
|
10837
|
+
} catch (error) {
|
|
10838
|
+
console.error("Error during requestTrustline:", error);
|
|
10839
|
+
throw error;
|
|
10840
|
+
}
|
|
10841
|
+
}
|
|
10541
10842
|
/**
|
|
10542
10843
|
* Estimate the gas for a transaction.
|
|
10543
10844
|
* @param rawTx - The raw transaction to estimate the gas for.
|
|
@@ -10755,11 +11056,8 @@ var SonicSpokeService = class _SonicSpokeService {
|
|
|
10755
11056
|
return spokeProvider.walletProvider.sendTransaction(rawTx);
|
|
10756
11057
|
}
|
|
10757
11058
|
static async createSwapIntent(createIntentParams, creatorHubWalletAddress, solverConfig2, fee, spokeProvider, hubProvider, raw) {
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
inputToken = hubProvider.chainConfig.nativeToken;
|
|
10761
|
-
}
|
|
10762
|
-
const outputToken = getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset;
|
|
11059
|
+
const inputToken = createIntentParams.inputToken;
|
|
11060
|
+
const outputToken = createIntentParams.dstChain !== types.SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset : createIntentParams.outputToken;
|
|
10763
11061
|
invariant12__default.default(
|
|
10764
11062
|
inputToken,
|
|
10765
11063
|
`hub asset not found for spoke chain token (intent.inputToken): ${createIntentParams.inputToken}`
|
|
@@ -11076,7 +11374,7 @@ function isJsonRpcPayloadResponse(value) {
|
|
|
11076
11374
|
return typeof value === "object" && value !== null && "id" in value && "result" in value && typeof value.result === "string";
|
|
11077
11375
|
}
|
|
11078
11376
|
function isIntentRelayChainId(value) {
|
|
11079
|
-
return typeof value === "bigint" && value >= 0n && Object.values(
|
|
11377
|
+
return typeof value === "bigint" && value >= 0n && Object.values(ChainIdToIntentRelayChainId).includes(value);
|
|
11080
11378
|
}
|
|
11081
11379
|
function isPartnerFeeAmount(value) {
|
|
11082
11380
|
return typeof value === "object" && value !== null && "address" in value && "amount" in value;
|
|
@@ -11696,11 +11994,8 @@ var EvmSolverService = class _EvmSolverService {
|
|
|
11696
11994
|
* @returns {Promise<[Hex, Intent, bigint]>} The encoded contract call, intent and fee amount
|
|
11697
11995
|
*/
|
|
11698
11996
|
static constructCreateIntentData(createIntentParams, creatorHubWalletAddress, solverConfig2, fee, hubProvider) {
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
inputToken = hubProvider.chainConfig.wrappedNativeToken;
|
|
11702
|
-
}
|
|
11703
|
-
const outputToken = getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset;
|
|
11997
|
+
const inputToken = createIntentParams.srcChain !== types.SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.srcChain, createIntentParams.inputToken)?.asset : createIntentParams.inputToken;
|
|
11998
|
+
const outputToken = createIntentParams.dstChain !== types.SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset : createIntentParams.outputToken;
|
|
11704
11999
|
invariant12__default.default(
|
|
11705
12000
|
inputToken,
|
|
11706
12001
|
`hub asset not found for spoke chain token (intent.inputToken): ${createIntentParams.inputToken}`
|
|
@@ -12475,6 +12770,12 @@ var SolverService = class {
|
|
|
12475
12770
|
spokeProvider
|
|
12476
12771
|
);
|
|
12477
12772
|
}
|
|
12773
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
12774
|
+
return {
|
|
12775
|
+
ok: true,
|
|
12776
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.inputToken, params.inputAmount, spokeProvider)
|
|
12777
|
+
};
|
|
12778
|
+
}
|
|
12478
12779
|
return {
|
|
12479
12780
|
ok: true,
|
|
12480
12781
|
value: true
|
|
@@ -12556,9 +12857,21 @@ var SolverService = class {
|
|
|
12556
12857
|
value: result
|
|
12557
12858
|
};
|
|
12558
12859
|
}
|
|
12860
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
12861
|
+
const result = await StellarSpokeService.requestTrustline(
|
|
12862
|
+
params.inputToken,
|
|
12863
|
+
params.inputAmount,
|
|
12864
|
+
spokeProvider,
|
|
12865
|
+
raw
|
|
12866
|
+
);
|
|
12867
|
+
return {
|
|
12868
|
+
ok: true,
|
|
12869
|
+
value: result
|
|
12870
|
+
};
|
|
12871
|
+
}
|
|
12559
12872
|
return {
|
|
12560
12873
|
ok: false,
|
|
12561
|
-
error: new Error("Approve only supported for EVM spoke chains")
|
|
12874
|
+
error: new Error("Approve only supported for EVM (approve) and Stellar (trustline) spoke chains")
|
|
12562
12875
|
};
|
|
12563
12876
|
} catch (error) {
|
|
12564
12877
|
return {
|
|
@@ -13361,6 +13674,12 @@ var MigrationService = class {
|
|
|
13361
13674
|
evmSpokeProvider
|
|
13362
13675
|
);
|
|
13363
13676
|
}
|
|
13677
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13678
|
+
return {
|
|
13679
|
+
ok: true,
|
|
13680
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.srcbnUSD, params.amount, spokeProvider)
|
|
13681
|
+
};
|
|
13682
|
+
}
|
|
13364
13683
|
return {
|
|
13365
13684
|
ok: true,
|
|
13366
13685
|
value: true
|
|
@@ -13387,6 +13706,29 @@ var MigrationService = class {
|
|
|
13387
13706
|
evmSpokeProvider
|
|
13388
13707
|
);
|
|
13389
13708
|
}
|
|
13709
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider.chainConfig.chain.type === "EVM") {
|
|
13710
|
+
const evmSpokeProvider = spokeProvider;
|
|
13711
|
+
let spender;
|
|
13712
|
+
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13713
|
+
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
13714
|
+
spender = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
13715
|
+
} else {
|
|
13716
|
+
spender = evmSpokeProvider.chainConfig.addresses.assetManager;
|
|
13717
|
+
}
|
|
13718
|
+
return await Erc20Service.isAllowanceValid(
|
|
13719
|
+
params.srcbnUSD,
|
|
13720
|
+
params.amount,
|
|
13721
|
+
wallet,
|
|
13722
|
+
spender,
|
|
13723
|
+
evmSpokeProvider
|
|
13724
|
+
);
|
|
13725
|
+
}
|
|
13726
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13727
|
+
return {
|
|
13728
|
+
ok: true,
|
|
13729
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.srcbnUSD, params.amount, spokeProvider)
|
|
13730
|
+
};
|
|
13731
|
+
}
|
|
13390
13732
|
if (spokeProvider instanceof SonicSpokeProvider && isIcxCreateRevertMigrationParams(params)) {
|
|
13391
13733
|
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13392
13734
|
const userRouter = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
@@ -13449,6 +13791,13 @@ var MigrationService = class {
|
|
|
13449
13791
|
value: result
|
|
13450
13792
|
};
|
|
13451
13793
|
}
|
|
13794
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13795
|
+
const result = await StellarSpokeService.requestTrustline(params.srcbnUSD, params.amount, spokeProvider, raw);
|
|
13796
|
+
return {
|
|
13797
|
+
ok: true,
|
|
13798
|
+
value: result
|
|
13799
|
+
};
|
|
13800
|
+
}
|
|
13452
13801
|
return {
|
|
13453
13802
|
ok: false,
|
|
13454
13803
|
error: new Error("Invalid params for migrate action")
|
|
@@ -13479,6 +13828,13 @@ var MigrationService = class {
|
|
|
13479
13828
|
value: result
|
|
13480
13829
|
};
|
|
13481
13830
|
}
|
|
13831
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13832
|
+
const result = await StellarSpokeService.requestTrustline(params.srcbnUSD, params.amount, spokeProvider, raw);
|
|
13833
|
+
return {
|
|
13834
|
+
ok: true,
|
|
13835
|
+
value: result
|
|
13836
|
+
};
|
|
13837
|
+
}
|
|
13482
13838
|
if (spokeProvider instanceof SonicSpokeProvider && isIcxCreateRevertMigrationParams(params)) {
|
|
13483
13839
|
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13484
13840
|
const userRouter = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
@@ -13572,6 +13928,14 @@ var MigrationService = class {
|
|
|
13572
13928
|
if (!packetResult.ok) {
|
|
13573
13929
|
return packetResult;
|
|
13574
13930
|
}
|
|
13931
|
+
if (!(params.srcChainId === types.SONIC_MAINNET_CHAIN_ID || params.dstChainId === types.SONIC_MAINNET_CHAIN_ID)) {
|
|
13932
|
+
await waitUntilIntentExecuted({
|
|
13933
|
+
intentRelayChainId: getIntentRelayChainId(types.SONIC_MAINNET_CHAIN_ID).toString(),
|
|
13934
|
+
spokeTxHash: packetResult.value.dst_tx_hash,
|
|
13935
|
+
timeout,
|
|
13936
|
+
apiUrl: this.config.relayerApiEndpoint
|
|
13937
|
+
});
|
|
13938
|
+
}
|
|
13575
13939
|
return { ok: true, value: [spokeTxHash, packetResult.value.dst_tx_hash] };
|
|
13576
13940
|
} catch (error) {
|
|
13577
13941
|
return {
|
|
@@ -13939,7 +14303,6 @@ var MigrationService = class {
|
|
|
13939
14303
|
const txResult = await SpokeService.deposit(
|
|
13940
14304
|
{
|
|
13941
14305
|
from: walletAddress,
|
|
13942
|
-
to: creatorHubWalletAddress,
|
|
13943
14306
|
token: params.srcbnUSD,
|
|
13944
14307
|
amount: params.amount,
|
|
13945
14308
|
data: migrationData
|
|
@@ -14654,6 +15017,26 @@ var BridgeService = class {
|
|
|
14654
15017
|
value: allowanceResult.value
|
|
14655
15018
|
};
|
|
14656
15019
|
}
|
|
15020
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
15021
|
+
const allowanceResult = await StellarSpokeService.hasSufficientTrustline(
|
|
15022
|
+
params.srcAsset,
|
|
15023
|
+
params.amount,
|
|
15024
|
+
spokeProvider
|
|
15025
|
+
);
|
|
15026
|
+
if (!allowanceResult) {
|
|
15027
|
+
return {
|
|
15028
|
+
ok: false,
|
|
15029
|
+
error: {
|
|
15030
|
+
code: "ALLOWANCE_CHECK_FAILED",
|
|
15031
|
+
error: allowanceResult
|
|
15032
|
+
}
|
|
15033
|
+
};
|
|
15034
|
+
}
|
|
15035
|
+
return {
|
|
15036
|
+
ok: true,
|
|
15037
|
+
value: allowanceResult
|
|
15038
|
+
};
|
|
15039
|
+
}
|
|
14657
15040
|
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
14658
15041
|
invariant12__default.default(viem.isAddress(params.srcAsset), "Invalid source asset address for Sonic chain");
|
|
14659
15042
|
const userRouter = await SonicSpokeService.getUserRouter(walletAddress, spokeProvider);
|
|
@@ -14722,6 +15105,13 @@ var BridgeService = class {
|
|
|
14722
15105
|
value: result
|
|
14723
15106
|
};
|
|
14724
15107
|
}
|
|
15108
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
15109
|
+
const result = await StellarSpokeService.requestTrustline(params.srcAsset, params.amount, spokeProvider, raw);
|
|
15110
|
+
return {
|
|
15111
|
+
ok: true,
|
|
15112
|
+
value: result
|
|
15113
|
+
};
|
|
15114
|
+
}
|
|
14725
15115
|
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
14726
15116
|
invariant12__default.default(viem.isAddress(params.srcAsset), "Invalid source asset address for Sonic chain");
|
|
14727
15117
|
const userRouter = await SonicSpokeService.getUserRouter(
|
|
@@ -14937,7 +15327,19 @@ var BridgeService = class {
|
|
|
14937
15327
|
}
|
|
14938
15328
|
const encodedRecipientAddress = encodeAddress(params.dstChainId, params.recipient);
|
|
14939
15329
|
if (params.dstChainId === this.hubProvider.chainConfig.chain.id) {
|
|
14940
|
-
|
|
15330
|
+
if (params.dstAsset.toLowerCase() === this.hubProvider.chainConfig.nativeToken.toLowerCase()) {
|
|
15331
|
+
calls.push({
|
|
15332
|
+
address: dstAssetInfo.asset,
|
|
15333
|
+
value: 0n,
|
|
15334
|
+
data: viem.encodeFunctionData({
|
|
15335
|
+
abi: wrappedSonicAbi,
|
|
15336
|
+
functionName: "withdrawTo",
|
|
15337
|
+
args: [encodedRecipientAddress, translatedWithdrawAmount]
|
|
15338
|
+
})
|
|
15339
|
+
});
|
|
15340
|
+
} else {
|
|
15341
|
+
calls.push(Erc20Service.encodeTransfer(dstAssetInfo.asset, encodedRecipientAddress, translatedWithdrawAmount));
|
|
15342
|
+
}
|
|
14941
15343
|
} else {
|
|
14942
15344
|
invariant12__default.default(dstAssetInfo, `Unsupported hub chain (${params.dstChainId}) token: ${params.dstAsset}`);
|
|
14943
15345
|
calls.push(
|
|
@@ -15245,6 +15647,9 @@ async function deriveUserWalletAddress(spokeProvider, hubProvider, walletAddress
|
|
|
15245
15647
|
const address = walletAddress ?? await spokeProvider.walletProvider.getWalletAddress();
|
|
15246
15648
|
return spokeProvider.chainConfig.chain.id === hubProvider.chainConfig.chain.id ? address : await WalletAbstractionService.getUserAbstractedWalletAddress(address, spokeProvider, hubProvider);
|
|
15247
15649
|
}
|
|
15650
|
+
function parseToStroops(amount) {
|
|
15651
|
+
return BigInt(Math.round(Number.parseFloat(amount) * 1e7));
|
|
15652
|
+
}
|
|
15248
15653
|
var BigNumberZeroDecimal = BigNumber4.BigNumber.clone({
|
|
15249
15654
|
DECIMAL_PLACES: 0,
|
|
15250
15655
|
ROUNDING_MODE: BigNumber4.BigNumber.ROUND_DOWN
|
|
@@ -16778,6 +17183,12 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
16778
17183
|
`Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`
|
|
16779
17184
|
);
|
|
16780
17185
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
17186
|
+
if (spokeProvider instanceof StellarSpokeProvider && (params.action === "supply" || params.action === "repay")) {
|
|
17187
|
+
return {
|
|
17188
|
+
ok: true,
|
|
17189
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.token, params.amount, spokeProvider)
|
|
17190
|
+
};
|
|
17191
|
+
}
|
|
16781
17192
|
if (spokeProvider instanceof EvmSpokeProvider && (params.action === "supply" || params.action === "repay")) {
|
|
16782
17193
|
return await Erc20Service.isAllowanceValid(
|
|
16783
17194
|
params.token,
|
|
@@ -16875,6 +17286,17 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
16875
17286
|
`Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`
|
|
16876
17287
|
);
|
|
16877
17288
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
17289
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
17290
|
+
invariant12__default.default(
|
|
17291
|
+
params.action === "supply" || params.action === "repay",
|
|
17292
|
+
"Invalid action (only supply and repay are supported on stellar)"
|
|
17293
|
+
);
|
|
17294
|
+
const result = await StellarSpokeService.requestTrustline(params.token, params.amount, spokeProvider, raw);
|
|
17295
|
+
return {
|
|
17296
|
+
ok: true,
|
|
17297
|
+
value: result
|
|
17298
|
+
};
|
|
17299
|
+
}
|
|
16878
17300
|
if (spokeProvider instanceof EvmSpokeProvider) {
|
|
16879
17301
|
invariant12__default.default(
|
|
16880
17302
|
params.action === "supply" || params.action === "repay",
|
|
@@ -17579,14 +18001,9 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17579
18001
|
const calls = [];
|
|
17580
18002
|
const assetConfig = getHubAssetInfo(spokeChainId, token);
|
|
17581
18003
|
invariant12__default.default(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
|
|
17582
|
-
|
|
18004
|
+
const assetAddress = assetConfig.asset;
|
|
17583
18005
|
const vaultAddress = assetConfig.vault;
|
|
17584
18006
|
const lendingPool = this.config.lendingPool;
|
|
17585
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17586
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17587
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17588
|
-
}
|
|
17589
|
-
}
|
|
17590
18007
|
calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
|
|
17591
18008
|
calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
|
|
17592
18009
|
const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
|
|
@@ -17616,15 +18033,10 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17616
18033
|
);
|
|
17617
18034
|
const assetConfig = getHubAssetInfo(spokeChainId, token);
|
|
17618
18035
|
invariant12__default.default(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
|
|
17619
|
-
|
|
18036
|
+
const assetAddress = assetConfig.asset;
|
|
17620
18037
|
const vaultAddress = assetConfig.vault;
|
|
17621
18038
|
const bnUSDVault = this.config.bnUSDVault;
|
|
17622
18039
|
const bnUSD = this.config.bnUSD;
|
|
17623
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17624
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17625
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17626
|
-
}
|
|
17627
|
-
}
|
|
17628
18040
|
const feeAmount = calculateFeeAmount(amount, this.config.partnerFee);
|
|
17629
18041
|
const calls = [];
|
|
17630
18042
|
if (bnUSDVault && bnUSD && bnUSDVault.toLowerCase() === vaultAddress.toLowerCase()) {
|
|
@@ -17745,15 +18157,10 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17745
18157
|
if (!assetConfig) {
|
|
17746
18158
|
throw new Error("[buildRepayData] Hub asset not found");
|
|
17747
18159
|
}
|
|
17748
|
-
|
|
18160
|
+
const assetAddress = assetConfig.asset;
|
|
17749
18161
|
const vaultAddress = assetConfig.vault;
|
|
17750
18162
|
const bnUSDVault = this.config.bnUSDVault;
|
|
17751
18163
|
const bnUSD = this.config.bnUSD;
|
|
17752
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17753
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17754
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17755
|
-
}
|
|
17756
|
-
}
|
|
17757
18164
|
calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
|
|
17758
18165
|
calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
|
|
17759
18166
|
const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
|
|
@@ -17946,6 +18353,8 @@ exports.BigNumberZeroDecimal = BigNumberZeroDecimal;
|
|
|
17946
18353
|
exports.BnUSDMigrationService = BnUSDMigrationService;
|
|
17947
18354
|
exports.BridgeService = BridgeService;
|
|
17948
18355
|
exports.ChainIdToIntentRelayChainId = ChainIdToIntentRelayChainId;
|
|
18356
|
+
exports.CustomSorobanServer = CustomSorobanServer;
|
|
18357
|
+
exports.CustomStellarAccount = CustomStellarAccount;
|
|
17949
18358
|
exports.DEFAULT_BACKEND_API_ENDPOINT = DEFAULT_BACKEND_API_ENDPOINT;
|
|
17950
18359
|
exports.DEFAULT_BACKEND_API_HEADERS = DEFAULT_BACKEND_API_HEADERS;
|
|
17951
18360
|
exports.DEFAULT_BACKEND_API_TIMEOUT = DEFAULT_BACKEND_API_TIMEOUT;
|
|
@@ -17955,7 +18364,6 @@ exports.DEFAULT_RELAYER_API_ENDPOINT = DEFAULT_RELAYER_API_ENDPOINT;
|
|
|
17955
18364
|
exports.DEFAULT_RELAY_TX_TIMEOUT = DEFAULT_RELAY_TX_TIMEOUT;
|
|
17956
18365
|
exports.DEFAULT_RETRY_DELAY_MS = DEFAULT_RETRY_DELAY_MS;
|
|
17957
18366
|
exports.EVM_CHAIN_IDS = EVM_CHAIN_IDS;
|
|
17958
|
-
exports.EVM_SPOKE_CHAIN_IDS = EVM_SPOKE_CHAIN_IDS;
|
|
17959
18367
|
exports.Erc20Service = Erc20Service;
|
|
17960
18368
|
exports.EvmAssetManagerService = EvmAssetManagerService;
|
|
17961
18369
|
exports.EvmHubProvider = EvmHubProvider;
|
|
@@ -17969,7 +18377,6 @@ exports.HALF_RAY = HALF_RAY;
|
|
|
17969
18377
|
exports.HALF_WAD = HALF_WAD;
|
|
17970
18378
|
exports.HubVaultSymbols = HubVaultSymbols;
|
|
17971
18379
|
exports.ICON_TX_RESULT_WAIT_MAX_RETRY = ICON_TX_RESULT_WAIT_MAX_RETRY;
|
|
17972
|
-
exports.INTENT_RELAY_CHAIN_IDS = INTENT_RELAY_CHAIN_IDS;
|
|
17973
18380
|
exports.IconSpokeProvider = IconSpokeProvider;
|
|
17974
18381
|
exports.IcxMigrationService = IcxMigrationService;
|
|
17975
18382
|
exports.InjectiveSpokeProvider = InjectiveSpokeProvider;
|
|
@@ -18001,6 +18408,7 @@ exports.SonicSpokeProvider = SonicSpokeProvider;
|
|
|
18001
18408
|
exports.SonicSpokeService = SonicSpokeService;
|
|
18002
18409
|
exports.SpokeService = SpokeService;
|
|
18003
18410
|
exports.StellarSpokeProvider = StellarSpokeProvider;
|
|
18411
|
+
exports.StellarSpokeService = StellarSpokeService;
|
|
18004
18412
|
exports.SuiSpokeProvider = SuiSpokeProvider;
|
|
18005
18413
|
exports.SuiSpokeService = SuiSpokeService;
|
|
18006
18414
|
exports.SupportedMigrationTokens = SupportedMigrationTokens;
|
|
@@ -18143,6 +18551,7 @@ exports.normalize = normalize;
|
|
|
18143
18551
|
exports.normalizeBN = normalizeBN;
|
|
18144
18552
|
exports.normalizedToUsd = normalizedToUsd;
|
|
18145
18553
|
exports.originalAssetTohubAssetMap = originalAssetTohubAssetMap;
|
|
18554
|
+
exports.parseToStroops = parseToStroops;
|
|
18146
18555
|
exports.poolAbi = poolAbi;
|
|
18147
18556
|
exports.randomUint256 = randomUint256;
|
|
18148
18557
|
exports.rayDiv = rayDiv;
|