@sodax/sdk 0.0.1-rc.37 → 0.0.1-rc.39
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 +13 -2
- package/dist/index.cjs +555 -130
- 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 +550 -126
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getAbiItem, defineChain, encodeAbiParameters, parseAbiParameters, fromHex, createPublicClient, http, toHex, erc20Abi as erc20Abi$1, encodeFunctionData, decodeAbiParameters, encodePacked, parseEventLogs, keccak256, isAddress } from 'viem';
|
|
2
|
-
import { nibiru, polygon, bsc, optimism, base, arbitrum, avalanche, sonic } from 'viem/chains';
|
|
3
|
-
import { SONIC_MAINNET_CHAIN_ID,
|
|
2
|
+
import { lightlinkPhoenix, nibiru, polygon, bsc, optimism, base, arbitrum, avalanche, sonic } from 'viem/chains';
|
|
3
|
+
import { SONIC_MAINNET_CHAIN_ID, CHAIN_IDS, ICON_MAINNET_CHAIN_ID, SUI_MAINNET_CHAIN_ID, STELLAR_MAINNET_CHAIN_ID, INJECTIVE_MAINNET_CHAIN_ID, LIGHTLINK_MAINNET_CHAIN_ID, HYPEREVM_MAINNET_CHAIN_ID, POLYGON_MAINNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, BASE_MAINNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, NIBIRU_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, SOLANA_MAINNET_CHAIN_ID } from '@sodax/types';
|
|
4
4
|
export * from '@sodax/types';
|
|
5
5
|
import { ChainGrpcWasmApi, TxGrpcApi, toBase64, fromBase64 } from '@injectivelabs/sdk-ts';
|
|
6
6
|
import { getNetworkEndpoints, Network } from '@injectivelabs/networks';
|
|
7
|
-
import
|
|
8
|
-
import { SorobanRpc, Horizon, Contract, TransactionBuilder, BASE_FEE, nativeToScVal, TimeoutInfinite, rpc, scValToBigInt, Operation, Address,
|
|
7
|
+
import { IconService, CallBuilder, Converter, CallTransactionBuilder } from 'icon-sdk-js';
|
|
8
|
+
import { SorobanRpc, Account, Horizon, Contract, TransactionBuilder, BASE_FEE, nativeToScVal, TimeoutInfinite, rpc, scValToBigInt, Operation, Address, Asset, FeeBumpTransaction } from '@stellar/stellar-sdk';
|
|
9
9
|
import { bcs } from '@mysten/sui/bcs';
|
|
10
10
|
import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
|
|
11
11
|
import { Transaction } from '@mysten/sui/transactions';
|
|
@@ -6120,22 +6120,6 @@ var DEFAULT_BACKEND_API_HEADERS = {
|
|
|
6120
6120
|
Accept: "application/json"
|
|
6121
6121
|
};
|
|
6122
6122
|
var VAULT_TOKEN_DECIMALS = 18;
|
|
6123
|
-
var INTENT_RELAY_CHAIN_IDS = {
|
|
6124
|
-
AVAX: 6n,
|
|
6125
|
-
SUI: 21n,
|
|
6126
|
-
SONIC: 146n,
|
|
6127
|
-
STELLAR: 27n,
|
|
6128
|
-
INJ: 19n,
|
|
6129
|
-
SOL: 1n,
|
|
6130
|
-
ICON: 1768124270n,
|
|
6131
|
-
BASE: 30n,
|
|
6132
|
-
BINANCE: 4n,
|
|
6133
|
-
OPTIMISM: 24n,
|
|
6134
|
-
POLYGON: 5n,
|
|
6135
|
-
ARBITRUM: 23n,
|
|
6136
|
-
NIBIRU: 7235938n,
|
|
6137
|
-
HYPER: 26745n
|
|
6138
|
-
};
|
|
6139
6123
|
var EVM_CHAIN_IDS = [
|
|
6140
6124
|
AVALANCHE_MAINNET_CHAIN_ID,
|
|
6141
6125
|
ARBITRUM_MAINNET_CHAIN_ID,
|
|
@@ -6145,34 +6129,25 @@ var EVM_CHAIN_IDS = [
|
|
|
6145
6129
|
OPTIMISM_MAINNET_CHAIN_ID,
|
|
6146
6130
|
POLYGON_MAINNET_CHAIN_ID,
|
|
6147
6131
|
NIBIRU_MAINNET_CHAIN_ID,
|
|
6148
|
-
HYPEREVM_MAINNET_CHAIN_ID
|
|
6149
|
-
|
|
6150
|
-
var EVM_SPOKE_CHAIN_IDS = [
|
|
6151
|
-
AVALANCHE_MAINNET_CHAIN_ID,
|
|
6152
|
-
ARBITRUM_MAINNET_CHAIN_ID,
|
|
6153
|
-
BASE_MAINNET_CHAIN_ID,
|
|
6154
|
-
BSC_MAINNET_CHAIN_ID,
|
|
6155
|
-
OPTIMISM_MAINNET_CHAIN_ID,
|
|
6156
|
-
POLYGON_MAINNET_CHAIN_ID,
|
|
6157
|
-
NIBIRU_MAINNET_CHAIN_ID,
|
|
6158
|
-
SONIC_MAINNET_CHAIN_ID,
|
|
6159
|
-
HYPEREVM_MAINNET_CHAIN_ID
|
|
6132
|
+
HYPEREVM_MAINNET_CHAIN_ID,
|
|
6133
|
+
LIGHTLINK_MAINNET_CHAIN_ID
|
|
6160
6134
|
];
|
|
6161
6135
|
var ChainIdToIntentRelayChainId = {
|
|
6162
|
-
[AVALANCHE_MAINNET_CHAIN_ID]:
|
|
6163
|
-
[ARBITRUM_MAINNET_CHAIN_ID]:
|
|
6164
|
-
[BASE_MAINNET_CHAIN_ID]:
|
|
6165
|
-
[BSC_MAINNET_CHAIN_ID]:
|
|
6166
|
-
[INJECTIVE_MAINNET_CHAIN_ID]:
|
|
6167
|
-
[SONIC_MAINNET_CHAIN_ID]:
|
|
6168
|
-
[OPTIMISM_MAINNET_CHAIN_ID]:
|
|
6169
|
-
[POLYGON_MAINNET_CHAIN_ID]:
|
|
6170
|
-
[SOLANA_MAINNET_CHAIN_ID]:
|
|
6171
|
-
[SUI_MAINNET_CHAIN_ID]:
|
|
6172
|
-
[STELLAR_MAINNET_CHAIN_ID]:
|
|
6173
|
-
[ICON_MAINNET_CHAIN_ID]:
|
|
6174
|
-
[NIBIRU_MAINNET_CHAIN_ID]:
|
|
6175
|
-
[HYPEREVM_MAINNET_CHAIN_ID]:
|
|
6136
|
+
[AVALANCHE_MAINNET_CHAIN_ID]: 6n,
|
|
6137
|
+
[ARBITRUM_MAINNET_CHAIN_ID]: 23n,
|
|
6138
|
+
[BASE_MAINNET_CHAIN_ID]: 30n,
|
|
6139
|
+
[BSC_MAINNET_CHAIN_ID]: 4n,
|
|
6140
|
+
[INJECTIVE_MAINNET_CHAIN_ID]: 19n,
|
|
6141
|
+
[SONIC_MAINNET_CHAIN_ID]: 146n,
|
|
6142
|
+
[OPTIMISM_MAINNET_CHAIN_ID]: 24n,
|
|
6143
|
+
[POLYGON_MAINNET_CHAIN_ID]: 5n,
|
|
6144
|
+
[SOLANA_MAINNET_CHAIN_ID]: 1n,
|
|
6145
|
+
[SUI_MAINNET_CHAIN_ID]: 21n,
|
|
6146
|
+
[STELLAR_MAINNET_CHAIN_ID]: 27n,
|
|
6147
|
+
[ICON_MAINNET_CHAIN_ID]: 1768124270n,
|
|
6148
|
+
[NIBIRU_MAINNET_CHAIN_ID]: 7235938n,
|
|
6149
|
+
[HYPEREVM_MAINNET_CHAIN_ID]: 26745n,
|
|
6150
|
+
[LIGHTLINK_MAINNET_CHAIN_ID]: 27756n
|
|
6176
6151
|
};
|
|
6177
6152
|
var getIntentRelayChainId = (chainId) => ChainIdToIntentRelayChainId[chainId];
|
|
6178
6153
|
var hyper = /* @__PURE__ */ defineChain({
|
|
@@ -6219,6 +6194,8 @@ function getEvmViemChain(id) {
|
|
|
6219
6194
|
return nibiru;
|
|
6220
6195
|
case HYPEREVM_MAINNET_CHAIN_ID:
|
|
6221
6196
|
return hyper;
|
|
6197
|
+
case LIGHTLINK_MAINNET_CHAIN_ID:
|
|
6198
|
+
return lightlinkPhoenix;
|
|
6222
6199
|
default:
|
|
6223
6200
|
throw new Error(`Unsupported EVM chain ID: ${id}`);
|
|
6224
6201
|
}
|
|
@@ -6934,6 +6911,119 @@ var spokeChainConfig = {
|
|
|
6934
6911
|
}
|
|
6935
6912
|
}
|
|
6936
6913
|
},
|
|
6914
|
+
[LIGHTLINK_MAINNET_CHAIN_ID]: {
|
|
6915
|
+
chain: {
|
|
6916
|
+
name: "lightlink phoenix",
|
|
6917
|
+
id: LIGHTLINK_MAINNET_CHAIN_ID,
|
|
6918
|
+
type: "EVM"
|
|
6919
|
+
},
|
|
6920
|
+
addresses: {
|
|
6921
|
+
assetManager: "0x4A1C82744cDDeE675A255fB289Cb0917A482e7C7",
|
|
6922
|
+
connection: "0x6D2126DB97dd88AfA85127253807D04A066b6746"
|
|
6923
|
+
},
|
|
6924
|
+
nativeToken: "0x0000000000000000000000000000000000000000",
|
|
6925
|
+
bnUSD: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7",
|
|
6926
|
+
supportedTokens: {
|
|
6927
|
+
ETH: {
|
|
6928
|
+
symbol: "ETH",
|
|
6929
|
+
name: "ETH",
|
|
6930
|
+
decimals: 18,
|
|
6931
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
6932
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6933
|
+
},
|
|
6934
|
+
bnUSD: {
|
|
6935
|
+
symbol: "bnUSD",
|
|
6936
|
+
name: "bnUSD",
|
|
6937
|
+
decimals: 18,
|
|
6938
|
+
address: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7",
|
|
6939
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6940
|
+
},
|
|
6941
|
+
SODA: {
|
|
6942
|
+
symbol: "SODA",
|
|
6943
|
+
name: "SODAX",
|
|
6944
|
+
decimals: 18,
|
|
6945
|
+
address: "0x6BC8C37cba91F76E68C9e6d689A9C21E4d32079B",
|
|
6946
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6947
|
+
},
|
|
6948
|
+
USDC: {
|
|
6949
|
+
symbol: "USDC",
|
|
6950
|
+
name: "USD Coin",
|
|
6951
|
+
decimals: 6,
|
|
6952
|
+
address: "0xbCF8C1B03bBDDA88D579330BDF236B58F8bb2cFd",
|
|
6953
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6954
|
+
},
|
|
6955
|
+
"BTC.LL": {
|
|
6956
|
+
symbol: "BTC.LL",
|
|
6957
|
+
name: "Bitcoin LightLINK",
|
|
6958
|
+
decimals: 18,
|
|
6959
|
+
address: "0x5E921D8B7709b409132628258A53449D1fD82341",
|
|
6960
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6961
|
+
},
|
|
6962
|
+
"AVAX.LL": {
|
|
6963
|
+
symbol: "AVAX.LL",
|
|
6964
|
+
name: "Avalanche LightLINK",
|
|
6965
|
+
decimals: 18,
|
|
6966
|
+
address: "0x373d9c5390535e9e30185E52826d45b76df09aBb",
|
|
6967
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6968
|
+
},
|
|
6969
|
+
"BNB.LL": {
|
|
6970
|
+
symbol: "BNB.LL",
|
|
6971
|
+
name: "BNB LightLINK",
|
|
6972
|
+
decimals: 18,
|
|
6973
|
+
address: "0xe80c2B7674dCdF47b199697E2c61730231b8da89",
|
|
6974
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6975
|
+
},
|
|
6976
|
+
"SOL.LL": {
|
|
6977
|
+
symbol: "SOL.LL",
|
|
6978
|
+
name: "Solana LightLINK",
|
|
6979
|
+
decimals: 18,
|
|
6980
|
+
address: "0xba9af7029Ae5c1054Fc367d5D6a47Dc3D5c0D6bA",
|
|
6981
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6982
|
+
},
|
|
6983
|
+
"XLM.LL": {
|
|
6984
|
+
symbol: "XLM.LL",
|
|
6985
|
+
name: "Stellar LightLINK",
|
|
6986
|
+
decimals: 18,
|
|
6987
|
+
address: "0x03beDD719b6d8de11f5B2671b2f30085a626F8Da",
|
|
6988
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6989
|
+
},
|
|
6990
|
+
"INJ.LL": {
|
|
6991
|
+
symbol: "INJ.LL",
|
|
6992
|
+
name: "Injective LightLINK",
|
|
6993
|
+
decimals: 18,
|
|
6994
|
+
address: "0x8a4C8B1A899Fa9D9246a112E8D43EC0C97b77B8C",
|
|
6995
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
6996
|
+
},
|
|
6997
|
+
"SUI.LL": {
|
|
6998
|
+
symbol: "SUI.LL",
|
|
6999
|
+
name: "Sui LightLINK",
|
|
7000
|
+
decimals: 18,
|
|
7001
|
+
address: "0x59e68e2F5147F74F27FD173397a7419C1e5d9999",
|
|
7002
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
7003
|
+
},
|
|
7004
|
+
"S.LL": {
|
|
7005
|
+
symbol: "S.LL",
|
|
7006
|
+
name: "Sonic LightLINK",
|
|
7007
|
+
decimals: 18,
|
|
7008
|
+
address: "0xb3A47798CB6585Ea0d31a7986f2a04b25C60247f",
|
|
7009
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
7010
|
+
},
|
|
7011
|
+
"POL.LL": {
|
|
7012
|
+
symbol: "POL.LL",
|
|
7013
|
+
name: "Polygon LightLINK",
|
|
7014
|
+
decimals: 18,
|
|
7015
|
+
address: "0xE963bfb4757fC8Ae66BC68E11e636f8fbafAfCb4",
|
|
7016
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
7017
|
+
},
|
|
7018
|
+
"HYPE.LL": {
|
|
7019
|
+
symbol: "HYPE.LL",
|
|
7020
|
+
name: "HyperEVM LightLINK",
|
|
7021
|
+
decimals: 18,
|
|
7022
|
+
address: "0x127b64fb645279F8aca786c507b94dde81F02d16",
|
|
7023
|
+
xChainId: LIGHTLINK_MAINNET_CHAIN_ID
|
|
7024
|
+
}
|
|
7025
|
+
}
|
|
7026
|
+
},
|
|
6937
7027
|
[INJECTIVE_MAINNET_CHAIN_ID]: {
|
|
6938
7028
|
addresses: {
|
|
6939
7029
|
assetManager: "inj1dg6tm62uup53wn2kn97caeqfwt0sukx3qjk8rw",
|
|
@@ -6995,6 +7085,23 @@ var spokeChainConfig = {
|
|
|
6995
7085
|
rateLimit: "CB6G3ULISTTBPXUN3BI6ADHQGWJEN7BPQINHL45TCB6TDFM5QWU24HAY",
|
|
6996
7086
|
testToken: ""
|
|
6997
7087
|
},
|
|
7088
|
+
trustlineConfigs: [
|
|
7089
|
+
{
|
|
7090
|
+
assetCode: "USDC",
|
|
7091
|
+
contractId: "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
|
|
7092
|
+
assetIssuer: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
|
|
7093
|
+
},
|
|
7094
|
+
{
|
|
7095
|
+
assetCode: "bnUSD",
|
|
7096
|
+
contractId: "CD6YBFFWMU2UJHX2NGRJ7RN76IJVTCC7MRA46DUBXNB7E6W7H7JRJ2CX",
|
|
7097
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
7098
|
+
},
|
|
7099
|
+
{
|
|
7100
|
+
assetCode: "SODA",
|
|
7101
|
+
contractId: "CAH5LKJC2ZB4RVUVEVL2QWJWNJLHQE2UF767ILLQ5EQ4O3OURR2XIUGM",
|
|
7102
|
+
assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
|
|
7103
|
+
}
|
|
7104
|
+
],
|
|
6998
7105
|
supportedTokens: {
|
|
6999
7106
|
bnUSD: {
|
|
7000
7107
|
symbol: "bnUSD",
|
|
@@ -7210,7 +7317,8 @@ var hubVaults = {
|
|
|
7210
7317
|
address: "0x62ecc3eeb80a162c57624b3ff80313fe69f5203e",
|
|
7211
7318
|
reserves: [
|
|
7212
7319
|
// hub asset addresses contained in the vault
|
|
7213
|
-
"0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38"
|
|
7320
|
+
"0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38",
|
|
7321
|
+
"0xb592d2631ccf245119532e025d11188cfadb6777"
|
|
7214
7322
|
]
|
|
7215
7323
|
},
|
|
7216
7324
|
[SodaTokens.sodaNIBI.symbol]: {
|
|
@@ -7305,8 +7413,10 @@ var hubVaults = {
|
|
|
7305
7413
|
// Arbitrum ETH hub asset
|
|
7306
7414
|
"0x57fc2ac5701e463ae261adbd6c99fbeb48ce5293",
|
|
7307
7415
|
// BSC ETH hub asset
|
|
7308
|
-
"0x50c42deacd8fc9773493ed674b675be577f2634b"
|
|
7416
|
+
"0x50c42deacd8fc9773493ed674b675be577f2634b",
|
|
7309
7417
|
// Sonic WETH hub asset
|
|
7418
|
+
"0x19920ef8fe1a9d51fdb0914abbb2f970c74dca68"
|
|
7419
|
+
// Lightlink ETH hub asset
|
|
7310
7420
|
]
|
|
7311
7421
|
},
|
|
7312
7422
|
[SodaTokens.sodaBTC.symbol]: {
|
|
@@ -7415,7 +7525,7 @@ var bnUSDLegacySpokeChainIds = [
|
|
|
7415
7525
|
SUI_MAINNET_CHAIN_ID,
|
|
7416
7526
|
STELLAR_MAINNET_CHAIN_ID
|
|
7417
7527
|
];
|
|
7418
|
-
var newbnUSDSpokeChainIds =
|
|
7528
|
+
var newbnUSDSpokeChainIds = CHAIN_IDS.filter((chainId) => chainId !== ICON_MAINNET_CHAIN_ID);
|
|
7419
7529
|
var bnUSDLegacyTokens = [
|
|
7420
7530
|
spokeChainConfig[ICON_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
7421
7531
|
spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.legacybnUSD,
|
|
@@ -7449,14 +7559,14 @@ var getAllLegacybnUSDTokens = () => {
|
|
|
7449
7559
|
var hubAssets = {
|
|
7450
7560
|
[SONIC_MAINNET_CHAIN_ID]: {
|
|
7451
7561
|
[spokeChainConfig[SONIC_MAINNET_CHAIN_ID].nativeToken]: {
|
|
7452
|
-
asset: spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.
|
|
7562
|
+
asset: spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.wS.address,
|
|
7453
7563
|
decimal: 18,
|
|
7454
7564
|
symbol: "S",
|
|
7455
7565
|
name: "Sonic",
|
|
7456
7566
|
vault: hubVaults.sodaS.address
|
|
7457
7567
|
},
|
|
7458
7568
|
[spokeChainConfig[SONIC_MAINNET_CHAIN_ID].bnUSD]: {
|
|
7459
|
-
asset:
|
|
7569
|
+
asset: spokeChainConfig[SONIC_MAINNET_CHAIN_ID].bnUSD,
|
|
7460
7570
|
decimal: 18,
|
|
7461
7571
|
symbol: "bnUSD",
|
|
7462
7572
|
name: "bnUSD",
|
|
@@ -7829,6 +7939,106 @@ var hubAssets = {
|
|
|
7829
7939
|
vault: hubVaults.sodaSODA.address
|
|
7830
7940
|
}
|
|
7831
7941
|
},
|
|
7942
|
+
[LIGHTLINK_MAINNET_CHAIN_ID]: {
|
|
7943
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].nativeToken]: {
|
|
7944
|
+
asset: "0x19920ef8fe1a9d51fdb0914abbb2f970c74dca68",
|
|
7945
|
+
decimal: 18,
|
|
7946
|
+
symbol: "ETH",
|
|
7947
|
+
name: "ETH",
|
|
7948
|
+
vault: hubVaults.sodaETH.address
|
|
7949
|
+
},
|
|
7950
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].bnUSD]: {
|
|
7951
|
+
asset: "0x14ab2ab7a76838b9205488efc3f700d0632ce8c7",
|
|
7952
|
+
decimal: 18,
|
|
7953
|
+
symbol: "bnUSD",
|
|
7954
|
+
name: "bnUSD",
|
|
7955
|
+
vault: hubVaults.bnUSD.address
|
|
7956
|
+
},
|
|
7957
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.SODA.address]: {
|
|
7958
|
+
asset: "0xe4faab621fb6716e32057b7ea7356219936519ac",
|
|
7959
|
+
decimal: 18,
|
|
7960
|
+
symbol: "SODA",
|
|
7961
|
+
name: "SODAX",
|
|
7962
|
+
vault: hubVaults.sodaSODA.address
|
|
7963
|
+
},
|
|
7964
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.USDC.address]: {
|
|
7965
|
+
asset: "0xe5159e2a89aeec2fc63d6c25adda3541670af101",
|
|
7966
|
+
decimal: 6,
|
|
7967
|
+
symbol: "USDC",
|
|
7968
|
+
name: "USD Coin",
|
|
7969
|
+
vault: hubVaults.sodaUSDC.address
|
|
7970
|
+
},
|
|
7971
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BTC.LL"].address]: {
|
|
7972
|
+
asset: "0x54582cdb0c145398b532e34f0851ffc1bbc88b4e",
|
|
7973
|
+
decimal: 18,
|
|
7974
|
+
symbol: "BTC.LL",
|
|
7975
|
+
name: "Bitcoin LightLINK",
|
|
7976
|
+
vault: hubVaults.sodaBTC.address
|
|
7977
|
+
},
|
|
7978
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["AVAX.LL"].address]: {
|
|
7979
|
+
asset: "0x415ff3ea8c905ef65cd82665c5534d0e4ff9221a",
|
|
7980
|
+
decimal: 18,
|
|
7981
|
+
symbol: "AVAX.LL",
|
|
7982
|
+
name: "Avalanche LightLINK",
|
|
7983
|
+
vault: hubVaults.sodaAVAX.address
|
|
7984
|
+
},
|
|
7985
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BNB.LL"].address]: {
|
|
7986
|
+
asset: "0xd32e524da9d64db4c37a50f1ee197b591e97dc05",
|
|
7987
|
+
decimal: 18,
|
|
7988
|
+
symbol: "BNB.LL",
|
|
7989
|
+
name: "BNB LightLINK",
|
|
7990
|
+
vault: hubVaults.sodaBNB.address
|
|
7991
|
+
},
|
|
7992
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SOL.LL"].address]: {
|
|
7993
|
+
asset: "0xd70c16f1e2c4207dc4c44bc69c8a1b82b50cf9e2",
|
|
7994
|
+
decimal: 18,
|
|
7995
|
+
symbol: "SOL.LL",
|
|
7996
|
+
name: "Solana LightLINK",
|
|
7997
|
+
vault: hubVaults.sodaSOL.address
|
|
7998
|
+
},
|
|
7999
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["XLM.LL"].address]: {
|
|
8000
|
+
asset: "0x18008b18964bc2c90521a7596ff9988743c97fd4",
|
|
8001
|
+
decimal: 18,
|
|
8002
|
+
symbol: "XLM.LL",
|
|
8003
|
+
name: "Stellar LightLINK",
|
|
8004
|
+
vault: hubVaults.sodaXLM.address
|
|
8005
|
+
},
|
|
8006
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["INJ.LL"].address]: {
|
|
8007
|
+
asset: "0xb036daab0c772b080babb84b8695c3ca858925b6",
|
|
8008
|
+
decimal: 18,
|
|
8009
|
+
symbol: "INJ.LL",
|
|
8010
|
+
name: "Injective LightLINK",
|
|
8011
|
+
vault: hubVaults.sodaINJ.address
|
|
8012
|
+
},
|
|
8013
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SUI.LL"].address]: {
|
|
8014
|
+
asset: "0x425852cca84e5f44d7b8ebb964b21bde585b4571",
|
|
8015
|
+
decimal: 18,
|
|
8016
|
+
symbol: "SUI.LL",
|
|
8017
|
+
name: "Sui LightLINK",
|
|
8018
|
+
vault: hubVaults.sodaSUI.address
|
|
8019
|
+
},
|
|
8020
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["S.LL"].address]: {
|
|
8021
|
+
asset: "0xb592d2631ccf245119532e025d11188cfadb6777",
|
|
8022
|
+
decimal: 18,
|
|
8023
|
+
symbol: "S.LL",
|
|
8024
|
+
name: "Sonic LightLINK",
|
|
8025
|
+
vault: hubVaults.sodaS.address
|
|
8026
|
+
},
|
|
8027
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["POL.LL"].address]: {
|
|
8028
|
+
asset: "0x15ba35f87f259b9b50d53a2fec271bb10020b090",
|
|
8029
|
+
decimal: 18,
|
|
8030
|
+
symbol: "POL.LL",
|
|
8031
|
+
name: "Polygon LightLINK",
|
|
8032
|
+
vault: hubVaults.sodaPOL.address
|
|
8033
|
+
},
|
|
8034
|
+
[spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["HYPE.LL"].address]: {
|
|
8035
|
+
asset: "0xea7e97b4597f724844426c32248ba80bd29c75f8",
|
|
8036
|
+
decimal: 18,
|
|
8037
|
+
symbol: "HYPE.LL",
|
|
8038
|
+
name: "HyperEVM LightLINK",
|
|
8039
|
+
vault: hubVaults.sodaHYPE.address
|
|
8040
|
+
}
|
|
8041
|
+
},
|
|
7832
8042
|
[INJECTIVE_MAINNET_CHAIN_ID]: {
|
|
7833
8043
|
[spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.INJ.address]: {
|
|
7834
8044
|
asset: "0xd375590b4955f6ea5623f799153f9b787a3bd319",
|
|
@@ -8025,7 +8235,7 @@ var hubAssets = {
|
|
|
8025
8235
|
decimal: 18,
|
|
8026
8236
|
symbol: "wICX",
|
|
8027
8237
|
name: "ICON",
|
|
8028
|
-
vault: "
|
|
8238
|
+
vault: "0x"
|
|
8029
8239
|
},
|
|
8030
8240
|
[spokeChainConfig[ICON_MAINNET_CHAIN_ID].bnUSD]: {
|
|
8031
8241
|
asset: "0x654dddf32a9a2ac53f5fb54bf1e93f66791f8047",
|
|
@@ -8106,6 +8316,22 @@ var solverSupportedTokens = {
|
|
|
8106
8316
|
spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.USDC
|
|
8107
8317
|
],
|
|
8108
8318
|
[HYPEREVM_MAINNET_CHAIN_ID]: [],
|
|
8319
|
+
[LIGHTLINK_MAINNET_CHAIN_ID]: [
|
|
8320
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.ETH,
|
|
8321
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
8322
|
+
// spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.SODA,
|
|
8323
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.USDC,
|
|
8324
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BTC.LL"],
|
|
8325
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["AVAX.LL"],
|
|
8326
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BNB.LL"],
|
|
8327
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SOL.LL"],
|
|
8328
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["XLM.LL"],
|
|
8329
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["INJ.LL"],
|
|
8330
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SUI.LL"],
|
|
8331
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["S.LL"],
|
|
8332
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["POL.LL"]
|
|
8333
|
+
// spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens['HYPE.LL'],
|
|
8334
|
+
],
|
|
8109
8335
|
[SOLANA_MAINNET_CHAIN_ID]: [
|
|
8110
8336
|
spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
|
|
8111
8337
|
spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
@@ -8215,6 +8441,21 @@ var moneyMarketSupportedTokens = {
|
|
|
8215
8441
|
spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
8216
8442
|
spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.SODA
|
|
8217
8443
|
],
|
|
8444
|
+
[LIGHTLINK_MAINNET_CHAIN_ID]: [
|
|
8445
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.ETH,
|
|
8446
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
8447
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.USDC,
|
|
8448
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["AVAX.LL"],
|
|
8449
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["BNB.LL"],
|
|
8450
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SOL.LL"],
|
|
8451
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["XLM.LL"],
|
|
8452
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["INJ.LL"],
|
|
8453
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["SUI.LL"],
|
|
8454
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["S.LL"],
|
|
8455
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["POL.LL"],
|
|
8456
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens["HYPE.LL"],
|
|
8457
|
+
spokeChainConfig[LIGHTLINK_MAINNET_CHAIN_ID].supportedTokens.SODA
|
|
8458
|
+
],
|
|
8218
8459
|
[SOLANA_MAINNET_CHAIN_ID]: [
|
|
8219
8460
|
spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
|
|
8220
8461
|
spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
|
|
@@ -8291,7 +8532,7 @@ var supportedHubAssets = new Set(
|
|
|
8291
8532
|
var supportedSodaAssets = new Set(
|
|
8292
8533
|
Object.values(hubAssets).flatMap((assets) => Object.values(assets).map((info) => info.vault.toLowerCase()))
|
|
8293
8534
|
);
|
|
8294
|
-
var spokeChainIdsSet = new Set(
|
|
8535
|
+
var spokeChainIdsSet = new Set(CHAIN_IDS);
|
|
8295
8536
|
var getOriginalAssetInfoFromVault = (chainId, vault) => {
|
|
8296
8537
|
const assets = hubAssets[chainId];
|
|
8297
8538
|
if (!assets) {
|
|
@@ -8314,7 +8555,7 @@ var isValidHubAsset = (hubAsset) => supportedHubAssets.has(hubAsset.toLowerCase(
|
|
|
8314
8555
|
var isValidVault = (vault) => supportedSodaAssets.has(vault.toLowerCase());
|
|
8315
8556
|
var isValidChainHubAsset = (chainId, hubAsset) => chainIdToHubAssetsMap.get(chainId)?.has(hubAsset.toLowerCase()) ?? false;
|
|
8316
8557
|
var isValidSpokeChainId = (chainId) => spokeChainIdsSet.has(chainId);
|
|
8317
|
-
var isValidIntentRelayChainId = (chainId) => Object.values(
|
|
8558
|
+
var isValidIntentRelayChainId = (chainId) => Object.values(ChainIdToIntentRelayChainId).some((id) => id === chainId);
|
|
8318
8559
|
var supportedHubChains = Object.keys(hubChainConfig);
|
|
8319
8560
|
var supportedSpokeChains = Object.keys(spokeChainConfig);
|
|
8320
8561
|
var intentRelayChainIdToSpokeChainIdMap = new Map(
|
|
@@ -8472,7 +8713,6 @@ var InjectiveSpokeProvider = class {
|
|
|
8472
8713
|
return num.toString();
|
|
8473
8714
|
}
|
|
8474
8715
|
};
|
|
8475
|
-
var IconSdk = "default" in IconSdkRaw.default ? IconSdkRaw.default : IconSdkRaw;
|
|
8476
8716
|
var IconSpokeProvider = class {
|
|
8477
8717
|
walletProvider;
|
|
8478
8718
|
chainConfig;
|
|
@@ -8481,7 +8721,7 @@ var IconSpokeProvider = class {
|
|
|
8481
8721
|
constructor(walletProvider, chainConfig, rpcUrl = "https://ctz.solidwallet.io/api/v3", debugRpcUrl = "https://ctz.solidwallet.io/api/v3d") {
|
|
8482
8722
|
this.walletProvider = walletProvider;
|
|
8483
8723
|
this.chainConfig = chainConfig;
|
|
8484
|
-
this.iconService = new
|
|
8724
|
+
this.iconService = new IconService(new IconService.HttpProvider(rpcUrl));
|
|
8485
8725
|
this.debugRpcUrl = debugRpcUrl;
|
|
8486
8726
|
}
|
|
8487
8727
|
};
|
|
@@ -8551,42 +8791,6 @@ var EvmSpokeProvider = class {
|
|
|
8551
8791
|
}
|
|
8552
8792
|
}
|
|
8553
8793
|
};
|
|
8554
|
-
var CustomStellarAccount = class {
|
|
8555
|
-
accountId;
|
|
8556
|
-
sequenceNumber;
|
|
8557
|
-
startingSequenceNumber;
|
|
8558
|
-
constructor({ account_id, sequence }) {
|
|
8559
|
-
this.accountId = account_id;
|
|
8560
|
-
this.sequenceNumber = BigInt(sequence);
|
|
8561
|
-
this.startingSequenceNumber = BigInt(sequence);
|
|
8562
|
-
}
|
|
8563
|
-
getSequenceNumber() {
|
|
8564
|
-
return this.sequenceNumber;
|
|
8565
|
-
}
|
|
8566
|
-
getStartingSequenceNumber() {
|
|
8567
|
-
return this.startingSequenceNumber;
|
|
8568
|
-
}
|
|
8569
|
-
getAccountId() {
|
|
8570
|
-
return this.accountId;
|
|
8571
|
-
}
|
|
8572
|
-
getAccountClone() {
|
|
8573
|
-
return new Account(this.accountId, this.sequenceNumber.toString());
|
|
8574
|
-
}
|
|
8575
|
-
incrementSequenceNumber() {
|
|
8576
|
-
this.sequenceNumber++;
|
|
8577
|
-
}
|
|
8578
|
-
decrementSequenceNumber() {
|
|
8579
|
-
if (this.sequenceNumber > this.startingSequenceNumber) {
|
|
8580
|
-
this.sequenceNumber--;
|
|
8581
|
-
}
|
|
8582
|
-
throw new Error(
|
|
8583
|
-
`Sequence number cannot be decremented below the starting sequence number: ${this.startingSequenceNumber}`
|
|
8584
|
-
);
|
|
8585
|
-
}
|
|
8586
|
-
resetSequenceNumber() {
|
|
8587
|
-
this.sequenceNumber = this.startingSequenceNumber;
|
|
8588
|
-
}
|
|
8589
|
-
};
|
|
8590
8794
|
var CustomSorobanServer = class extends SorobanRpc.Server {
|
|
8591
8795
|
customHeaders;
|
|
8592
8796
|
constructor(serverUrl, customHeaders) {
|
|
@@ -8679,6 +8883,44 @@ var CustomSorobanServer = class extends SorobanRpc.Server {
|
|
|
8679
8883
|
return response.json().then((json) => json.result);
|
|
8680
8884
|
}
|
|
8681
8885
|
};
|
|
8886
|
+
|
|
8887
|
+
// src/entities/stellar/StellarSpokeProvider.ts
|
|
8888
|
+
var CustomStellarAccount = class {
|
|
8889
|
+
accountId;
|
|
8890
|
+
sequenceNumber;
|
|
8891
|
+
startingSequenceNumber;
|
|
8892
|
+
constructor({ account_id, sequence }) {
|
|
8893
|
+
this.accountId = account_id;
|
|
8894
|
+
this.sequenceNumber = BigInt(sequence);
|
|
8895
|
+
this.startingSequenceNumber = BigInt(sequence);
|
|
8896
|
+
}
|
|
8897
|
+
getSequenceNumber() {
|
|
8898
|
+
return this.sequenceNumber;
|
|
8899
|
+
}
|
|
8900
|
+
getStartingSequenceNumber() {
|
|
8901
|
+
return this.startingSequenceNumber;
|
|
8902
|
+
}
|
|
8903
|
+
getAccountId() {
|
|
8904
|
+
return this.accountId;
|
|
8905
|
+
}
|
|
8906
|
+
getAccountClone() {
|
|
8907
|
+
return new Account(this.accountId, this.sequenceNumber.toString());
|
|
8908
|
+
}
|
|
8909
|
+
incrementSequenceNumber() {
|
|
8910
|
+
this.sequenceNumber++;
|
|
8911
|
+
}
|
|
8912
|
+
decrementSequenceNumber() {
|
|
8913
|
+
if (this.sequenceNumber > this.startingSequenceNumber) {
|
|
8914
|
+
this.sequenceNumber--;
|
|
8915
|
+
}
|
|
8916
|
+
throw new Error(
|
|
8917
|
+
`Sequence number cannot be decremented below the starting sequence number: ${this.startingSequenceNumber}`
|
|
8918
|
+
);
|
|
8919
|
+
}
|
|
8920
|
+
resetSequenceNumber() {
|
|
8921
|
+
this.sequenceNumber = this.startingSequenceNumber;
|
|
8922
|
+
}
|
|
8923
|
+
};
|
|
8682
8924
|
var StellarSpokeProvider = class {
|
|
8683
8925
|
server;
|
|
8684
8926
|
sorobanServer;
|
|
@@ -10074,8 +10316,6 @@ async function estimateStepCost(rawTx, debugRpcUrl) {
|
|
|
10074
10316
|
}
|
|
10075
10317
|
|
|
10076
10318
|
// src/services/spoke/IconSpokeService.ts
|
|
10077
|
-
var IconSdk2 = "default" in IconSdkRaw.default ? IconSdkRaw.default : IconSdkRaw;
|
|
10078
|
-
var { Converter, CallTransactionBuilder, CallBuilder } = IconSdk2;
|
|
10079
10319
|
var IconSpokeService = class _IconSpokeService {
|
|
10080
10320
|
constructor() {
|
|
10081
10321
|
}
|
|
@@ -10510,6 +10750,83 @@ var SolanaSpokeService = class _SolanaSpokeService {
|
|
|
10510
10750
|
var StellarSpokeService = class _StellarSpokeService {
|
|
10511
10751
|
constructor() {
|
|
10512
10752
|
}
|
|
10753
|
+
/**
|
|
10754
|
+
* Check if the user has sufficent trustline established for the token.
|
|
10755
|
+
* @param token - The token address to check the trustline for.
|
|
10756
|
+
* @param amount - The amount of tokens to check the trustline for.
|
|
10757
|
+
* @param spokeProvider - The Stellar spoke provider.
|
|
10758
|
+
* @returns True if the user has sufficent trustline established for the token, false otherwise.
|
|
10759
|
+
*/
|
|
10760
|
+
static async hasSufficientTrustline(token, amount, spokeProvider) {
|
|
10761
|
+
if (token.toLowerCase() === spokeProvider.chainConfig.nativeToken.toLowerCase() || token.toLowerCase() === spokeChainConfig[STELLAR_MAINNET_CHAIN_ID].supportedTokens.legacybnUSD.address.toLowerCase()) {
|
|
10762
|
+
return true;
|
|
10763
|
+
}
|
|
10764
|
+
const trustlineConfig = spokeProvider.chainConfig.trustlineConfigs.find(
|
|
10765
|
+
(config) => config.contractId.toLowerCase() === token.toLowerCase()
|
|
10766
|
+
);
|
|
10767
|
+
if (!trustlineConfig) {
|
|
10768
|
+
throw new Error(`Trustline config not found for token: ${token}`);
|
|
10769
|
+
}
|
|
10770
|
+
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
10771
|
+
const { balances } = await spokeProvider.server.accounts().accountId(walletAddress).call();
|
|
10772
|
+
const tokenBalance = balances.find(
|
|
10773
|
+
(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()
|
|
10774
|
+
);
|
|
10775
|
+
if (!tokenBalance) {
|
|
10776
|
+
console.error(`No token balances found for token: ${token}`);
|
|
10777
|
+
return false;
|
|
10778
|
+
}
|
|
10779
|
+
const limit = parseToStroops(tokenBalance.limit);
|
|
10780
|
+
const balance = parseToStroops(tokenBalance.balance);
|
|
10781
|
+
const availableTrustAmount = limit - balance;
|
|
10782
|
+
return availableTrustAmount >= amount;
|
|
10783
|
+
}
|
|
10784
|
+
/**
|
|
10785
|
+
* Request a trustline for a given token and amount.
|
|
10786
|
+
* @param token - The token address to request the trustline for.
|
|
10787
|
+
* @param amount - The amount of tokens to request the trustline for.
|
|
10788
|
+
* @param spokeProvider - The spoke provider.
|
|
10789
|
+
* @param raw - Whether to return the raw transaction data.
|
|
10790
|
+
* @returns The transaction result.
|
|
10791
|
+
*/
|
|
10792
|
+
static async requestTrustline(token, amount, spokeProvider, raw) {
|
|
10793
|
+
try {
|
|
10794
|
+
const asset = spokeProvider.chainConfig.trustlineConfigs.find(
|
|
10795
|
+
(t) => t.contractId.toLowerCase() === token.toLowerCase()
|
|
10796
|
+
);
|
|
10797
|
+
if (!asset) {
|
|
10798
|
+
throw new Error(`Asset ${token} not found. Cannot proceed with trustline.`);
|
|
10799
|
+
}
|
|
10800
|
+
const [network, walletAddress] = await Promise.all([
|
|
10801
|
+
spokeProvider.sorobanServer.getNetwork(),
|
|
10802
|
+
spokeProvider.walletProvider.getWalletAddress()
|
|
10803
|
+
]);
|
|
10804
|
+
const accountResponse = await spokeProvider.server.loadAccount(walletAddress);
|
|
10805
|
+
const stellarAccount = new CustomStellarAccount(accountResponse);
|
|
10806
|
+
const transaction = new TransactionBuilder(stellarAccount.getAccountClone(), {
|
|
10807
|
+
fee: BASE_FEE,
|
|
10808
|
+
networkPassphrase: network.passphrase
|
|
10809
|
+
}).addOperation(
|
|
10810
|
+
Operation.changeTrust({
|
|
10811
|
+
asset: new Asset(asset?.assetCode, asset?.assetIssuer)
|
|
10812
|
+
})
|
|
10813
|
+
).setTimeout(STELLAR_DEFAULT_TX_TIMEOUT_SECONDS).build();
|
|
10814
|
+
if (raw) {
|
|
10815
|
+
const transactionXdr = transaction.toXDR();
|
|
10816
|
+
return {
|
|
10817
|
+
from: walletAddress,
|
|
10818
|
+
to: spokeProvider.chainConfig.addresses.assetManager,
|
|
10819
|
+
value: amount,
|
|
10820
|
+
data: transactionXdr
|
|
10821
|
+
};
|
|
10822
|
+
}
|
|
10823
|
+
const hash = await spokeProvider.signAndSendTransaction(transaction);
|
|
10824
|
+
return `${hash}`;
|
|
10825
|
+
} catch (error) {
|
|
10826
|
+
console.error("Error during requestTrustline:", error);
|
|
10827
|
+
throw error;
|
|
10828
|
+
}
|
|
10829
|
+
}
|
|
10513
10830
|
/**
|
|
10514
10831
|
* Estimate the gas for a transaction.
|
|
10515
10832
|
* @param rawTx - The raw transaction to estimate the gas for.
|
|
@@ -10727,11 +11044,8 @@ var SonicSpokeService = class _SonicSpokeService {
|
|
|
10727
11044
|
return spokeProvider.walletProvider.sendTransaction(rawTx);
|
|
10728
11045
|
}
|
|
10729
11046
|
static async createSwapIntent(createIntentParams, creatorHubWalletAddress, solverConfig2, fee, spokeProvider, hubProvider, raw) {
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
inputToken = hubProvider.chainConfig.nativeToken;
|
|
10733
|
-
}
|
|
10734
|
-
const outputToken = getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset;
|
|
11047
|
+
const inputToken = createIntentParams.inputToken;
|
|
11048
|
+
const outputToken = createIntentParams.dstChain !== SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset : createIntentParams.outputToken;
|
|
10735
11049
|
invariant12(
|
|
10736
11050
|
inputToken,
|
|
10737
11051
|
`hub asset not found for spoke chain token (intent.inputToken): ${createIntentParams.inputToken}`
|
|
@@ -11048,7 +11362,7 @@ function isJsonRpcPayloadResponse(value) {
|
|
|
11048
11362
|
return typeof value === "object" && value !== null && "id" in value && "result" in value && typeof value.result === "string";
|
|
11049
11363
|
}
|
|
11050
11364
|
function isIntentRelayChainId(value) {
|
|
11051
|
-
return typeof value === "bigint" && value >= 0n && Object.values(
|
|
11365
|
+
return typeof value === "bigint" && value >= 0n && Object.values(ChainIdToIntentRelayChainId).includes(value);
|
|
11052
11366
|
}
|
|
11053
11367
|
function isPartnerFeeAmount(value) {
|
|
11054
11368
|
return typeof value === "object" && value !== null && "address" in value && "amount" in value;
|
|
@@ -11668,11 +11982,8 @@ var EvmSolverService = class _EvmSolverService {
|
|
|
11668
11982
|
* @returns {Promise<[Hex, Intent, bigint]>} The encoded contract call, intent and fee amount
|
|
11669
11983
|
*/
|
|
11670
11984
|
static constructCreateIntentData(createIntentParams, creatorHubWalletAddress, solverConfig2, fee, hubProvider) {
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
inputToken = hubProvider.chainConfig.wrappedNativeToken;
|
|
11674
|
-
}
|
|
11675
|
-
const outputToken = getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset;
|
|
11985
|
+
const inputToken = createIntentParams.srcChain !== SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.srcChain, createIntentParams.inputToken)?.asset : createIntentParams.inputToken;
|
|
11986
|
+
const outputToken = createIntentParams.dstChain !== SONIC_MAINNET_CHAIN_ID ? getHubAssetInfo(createIntentParams.dstChain, createIntentParams.outputToken)?.asset : createIntentParams.outputToken;
|
|
11676
11987
|
invariant12(
|
|
11677
11988
|
inputToken,
|
|
11678
11989
|
`hub asset not found for spoke chain token (intent.inputToken): ${createIntentParams.inputToken}`
|
|
@@ -12447,6 +12758,12 @@ var SolverService = class {
|
|
|
12447
12758
|
spokeProvider
|
|
12448
12759
|
);
|
|
12449
12760
|
}
|
|
12761
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
12762
|
+
return {
|
|
12763
|
+
ok: true,
|
|
12764
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.inputToken, params.inputAmount, spokeProvider)
|
|
12765
|
+
};
|
|
12766
|
+
}
|
|
12450
12767
|
return {
|
|
12451
12768
|
ok: true,
|
|
12452
12769
|
value: true
|
|
@@ -12528,9 +12845,21 @@ var SolverService = class {
|
|
|
12528
12845
|
value: result
|
|
12529
12846
|
};
|
|
12530
12847
|
}
|
|
12848
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
12849
|
+
const result = await StellarSpokeService.requestTrustline(
|
|
12850
|
+
params.inputToken,
|
|
12851
|
+
params.inputAmount,
|
|
12852
|
+
spokeProvider,
|
|
12853
|
+
raw
|
|
12854
|
+
);
|
|
12855
|
+
return {
|
|
12856
|
+
ok: true,
|
|
12857
|
+
value: result
|
|
12858
|
+
};
|
|
12859
|
+
}
|
|
12531
12860
|
return {
|
|
12532
12861
|
ok: false,
|
|
12533
|
-
error: new Error("Approve only supported for EVM spoke chains")
|
|
12862
|
+
error: new Error("Approve only supported for EVM (approve) and Stellar (trustline) spoke chains")
|
|
12534
12863
|
};
|
|
12535
12864
|
} catch (error) {
|
|
12536
12865
|
return {
|
|
@@ -13333,6 +13662,12 @@ var MigrationService = class {
|
|
|
13333
13662
|
evmSpokeProvider
|
|
13334
13663
|
);
|
|
13335
13664
|
}
|
|
13665
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13666
|
+
return {
|
|
13667
|
+
ok: true,
|
|
13668
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.srcbnUSD, params.amount, spokeProvider)
|
|
13669
|
+
};
|
|
13670
|
+
}
|
|
13336
13671
|
return {
|
|
13337
13672
|
ok: true,
|
|
13338
13673
|
value: true
|
|
@@ -13359,6 +13694,29 @@ var MigrationService = class {
|
|
|
13359
13694
|
evmSpokeProvider
|
|
13360
13695
|
);
|
|
13361
13696
|
}
|
|
13697
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider.chainConfig.chain.type === "EVM") {
|
|
13698
|
+
const evmSpokeProvider = spokeProvider;
|
|
13699
|
+
let spender;
|
|
13700
|
+
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13701
|
+
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
13702
|
+
spender = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
13703
|
+
} else {
|
|
13704
|
+
spender = evmSpokeProvider.chainConfig.addresses.assetManager;
|
|
13705
|
+
}
|
|
13706
|
+
return await Erc20Service.isAllowanceValid(
|
|
13707
|
+
params.srcbnUSD,
|
|
13708
|
+
params.amount,
|
|
13709
|
+
wallet,
|
|
13710
|
+
spender,
|
|
13711
|
+
evmSpokeProvider
|
|
13712
|
+
);
|
|
13713
|
+
}
|
|
13714
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13715
|
+
return {
|
|
13716
|
+
ok: true,
|
|
13717
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.srcbnUSD, params.amount, spokeProvider)
|
|
13718
|
+
};
|
|
13719
|
+
}
|
|
13362
13720
|
if (spokeProvider instanceof SonicSpokeProvider && isIcxCreateRevertMigrationParams(params)) {
|
|
13363
13721
|
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13364
13722
|
const userRouter = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
@@ -13421,6 +13779,13 @@ var MigrationService = class {
|
|
|
13421
13779
|
value: result
|
|
13422
13780
|
};
|
|
13423
13781
|
}
|
|
13782
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13783
|
+
const result = await StellarSpokeService.requestTrustline(params.srcbnUSD, params.amount, spokeProvider, raw);
|
|
13784
|
+
return {
|
|
13785
|
+
ok: true,
|
|
13786
|
+
value: result
|
|
13787
|
+
};
|
|
13788
|
+
}
|
|
13424
13789
|
return {
|
|
13425
13790
|
ok: false,
|
|
13426
13791
|
error: new Error("Invalid params for migrate action")
|
|
@@ -13451,6 +13816,13 @@ var MigrationService = class {
|
|
|
13451
13816
|
value: result
|
|
13452
13817
|
};
|
|
13453
13818
|
}
|
|
13819
|
+
if (isUnifiedBnUSDMigrateParams(params) && spokeProvider instanceof StellarSpokeProvider) {
|
|
13820
|
+
const result = await StellarSpokeService.requestTrustline(params.srcbnUSD, params.amount, spokeProvider, raw);
|
|
13821
|
+
return {
|
|
13822
|
+
ok: true,
|
|
13823
|
+
value: result
|
|
13824
|
+
};
|
|
13825
|
+
}
|
|
13454
13826
|
if (spokeProvider instanceof SonicSpokeProvider && isIcxCreateRevertMigrationParams(params)) {
|
|
13455
13827
|
const wallet = await spokeProvider.walletProvider.getWalletAddress();
|
|
13456
13828
|
const userRouter = await SonicSpokeService.getUserRouter(wallet, spokeProvider);
|
|
@@ -13544,6 +13916,14 @@ var MigrationService = class {
|
|
|
13544
13916
|
if (!packetResult.ok) {
|
|
13545
13917
|
return packetResult;
|
|
13546
13918
|
}
|
|
13919
|
+
if (!(params.srcChainId === SONIC_MAINNET_CHAIN_ID || params.dstChainId === SONIC_MAINNET_CHAIN_ID)) {
|
|
13920
|
+
await waitUntilIntentExecuted({
|
|
13921
|
+
intentRelayChainId: getIntentRelayChainId(SONIC_MAINNET_CHAIN_ID).toString(),
|
|
13922
|
+
spokeTxHash: packetResult.value.dst_tx_hash,
|
|
13923
|
+
timeout,
|
|
13924
|
+
apiUrl: this.config.relayerApiEndpoint
|
|
13925
|
+
});
|
|
13926
|
+
}
|
|
13547
13927
|
return { ok: true, value: [spokeTxHash, packetResult.value.dst_tx_hash] };
|
|
13548
13928
|
} catch (error) {
|
|
13549
13929
|
return {
|
|
@@ -14625,6 +15005,26 @@ var BridgeService = class {
|
|
|
14625
15005
|
value: allowanceResult.value
|
|
14626
15006
|
};
|
|
14627
15007
|
}
|
|
15008
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
15009
|
+
const allowanceResult = await StellarSpokeService.hasSufficientTrustline(
|
|
15010
|
+
params.srcAsset,
|
|
15011
|
+
params.amount,
|
|
15012
|
+
spokeProvider
|
|
15013
|
+
);
|
|
15014
|
+
if (!allowanceResult) {
|
|
15015
|
+
return {
|
|
15016
|
+
ok: false,
|
|
15017
|
+
error: {
|
|
15018
|
+
code: "ALLOWANCE_CHECK_FAILED",
|
|
15019
|
+
error: allowanceResult
|
|
15020
|
+
}
|
|
15021
|
+
};
|
|
15022
|
+
}
|
|
15023
|
+
return {
|
|
15024
|
+
ok: true,
|
|
15025
|
+
value: allowanceResult
|
|
15026
|
+
};
|
|
15027
|
+
}
|
|
14628
15028
|
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
14629
15029
|
invariant12(isAddress(params.srcAsset), "Invalid source asset address for Sonic chain");
|
|
14630
15030
|
const userRouter = await SonicSpokeService.getUserRouter(walletAddress, spokeProvider);
|
|
@@ -14693,6 +15093,13 @@ var BridgeService = class {
|
|
|
14693
15093
|
value: result
|
|
14694
15094
|
};
|
|
14695
15095
|
}
|
|
15096
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
15097
|
+
const result = await StellarSpokeService.requestTrustline(params.srcAsset, params.amount, spokeProvider, raw);
|
|
15098
|
+
return {
|
|
15099
|
+
ok: true,
|
|
15100
|
+
value: result
|
|
15101
|
+
};
|
|
15102
|
+
}
|
|
14696
15103
|
if (spokeProvider instanceof SonicSpokeProvider) {
|
|
14697
15104
|
invariant12(isAddress(params.srcAsset), "Invalid source asset address for Sonic chain");
|
|
14698
15105
|
const userRouter = await SonicSpokeService.getUserRouter(
|
|
@@ -14908,7 +15315,19 @@ var BridgeService = class {
|
|
|
14908
15315
|
}
|
|
14909
15316
|
const encodedRecipientAddress = encodeAddress(params.dstChainId, params.recipient);
|
|
14910
15317
|
if (params.dstChainId === this.hubProvider.chainConfig.chain.id) {
|
|
14911
|
-
|
|
15318
|
+
if (params.dstAsset.toLowerCase() === this.hubProvider.chainConfig.nativeToken.toLowerCase()) {
|
|
15319
|
+
calls.push({
|
|
15320
|
+
address: dstAssetInfo.asset,
|
|
15321
|
+
value: 0n,
|
|
15322
|
+
data: encodeFunctionData({
|
|
15323
|
+
abi: wrappedSonicAbi,
|
|
15324
|
+
functionName: "withdrawTo",
|
|
15325
|
+
args: [encodedRecipientAddress, translatedWithdrawAmount]
|
|
15326
|
+
})
|
|
15327
|
+
});
|
|
15328
|
+
} else {
|
|
15329
|
+
calls.push(Erc20Service.encodeTransfer(dstAssetInfo.asset, encodedRecipientAddress, translatedWithdrawAmount));
|
|
15330
|
+
}
|
|
14912
15331
|
} else {
|
|
14913
15332
|
invariant12(dstAssetInfo, `Unsupported hub chain (${params.dstChainId}) token: ${params.dstAsset}`);
|
|
14914
15333
|
calls.push(
|
|
@@ -15216,6 +15635,9 @@ async function deriveUserWalletAddress(spokeProvider, hubProvider, walletAddress
|
|
|
15216
15635
|
const address = walletAddress ?? await spokeProvider.walletProvider.getWalletAddress();
|
|
15217
15636
|
return spokeProvider.chainConfig.chain.id === hubProvider.chainConfig.chain.id ? address : await WalletAbstractionService.getUserAbstractedWalletAddress(address, spokeProvider, hubProvider);
|
|
15218
15637
|
}
|
|
15638
|
+
function parseToStroops(amount) {
|
|
15639
|
+
return BigInt(Math.round(Number.parseFloat(amount) * 1e7));
|
|
15640
|
+
}
|
|
15219
15641
|
var BigNumberZeroDecimal = BigNumber.clone({
|
|
15220
15642
|
DECIMAL_PLACES: 0,
|
|
15221
15643
|
ROUNDING_MODE: BigNumber.ROUND_DOWN
|
|
@@ -16749,6 +17171,12 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
16749
17171
|
`Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`
|
|
16750
17172
|
);
|
|
16751
17173
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
17174
|
+
if (spokeProvider instanceof StellarSpokeProvider && (params.action === "supply" || params.action === "repay")) {
|
|
17175
|
+
return {
|
|
17176
|
+
ok: true,
|
|
17177
|
+
value: await StellarSpokeService.hasSufficientTrustline(params.token, params.amount, spokeProvider)
|
|
17178
|
+
};
|
|
17179
|
+
}
|
|
16752
17180
|
if (spokeProvider instanceof EvmSpokeProvider && (params.action === "supply" || params.action === "repay")) {
|
|
16753
17181
|
return await Erc20Service.isAllowanceValid(
|
|
16754
17182
|
params.token,
|
|
@@ -16846,6 +17274,17 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
16846
17274
|
`Unsupported spoke chain (${spokeProvider.chainConfig.chain.id}) token: ${params.token}`
|
|
16847
17275
|
);
|
|
16848
17276
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
17277
|
+
if (spokeProvider instanceof StellarSpokeProvider) {
|
|
17278
|
+
invariant12(
|
|
17279
|
+
params.action === "supply" || params.action === "repay",
|
|
17280
|
+
"Invalid action (only supply and repay are supported on stellar)"
|
|
17281
|
+
);
|
|
17282
|
+
const result = await StellarSpokeService.requestTrustline(params.token, params.amount, spokeProvider, raw);
|
|
17283
|
+
return {
|
|
17284
|
+
ok: true,
|
|
17285
|
+
value: result
|
|
17286
|
+
};
|
|
17287
|
+
}
|
|
16849
17288
|
if (spokeProvider instanceof EvmSpokeProvider) {
|
|
16850
17289
|
invariant12(
|
|
16851
17290
|
params.action === "supply" || params.action === "repay",
|
|
@@ -17550,14 +17989,9 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17550
17989
|
const calls = [];
|
|
17551
17990
|
const assetConfig = getHubAssetInfo(spokeChainId, token);
|
|
17552
17991
|
invariant12(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
|
|
17553
|
-
|
|
17992
|
+
const assetAddress = assetConfig.asset;
|
|
17554
17993
|
const vaultAddress = assetConfig.vault;
|
|
17555
17994
|
const lendingPool = this.config.lendingPool;
|
|
17556
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17557
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17558
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17559
|
-
}
|
|
17560
|
-
}
|
|
17561
17995
|
calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
|
|
17562
17996
|
calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
|
|
17563
17997
|
const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
|
|
@@ -17587,15 +18021,10 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17587
18021
|
);
|
|
17588
18022
|
const assetConfig = getHubAssetInfo(spokeChainId, token);
|
|
17589
18023
|
invariant12(assetConfig, `hub asset not found for spoke chain token (token): ${token}`);
|
|
17590
|
-
|
|
18024
|
+
const assetAddress = assetConfig.asset;
|
|
17591
18025
|
const vaultAddress = assetConfig.vault;
|
|
17592
18026
|
const bnUSDVault = this.config.bnUSDVault;
|
|
17593
18027
|
const bnUSD = this.config.bnUSD;
|
|
17594
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17595
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17596
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17597
|
-
}
|
|
17598
|
-
}
|
|
17599
18028
|
const feeAmount = calculateFeeAmount(amount, this.config.partnerFee);
|
|
17600
18029
|
const calls = [];
|
|
17601
18030
|
if (bnUSDVault && bnUSD && bnUSDVault.toLowerCase() === vaultAddress.toLowerCase()) {
|
|
@@ -17716,15 +18145,10 @@ var MoneyMarketService = class _MoneyMarketService {
|
|
|
17716
18145
|
if (!assetConfig) {
|
|
17717
18146
|
throw new Error("[buildRepayData] Hub asset not found");
|
|
17718
18147
|
}
|
|
17719
|
-
|
|
18148
|
+
const assetAddress = assetConfig.asset;
|
|
17720
18149
|
const vaultAddress = assetConfig.vault;
|
|
17721
18150
|
const bnUSDVault = this.config.bnUSDVault;
|
|
17722
18151
|
const bnUSD = this.config.bnUSD;
|
|
17723
|
-
if (spokeChainId === this.hubProvider.chainConfig.chain.id) {
|
|
17724
|
-
if (token.toLowerCase() === spokeChainConfig[this.hubProvider.chainConfig.chain.id].nativeToken.toLowerCase()) {
|
|
17725
|
-
assetAddress = spokeChainConfig[this.hubProvider.chainConfig.chain.id].supportedTokens.wS.address;
|
|
17726
|
-
}
|
|
17727
|
-
}
|
|
17728
18152
|
calls.push(Erc20Service.encodeApprove(assetAddress, vaultAddress, amount));
|
|
17729
18153
|
calls.push(EvmVaultTokenService.encodeDeposit(vaultAddress, assetAddress, amount));
|
|
17730
18154
|
const translatedAmount = EvmVaultTokenService.translateIncomingDecimals(assetConfig.decimal, amount);
|
|
@@ -17910,6 +18334,6 @@ var SolverIntentErrorCode = /* @__PURE__ */ ((SolverIntentErrorCode2) => {
|
|
|
17910
18334
|
return SolverIntentErrorCode2;
|
|
17911
18335
|
})(SolverIntentErrorCode || {});
|
|
17912
18336
|
|
|
17913
|
-
export { BackendApiService, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BnUSDMigrationService, BridgeService, ChainIdToIntentRelayChainId, DEFAULT_BACKEND_API_ENDPOINT, DEFAULT_BACKEND_API_HEADERS, DEFAULT_BACKEND_API_TIMEOUT, DEFAULT_DEADLINE_OFFSET, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, EVM_CHAIN_IDS,
|
|
18337
|
+
export { BackendApiService, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BnUSDMigrationService, BridgeService, ChainIdToIntentRelayChainId, CustomSorobanServer, CustomStellarAccount, DEFAULT_BACKEND_API_ENDPOINT, DEFAULT_BACKEND_API_HEADERS, DEFAULT_BACKEND_API_TIMEOUT, DEFAULT_DEADLINE_OFFSET, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, EVM_CHAIN_IDS, Erc20Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeProvider, EvmSpokeService, EvmVaultTokenService, EvmWalletAbstraction, FEE_PERCENTAGE_SCALE, HALF_RAY, HALF_WAD, HubVaultSymbols, ICON_TX_RESULT_WAIT_MAX_RETRY, IconSpokeProvider, IcxMigrationService, InjectiveSpokeProvider, IntentCreatedEventAbi, IntentDataType, IntentsAbi, LTV_PRECISION, LendingPoolService, LockupMultiplier, LockupPeriod, MAX_UINT256, MigrationService, MoneyMarketDataService, MoneyMarketService, RAY, RAY_DECIMALS, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, SodaTokens, SodaTokensAsHubAssets, SodaVaultTokensSet, Sodax, SolanaSpokeProvider, SolverIntentErrorCode, SolverIntentStatusCode, SolverService, SonicSpokeProvider, SonicSpokeService, SpokeService, StellarSpokeProvider, StellarSpokeService, SuiSpokeProvider, SuiSpokeService, SupportedMigrationTokens, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, WalletAbstractionService, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, chainIdToHubAssetsMap, connectionAbi, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubAssetInfo, getHubChainConfig, getHubVaultTokenByAddress, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getMoneyMarketConfig, getOriginalAssetAddress, getOriginalAssetInfoFromVault, getOriginalTokenFromOriginalAssetAddress, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSpokeChainIdFromIntentRelayChainId, getSupportedMoneyMarketTokens, getSupportedSolverTokens, getTransactionPackets, hexToBigInt, hubAssetToOriginalAssetMap, hubAssets, hubVaultTokensMap, hubVaults, hubVaultsAddressSet, hyper, intentRelayChainIdToSpokeChainIdMap, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isEvmHubChainConfig, isEvmInitializedConfig, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isIconAddress, isIconSpokeProvider, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveSpokeProvider, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketReserveAsset, isMoneyMarketReserveHubAsset, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketSupportedToken, isMoneyMarketWithdrawUnknownError, isNativeToken, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isResponseAddressType, isResponseSigningType, isSodaVaultToken, isSolanaSpokeProvider, isSolverSupportedToken, isSonicSpokeProvider, isStellarSpokeProvider, isSuiSpokeProvider, isUnifiedBnUSDMigrateParams, isValidChainHubAsset, isValidHubAsset, isValidIntentRelayChainId, isValidOriginalAssetAddress, isValidSpokeChainId, isValidVault, isWaitUntilIntentExecutedFailed, moneyMarketReserveAssets, moneyMarketReserveHubAssetsSet, moneyMarketSupportedTokens, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, originalAssetTohubAssetMap, parseToStroops, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainIdsSet, submitTransaction, supportedHubAssets, supportedHubChains, supportedSodaAssets, supportedSpokeChains, supportedTokensPerChain, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
17914
18338
|
//# sourceMappingURL=index.mjs.map
|
|
17915
18339
|
//# sourceMappingURL=index.mjs.map
|