@swapkit/core 1.0.0-rc.29 → 1.0.0-rc.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +106 -98
- package/package.json +8 -8
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var We = (e, t, n) => t in e ?
|
|
3
|
-
var T = (e, t, n) => (We(e, typeof t != "symbol" ? t + "" : t, n), n),
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var We = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var T = (e, t, n) => (We(e, typeof t != "symbol" ? t + "" : t, n), n), je = (e, t, n) => {
|
|
4
4
|
if (!t.has(e))
|
|
5
5
|
throw TypeError("Cannot " + n);
|
|
6
6
|
};
|
|
7
|
-
var f = (e, t, n) => (
|
|
7
|
+
var f = (e, t, n) => (je(e, t, "read from private field"), n ? n.call(e) : t.get(e)), B = (e, t, n) => {
|
|
8
8
|
if (t.has(e))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var Ke = Object.defineProperty, Ye = (e, t, n) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, v = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
13
13
|
const _n = [
|
|
14
14
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
15
15
|
{
|
|
@@ -108,7 +108,7 @@ const _n = [
|
|
|
108
108
|
stateMutability: "nonpayable",
|
|
109
109
|
type: "function"
|
|
110
110
|
}
|
|
111
|
-
],
|
|
111
|
+
], Xe = [
|
|
112
112
|
{
|
|
113
113
|
inputs: [{ internalType: "address", name: "rune", type: "address" }],
|
|
114
114
|
stateMutability: "nonpayable",
|
|
@@ -283,7 +283,7 @@ const _n = [
|
|
|
283
283
|
stateMutability: "view",
|
|
284
284
|
type: "function"
|
|
285
285
|
}
|
|
286
|
-
],
|
|
286
|
+
], Je = [
|
|
287
287
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
288
288
|
{
|
|
289
289
|
anonymous: !1,
|
|
@@ -447,7 +447,7 @@ const _n = [
|
|
|
447
447
|
stateMutability: "view",
|
|
448
448
|
type: "function"
|
|
449
449
|
}
|
|
450
|
-
],
|
|
450
|
+
], Qe = [
|
|
451
451
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
452
452
|
{
|
|
453
453
|
anonymous: !1,
|
|
@@ -600,13 +600,13 @@ const _n = [
|
|
|
600
600
|
type: "function"
|
|
601
601
|
}
|
|
602
602
|
];
|
|
603
|
-
var
|
|
604
|
-
const
|
|
603
|
+
var ze = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e))(ze || {});
|
|
604
|
+
const Ze = [
|
|
605
605
|
"ERC20-ERC20",
|
|
606
606
|
"ARC20-ARC20",
|
|
607
607
|
"BEP20-BEP20"
|
|
608
608
|
/* BSC_TO_BSC */
|
|
609
|
-
],
|
|
609
|
+
], et = [
|
|
610
610
|
"ERC20-TC",
|
|
611
611
|
"ERC20-ARC20",
|
|
612
612
|
"ERC20-BEP20",
|
|
@@ -617,15 +617,15 @@ const ze = [
|
|
|
617
617
|
"BEP20-ERC20",
|
|
618
618
|
"BEP20-ARC20"
|
|
619
619
|
/* BSC_TO_AVAX */
|
|
620
|
-
],
|
|
620
|
+
], tt = [
|
|
621
621
|
"TC-TC",
|
|
622
622
|
"TC-ERC20",
|
|
623
623
|
"TC-ARC20",
|
|
624
624
|
"TC-BEP20"
|
|
625
625
|
/* TC_SUPPORTED_TO_BSC */
|
|
626
626
|
];
|
|
627
|
-
var Ce = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(Ce || {}),
|
|
628
|
-
const
|
|
627
|
+
var Ce = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(Ce || {}), nt = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(nt || {}), l = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(l || {});
|
|
628
|
+
const at = {
|
|
629
629
|
[l.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
|
|
630
630
|
[l.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
|
|
631
631
|
[l.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
|
|
@@ -677,7 +677,7 @@ const nt = {
|
|
|
677
677
|
[l.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
|
|
678
678
|
[l.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
|
|
679
679
|
}, ie = (e, t) => {
|
|
680
|
-
let n =
|
|
680
|
+
let n = at[e];
|
|
681
681
|
for (let a = 0; a < t.length; a++)
|
|
682
682
|
n = n.replace(`{${a}}`, t[a]);
|
|
683
683
|
return t.length === 0 ? n.replace("{0}", "") : n;
|
|
@@ -724,7 +724,7 @@ let fn = class Me extends Error {
|
|
|
724
724
|
return this.toErrorInfo();
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
|
-
var i = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(i || {}),
|
|
727
|
+
var i = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(i || {}), st = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(st || {}), it = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0", e.AVAX = "m/44'/60'/0'/0", e.BCH = "m/44'/145'/0'/0", e.BNB = "m/44'/714'/0'/0", e.BSC = "m/44'/60'/0'/0", e.BTC = "m/84'/0'/0'/0", e.DOGE = "m/44'/3'/0'/0", e.ETH = "m/44'/60'/0'/0", e.GAIA = "m/44'/118'/0'/0", e.KUJI = "m/44'/118'/0'/0", e.LTC = "m/84'/2'/0'/0", e.MATIC = "m/44'/60'/0'/0", e.MAYA = "m/44'/931'/0'/0", e.OP = "m/44'/60'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(it || {});
|
|
728
728
|
const bn = {
|
|
729
729
|
ARB: [44, 60, 0, 0, 0],
|
|
730
730
|
AVAX: [44, 60, 0, 0, 0],
|
|
@@ -743,7 +743,7 @@ const bn = {
|
|
|
743
743
|
THOR: [44, 931, 0, 0, 0]
|
|
744
744
|
};
|
|
745
745
|
var A = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.THOR = 8] = "THOR", e))(A || {});
|
|
746
|
-
const
|
|
746
|
+
const rt = [
|
|
747
747
|
"ETH",
|
|
748
748
|
"AVAX",
|
|
749
749
|
"BSC",
|
|
@@ -775,17 +775,17 @@ const it = [
|
|
|
775
775
|
"THOR"
|
|
776
776
|
/* THORChain */
|
|
777
777
|
];
|
|
778
|
-
var _e = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(_e || {}), Ne = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(Ne || {}),
|
|
779
|
-
const ae = Object.values(i),
|
|
778
|
+
var _e = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(_e || {}), Ne = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(Ne || {}), W = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(W || {});
|
|
779
|
+
const ae = Object.values(i), ot = Object.keys(i), fe = ae.reduce(
|
|
780
780
|
(e, t) => {
|
|
781
|
-
const n =
|
|
781
|
+
const n = ot.find((a) => i[a] === t);
|
|
782
782
|
return n && (e[t] = n), e;
|
|
783
783
|
},
|
|
784
784
|
{}
|
|
785
|
-
),
|
|
785
|
+
), pt = ae.reduce(
|
|
786
786
|
(e, t) => (e[t] = _e[fe[t]], e),
|
|
787
787
|
{}
|
|
788
|
-
),
|
|
788
|
+
), dt = ae.reduce(
|
|
789
789
|
(e, t) => (e[t] = Ne[fe[t]], e),
|
|
790
790
|
{}
|
|
791
791
|
), Rn = ae.reduce(
|
|
@@ -836,17 +836,17 @@ const ae = Object.values(i), rt = Object.keys(i), fe = ae.reduce(
|
|
|
836
836
|
MATIC: "https://polygonscan.com",
|
|
837
837
|
THOR: "https://viewblock.io/thorchain"
|
|
838
838
|
};
|
|
839
|
-
var
|
|
839
|
+
var ut = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(ut || {}), h = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(h || {}), F = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(F || {}), lt = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(lt || {}), yt = Object.defineProperty, ct = (e, t, n) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (ct(e, typeof t != "symbol" ? t + "" : t, n), n), mt = (e, t, n) => {
|
|
840
840
|
if (!t.has(e))
|
|
841
841
|
throw TypeError("Cannot " + n);
|
|
842
842
|
}, V = (e, t, n) => {
|
|
843
843
|
if (t.has(e))
|
|
844
844
|
throw TypeError("Cannot add the same private member more than once");
|
|
845
845
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
846
|
-
}, R = (e, t, n) => (
|
|
847
|
-
const
|
|
846
|
+
}, R = (e, t, n) => (mt(e, t, "access private method"), n);
|
|
847
|
+
const Tt = "0x313ce567", De = async ({ chain: e, to: t }) => {
|
|
848
848
|
try {
|
|
849
|
-
const { result: n } = await we.post(
|
|
849
|
+
const { result: n } = await we.post(dt[e], {
|
|
850
850
|
headers: {
|
|
851
851
|
accept: "*/*",
|
|
852
852
|
"content-type": "application/json",
|
|
@@ -856,37 +856,37 @@ const mt = "0x313ce567", De = async ({ chain: e, to: t }) => {
|
|
|
856
856
|
id: 44,
|
|
857
857
|
jsonrpc: "2.0",
|
|
858
858
|
method: "eth_call",
|
|
859
|
-
params: [{ to: t.toLowerCase(), data:
|
|
859
|
+
params: [{ to: t.toLowerCase(), data: Tt }, "latest"]
|
|
860
860
|
})
|
|
861
861
|
});
|
|
862
862
|
return parseInt(BigInt(n).toString());
|
|
863
863
|
} catch (n) {
|
|
864
864
|
return console.error(n), A[e];
|
|
865
865
|
}
|
|
866
|
-
},
|
|
866
|
+
}, ht = async (e) => {
|
|
867
867
|
if (e === i.Ethereum)
|
|
868
868
|
return A.ETH;
|
|
869
869
|
const [, t] = e.split("-");
|
|
870
870
|
return t != null && t.startsWith("0x") ? De({ chain: i.Ethereum, to: t }) : A.ETH;
|
|
871
|
-
},
|
|
871
|
+
}, _t = async (e) => {
|
|
872
872
|
const [, t] = e.split("-");
|
|
873
873
|
return t != null && t.startsWith("0x") ? De({ chain: i.Avalanche, to: t.toLowerCase() }) : A.AVAX;
|
|
874
|
-
},
|
|
874
|
+
}, ft = async (e) => (e === i.BinanceSmartChain, A.BSC), bt = async ({ chain: e, symbol: t }) => {
|
|
875
875
|
switch (e) {
|
|
876
876
|
case i.Ethereum:
|
|
877
|
-
return Tt(t);
|
|
878
|
-
case i.Avalanche:
|
|
879
877
|
return ht(t);
|
|
880
|
-
case i.
|
|
878
|
+
case i.Avalanche:
|
|
881
879
|
return _t(t);
|
|
880
|
+
case i.BinanceSmartChain:
|
|
881
|
+
return ft(t);
|
|
882
882
|
default:
|
|
883
883
|
return A[e];
|
|
884
884
|
}
|
|
885
|
-
},
|
|
885
|
+
}, wt = {
|
|
886
886
|
[F.Average]: 1.2,
|
|
887
887
|
[F.Fast]: 1.5,
|
|
888
888
|
[F.Fastest]: 2
|
|
889
|
-
},
|
|
889
|
+
}, Pe = ({ chain: e, symbol: t }) => {
|
|
890
890
|
switch (e) {
|
|
891
891
|
case i.Bitcoin:
|
|
892
892
|
case i.BitcoinCash:
|
|
@@ -978,9 +978,16 @@ const mt = "0x313ce567", De = async ({ chain: e, to: t }) => {
|
|
|
978
978
|
}, Rt = new RegExp(
|
|
979
979
|
/(.)\1{6}|\.ORG|\.NET|\.FINANCE|\.COM|WWW|HTTP|\\\\|\/\/|[\s$%:[\]]/,
|
|
980
980
|
"gmi"
|
|
981
|
-
), gt = (e) =>
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
), gt = (e) => {
|
|
982
|
+
const [t, n] = e.split(".");
|
|
983
|
+
if (!rt.includes(t))
|
|
984
|
+
return !0;
|
|
985
|
+
const [, a] = n.split("-");
|
|
986
|
+
return Pe({ chain: t, symbol: n }) || !!a;
|
|
987
|
+
}, In = (e) => e.filter((t) => {
|
|
988
|
+
const n = `${t.chain}.${t.symbol}`;
|
|
989
|
+
return !Rt.test(n) && gt(n);
|
|
990
|
+
}), Ot = ({
|
|
984
991
|
liquidityUnits: e,
|
|
985
992
|
poolUnits: t,
|
|
986
993
|
runeDepth: n
|
|
@@ -1111,7 +1118,7 @@ class Ae extends Error {
|
|
|
1111
1118
|
}), this.name = "HTTPError", this.response = t, this.request = n, this.options = a;
|
|
1112
1119
|
}
|
|
1113
1120
|
}
|
|
1114
|
-
class
|
|
1121
|
+
class Be extends Error {
|
|
1115
1122
|
constructor(t) {
|
|
1116
1123
|
super("Request timed out"), Object.defineProperty(this, "request", {
|
|
1117
1124
|
enumerable: !0,
|
|
@@ -1126,7 +1133,7 @@ const Q = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
|
1126
1133
|
if ((!Q(t) || Array.isArray(t)) && t !== void 0)
|
|
1127
1134
|
throw new TypeError("The `options` argument must be an object");
|
|
1128
1135
|
return be({}, ...e);
|
|
1129
|
-
},
|
|
1136
|
+
}, Le = (e = {}, t = {}) => {
|
|
1130
1137
|
const n = new globalThis.Headers(e), a = t instanceof globalThis.Headers, s = new globalThis.Headers(t);
|
|
1131
1138
|
for (const [r, o] of s.entries())
|
|
1132
1139
|
a && o === "undefined" || o === void 0 ? n.delete(r) : n.set(r, o);
|
|
@@ -1139,7 +1146,7 @@ const Q = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
|
1139
1146
|
else if (Q(a)) {
|
|
1140
1147
|
for (let [s, r] of Object.entries(a))
|
|
1141
1148
|
Q(r) && s in t && (r = be(t[s], r)), t = { ...t, [s]: r };
|
|
1142
|
-
Q(a.headers) && (n =
|
|
1149
|
+
Q(a.headers) && (n = Le(n, a.headers), t.headers = n);
|
|
1143
1150
|
}
|
|
1144
1151
|
return t;
|
|
1145
1152
|
}, Ct = (() => {
|
|
@@ -1153,13 +1160,13 @@ const Q = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
|
1153
1160
|
return e = !0, "half";
|
|
1154
1161
|
}
|
|
1155
1162
|
}).headers.has("Content-Type")), e && !t;
|
|
1156
|
-
})(), Mt = typeof globalThis.AbortController == "function", Nt = typeof globalThis.ReadableStream == "function", xt = typeof globalThis.FormData == "function",
|
|
1163
|
+
})(), Mt = typeof globalThis.AbortController == "function", Nt = typeof globalThis.ReadableStream == "function", xt = typeof globalThis.FormData == "function", Ve = ["get", "post", "put", "patch", "head", "delete"], Dt = {
|
|
1157
1164
|
json: "application/json",
|
|
1158
1165
|
text: "text/*",
|
|
1159
1166
|
formData: "multipart/form-data",
|
|
1160
1167
|
arrayBuffer: "*/*",
|
|
1161
1168
|
blob: "*/*"
|
|
1162
|
-
}, re = 2147483647,
|
|
1169
|
+
}, re = 2147483647, Ue = Symbol("stop"), Pt = {
|
|
1163
1170
|
json: !0,
|
|
1164
1171
|
parseJson: !0,
|
|
1165
1172
|
searchParams: !0,
|
|
@@ -1186,11 +1193,11 @@ const Q = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
|
1186
1193
|
window: !0,
|
|
1187
1194
|
dispatcher: !0,
|
|
1188
1195
|
duplex: !0
|
|
1189
|
-
}, Lt = (e) =>
|
|
1196
|
+
}, Lt = (e) => Ve.includes(e) ? e.toUpperCase() : e, Vt = ["get", "put", "head", "delete", "options", "trace"], Ut = [408, 413, 429, 500, 502, 503, 504], He = [413, 429, 503], Ee = {
|
|
1190
1197
|
limit: 2,
|
|
1191
1198
|
methods: Vt,
|
|
1192
1199
|
statusCodes: Ut,
|
|
1193
|
-
afterStatusCodes:
|
|
1200
|
+
afterStatusCodes: He,
|
|
1194
1201
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
1195
1202
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
1196
1203
|
delay: (e) => 0.3 * 2 ** (e - 1) * 1e3
|
|
@@ -1207,13 +1214,13 @@ const Q = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
|
1207
1214
|
return {
|
|
1208
1215
|
...Ee,
|
|
1209
1216
|
...e,
|
|
1210
|
-
afterStatusCodes:
|
|
1217
|
+
afterStatusCodes: He
|
|
1211
1218
|
};
|
|
1212
1219
|
};
|
|
1213
1220
|
async function $t(e, t, n, a) {
|
|
1214
1221
|
return new Promise((s, r) => {
|
|
1215
1222
|
const o = setTimeout(() => {
|
|
1216
|
-
n && n.abort(), r(new
|
|
1223
|
+
n && n.abort(), r(new Be(e));
|
|
1217
1224
|
}, a.timeout);
|
|
1218
1225
|
a.fetch(e, t).then(s).catch(r).then(() => {
|
|
1219
1226
|
clearTimeout(o);
|
|
@@ -1308,7 +1315,7 @@ class Z {
|
|
|
1308
1315
|
// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208
|
|
1309
1316
|
credentials: this._input.credentials || "same-origin",
|
|
1310
1317
|
...n,
|
|
1311
|
-
headers:
|
|
1318
|
+
headers: Le(this._input.headers, n.headers),
|
|
1312
1319
|
hooks: be({
|
|
1313
1320
|
beforeRequest: [],
|
|
1314
1321
|
beforeRetry: [],
|
|
@@ -1345,7 +1352,7 @@ class Z {
|
|
|
1345
1352
|
this._options.json !== void 0 && (this._options.body = JSON.stringify(this._options.json), this.request.headers.set("content-type", this._options.headers.get("content-type") ?? "application/json"), this.request = new globalThis.Request(this.request, { body: this._options.body }));
|
|
1346
1353
|
}
|
|
1347
1354
|
_calculateRetryDelay(t) {
|
|
1348
|
-
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(t instanceof
|
|
1355
|
+
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(t instanceof Be)) {
|
|
1349
1356
|
if (t instanceof Ae) {
|
|
1350
1357
|
if (!this._options.retry.statusCodes.includes(t.response.status))
|
|
1351
1358
|
return 0;
|
|
@@ -1378,7 +1385,7 @@ class Z {
|
|
|
1378
1385
|
options: this._options,
|
|
1379
1386
|
error: n,
|
|
1380
1387
|
retryCount: this._retryCount
|
|
1381
|
-
}) ===
|
|
1388
|
+
}) === Ue)
|
|
1382
1389
|
return;
|
|
1383
1390
|
return this._retry(t);
|
|
1384
1391
|
}
|
|
@@ -1435,10 +1442,10 @@ class Z {
|
|
|
1435
1442
|
/*! MIT License © Sindre Sorhus */
|
|
1436
1443
|
const pe = (e) => {
|
|
1437
1444
|
const t = (n, a) => Z.create(n, J(e, a));
|
|
1438
|
-
for (const n of
|
|
1445
|
+
for (const n of Ve)
|
|
1439
1446
|
t[n] = (a, s) => Z.create(a, J(e, s, { method: n }));
|
|
1440
|
-
return t.create = (n) => pe(J(n)), t.extend = (n) => pe(J(e, n)), t.stop =
|
|
1441
|
-
}, Gt = pe(),
|
|
1447
|
+
return t.create = (n) => pe(J(n)), t.extend = (n) => pe(J(e, n)), t.stop = Ue, t;
|
|
1448
|
+
}, Gt = pe(), qt = Gt, Wt = typeof window < "u" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" }, Re = qt.create({ headers: Wt }), we = {
|
|
1442
1449
|
get: (e, t) => Re.get(e, t).json(),
|
|
1443
1450
|
post: (e, t) => Re.post(e, t).json()
|
|
1444
1451
|
}, ge = Object.values(i), jt = (e = "") => {
|
|
@@ -1468,17 +1475,17 @@ function se({
|
|
|
1468
1475
|
""
|
|
1469
1476
|
);
|
|
1470
1477
|
}
|
|
1471
|
-
var U, k, de,
|
|
1472
|
-
const Kt = class
|
|
1478
|
+
var U, k, de, $e, ue, Oe, ee, le, $, q, te, ye;
|
|
1479
|
+
const Kt = class ke {
|
|
1473
1480
|
constructor(t) {
|
|
1474
1481
|
V(this, U), V(this, de), V(this, ue), V(this, ee), V(this, $), V(this, te), C(this, "decimalMultiplier", 10n ** 8n), C(this, "bigIntValue", 0n), C(this, "decimal");
|
|
1475
1482
|
const n = me(t);
|
|
1476
1483
|
this.decimal = typeof t == "object" ? t.decimal : void 0, this.decimalMultiplier = H(
|
|
1477
|
-
Math.max(R(this, te, ye).call(this, R(this, $,
|
|
1478
|
-
), R(this, de,
|
|
1484
|
+
Math.max(R(this, te, ye).call(this, R(this, $, q).call(this, n)), this.decimal || 0)
|
|
1485
|
+
), R(this, de, $e).call(this, n);
|
|
1479
1486
|
}
|
|
1480
1487
|
static fromBigInt(t, n) {
|
|
1481
|
-
return new
|
|
1488
|
+
return new ke({
|
|
1482
1489
|
decimal: n,
|
|
1483
1490
|
value: se({ value: t, bigIntDecimal: n, decimal: n })
|
|
1484
1491
|
});
|
|
@@ -1551,7 +1558,7 @@ const Kt = class $e {
|
|
|
1551
1558
|
getBigIntValue(t, n) {
|
|
1552
1559
|
if (!n && typeof t == "object")
|
|
1553
1560
|
return t.bigIntValue;
|
|
1554
|
-
const a = me(t), s = R(this, $,
|
|
1561
|
+
const a = me(t), s = R(this, $, q).call(this, a);
|
|
1555
1562
|
return s === "0" || s === "undefined" ? 0n : R(this, ee, le).call(this, s, n);
|
|
1556
1563
|
}
|
|
1557
1564
|
formatBigIntToSafeValue(t, n) {
|
|
@@ -1637,18 +1644,18 @@ U = /* @__PURE__ */ new WeakSet(), k = function(e, ...t) {
|
|
|
1637
1644
|
value: s
|
|
1638
1645
|
});
|
|
1639
1646
|
return new this.constructor({ decimal: this.decimal, value: r, identifier: this.toString() });
|
|
1640
|
-
}, de = /* @__PURE__ */ new WeakSet(),
|
|
1641
|
-
const t = R(this, $,
|
|
1647
|
+
}, de = /* @__PURE__ */ new WeakSet(), $e = function(e) {
|
|
1648
|
+
const t = R(this, $, q).call(this, e) || "0";
|
|
1642
1649
|
this.bigIntValue = R(this, ee, le).call(this, t);
|
|
1643
1650
|
}, ue = /* @__PURE__ */ new WeakSet(), Oe = function(...e) {
|
|
1644
1651
|
const t = e.map(
|
|
1645
|
-
(n) => typeof n == "object" ? n.decimal || G(n.decimalMultiplier) : R(this, te, ye).call(this, R(this, $,
|
|
1652
|
+
(n) => typeof n == "object" ? n.decimal || G(n.decimalMultiplier) : R(this, te, ye).call(this, R(this, $, q).call(this, n))
|
|
1646
1653
|
).filter(Boolean);
|
|
1647
1654
|
return Math.max(...t, j);
|
|
1648
1655
|
}, ee = /* @__PURE__ */ new WeakSet(), le = function(e, t) {
|
|
1649
1656
|
const n = t ? H(t) : this.decimalMultiplier, a = G(n), [s = "", r = ""] = e.split(".");
|
|
1650
1657
|
return BigInt(`${s}${r.padEnd(a, "0")}`);
|
|
1651
|
-
}, $ = /* @__PURE__ */ new WeakSet(),
|
|
1658
|
+
}, $ = /* @__PURE__ */ new WeakSet(), q = function(e) {
|
|
1652
1659
|
const t = `${typeof e == "number" ? Number(e).toLocaleString("fullwide", {
|
|
1653
1660
|
useGrouping: !1,
|
|
1654
1661
|
maximumFractionDigits: 20
|
|
@@ -1671,15 +1678,16 @@ const Ie = (e) => {
|
|
|
1671
1678
|
return Te.get(e.toUpperCase()) || { decimal: A.THOR, identifier: "" };
|
|
1672
1679
|
}, Se = async (e, t = 0) => {
|
|
1673
1680
|
jt(e);
|
|
1674
|
-
const n = await
|
|
1681
|
+
const n = await bt(he(e)), a = z(t, n);
|
|
1675
1682
|
return new N({ decimal: n, value: a, identifier: e });
|
|
1676
1683
|
};
|
|
1677
1684
|
class N extends ce {
|
|
1678
1685
|
constructor(t) {
|
|
1686
|
+
const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`;
|
|
1679
1687
|
super(
|
|
1680
1688
|
t.value instanceof ce ? t.value : { decimal: t.decimal, value: t.value }
|
|
1681
1689
|
), C(this, "address"), C(this, "chain"), C(this, "isSynthetic", !1), C(this, "isGasAsset", !1), C(this, "symbol"), C(this, "ticker"), C(this, "type");
|
|
1682
|
-
const
|
|
1690
|
+
const a = he(n);
|
|
1683
1691
|
this.type = Et(a), this.chain = a.chain, this.ticker = a.ticker, this.symbol = a.symbol, this.address = a.address, this.isSynthetic = a.isSynthetic, this.isGasAsset = a.isGasAsset;
|
|
1684
1692
|
}
|
|
1685
1693
|
get assetValue() {
|
|
@@ -1767,7 +1775,7 @@ const oe = (e) => {
|
|
|
1767
1775
|
return {
|
|
1768
1776
|
address: d == null ? void 0 : d.toLowerCase(),
|
|
1769
1777
|
chain: r,
|
|
1770
|
-
isGasAsset:
|
|
1778
|
+
isGasAsset: Pe({ chain: r, symbol: o }),
|
|
1771
1779
|
isSynthetic: t,
|
|
1772
1780
|
symbol: (t ? `${n}/` : "") + (d ? `${p}-${(d == null ? void 0 : d.toLowerCase()) ?? ""}` : o),
|
|
1773
1781
|
ticker: p
|
|
@@ -3531,12 +3539,12 @@ const Xt = [
|
|
|
3531
3539
|
type: "function"
|
|
3532
3540
|
},
|
|
3533
3541
|
{ stateMutability: "payable", type: "receive" }
|
|
3534
|
-
],
|
|
3542
|
+
], Fe = {
|
|
3535
3543
|
["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: Xt,
|
|
3536
3544
|
["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: Qt,
|
|
3537
3545
|
["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: zt
|
|
3538
3546
|
}, un = {
|
|
3539
|
-
...
|
|
3547
|
+
...Fe,
|
|
3540
3548
|
// AVAX
|
|
3541
3549
|
["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: en,
|
|
3542
3550
|
["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: Jt,
|
|
@@ -3571,7 +3579,7 @@ const Xt = [
|
|
|
3571
3579
|
token: E
|
|
3572
3580
|
}
|
|
3573
3581
|
}) => {
|
|
3574
|
-
const O = !!
|
|
3582
|
+
const O = !!Fe[t.toLowerCase()];
|
|
3575
3583
|
if (O && !y)
|
|
3576
3584
|
throw new Error("Router is required on calldata for swapIn with GenericContract");
|
|
3577
3585
|
const I = c || d, S = e && u || I;
|
|
@@ -3590,8 +3598,8 @@ const Xt = [
|
|
|
3590
3598
|
S.replace("{recipientAddress}", n),
|
|
3591
3599
|
a(E),
|
|
3592
3600
|
s
|
|
3593
|
-
],
|
|
3594
|
-
return [...P, ...
|
|
3601
|
+
], Ge = O ? [a(y), o, p] : [r, p];
|
|
3602
|
+
return [...P, ...Ge];
|
|
3595
3603
|
}, yn = ({ chain: e, txHash: t }) => {
|
|
3596
3604
|
const n = xe[e];
|
|
3597
3605
|
switch (e) {
|
|
@@ -3643,10 +3651,10 @@ const Xt = [
|
|
|
3643
3651
|
throw new Error(`Unsupported chain: ${e}`);
|
|
3644
3652
|
}
|
|
3645
3653
|
}, mn = (e) => {
|
|
3646
|
-
const t = e ?
|
|
3654
|
+
const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
|
|
3647
3655
|
return we.get(`${t}/thorchain/inbound_addresses`);
|
|
3648
3656
|
}, Tn = (e) => {
|
|
3649
|
-
const t = e ?
|
|
3657
|
+
const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
|
|
3650
3658
|
return we.get(`${t}/thorchain/mimir`);
|
|
3651
3659
|
}, ve = () => Object.values(i).reduce(
|
|
3652
3660
|
(e, t) => (e[t] = null, e),
|
|
@@ -3675,7 +3683,7 @@ class Bn {
|
|
|
3675
3683
|
if (!a.complete)
|
|
3676
3684
|
throw new m("core_swap_route_not_complete");
|
|
3677
3685
|
try {
|
|
3678
|
-
if (
|
|
3686
|
+
if (Ze.includes(r)) {
|
|
3679
3687
|
const y = this.connectedWallets[o];
|
|
3680
3688
|
if (!(y != null && y.sendTransaction))
|
|
3681
3689
|
throw new m("core_wallet_connection_not_found");
|
|
@@ -3685,12 +3693,12 @@ class Bn {
|
|
|
3685
3693
|
data: c,
|
|
3686
3694
|
from: _,
|
|
3687
3695
|
to: b.toLowerCase(),
|
|
3688
|
-
chainId: BigInt(
|
|
3696
|
+
chainId: BigInt(pt[o]),
|
|
3689
3697
|
value: w ? BigInt(w) : 0n
|
|
3690
3698
|
};
|
|
3691
3699
|
return y.sendTransaction(E, s);
|
|
3692
3700
|
}
|
|
3693
|
-
if (
|
|
3701
|
+
if (tt.includes(r)) {
|
|
3694
3702
|
if (!a.calldata.fromAsset)
|
|
3695
3703
|
throw new m("core_swap_asset_not_recognized");
|
|
3696
3704
|
const y = await N.fromString(a.calldata.fromAsset);
|
|
@@ -3709,7 +3717,7 @@ class Bn {
|
|
|
3709
3717
|
recipient: u
|
|
3710
3718
|
});
|
|
3711
3719
|
}
|
|
3712
|
-
if (
|
|
3720
|
+
if (et.includes(r)) {
|
|
3713
3721
|
const { calldata: y, contract: u } = a;
|
|
3714
3722
|
if (!u)
|
|
3715
3723
|
throw new m("core_swap_contract_not_found");
|
|
@@ -3788,7 +3796,7 @@ class Bn {
|
|
|
3788
3796
|
case i.Ethereum:
|
|
3789
3797
|
case i.BinanceSmartChain:
|
|
3790
3798
|
case i.Avalanche: {
|
|
3791
|
-
const { getChecksumAddressFromAsset: u } = await import("@swapkit/toolbox-evm"), c = r === i.Avalanche ?
|
|
3799
|
+
const { getChecksumAddressFromAsset: u } = await import("@swapkit/toolbox-evm"), c = r === i.Avalanche ? Je : r === i.BinanceSmartChain ? Qe : Xe;
|
|
3792
3800
|
return await d.call({
|
|
3793
3801
|
abi: c,
|
|
3794
3802
|
contractAddress: a || (await f(this, L).call(this, r)).router,
|
|
@@ -4077,7 +4085,7 @@ class Bn {
|
|
|
4077
4085
|
gas_rate: s,
|
|
4078
4086
|
router: r,
|
|
4079
4087
|
address: o
|
|
4080
|
-
} = await f(this, L).call(this, t.chain), p = (parseInt(s) || 0) *
|
|
4088
|
+
} = await f(this, L).call(this, t.chain), p = (parseInt(s) || 0) * wt[a];
|
|
4081
4089
|
return this.deposit({
|
|
4082
4090
|
assetValue: t,
|
|
4083
4091
|
recipient: o,
|
|
@@ -4103,57 +4111,57 @@ class Bn {
|
|
|
4103
4111
|
}
|
|
4104
4112
|
L = new WeakMap(), ne = new WeakMap(), K = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
|
|
4105
4113
|
export {
|
|
4106
|
-
|
|
4114
|
+
Ze as AGG_SWAP,
|
|
4107
4115
|
fn as ApiError,
|
|
4108
|
-
|
|
4116
|
+
W as ApiUrl,
|
|
4109
4117
|
N as AssetValue,
|
|
4110
4118
|
A as BaseDecimal,
|
|
4111
4119
|
ce as BigIntArithmetics,
|
|
4112
4120
|
i as Chain,
|
|
4113
4121
|
_e as ChainId,
|
|
4114
4122
|
gn as ChainIdToChain,
|
|
4115
|
-
|
|
4123
|
+
pt as ChainToChainId,
|
|
4116
4124
|
xe as ChainToExplorerUrl,
|
|
4117
4125
|
Rn as ChainToHexChainId,
|
|
4118
|
-
|
|
4119
|
-
|
|
4126
|
+
dt as ChainToRPC,
|
|
4127
|
+
st as ContractAddress,
|
|
4120
4128
|
An as CosmosChainList,
|
|
4121
|
-
|
|
4129
|
+
it as DerivationPath,
|
|
4122
4130
|
l as ERROR_CODE,
|
|
4123
|
-
|
|
4131
|
+
nt as ERROR_MODULE,
|
|
4124
4132
|
Ce as ERROR_TYPE,
|
|
4125
|
-
|
|
4126
|
-
|
|
4133
|
+
rt as EVMChainList,
|
|
4134
|
+
ut as ErrorCode,
|
|
4127
4135
|
F as FeeOption,
|
|
4128
4136
|
h as MemoType,
|
|
4129
4137
|
bn as NetworkDerivationPath,
|
|
4130
|
-
|
|
4138
|
+
ze as QuoteMode,
|
|
4131
4139
|
Ne as RPCUrl,
|
|
4132
4140
|
we as RequestClient,
|
|
4133
|
-
|
|
4134
|
-
|
|
4141
|
+
et as SWAP_IN,
|
|
4142
|
+
tt as SWAP_OUT,
|
|
4135
4143
|
Bn as SwapKitCore,
|
|
4136
4144
|
m as SwapKitError,
|
|
4137
4145
|
D as SwapKitNumber,
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4146
|
+
Je as TCAvalancheDepositABI,
|
|
4147
|
+
Qe as TCBscDepositABI,
|
|
4148
|
+
Xe as TCEthereumVaultAbi,
|
|
4141
4149
|
En as TCSupportedChainList,
|
|
4142
4150
|
wn as UTXOChainList,
|
|
4143
|
-
|
|
4151
|
+
lt as WalletOption,
|
|
4144
4152
|
On as assetFromString,
|
|
4145
4153
|
Pn as derivationPathToString,
|
|
4146
4154
|
_n as erc20ABI,
|
|
4147
4155
|
In as filterAssets,
|
|
4148
4156
|
se as formatBigIntToSafeValue,
|
|
4149
|
-
|
|
4157
|
+
wt as gasFeeMultiplier,
|
|
4150
4158
|
Et as getAssetType,
|
|
4151
4159
|
It as getAsymmetricAssetShare,
|
|
4152
4160
|
vn as getAsymmetricAssetWithdrawAmount,
|
|
4153
4161
|
Ot as getAsymmetricRuneShare,
|
|
4154
4162
|
Sn as getAsymmetricRuneWithdrawAmount,
|
|
4155
4163
|
At as getCommonAssetInfo,
|
|
4156
|
-
|
|
4164
|
+
bt as getDecimal,
|
|
4157
4165
|
Mn as getEstimatedPoolShare,
|
|
4158
4166
|
Nn as getLiquiditySlippage,
|
|
4159
4167
|
x as getMemoFor,
|
|
@@ -4161,6 +4169,6 @@ export {
|
|
|
4161
4169
|
St as getSymmetricPoolShare,
|
|
4162
4170
|
Cn as getSymmetricWithdraw,
|
|
4163
4171
|
xn as getTHORNameCost,
|
|
4164
|
-
|
|
4172
|
+
Pe as isGasAsset,
|
|
4165
4173
|
Dn as validateTHORName
|
|
4166
4174
|
};
|