@swapkit/core 1.0.0-rc.95 → 1.0.0-rc.97
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.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.es.js +444 -463
- package/dist/index.es.js.map +1 -1
- package/package.json +12 -12
- package/src/client/types.ts +10 -3
package/dist/index.es.js
CHANGED
|
@@ -10,7 +10,7 @@ var A = (e, t, n) => (pt(e, t, "read from private field"), n ? n.call(e) : t.get
|
|
|
10
10
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
11
11
|
};
|
|
12
12
|
var ut = Object.defineProperty, yt = (e, t, n) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, N = (e, t, n) => (yt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
13
|
-
const
|
|
13
|
+
const Gn = [
|
|
14
14
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
15
15
|
{
|
|
16
16
|
anonymous: !1,
|
|
@@ -686,13 +686,13 @@ const ft = {
|
|
|
686
686
|
n = (n == null ? void 0 : n.replace(`{${a}}`, t[a])) ?? "";
|
|
687
687
|
return n;
|
|
688
688
|
};
|
|
689
|
-
let
|
|
689
|
+
let Xn = class He extends Error {
|
|
690
690
|
constructor({
|
|
691
691
|
status: t,
|
|
692
692
|
revision: n,
|
|
693
693
|
module: a,
|
|
694
694
|
code: i,
|
|
695
|
-
message:
|
|
695
|
+
message: s,
|
|
696
696
|
type: p,
|
|
697
697
|
options: { shouldLog: u, shouldThrow: y, shouldTrace: l } = {
|
|
698
698
|
shouldLog: !0,
|
|
@@ -701,7 +701,7 @@ let Wn = class He extends Error {
|
|
|
701
701
|
},
|
|
702
702
|
displayMessageParams: m
|
|
703
703
|
}) {
|
|
704
|
-
const T =
|
|
704
|
+
const T = s || ce(i, m || []) || "";
|
|
705
705
|
super(T), N(this, "status"), N(this, "revision"), N(this, "type"), N(this, "module"), N(this, "code"), N(this, "message"), N(this, "display"), N(this, "stack"), N(this, "options"), N(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = T, this.display = ce(i, m || []), this.code = i, this.type = p || Ve.UNHANDLED_ERROR, this.options = {
|
|
706
706
|
shouldLog: u || !0,
|
|
707
707
|
shouldTrace: l || !0,
|
|
@@ -728,14 +728,15 @@ let Wn = class He extends Error {
|
|
|
728
728
|
return this.toErrorInfo();
|
|
729
729
|
}
|
|
730
730
|
};
|
|
731
|
-
var
|
|
732
|
-
const
|
|
731
|
+
var r = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dash = "DASH", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polkadot = "DOT", e.Chainflip = "FLIP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(r || {}), At = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(At || {}), ht = /* @__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.DASH = "m/44'/5'/0'/0", e.DOGE = "m/44'/3'/0'/0", e.DOT = "////", e.ETH = "m/44'/60'/0'/0", e.FLIP = "////", 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))(ht || {});
|
|
732
|
+
const jn = {
|
|
733
733
|
ARB: [44, 60, 0, 0, 0],
|
|
734
734
|
AVAX: [44, 60, 0, 0, 0],
|
|
735
735
|
BCH: [44, 145, 0, 0, 0],
|
|
736
736
|
BNB: [44, 714, 0, 0, 0],
|
|
737
737
|
BSC: [44, 60, 0, 0, 0],
|
|
738
738
|
BTC: [84, 0, 0, 0, 0],
|
|
739
|
+
DASH: [44, 5, 0, 0, 0],
|
|
739
740
|
DOGE: [44, 3, 0, 0, 0],
|
|
740
741
|
ETH: [44, 60, 0, 0, 0],
|
|
741
742
|
GAIA: [44, 118, 0, 0, 0],
|
|
@@ -749,8 +750,8 @@ const $n = {
|
|
|
749
750
|
DOT: [0, 0, 0, 0, 0],
|
|
750
751
|
FLIP: [0, 0, 0, 0, 0]
|
|
751
752
|
};
|
|
752
|
-
var E = /* @__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.DOT = 10] = "DOT", e[e.ETH = 18] = "ETH", e[e.FLIP = 18] = "FLIP", 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))(E || {});
|
|
753
|
-
const
|
|
753
|
+
var E = /* @__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.DOT = 10] = "DOT", e[e.ETH = 18] = "ETH", e[e.FLIP = 18] = "FLIP", 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[e.ZEC = 8] = "ZEC", e))(E || {});
|
|
754
|
+
const Kn = [
|
|
754
755
|
"DOT",
|
|
755
756
|
"FLIP"
|
|
756
757
|
/* Chainflip */
|
|
@@ -762,18 +763,19 @@ const qn = [
|
|
|
762
763
|
"OP",
|
|
763
764
|
"MATIC"
|
|
764
765
|
/* Polygon */
|
|
765
|
-
],
|
|
766
|
+
], Rt = Et, Ot = [
|
|
766
767
|
"BTC",
|
|
767
768
|
"BCH",
|
|
769
|
+
"DASH",
|
|
768
770
|
"DOGE",
|
|
769
771
|
"LTC"
|
|
770
772
|
/* Litecoin */
|
|
771
|
-
],
|
|
773
|
+
], Yn = Ot, St = [
|
|
772
774
|
"GAIA",
|
|
773
775
|
"THOR",
|
|
774
776
|
"BNB"
|
|
775
777
|
/* Binance */
|
|
776
|
-
],
|
|
778
|
+
], Qn = St, wt = [
|
|
777
779
|
"AVAX",
|
|
778
780
|
"BNB",
|
|
779
781
|
"BSC",
|
|
@@ -785,27 +787,27 @@ const qn = [
|
|
|
785
787
|
"LTC",
|
|
786
788
|
"THOR"
|
|
787
789
|
/* THORChain */
|
|
788
|
-
];
|
|
789
|
-
var
|
|
790
|
-
const oe = Object.values(
|
|
790
|
+
], Jn = wt;
|
|
791
|
+
var Se = /* @__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.Chainflip = "chainflip", e.Cosmos = "cosmoshub-4", e.Dash = "dash", 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.Polkadot = "polkadot", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(Se || {}), Fe = /* @__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.Chainflip = "wss://mainnet-archive.chainflip.io", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Dash = "https://node-router.thorswap.net/dash", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Kujira = "https://rpc-kujira.synergynodes.com/", 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.Polkadot = "wss://rpc.polkadot.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(Fe || {}), Q = /* @__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.net", e.ThorswapStatic = "https://static.thorswap.net", e))(Q || {});
|
|
792
|
+
const oe = Object.values(r), Mt = Object.keys(r), we = oe.reduce(
|
|
791
793
|
(e, t) => {
|
|
792
|
-
const n =
|
|
794
|
+
const n = Mt.find((a) => r[a] === t);
|
|
793
795
|
return n && (e[t] = n), e;
|
|
794
796
|
},
|
|
795
797
|
{}
|
|
796
798
|
), Ue = oe.reduce(
|
|
797
|
-
(e, t) => (e[t] = we[
|
|
799
|
+
(e, t) => (e[t] = Se[we[t]], e),
|
|
798
800
|
{}
|
|
799
|
-
),
|
|
800
|
-
(e, t) => (e[t] = Fe[
|
|
801
|
+
), It = oe.reduce(
|
|
802
|
+
(e, t) => (e[t] = Fe[we[t]], e),
|
|
801
803
|
{}
|
|
802
|
-
),
|
|
804
|
+
), Zn = oe.reduce(
|
|
803
805
|
(e, t) => {
|
|
804
|
-
const n = `${
|
|
805
|
-
return e[t] =
|
|
806
|
+
const n = `${we[t]}Hex`;
|
|
807
|
+
return e[t] = Se[n], e;
|
|
806
808
|
},
|
|
807
809
|
{}
|
|
808
|
-
),
|
|
810
|
+
), zn = {
|
|
809
811
|
"0xa4b1": "ARB",
|
|
810
812
|
42161: "ARB",
|
|
811
813
|
"0xa86a": "AVAX",
|
|
@@ -817,6 +819,7 @@ const oe = Object.values(s), Rt = Object.keys(s), Se = oe.reduce(
|
|
|
817
819
|
bitcoin: "BTC",
|
|
818
820
|
chainflip: "FLIP",
|
|
819
821
|
"cosmoshub-4": "GAIA",
|
|
822
|
+
dash: "DASH",
|
|
820
823
|
dogecoin: "DOGE",
|
|
821
824
|
"0x1": "ETH",
|
|
822
825
|
"kaiyo-1": "KUJI",
|
|
@@ -841,6 +844,7 @@ const oe = Object.values(s), Rt = Object.keys(s), Se = oe.reduce(
|
|
|
841
844
|
BTC: "https://blockchair.com/bitcoin",
|
|
842
845
|
FLIP: "https://explorer.polkascan.io/polkadot",
|
|
843
846
|
GAIA: "https://cosmos.bigdipper.live",
|
|
847
|
+
DASH: "https://blockchair.com/dash",
|
|
844
848
|
DOGE: "https://blockchair.com/dogecoin",
|
|
845
849
|
KUJI: "https://finder.kujira.network/kaiyo-1",
|
|
846
850
|
ETH: "https://etherscan.io",
|
|
@@ -851,19 +855,19 @@ const oe = Object.values(s), Rt = Object.keys(s), Se = oe.reduce(
|
|
|
851
855
|
MATIC: "https://polygonscan.com",
|
|
852
856
|
THOR: "https://runescan.io"
|
|
853
857
|
};
|
|
854
|
-
var f = /* @__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))(f || {}), X = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(X || {}),
|
|
858
|
+
var f = /* @__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))(f || {}), X = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(X || {}), gt = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.KEEPKEY = "KEEPKEY", 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.OKX_MOBILE = "OKX_MOBILE", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(gt || {}), Ct = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e[e.LockedDevice = 21781] = "LockedDevice", e[e.TC_NotFound = 65535] = "TC_NotFound", e))(Ct || {}), vt = Object.defineProperty, Nt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (Nt(e, typeof t != "symbol" ? t + "" : t, n), n), Dt = (e, t, n) => {
|
|
855
859
|
if (!t.has(e))
|
|
856
860
|
throw TypeError("Cannot " + n);
|
|
857
861
|
}, q = (e, t, n) => {
|
|
858
862
|
if (t.has(e))
|
|
859
863
|
throw TypeError("Cannot add the same private member more than once");
|
|
860
864
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
861
|
-
}, M = (e, t, n) => (
|
|
865
|
+
}, M = (e, t, n) => (Dt(e, t, "access private method"), n), d = /* @__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_MAX_500 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.SWAP_AMOUNT_TOO_LOW = "2012", 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))(d || {});
|
|
862
866
|
d.INVALID_INPUT_PARAMETERS + "", d.UNKNOWN_PROVIDERS + "", d.CANNOT_FIND_INBOUND_ADDRESS + "", d.NO_INBOUND_ADDRESSES + "", d.CHAIN_HALTED_OR_UNSUPPORTED + "", d.MISSING_INPUT_PARAMETER + "", d.INVALID_TYPE_GENERIC + "", d.INVALID_NUMBER_STRING + "", d.INVALID_NUMBER + "", d.INVALID_BOOLEAN + "", d.INVALID_OBJECT + "", d.INVALID_ARRAY + "", d.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", d.SELL_BUY_ASSETS_ARE_THE_SAME + "", d.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", d.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", d.AFF_ADDRESS_TOO_LONG + "", d.AFF_BPS_INTEGER_MAX_500 + "", d.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", d.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", d.PREFERRED_PROVIDER_NOT_SUPPORTED + "", d.SOURCE_ADDRESS_SMART_CONTRACT + "", d.SWAP_AMOUNT_TOO_LOW + "", d.DESTINATION_ADDRESS_SMART_CONTRACT + "", d.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", d.INVALID_PROVIDER + "", d.MISSING_CROSS_CHAIN_PROVIDER + "", d.MISSING_AVAX_PROVIDER + "", d.MISSING_BSC_PROVIDER + "", d.MISSING_ETH_PROVIDER + "", d.MISSING_ARB_PROVIDER + "", d.INVALID_PROVIDER_FOR_SWAP_OUT + "", d.INVALID_CHAIN + "", d.INVALID_ASSET + "", d.UNSUPPORTED_CHAIN + "", d.UNSUPPORTED_ASSET + "", d.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", d.THORNODE_QUOTE_GENERIC_ERROR + "", d.INVALID_SOURCE_ADDRESS + "", d.INVALID_DESTINATION_ADDRESS + "", d.NOT_ENOUGH_SYNTH_BALANCE + "", d.SYNTH_MINTING_CAP_REACHED + "", d.INVALID_QUOTE_MODE + "", d.NO_QUOTES + "", d.SERVICE_UNAVAILABLE_GENERIC + "", d.MISSING_GAS_DATA_GENERIC + "", d.MISSING_TOKEN_INFO_GENERIC + "", d.CANT_FIND_TOKEN_LIST + "", d.NO_PRICE + "", d.PRICE_IS_STALE + "", d.ADDRESS_NOT_WHITELISTED + "", d.ADDRESS_ALREADY_CLAIMED + "";
|
|
863
|
-
var de = /* @__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.Polkadot = "DOT", e.Chainflip = "FLIP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(de || {}), Me = /* @__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.Chainflip = "chainflip", 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.Polkadot = "polkadot", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(Me || {}), $e = /* @__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.Chainflip = "wss://mainnet-archive.chainflip.io", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.
|
|
864
|
-
const le = Object.values(de),
|
|
867
|
+
var de = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dash = "DASH", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polkadot = "DOT", e.Chainflip = "FLIP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(de || {}), Me = /* @__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.Chainflip = "chainflip", e.Cosmos = "cosmoshub-4", e.Dash = "dash", 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.Polkadot = "polkadot", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(Me || {}), $e = /* @__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.Chainflip = "wss://mainnet-archive.chainflip.io", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Dash = "https://node-router.thorswap.net/dash", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Kujira = "https://rpc-kujira.synergynodes.com/", 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.Polkadot = "wss://rpc.polkadot.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))($e || {}), L = /* @__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.net", e.ThorswapStatic = "https://static.thorswap.net", e))(L || {});
|
|
868
|
+
const le = Object.values(de), Pt = Object.keys(de), Ie = le.reduce(
|
|
865
869
|
(e, t) => {
|
|
866
|
-
const n =
|
|
870
|
+
const n = Pt.find((a) => de[a] === t);
|
|
867
871
|
return n && (e[t] = n), e;
|
|
868
872
|
},
|
|
869
873
|
{}
|
|
@@ -885,7 +889,7 @@ le.reduce(
|
|
|
885
889
|
);
|
|
886
890
|
class Ce extends Error {
|
|
887
891
|
constructor(t, n, a) {
|
|
888
|
-
const i = t.status || t.status === 0 ? t.status : "",
|
|
892
|
+
const i = t.status || t.status === 0 ? t.status : "", s = t.statusText || "", p = `${i} ${s}`.trim(), u = p ? `status code ${p}` : "an unknown error";
|
|
889
893
|
super(`Request failed with ${u}`), Object.defineProperty(this, "response", {
|
|
890
894
|
enumerable: !0,
|
|
891
895
|
configurable: !0,
|
|
@@ -921,8 +925,8 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
921
925
|
return ge({}, ...e);
|
|
922
926
|
}, Ge = (e = {}, t = {}) => {
|
|
923
927
|
const n = new globalThis.Headers(e), a = t instanceof globalThis.Headers, i = new globalThis.Headers(t);
|
|
924
|
-
for (const [
|
|
925
|
-
a && p === "undefined" || p === void 0 ? n.delete(
|
|
928
|
+
for (const [s, p] of i.entries())
|
|
929
|
+
a && p === "undefined" || p === void 0 ? n.delete(s) : n.set(s, p);
|
|
926
930
|
return n;
|
|
927
931
|
}, ge = (...e) => {
|
|
928
932
|
let t = {}, n = {};
|
|
@@ -930,12 +934,12 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
930
934
|
if (Array.isArray(a))
|
|
931
935
|
Array.isArray(t) || (t = []), t = [...t, ...a];
|
|
932
936
|
else if (ne(a)) {
|
|
933
|
-
for (let [i,
|
|
934
|
-
ne(
|
|
937
|
+
for (let [i, s] of Object.entries(a))
|
|
938
|
+
ne(s) && i in t && (s = ge(t[i], s)), t = { ...t, [i]: s };
|
|
935
939
|
ne(a.headers) && (n = Ge(n, a.headers), t.headers = n);
|
|
936
940
|
}
|
|
937
941
|
return t;
|
|
938
|
-
},
|
|
942
|
+
}, kt = (() => {
|
|
939
943
|
let e = !1, t = !1;
|
|
940
944
|
const n = typeof globalThis.ReadableStream == "function", a = typeof globalThis.Request == "function";
|
|
941
945
|
return n && a && (t = new globalThis.Request("https://empty.invalid", {
|
|
@@ -946,13 +950,13 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
946
950
|
return e = !0, "half";
|
|
947
951
|
}
|
|
948
952
|
}).headers.has("Content-Type")), e && !t;
|
|
949
|
-
})(),
|
|
953
|
+
})(), xt = typeof globalThis.AbortController == "function", Bt = typeof globalThis.ReadableStream == "function", Lt = typeof globalThis.FormData == "function", Xe = ["get", "post", "put", "patch", "head", "delete"], Vt = {
|
|
950
954
|
json: "application/json",
|
|
951
955
|
text: "text/*",
|
|
952
956
|
formData: "multipart/form-data",
|
|
953
957
|
arrayBuffer: "*/*",
|
|
954
958
|
blob: "*/*"
|
|
955
|
-
}, be = 2147483647, je = Symbol("stop"),
|
|
959
|
+
}, be = 2147483647, je = Symbol("stop"), Ht = {
|
|
956
960
|
json: !0,
|
|
957
961
|
parseJson: !0,
|
|
958
962
|
searchParams: !0,
|
|
@@ -963,7 +967,7 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
963
967
|
throwHttpErrors: !0,
|
|
964
968
|
onDownloadProgress: !0,
|
|
965
969
|
fetch: !0
|
|
966
|
-
},
|
|
970
|
+
}, Ft = {
|
|
967
971
|
method: !0,
|
|
968
972
|
headers: !0,
|
|
969
973
|
body: !0,
|
|
@@ -979,15 +983,15 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
979
983
|
window: !0,
|
|
980
984
|
dispatcher: !0,
|
|
981
985
|
duplex: !0
|
|
982
|
-
},
|
|
986
|
+
}, Ut = (e) => Xe.includes(e) ? e.toUpperCase() : e, Wt = ["get", "put", "head", "delete", "options", "trace"], $t = [408, 413, 429, 500, 502, 503, 504], Ke = [413, 429, 503], ve = {
|
|
983
987
|
limit: 2,
|
|
984
|
-
methods:
|
|
985
|
-
statusCodes:
|
|
988
|
+
methods: Wt,
|
|
989
|
+
statusCodes: $t,
|
|
986
990
|
afterStatusCodes: Ke,
|
|
987
991
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
988
992
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
989
993
|
delay: (e) => 0.3 * 2 ** (e - 1) * 1e3
|
|
990
|
-
},
|
|
994
|
+
}, qt = (e = {}) => {
|
|
991
995
|
if (typeof e == "number")
|
|
992
996
|
return {
|
|
993
997
|
...ve,
|
|
@@ -1003,31 +1007,31 @@ const ne = (e) => e !== null && typeof e == "object", te = (...e) => {
|
|
|
1003
1007
|
afterStatusCodes: Ke
|
|
1004
1008
|
};
|
|
1005
1009
|
};
|
|
1006
|
-
async function
|
|
1007
|
-
return new Promise((i,
|
|
1010
|
+
async function Gt(e, t, n, a) {
|
|
1011
|
+
return new Promise((i, s) => {
|
|
1008
1012
|
const p = setTimeout(() => {
|
|
1009
|
-
n && n.abort(),
|
|
1013
|
+
n && n.abort(), s(new qe(e));
|
|
1010
1014
|
}, a.timeout);
|
|
1011
|
-
a.fetch(e, t).then(i).catch(
|
|
1015
|
+
a.fetch(e, t).then(i).catch(s).then(() => {
|
|
1012
1016
|
clearTimeout(p);
|
|
1013
1017
|
});
|
|
1014
1018
|
});
|
|
1015
1019
|
}
|
|
1016
|
-
async function
|
|
1020
|
+
async function Xt(e, { signal: t }) {
|
|
1017
1021
|
return new Promise((n, a) => {
|
|
1018
1022
|
t && (t.throwIfAborted(), t.addEventListener("abort", i, { once: !0 }));
|
|
1019
1023
|
function i() {
|
|
1020
|
-
clearTimeout(
|
|
1024
|
+
clearTimeout(s), a(t.reason);
|
|
1021
1025
|
}
|
|
1022
|
-
const
|
|
1026
|
+
const s = setTimeout(() => {
|
|
1023
1027
|
t == null || t.removeEventListener("abort", i), n();
|
|
1024
1028
|
}, e);
|
|
1025
1029
|
});
|
|
1026
1030
|
}
|
|
1027
|
-
const
|
|
1031
|
+
const jt = (e, t) => {
|
|
1028
1032
|
const n = {};
|
|
1029
1033
|
for (const a in t)
|
|
1030
|
-
!(a in
|
|
1034
|
+
!(a in Ft) && !(a in Ht) && !(a in e) && (n[a] = t[a]);
|
|
1031
1035
|
return n;
|
|
1032
1036
|
};
|
|
1033
1037
|
class re {
|
|
@@ -1050,16 +1054,16 @@ class re {
|
|
|
1050
1054
|
if (a._options.onDownloadProgress) {
|
|
1051
1055
|
if (typeof a._options.onDownloadProgress != "function")
|
|
1052
1056
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
1053
|
-
if (!
|
|
1057
|
+
if (!Bt)
|
|
1054
1058
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
1055
1059
|
return a._stream(p.clone(), a._options.onDownloadProgress);
|
|
1056
1060
|
}
|
|
1057
1061
|
return p;
|
|
1058
|
-
},
|
|
1059
|
-
for (const [p, u] of Object.entries(
|
|
1060
|
-
|
|
1062
|
+
}, s = a._options.retry.methods.includes(a.request.method.toLowerCase()) ? a._retry(i) : i();
|
|
1063
|
+
for (const [p, u] of Object.entries(Vt))
|
|
1064
|
+
s[p] = async () => {
|
|
1061
1065
|
a.request.headers.set("accept", a.request.headers.get("accept") || u);
|
|
1062
|
-
const y = (await
|
|
1066
|
+
const y = (await s).clone();
|
|
1063
1067
|
if (p === "json") {
|
|
1064
1068
|
if (y.status === 204 || (await y.clone().arrayBuffer()).byteLength === 0)
|
|
1065
1069
|
return "";
|
|
@@ -1068,7 +1072,7 @@ class re {
|
|
|
1068
1072
|
}
|
|
1069
1073
|
return y[p]();
|
|
1070
1074
|
};
|
|
1071
|
-
return
|
|
1075
|
+
return s;
|
|
1072
1076
|
}
|
|
1073
1077
|
// eslint-disable-next-line complexity
|
|
1074
1078
|
constructor(t, n = {}) {
|
|
@@ -1108,10 +1112,10 @@ class re {
|
|
|
1108
1112
|
beforeError: [],
|
|
1109
1113
|
afterResponse: []
|
|
1110
1114
|
}, n.hooks),
|
|
1111
|
-
method:
|
|
1115
|
+
method: Ut(n.method ?? this._input.method),
|
|
1112
1116
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
1113
1117
|
prefixUrl: String(n.prefixUrl || ""),
|
|
1114
|
-
retry:
|
|
1118
|
+
retry: qt(n.retry),
|
|
1115
1119
|
throwHttpErrors: n.throwHttpErrors !== !1,
|
|
1116
1120
|
timeout: n.timeout ?? 1e4,
|
|
1117
1121
|
fetch: n.fetch ?? globalThis.fetch.bind(globalThis)
|
|
@@ -1122,7 +1126,7 @@ class re {
|
|
|
1122
1126
|
throw new Error("`input` must not begin with a slash when using `prefixUrl`");
|
|
1123
1127
|
this._options.prefixUrl.endsWith("/") || (this._options.prefixUrl += "/"), this._input = this._options.prefixUrl + this._input;
|
|
1124
1128
|
}
|
|
1125
|
-
if (
|
|
1129
|
+
if (xt) {
|
|
1126
1130
|
if (this.abortController = new globalThis.AbortController(), this._options.signal) {
|
|
1127
1131
|
const a = this._options.signal;
|
|
1128
1132
|
this._options.signal.addEventListener("abort", () => {
|
|
@@ -1131,9 +1135,9 @@ class re {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
this._options.signal = this.abortController.signal;
|
|
1133
1137
|
}
|
|
1134
|
-
if (
|
|
1138
|
+
if (kt && (this._options.duplex = "half"), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) {
|
|
1135
1139
|
const a = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), i = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, a);
|
|
1136
|
-
(
|
|
1140
|
+
(Lt && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"]) && this.request.headers.delete("content-type"), this.request = new globalThis.Request(new globalThis.Request(i, { ...this.request }), this._options);
|
|
1137
1141
|
}
|
|
1138
1142
|
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 }));
|
|
1139
1143
|
}
|
|
@@ -1164,7 +1168,7 @@ class re {
|
|
|
1164
1168
|
} catch (n) {
|
|
1165
1169
|
const a = Math.min(this._calculateRetryDelay(n), be);
|
|
1166
1170
|
if (a !== 0 && this._retryCount > 0) {
|
|
1167
|
-
await
|
|
1171
|
+
await Xt(a, { signal: this._options.signal });
|
|
1168
1172
|
for (const i of this._options.hooks.beforeRetry)
|
|
1169
1173
|
if (await i({
|
|
1170
1174
|
request: this.request,
|
|
@@ -1188,8 +1192,8 @@ class re {
|
|
|
1188
1192
|
if (a instanceof Response)
|
|
1189
1193
|
return a;
|
|
1190
1194
|
}
|
|
1191
|
-
const t =
|
|
1192
|
-
return this._options.timeout === !1 ? this._options.fetch(this.request.clone(), t) :
|
|
1195
|
+
const t = jt(this.request, this._options);
|
|
1196
|
+
return this._options.timeout === !1 ? this._options.fetch(this.request.clone(), t) : Gt(this.request.clone(), t, this.abortController, this._options);
|
|
1193
1197
|
}
|
|
1194
1198
|
/* istanbul ignore next */
|
|
1195
1199
|
_stream(t, n) {
|
|
@@ -1200,13 +1204,13 @@ class re {
|
|
|
1200
1204
|
statusText: t.statusText,
|
|
1201
1205
|
headers: t.headers
|
|
1202
1206
|
})) : new globalThis.Response(new globalThis.ReadableStream({
|
|
1203
|
-
async start(
|
|
1207
|
+
async start(s) {
|
|
1204
1208
|
const p = t.body.getReader();
|
|
1205
1209
|
n && n({ percent: 0, transferredBytes: 0, totalBytes: a }, new Uint8Array());
|
|
1206
1210
|
async function u() {
|
|
1207
1211
|
const { done: y, value: l } = await p.read();
|
|
1208
1212
|
if (y) {
|
|
1209
|
-
|
|
1213
|
+
s.close();
|
|
1210
1214
|
return;
|
|
1211
1215
|
}
|
|
1212
1216
|
if (n) {
|
|
@@ -1214,7 +1218,7 @@ class re {
|
|
|
1214
1218
|
const m = a === 0 ? 0 : i / a;
|
|
1215
1219
|
n({ percent: m, transferredBytes: i, totalBytes: a }, l);
|
|
1216
1220
|
}
|
|
1217
|
-
|
|
1221
|
+
s.enqueue(l), await u();
|
|
1218
1222
|
}
|
|
1219
1223
|
await u();
|
|
1220
1224
|
}
|
|
@@ -1241,7 +1245,7 @@ const k = {
|
|
|
1241
1245
|
TokenlistProviders: `${L.ThorswapApi}/tokenlist/providers`,
|
|
1242
1246
|
TokenList: `${L.ThorswapStatic}/token-list`,
|
|
1243
1247
|
Thorname: `${L.ThorswapApi}/thorname`
|
|
1244
|
-
}, Qe = typeof window < "u" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" }, Ne = () => ae || (ae = Ye.create({ headers: Qe }), ae),
|
|
1248
|
+
}, Qe = typeof window < "u" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" }, Ne = () => ae || (ae = Ye.create({ headers: Qe }), ae), ea = ({ apiKey: e, ...t }) => {
|
|
1245
1249
|
ae = Ye.create({
|
|
1246
1250
|
...t,
|
|
1247
1251
|
headers: { ...Qe, ...t.headers, "x-api-key": e }
|
|
@@ -1249,14 +1253,14 @@ const k = {
|
|
|
1249
1253
|
}, g = {
|
|
1250
1254
|
get: (e, t) => Ne().get(e, t).json(),
|
|
1251
1255
|
post: (e, t) => Ne().post(e, t).json()
|
|
1252
|
-
},
|
|
1256
|
+
}, Kt = ({ tokens: e, ...t }) => {
|
|
1253
1257
|
const n = new URLSearchParams();
|
|
1254
|
-
return e.filter((a, i,
|
|
1258
|
+
return e.filter((a, i, s) => s.findIndex((p) => p === a) === i).forEach((a) => n.append("tokens", JSON.stringify(a))), t.metadata && n.append("metadata", "true"), t.lookup && n.append("lookup", "true"), t.sparkline && n.append("sparkline", "true"), g.post(k.CachedPrices, {
|
|
1255
1259
|
body: n.toString(),
|
|
1256
1260
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
1257
1261
|
});
|
|
1258
|
-
},
|
|
1259
|
-
getCachedPrices:
|
|
1262
|
+
}, ta = {
|
|
1263
|
+
getCachedPrices: Kt,
|
|
1260
1264
|
getQuote: (e) => g.get(k.Quote, { searchParams: e }),
|
|
1261
1265
|
getGasRates: () => g.get(k.GasRates),
|
|
1262
1266
|
getTxnDetails: (e) => g.get(k.Txn, { searchParams: e }),
|
|
@@ -1266,10 +1270,10 @@ const k = {
|
|
|
1266
1270
|
getThornameRegisteredChains: (e) => g.get(`${k.Thorname}/chains/${e}`),
|
|
1267
1271
|
getThornameRlookup: (e, t) => g.get(`${k.Thorname}/rlookup`, { searchParams: { address: e, chain: t } })
|
|
1268
1272
|
};
|
|
1269
|
-
var
|
|
1270
|
-
const
|
|
1273
|
+
var Yt = /* @__PURE__ */ ((e) => (e.SWAP_TC_TO_TC = "SWAP:TC-TC", e.SWAP_ETH_TO_TC = "SWAP:ERC20-TC", e.SWAP_TC_TO_ETH = "SWAP:TC-ERC20", e.SWAP_ETH_TO_ETH = "SWAP:ERC20-ERC20", e.SWAP_AVAX_TO_TC = "SWAP:AVAX-TC", e.SWAP_TC_TO_AVAX = "SWAP:TC-AVAX", e.SWAP_AVAX_TO_AVAX = "SWAP:AVAX-AVAX", e.SWAP_ETH_TO_AVAX = "SWAP:ETH-AVAX", e.SWAP_AVAX_TO_ETH = "SWAP:AVAX-ETH", e.SWAP_TC_TO_GAIA = "SWAP:TC-GAIA", e.SWAP_GAIA_TO_TC = "SWAP:GAIA-TC", e.SWAP_TC_TO_BNB = "SWAP:TC-BNB", e.SWAP_BNB_TO_TC = "SWAP:BNB-TC", e.SWAP_TC_TO_BTC = "SWAP:TC-BTC", e.SWAP_BTC_TO_TC = "SWAP:BTC-TC", e.SWAP_TC_TO_BCH = "SWAP:TC-BCH", e.SWAP_BCH_TO_TC = "SWAP:BCH-TC", e.SWAP_TC_TO_LTC = "SWAP:TC-LTC", e.SWAP_LTC_TO_TC = "SWAP:LTC-TC", e.SWAP_TC_TO_DOGE = "SWAP:TC-DOGE", e.SWAP_DOGE_TO_TC = "SWAP:DOGE-TC", e.TC_STATUS = "TC:STATUS", e.TC_TRANSFER = "TC:TRANSFER", e.TC_DEPOSIT = "TC:DEPOSIT", e.TC_SEND = "TC:SEND", e.TC_SWITCH = "TC:SWITCH", e.TC_LP_ADD = "TC:ADDLIQUIDITY", e.TC_LP_WITHDRAW = "TC:WITHDRAW", e.TC_TNS_CREATE = "TC:TNS-CREATE", e.TC_TNS_EXTEND = "TC:TNS-EXTEND", e.TC_TNS_UPDATE = "TC:TNS-UPDATE", e.TC_SAVINGS_ADD = "TC:ADDSAVINGS", e.TC_SAVINGS_WITHDRAW = "TC:WITHDRAWSAVINGS", e.TC_LENDING_OPEN = "TC:LENDINGOPEN", e.TC_LENDING_CLOSE = "TC:LENDINGCLOSE", e.ETH_APPROVAL = "ETH:APPROVAL", e.ETH_STATUS = "ETH:STATUS", e.ETH_TRANSFER_TO_TC = "ETH:TRANSFER:IN", e.ETH_TRANSFER_FROM_TC = "ETH:TRANSFER:OUT", e.AVAX_APPROVAL = "AVAX:APPROVAL", e.AVAX_STATUS = "AVAX:STATUS", e.AVAX_TRANSFER_TO_TC = "AVAX:TRANSFER:IN", e.AVAX_TRANSFER_FROM_TC = "AVAX:TRANSFER:OUT", e.BSC_APPROVAL = "BSC:APPROVAL", e.BSC_STATUS = "BSC:STATUS", e.BSC_TRANSFER_TO_TC = "BSC:TRANSFER:IN", e.BSC_TRANSFER_FROM_TC = "BSC:TRANSFER:OUT", e.APPROVAL = "APPROVAL", e.STATUS = "STATUS", e.TRANSFER_TO_TC = "TRANSFER:IN", e.TRANSFER_FROM_TC = "TRANSFER:OUT", e.UNSUPPORTED = "UNSUPPORTED", e.TC_LENDING = "TC:LENDING", e))(Yt || {}), Qt = /* @__PURE__ */ ((e) => (e.PENDING = "pending", e.SUCCESS = "success", e.CANCELLED = "cancelled", e.REFUNDED = "refunded", e.REPLACED = "replaced", e.ERROR = "error", e.UNKNOWN = "unknown", e.NOT_STARTED = "not_started", e.NOT_FOUND = "not_found", e.RETRIES_EXCEEDED = "retries_exceeded", e.STREAMING = "streaming", e))(Qt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.NOT_STARTED = 0] = "NOT_STARTED", e[e.SUCCESS = 1] = "SUCCESS", e[e.REFUNDED = 2] = "REFUNDED", e))(Jt || {});
|
|
1274
|
+
const Zt = "0x313ce567", Je = async ({ chain: e, to: t }) => {
|
|
1271
1275
|
try {
|
|
1272
|
-
const { result: n } = await g.post(
|
|
1276
|
+
const { result: n } = await g.post(It[e], {
|
|
1273
1277
|
headers: {
|
|
1274
1278
|
accept: "*/*",
|
|
1275
1279
|
"content-type": "application/json",
|
|
@@ -1279,182 +1283,155 @@ const Kt = "0x313ce567", Je = async ({ chain: e, to: t }) => {
|
|
|
1279
1283
|
id: 44,
|
|
1280
1284
|
jsonrpc: "2.0",
|
|
1281
1285
|
method: "eth_call",
|
|
1282
|
-
params: [{ to: t.toLowerCase(), data:
|
|
1286
|
+
params: [{ to: t.toLowerCase(), data: Zt }, "latest"]
|
|
1283
1287
|
})
|
|
1284
1288
|
});
|
|
1285
1289
|
return parseInt(BigInt(n).toString());
|
|
1286
1290
|
} catch (n) {
|
|
1287
1291
|
return console.error(n), E[e];
|
|
1288
1292
|
}
|
|
1289
|
-
},
|
|
1290
|
-
if (e ===
|
|
1293
|
+
}, zt = async (e) => {
|
|
1294
|
+
if (e === r.Ethereum)
|
|
1291
1295
|
return E.ETH;
|
|
1292
1296
|
const [, t] = e.split("-");
|
|
1293
|
-
return t != null && t.startsWith("0x") ? Je({ chain:
|
|
1294
|
-
},
|
|
1297
|
+
return t != null && t.startsWith("0x") ? Je({ chain: r.Ethereum, to: t }) : E.ETH;
|
|
1298
|
+
}, en = async (e) => {
|
|
1295
1299
|
const [, t] = e.split("-");
|
|
1296
|
-
return t != null && t.startsWith("0x") ? Je({ chain:
|
|
1297
|
-
},
|
|
1300
|
+
return t != null && t.startsWith("0x") ? Je({ chain: r.Avalanche, to: t.toLowerCase() }) : E.AVAX;
|
|
1301
|
+
}, tn = async (e) => (e === r.BinanceSmartChain, E.BSC), nn = async ({ chain: e, symbol: t }) => {
|
|
1298
1302
|
switch (e) {
|
|
1299
|
-
case
|
|
1300
|
-
return
|
|
1301
|
-
case
|
|
1302
|
-
return
|
|
1303
|
-
case
|
|
1304
|
-
return
|
|
1303
|
+
case r.Ethereum:
|
|
1304
|
+
return zt(t);
|
|
1305
|
+
case r.Avalanche:
|
|
1306
|
+
return en(t);
|
|
1307
|
+
case r.BinanceSmartChain:
|
|
1308
|
+
return tn(t);
|
|
1305
1309
|
default:
|
|
1306
1310
|
return E[e];
|
|
1307
1311
|
}
|
|
1308
|
-
},
|
|
1312
|
+
}, an = {
|
|
1309
1313
|
[X.Average]: 1.2,
|
|
1310
1314
|
[X.Fast]: 1.5,
|
|
1311
1315
|
[X.Fastest]: 2
|
|
1312
1316
|
}, Ze = ({ chain: e, symbol: t }) => {
|
|
1313
1317
|
switch (e) {
|
|
1314
|
-
case
|
|
1315
|
-
case
|
|
1316
|
-
case s.Litecoin:
|
|
1317
|
-
case s.Dogecoin:
|
|
1318
|
-
case s.Binance:
|
|
1319
|
-
case s.Ethereum:
|
|
1320
|
-
case s.Avalanche:
|
|
1321
|
-
case s.Polkadot:
|
|
1322
|
-
case s.Chainflip:
|
|
1323
|
-
return t === e;
|
|
1324
|
-
case s.Arbitrum:
|
|
1325
|
-
case s.Optimism:
|
|
1318
|
+
case r.Arbitrum:
|
|
1319
|
+
case r.Optimism:
|
|
1326
1320
|
return t === "ETH";
|
|
1327
|
-
case
|
|
1321
|
+
case r.Maya:
|
|
1328
1322
|
return t === "CACAO";
|
|
1329
|
-
case
|
|
1323
|
+
case r.Kujira:
|
|
1330
1324
|
return t === "KUJI";
|
|
1331
|
-
case
|
|
1325
|
+
case r.Cosmos:
|
|
1332
1326
|
return t === "ATOM";
|
|
1333
|
-
case
|
|
1327
|
+
case r.Polygon:
|
|
1334
1328
|
return t === "MATIC";
|
|
1335
|
-
case
|
|
1329
|
+
case r.BinanceSmartChain:
|
|
1336
1330
|
return t === "BNB";
|
|
1337
|
-
case
|
|
1331
|
+
case r.THORChain:
|
|
1338
1332
|
return t === "RUNE";
|
|
1333
|
+
default:
|
|
1334
|
+
return t === e;
|
|
1339
1335
|
}
|
|
1340
|
-
},
|
|
1336
|
+
}, sn = (e) => {
|
|
1341
1337
|
switch (e) {
|
|
1342
|
-
case `${
|
|
1338
|
+
case `${r.Ethereum}.THOR`:
|
|
1343
1339
|
return { identifier: "ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044", decimal: 18 };
|
|
1344
|
-
case `${
|
|
1340
|
+
case `${r.Ethereum}.vTHOR`:
|
|
1345
1341
|
return { identifier: "ETH.vTHOR-0x815c23eca83261b6ec689b60cc4a58b54bc24d8d", decimal: 18 };
|
|
1346
|
-
case
|
|
1342
|
+
case r.Cosmos:
|
|
1347
1343
|
return { identifier: "GAIA.ATOM", decimal: E[e] };
|
|
1348
|
-
case
|
|
1344
|
+
case r.THORChain:
|
|
1349
1345
|
return { identifier: "THOR.RUNE", decimal: E[e] };
|
|
1350
|
-
case
|
|
1346
|
+
case r.BinanceSmartChain:
|
|
1351
1347
|
return { identifier: "BSC.BNB", decimal: E[e] };
|
|
1352
|
-
case
|
|
1348
|
+
case r.Maya:
|
|
1353
1349
|
return { identifier: "MAYA.CACAO", decimal: E.MAYA };
|
|
1354
|
-
case `${
|
|
1350
|
+
case `${r.Maya}.MAYA`:
|
|
1355
1351
|
return { identifier: "MAYA.MAYA", decimal: 4 };
|
|
1356
|
-
case `${
|
|
1357
|
-
return { identifier: `${
|
|
1358
|
-
|
|
1359
|
-
case s.Arbitrum:
|
|
1360
|
-
case s.Optimism:
|
|
1361
|
-
case s.BitcoinCash:
|
|
1362
|
-
case s.Litecoin:
|
|
1363
|
-
case s.Dogecoin:
|
|
1364
|
-
case s.Binance:
|
|
1365
|
-
case s.Avalanche:
|
|
1366
|
-
case s.Chainflip:
|
|
1367
|
-
case s.Polygon:
|
|
1368
|
-
case s.Polkadot:
|
|
1369
|
-
case s.Bitcoin:
|
|
1370
|
-
case s.Ethereum:
|
|
1352
|
+
case `${r.Kujira}.USK`:
|
|
1353
|
+
return { identifier: `${r.Kujira}.USK`, decimal: 6 };
|
|
1354
|
+
default:
|
|
1371
1355
|
return { identifier: `${e}.${e}`, decimal: E[e] };
|
|
1372
1356
|
}
|
|
1373
|
-
},
|
|
1357
|
+
}, rn = ({ chain: e, symbol: t }) => {
|
|
1374
1358
|
if (t.includes("/"))
|
|
1375
1359
|
return "Synth";
|
|
1376
1360
|
switch (e) {
|
|
1377
|
-
case
|
|
1378
|
-
|
|
1379
|
-
case
|
|
1380
|
-
|
|
1381
|
-
case
|
|
1382
|
-
|
|
1383
|
-
case
|
|
1384
|
-
|
|
1361
|
+
case r.Cosmos:
|
|
1362
|
+
return t === "ATOM" ? "Native" : r.Cosmos;
|
|
1363
|
+
case r.Kujira:
|
|
1364
|
+
return t === r.Kujira ? "Native" : r.Kujira;
|
|
1365
|
+
case r.Binance:
|
|
1366
|
+
return t === r.Binance ? "Native" : "BEP2";
|
|
1367
|
+
case r.BinanceSmartChain:
|
|
1368
|
+
return t === r.Binance ? "Native" : "BEP20";
|
|
1369
|
+
case r.Ethereum:
|
|
1370
|
+
return t === r.Ethereum ? "Native" : "ERC20";
|
|
1371
|
+
case r.Avalanche:
|
|
1372
|
+
return t === r.Avalanche ? "Native" : r.Avalanche;
|
|
1373
|
+
case r.Polygon:
|
|
1374
|
+
return t === r.Polygon ? "Native" : "POLYGON";
|
|
1375
|
+
case r.Arbitrum:
|
|
1376
|
+
return [r.Ethereum, r.Arbitrum].includes(t) ? "Native" : "ARBITRUM";
|
|
1377
|
+
case r.Optimism:
|
|
1378
|
+
return [r.Ethereum, r.Optimism].includes(t) ? "Native" : "OPTIMISM";
|
|
1379
|
+
default:
|
|
1385
1380
|
return "Native";
|
|
1386
|
-
case s.Cosmos:
|
|
1387
|
-
return t === "ATOM" ? "Native" : s.Cosmos;
|
|
1388
|
-
case s.Kujira:
|
|
1389
|
-
return t === s.Kujira ? "Native" : s.Kujira;
|
|
1390
|
-
case s.Binance:
|
|
1391
|
-
return t === s.Binance ? "Native" : "BEP2";
|
|
1392
|
-
case s.BinanceSmartChain:
|
|
1393
|
-
return t === s.Binance ? "Native" : "BEP20";
|
|
1394
|
-
case s.Ethereum:
|
|
1395
|
-
return t === s.Ethereum ? "Native" : "ERC20";
|
|
1396
|
-
case s.Avalanche:
|
|
1397
|
-
return t === s.Avalanche ? "Native" : s.Avalanche;
|
|
1398
|
-
case s.Polygon:
|
|
1399
|
-
return t === s.Polygon ? "Native" : "POLYGON";
|
|
1400
|
-
case s.Arbitrum:
|
|
1401
|
-
return [s.Ethereum, s.Arbitrum].includes(t) ? "Native" : "ARBITRUM";
|
|
1402
|
-
case s.Optimism:
|
|
1403
|
-
return [s.Ethereum, s.Optimism].includes(t) ? "Native" : "OPTIMISM";
|
|
1404
1381
|
}
|
|
1405
|
-
},
|
|
1382
|
+
}, na = (e) => {
|
|
1406
1383
|
var t;
|
|
1407
|
-
const [n, ...a] = e.split("."), i = e.includes("/"),
|
|
1408
|
-
return { chain: n, symbol:
|
|
1409
|
-
},
|
|
1384
|
+
const [n, ...a] = e.split("."), i = e.includes("/"), s = a.join("."), p = (t = s == null ? void 0 : s.split("-")) == null ? void 0 : t[0];
|
|
1385
|
+
return { chain: n, symbol: s, ticker: p, synth: i };
|
|
1386
|
+
}, pn = new RegExp(
|
|
1410
1387
|
/(.)\1{6}|\.ORG|\.NET|\.FINANCE|\.COM|WWW|HTTP|\\\\|\/\/|[\s$%:[\]]/,
|
|
1411
1388
|
"gmi"
|
|
1412
|
-
),
|
|
1389
|
+
), un = (e) => {
|
|
1413
1390
|
const [t, n] = e.split(".");
|
|
1414
|
-
if (!
|
|
1391
|
+
if (!Rt.includes(t))
|
|
1415
1392
|
return !0;
|
|
1416
1393
|
const [, a] = n.split("-");
|
|
1417
1394
|
return Ze({ chain: t, symbol: n }) || !!a;
|
|
1418
|
-
},
|
|
1419
|
-
const
|
|
1420
|
-
return !
|
|
1395
|
+
}, aa = (e) => e.filter(({ chain: t, value: n, symbol: a }) => {
|
|
1396
|
+
const i = `${t}.${a}`;
|
|
1397
|
+
return !pn.test(i) && un(i) && n !== "0";
|
|
1421
1398
|
});
|
|
1422
|
-
function
|
|
1399
|
+
function yn({
|
|
1423
1400
|
liquidityUnits: e,
|
|
1424
1401
|
poolUnits: t,
|
|
1425
1402
|
runeDepth: n
|
|
1426
1403
|
}) {
|
|
1427
|
-
const a = I(e), i = I(t),
|
|
1404
|
+
const a = I(e), i = I(t), s = I(n), p = a.mul(s), u = i.mul(i).mul(2), y = i.mul(a).mul(2), l = a.mul(a), m = i.mul(i).mul(i);
|
|
1428
1405
|
return p.mul(u.sub(y).add(l)).div(m);
|
|
1429
1406
|
}
|
|
1430
|
-
function
|
|
1407
|
+
function on({
|
|
1431
1408
|
liquidityUnits: e,
|
|
1432
1409
|
poolUnits: t,
|
|
1433
1410
|
assetDepth: n
|
|
1434
1411
|
}) {
|
|
1435
|
-
const a = I(e), i = I(t),
|
|
1412
|
+
const a = I(e), i = I(t), s = I(n), p = a.mul(s), u = i.mul(i).mul(2), y = i.mul(a).mul(2), l = a.mul(a), m = p.mul(u.sub(y).add(l)), T = i.mul(i).mul(i);
|
|
1436
1413
|
return m.div(T);
|
|
1437
1414
|
}
|
|
1438
|
-
function
|
|
1415
|
+
function ia({
|
|
1439
1416
|
percent: e,
|
|
1440
1417
|
runeDepth: t,
|
|
1441
1418
|
liquidityUnits: n,
|
|
1442
1419
|
poolUnits: a
|
|
1443
1420
|
}) {
|
|
1444
|
-
return
|
|
1421
|
+
return yn({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
|
|
1445
1422
|
}
|
|
1446
|
-
function
|
|
1423
|
+
function sa({
|
|
1447
1424
|
percent: e,
|
|
1448
1425
|
assetDepth: t,
|
|
1449
1426
|
liquidityUnits: n,
|
|
1450
1427
|
poolUnits: a
|
|
1451
1428
|
}) {
|
|
1452
|
-
return
|
|
1429
|
+
return on({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
|
|
1453
1430
|
}
|
|
1454
1431
|
function I(e) {
|
|
1455
1432
|
return x.fromBigInt(BigInt(e), E.THOR);
|
|
1456
1433
|
}
|
|
1457
|
-
function
|
|
1434
|
+
function dn({
|
|
1458
1435
|
liquidityUnits: e,
|
|
1459
1436
|
poolUnits: t,
|
|
1460
1437
|
runeDepth: n,
|
|
@@ -1465,7 +1442,7 @@ function pn({
|
|
|
1465
1442
|
runeAmount: I(n).mul(e).div(t)
|
|
1466
1443
|
};
|
|
1467
1444
|
}
|
|
1468
|
-
function
|
|
1445
|
+
function ra({
|
|
1469
1446
|
liquidityUnits: e,
|
|
1470
1447
|
poolUnits: t,
|
|
1471
1448
|
runeDepth: n,
|
|
@@ -1473,26 +1450,26 @@ function na({
|
|
|
1473
1450
|
percent: i
|
|
1474
1451
|
}) {
|
|
1475
1452
|
return Object.fromEntries(
|
|
1476
|
-
Object.entries(
|
|
1477
|
-
([
|
|
1453
|
+
Object.entries(dn({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
|
|
1454
|
+
([s, p]) => [s, p.mul(i)]
|
|
1478
1455
|
)
|
|
1479
1456
|
);
|
|
1480
1457
|
}
|
|
1481
|
-
function
|
|
1458
|
+
function pa({
|
|
1482
1459
|
runeDepth: e,
|
|
1483
1460
|
poolUnits: t,
|
|
1484
1461
|
assetDepth: n,
|
|
1485
1462
|
liquidityUnits: a,
|
|
1486
1463
|
runeAmount: i,
|
|
1487
|
-
assetAmount:
|
|
1464
|
+
assetAmount: s
|
|
1488
1465
|
}) {
|
|
1489
|
-
const p = new x({ value: e, decimal: 8 }), u = new x({ value: n, decimal: 8 }), y = new x({ value: t, decimal: 8 }), l = new x({ value: i, decimal: 8 }), m = new x({ value:
|
|
1490
|
-
if (
|
|
1466
|
+
const p = new x({ value: e, decimal: 8 }), u = new x({ value: n, decimal: 8 }), y = new x({ value: t, decimal: 8 }), l = new x({ value: i, decimal: 8 }), m = new x({ value: s, decimal: 8 }), T = l.mul(u), _ = m.mul(p), h = l.mul(m), R = p.mul(u), O = y.mul(T.add(_.add(h.mul(2)))), S = T.add(_.add(R.mul(2))), w = O.div(S), B = I(a).add(w);
|
|
1467
|
+
if (w.getBaseValue("number") === 0)
|
|
1491
1468
|
return B.div(y).getBaseValue("number");
|
|
1492
1469
|
const Te = y.add(B);
|
|
1493
1470
|
return B.div(Te).getBaseValue("number");
|
|
1494
1471
|
}
|
|
1495
|
-
function
|
|
1472
|
+
function ua({
|
|
1496
1473
|
runeAmount: e,
|
|
1497
1474
|
assetAmount: t,
|
|
1498
1475
|
runeDepth: n,
|
|
@@ -1500,7 +1477,7 @@ function ia({
|
|
|
1500
1477
|
}) {
|
|
1501
1478
|
if (e === "0" || t === "0" || n === "0" || a === "0")
|
|
1502
1479
|
return 0;
|
|
1503
|
-
const i = I(n),
|
|
1480
|
+
const i = I(n), s = I(a), p = I(t), u = I(e), y = p.mul(i).sub(s.mul(u)), l = s.mul(u).add(i.mul(s));
|
|
1504
1481
|
return Math.abs(y.div(l).getBaseValue("number"));
|
|
1505
1482
|
}
|
|
1506
1483
|
const D = (e, t) => {
|
|
@@ -1515,27 +1492,27 @@ const D = (e, t) => {
|
|
|
1515
1492
|
return `${e}:${n}:${a}`;
|
|
1516
1493
|
}
|
|
1517
1494
|
case f.THORNAME_REGISTER: {
|
|
1518
|
-
const { name: n, chain: a, address: i, owner:
|
|
1519
|
-
return `${e}:${n}:${a}:${i}${
|
|
1495
|
+
const { name: n, chain: a, address: i, owner: s } = t;
|
|
1496
|
+
return `${e}:${n}:${a}:${i}${s ? `:${s}` : ""}`;
|
|
1520
1497
|
}
|
|
1521
1498
|
case f.DEPOSIT: {
|
|
1522
|
-
const { chain: n, symbol: a, address: i, singleSide:
|
|
1523
|
-
return
|
|
1499
|
+
const { chain: n, symbol: a, address: i, singleSide: s } = t;
|
|
1500
|
+
return s ? `${e}:${n}/${a}` : `${e}:${((p, u) => {
|
|
1524
1501
|
switch (p) {
|
|
1525
|
-
case
|
|
1502
|
+
case r.Litecoin:
|
|
1526
1503
|
return "l";
|
|
1527
|
-
case
|
|
1504
|
+
case r.Dogecoin:
|
|
1528
1505
|
return "d";
|
|
1529
|
-
case
|
|
1506
|
+
case r.BitcoinCash:
|
|
1530
1507
|
return "c";
|
|
1531
1508
|
default:
|
|
1532
1509
|
return `${p}.${u}`;
|
|
1533
1510
|
}
|
|
1534
|
-
})(n, a)}:${i || ""}
|
|
1511
|
+
})(n, a)}:${i || ""}`;
|
|
1535
1512
|
}
|
|
1536
1513
|
case f.WITHDRAW: {
|
|
1537
|
-
const { chain: n, ticker: a, symbol: i, basisPoints:
|
|
1538
|
-
return `${e}:${n}${u ? "/" : "."}${y}:${
|
|
1514
|
+
const { chain: n, ticker: a, symbol: i, basisPoints: s, targetAssetString: p, singleSide: u } = t, y = n === "ETH" && a !== "ETH" ? `${a}-${i.slice(-3)}` : i, l = !u && p ? `:${p}` : "";
|
|
1515
|
+
return `${e}:${n}${u ? "/" : "."}${y}:${s}${l}`;
|
|
1539
1516
|
}
|
|
1540
1517
|
case f.OPEN_LOAN:
|
|
1541
1518
|
case f.CLOSE_LOAN: {
|
|
@@ -1546,22 +1523,22 @@ const D = (e, t) => {
|
|
|
1546
1523
|
return "";
|
|
1547
1524
|
}
|
|
1548
1525
|
};
|
|
1549
|
-
function
|
|
1526
|
+
function ya(e) {
|
|
1550
1527
|
if (e < 0)
|
|
1551
1528
|
throw new Error("Invalid number of year");
|
|
1552
1529
|
return 10 + e;
|
|
1553
1530
|
}
|
|
1554
|
-
function
|
|
1531
|
+
function oa(e) {
|
|
1555
1532
|
if (e.length > 30)
|
|
1556
1533
|
return !1;
|
|
1557
1534
|
const t = /^[a-zA-Z0-9+_-]+$/g;
|
|
1558
1535
|
return !!e.match(t);
|
|
1559
1536
|
}
|
|
1560
|
-
function
|
|
1537
|
+
function da([e, t, n, a, i]) {
|
|
1561
1538
|
return `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`;
|
|
1562
1539
|
}
|
|
1563
|
-
const De = [...Object.values(
|
|
1564
|
-
function
|
|
1540
|
+
const De = [...Object.values(r), "TERRA"];
|
|
1541
|
+
function ln(e = "") {
|
|
1565
1542
|
const t = e.toUpperCase(), [n] = t.split(".");
|
|
1566
1543
|
if (De.includes(n))
|
|
1567
1544
|
return !0;
|
|
@@ -1582,8 +1559,8 @@ function me({
|
|
|
1582
1559
|
return e.toString();
|
|
1583
1560
|
const a = e < 0n;
|
|
1584
1561
|
let i = e.toString().substring(a ? 1 : 0);
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1562
|
+
const s = n - (i.length - 1);
|
|
1563
|
+
s > 0 && (i = "0".repeat(s) + i);
|
|
1587
1564
|
const p = i.length - n;
|
|
1588
1565
|
let u = i.slice(-n);
|
|
1589
1566
|
return parseInt(u[t]) >= 5 ? u = `${u.substring(0, t - 1)}${(parseInt(u[t - 1]) + 1).toString()}` : u = u.substring(0, t), `${a ? "-" : ""}${i.slice(0, p)}.${u}`.replace(
|
|
@@ -1592,7 +1569,7 @@ function me({
|
|
|
1592
1569
|
);
|
|
1593
1570
|
}
|
|
1594
1571
|
var W, G, H, $, Ee, ze, ie, _e, pe, Re;
|
|
1595
|
-
const
|
|
1572
|
+
const mn = class et {
|
|
1596
1573
|
constructor(t) {
|
|
1597
1574
|
q(this, W), q(this, H), q(this, Ee), q(this, ie), q(this, pe), C(this, "decimalMultiplier", 10n ** 8n), C(this, "bigIntValue", 0n), C(this, "decimal");
|
|
1598
1575
|
const n = Oe(t), a = typeof t == "object";
|
|
@@ -1678,62 +1655,62 @@ const yn = class et {
|
|
|
1678
1655
|
return i === "0" || i === "undefined" ? 0n : M(this, pe, Re).call(this, i, n);
|
|
1679
1656
|
}
|
|
1680
1657
|
toSignificant(t = 6) {
|
|
1681
|
-
const [n, a] = this.getValue("string").split("."), i = n || "",
|
|
1682
|
-
if ((parseInt(i) ? i.length +
|
|
1658
|
+
const [n, a] = this.getValue("string").split("."), i = n || "", s = a || "";
|
|
1659
|
+
if ((parseInt(i) ? i.length + s.length : s.length) <= t)
|
|
1683
1660
|
return this.getValue("string");
|
|
1684
1661
|
if (i.length >= t)
|
|
1685
1662
|
return i.slice(0, t).padEnd(i.length, "0");
|
|
1686
1663
|
if (parseInt(i))
|
|
1687
|
-
return `${i}.${
|
|
1664
|
+
return `${i}.${s.slice(0, t - i.length)}`.padEnd(
|
|
1688
1665
|
t - i.length,
|
|
1689
1666
|
"0"
|
|
1690
1667
|
);
|
|
1691
|
-
const p = parseInt(
|
|
1668
|
+
const p = parseInt(s), u = `${p}`.slice(0, t);
|
|
1692
1669
|
return `0.${u.padStart(
|
|
1693
|
-
|
|
1670
|
+
s.length - `${p}`.length + u.length,
|
|
1694
1671
|
"0"
|
|
1695
1672
|
)}`;
|
|
1696
1673
|
}
|
|
1697
1674
|
toFixed(t = 6) {
|
|
1698
|
-
const [n, a] = this.getValue("string").split("."), i = n || "",
|
|
1675
|
+
const [n, a] = this.getValue("string").split("."), i = n || "", s = a || "";
|
|
1699
1676
|
if (parseInt(i))
|
|
1700
|
-
return `${i}.${
|
|
1701
|
-
const p = parseInt(
|
|
1677
|
+
return `${i}.${s.slice(0, t)}`.padEnd(t, "0");
|
|
1678
|
+
const p = parseInt(s), u = `${p}`.slice(0, t);
|
|
1702
1679
|
return `0.${u.padStart(
|
|
1703
|
-
|
|
1680
|
+
s.length - `${p}`.length + u.length,
|
|
1704
1681
|
"0"
|
|
1705
1682
|
)}`;
|
|
1706
1683
|
}
|
|
1707
1684
|
toAbbreviation(t = 2) {
|
|
1708
|
-
const n = this.getValue("number"), a = ["", "K", "M", "B", "T", "Q", "Qi", "S"], i = Math.floor(Math.log10(Math.abs(n)) / 3),
|
|
1709
|
-
if (!
|
|
1685
|
+
const n = this.getValue("number"), a = ["", "K", "M", "B", "T", "Q", "Qi", "S"], i = Math.floor(Math.log10(Math.abs(n)) / 3), s = a[i];
|
|
1686
|
+
if (!s)
|
|
1710
1687
|
return this.getValue("string");
|
|
1711
1688
|
const p = 10 ** (i * 3);
|
|
1712
|
-
return `${(n / p).toFixed(t)}${
|
|
1689
|
+
return `${(n / p).toFixed(t)}${s}`;
|
|
1713
1690
|
}
|
|
1714
1691
|
toCurrency(t = "$", {
|
|
1715
1692
|
currencyPosition: n = "start",
|
|
1716
1693
|
decimal: a = 2,
|
|
1717
1694
|
decimalSeparator: i = ".",
|
|
1718
|
-
thousandSeparator:
|
|
1695
|
+
thousandSeparator: s = ","
|
|
1719
1696
|
} = {}) {
|
|
1720
|
-
const p = this.getValue("number"), [u, y = ""] = p.toFixed(6).split("."), l = u.replace(/\B(?=(\d{3})+(?!\d))/g,
|
|
1697
|
+
const p = this.getValue("number"), [u, y = ""] = p.toFixed(6).split("."), l = u.replace(/\B(?=(\d{3})+(?!\d))/g, s), m = !u && !y ? "0.00" : u === "0" ? `${parseFloat(`0.${y}`)}`.replace(".", i) : `${l}${parseInt(y) ? `${i}${y.slice(0, a)}` : ""}`;
|
|
1721
1698
|
return `${n === "start" ? t : ""}${m}${n === "end" ? t : ""}`;
|
|
1722
1699
|
}
|
|
1723
1700
|
formatBigIntToSafeValue(t, n) {
|
|
1724
1701
|
const a = n || this.decimal || J, i = Math.max(
|
|
1725
1702
|
a,
|
|
1726
1703
|
j(this.decimalMultiplier)
|
|
1727
|
-
),
|
|
1704
|
+
), s = t < 0n, p = t.toString().substring(s ? 1 : 0), u = i - (p.length - 1), y = u > 0 ? "0".repeat(u) + p : p, l = y.length - i;
|
|
1728
1705
|
let m = y.slice(-i);
|
|
1729
|
-
return parseInt(m[a]) >= 5 ? m = `${m.substring(0, a - 1)}${(parseInt(m[a - 1]) + 1).toString()}` : m = m.substring(0, a), `${
|
|
1706
|
+
return parseInt(m[a]) >= 5 ? m = `${m.substring(0, a - 1)}${(parseInt(m[a - 1]) + 1).toString()}` : m = m.substring(0, a), `${s ? "-" : ""}${y.slice(
|
|
1730
1707
|
0,
|
|
1731
1708
|
l
|
|
1732
1709
|
)}.${m}`.replace(/\.?0*$/, "");
|
|
1733
1710
|
}
|
|
1734
1711
|
};
|
|
1735
1712
|
W = /* @__PURE__ */ new WeakSet(), G = function(e, ...t) {
|
|
1736
|
-
const n = M(this, ie, _e).call(this, this, ...t), a = Math.max(n, j(this.decimalMultiplier)), i = F(a),
|
|
1713
|
+
const n = M(this, ie, _e).call(this, this, ...t), a = Math.max(n, j(this.decimalMultiplier)), i = F(a), s = t.reduce(
|
|
1737
1714
|
(u, y) => {
|
|
1738
1715
|
const l = this.getBigIntValue(y, a);
|
|
1739
1716
|
switch (e) {
|
|
@@ -1757,7 +1734,7 @@ W = /* @__PURE__ */ new WeakSet(), G = function(e, ...t) {
|
|
|
1757
1734
|
), p = me({
|
|
1758
1735
|
bigIntDecimal: a,
|
|
1759
1736
|
decimal: a,
|
|
1760
|
-
value:
|
|
1737
|
+
value: s
|
|
1761
1738
|
});
|
|
1762
1739
|
return new this.constructor({
|
|
1763
1740
|
decimalMultiplier: F(a),
|
|
@@ -1786,16 +1763,16 @@ W = /* @__PURE__ */ new WeakSet(), G = function(e, ...t) {
|
|
|
1786
1763
|
const t = e.map((n) => typeof n == "object" ? n.decimal || j(n.decimalMultiplier) : nt(ue(n))).filter(Boolean);
|
|
1787
1764
|
return Math.max(...t, J);
|
|
1788
1765
|
}, pe = /* @__PURE__ */ new WeakSet(), Re = function(e, t) {
|
|
1789
|
-
const n = t ? F(t) : this.decimalMultiplier, a = j(n), [i = "",
|
|
1790
|
-
return BigInt(`${i}${
|
|
1766
|
+
const n = t ? F(t) : this.decimalMultiplier, a = j(n), [i = "", s = ""] = e.split(".");
|
|
1767
|
+
return BigInt(`${i}${s.padEnd(a, "0")}`);
|
|
1791
1768
|
};
|
|
1792
|
-
let tt =
|
|
1793
|
-
const
|
|
1769
|
+
let tt = mn;
|
|
1770
|
+
const Tn = Intl.NumberFormat("fullwide", {
|
|
1794
1771
|
useGrouping: !1,
|
|
1795
1772
|
maximumFractionDigits: 20
|
|
1796
1773
|
});
|
|
1797
1774
|
function ue(e) {
|
|
1798
|
-
const t = `${typeof e == "number" ?
|
|
1775
|
+
const t = `${typeof e == "number" ? Tn.format(e) : Oe(e)}`.replaceAll(",", ".").split(".");
|
|
1799
1776
|
return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
|
|
1800
1777
|
}
|
|
1801
1778
|
function nt(e) {
|
|
@@ -1813,12 +1790,12 @@ class P extends tt {
|
|
|
1813
1790
|
decimal: n,
|
|
1814
1791
|
tax: a,
|
|
1815
1792
|
chain: i,
|
|
1816
|
-
symbol:
|
|
1793
|
+
symbol: s,
|
|
1817
1794
|
identifier: p
|
|
1818
1795
|
}) {
|
|
1819
1796
|
super(typeof t == "object" ? t : { decimal: n, value: t }), C(this, "address"), C(this, "chain"), C(this, "isGasAsset", !1), C(this, "isSynthetic", !1), C(this, "symbol"), C(this, "tax"), C(this, "ticker"), C(this, "type");
|
|
1820
|
-
const u = se(p || `${i}.${
|
|
1821
|
-
this.type =
|
|
1797
|
+
const u = se(p || `${i}.${s}`);
|
|
1798
|
+
this.type = rn(u), this.tax = a, this.chain = u.chain, this.ticker = u.ticker, this.symbol = u.symbol, this.address = u.address, this.isSynthetic = u.isSynthetic, this.isGasAsset = u.isGasAsset;
|
|
1822
1799
|
}
|
|
1823
1800
|
toString() {
|
|
1824
1801
|
return this.isSynthetic ? this.symbol : `${this.chain}.${this.symbol}`;
|
|
@@ -1836,10 +1813,10 @@ class P extends tt {
|
|
|
1836
1813
|
// THOR.ETH.ETH
|
|
1837
1814
|
// ETH.THOR-0x1234567890
|
|
1838
1815
|
static fromUrl(t, n = 0) {
|
|
1839
|
-
const [a, i,
|
|
1816
|
+
const [a, i, s] = t.split(".");
|
|
1840
1817
|
if (!a || !i)
|
|
1841
1818
|
throw new Error("Invalid asset url");
|
|
1842
|
-
const p = a ===
|
|
1819
|
+
const p = a === r.THORChain && s ? `${a}.${i}/${s}` : t;
|
|
1843
1820
|
return Ae(p, n);
|
|
1844
1821
|
}
|
|
1845
1822
|
static fromString(t, n = 0) {
|
|
@@ -1849,10 +1826,10 @@ class P extends tt {
|
|
|
1849
1826
|
return Ae(t, n);
|
|
1850
1827
|
}
|
|
1851
1828
|
static fromStringSync(t, n = 0) {
|
|
1852
|
-
const { chain: a, isSynthetic: i } = se(t),
|
|
1829
|
+
const { chain: a, isSynthetic: i } = se(t), s = K.get(t.toUpperCase());
|
|
1853
1830
|
if (i)
|
|
1854
1831
|
return Pe(t, n);
|
|
1855
|
-
const { tax: p, decimal: u, identifier: y } =
|
|
1832
|
+
const { tax: p, decimal: u, identifier: y } = s || {
|
|
1856
1833
|
decimal: E[a],
|
|
1857
1834
|
identifier: t
|
|
1858
1835
|
};
|
|
@@ -1864,17 +1841,17 @@ class P extends tt {
|
|
|
1864
1841
|
});
|
|
1865
1842
|
}
|
|
1866
1843
|
static fromIdentifierSync(t, n = 0) {
|
|
1867
|
-
const { chain: a, isSynthetic: i } = se(t),
|
|
1844
|
+
const { chain: a, isSynthetic: i } = se(t), s = K.get(t);
|
|
1868
1845
|
if (i)
|
|
1869
1846
|
return Pe(t, n);
|
|
1870
|
-
const { tax: p, decimal: u, identifier: y } =
|
|
1847
|
+
const { tax: p, decimal: u, identifier: y } = s || {
|
|
1871
1848
|
decimal: E[a],
|
|
1872
1849
|
identifier: t
|
|
1873
1850
|
};
|
|
1874
1851
|
return new P({ tax: p, decimal: u, identifier: y, value: Y(n, u) });
|
|
1875
1852
|
}
|
|
1876
1853
|
static fromChainOrSignature(t, n = 0) {
|
|
1877
|
-
const { decimal: a, identifier: i } =
|
|
1854
|
+
const { decimal: a, identifier: i } = sn(t);
|
|
1878
1855
|
return new P({ value: Y(n, a), decimal: a, identifier: i });
|
|
1879
1856
|
}
|
|
1880
1857
|
static loadStaticAssets() {
|
|
@@ -1883,8 +1860,8 @@ class P extends tt {
|
|
|
1883
1860
|
try {
|
|
1884
1861
|
const a = await import("@swapkit/tokens");
|
|
1885
1862
|
Object.values(a).forEach((i) => {
|
|
1886
|
-
var
|
|
1887
|
-
(
|
|
1863
|
+
var s;
|
|
1864
|
+
(s = i == null ? void 0 : i.tokens) == null || s.forEach(({ identifier: p, chain: u, ...y }) => {
|
|
1888
1865
|
K.set(p.toUpperCase(), {
|
|
1889
1866
|
identifier: p,
|
|
1890
1867
|
decimal: "decimals" in y ? y.decimals : E[u]
|
|
@@ -1905,57 +1882,57 @@ class P extends tt {
|
|
|
1905
1882
|
function fe(e) {
|
|
1906
1883
|
const t = P.fromChainOrSignature(e);
|
|
1907
1884
|
switch (e) {
|
|
1908
|
-
case
|
|
1909
|
-
case
|
|
1910
|
-
case
|
|
1885
|
+
case r.Bitcoin:
|
|
1886
|
+
case r.Litecoin:
|
|
1887
|
+
case r.BitcoinCash:
|
|
1911
1888
|
return t.set(10001e-8);
|
|
1912
|
-
case
|
|
1889
|
+
case r.Dogecoin:
|
|
1913
1890
|
return t.set(1.00000001);
|
|
1914
|
-
case
|
|
1915
|
-
case
|
|
1891
|
+
case r.Avalanche:
|
|
1892
|
+
case r.Ethereum:
|
|
1916
1893
|
return t.set(1e-8);
|
|
1917
|
-
case
|
|
1918
|
-
case
|
|
1894
|
+
case r.THORChain:
|
|
1895
|
+
case r.Maya:
|
|
1919
1896
|
return t.set(0);
|
|
1920
|
-
case
|
|
1897
|
+
case r.Cosmos:
|
|
1921
1898
|
return t.set(1e-6);
|
|
1922
1899
|
default:
|
|
1923
1900
|
return t.set(1e-8);
|
|
1924
1901
|
}
|
|
1925
1902
|
}
|
|
1926
1903
|
async function Ae(e, t = 0) {
|
|
1927
|
-
|
|
1928
|
-
const n = K.get(e.toUpperCase()), a = (n == null ? void 0 : n.decimal) || await
|
|
1904
|
+
ln(e);
|
|
1905
|
+
const n = K.get(e.toUpperCase()), a = (n == null ? void 0 : n.decimal) || await nn(se(e));
|
|
1929
1906
|
return n || K.set(e.toUpperCase(), { identifier: e, decimal: a }), new P({ decimal: a, value: Y(t, a), identifier: e });
|
|
1930
1907
|
}
|
|
1931
1908
|
function Pe(e, t = 0) {
|
|
1932
|
-
const [n, a] = e.split(".")[0].toUpperCase() ===
|
|
1909
|
+
const [n, a] = e.split(".")[0].toUpperCase() === r.THORChain ? e.split(".").slice(1).join().split("/") : e.split("/");
|
|
1933
1910
|
if (!n || !a)
|
|
1934
1911
|
throw new Error("Invalid asset identifier");
|
|
1935
1912
|
return new P({
|
|
1936
1913
|
decimal: 8,
|
|
1937
1914
|
value: Y(t, 8),
|
|
1938
|
-
identifier: `${
|
|
1915
|
+
identifier: `${r.THORChain}.${n}/${a}`
|
|
1939
1916
|
});
|
|
1940
1917
|
}
|
|
1941
1918
|
function Y(e, t) {
|
|
1942
1919
|
return typeof e == "bigint" ? me({ value: e, bigIntDecimal: t, decimal: t }) : e;
|
|
1943
1920
|
}
|
|
1944
1921
|
function se(e) {
|
|
1945
|
-
const t = e.slice(0, 14).includes("/"), [n, a] = e.split(".")[0].toUpperCase() ===
|
|
1922
|
+
const t = e.slice(0, 14).includes("/"), [n, a] = e.split(".")[0].toUpperCase() === r.THORChain ? e.split(".").slice(1).join().split("/") : e.split("/");
|
|
1946
1923
|
if (t && (!n || !a))
|
|
1947
1924
|
throw new Error("Invalid asset identifier");
|
|
1948
|
-
const i = e.includes(".") && !t ? e : `${
|
|
1925
|
+
const i = e.includes(".") && !t ? e : `${r.THORChain}.${a}`, [s, ...p] = i.split("."), [u, y] = (t ? a : p.join(".")).split("-"), l = t ? a : p.join(".");
|
|
1949
1926
|
return {
|
|
1950
1927
|
address: y == null ? void 0 : y.toLowerCase(),
|
|
1951
|
-
chain:
|
|
1952
|
-
isGasAsset: Ze({ chain:
|
|
1928
|
+
chain: s,
|
|
1929
|
+
isGasAsset: Ze({ chain: s, symbol: l }),
|
|
1953
1930
|
isSynthetic: t,
|
|
1954
1931
|
symbol: (t ? `${n}/` : "") + (y ? `${u}-${(y == null ? void 0 : y.toLowerCase()) ?? ""}` : l),
|
|
1955
1932
|
ticker: u
|
|
1956
1933
|
};
|
|
1957
1934
|
}
|
|
1958
|
-
const
|
|
1935
|
+
const cn = {
|
|
1959
1936
|
/**
|
|
1960
1937
|
* Core
|
|
1961
1938
|
*/
|
|
@@ -2021,7 +1998,7 @@ const dn = {
|
|
|
2021
1998
|
};
|
|
2022
1999
|
class c extends Error {
|
|
2023
2000
|
constructor(t, n) {
|
|
2024
|
-
n && console.error(n, { stack: n == null ? void 0 : n.stack, message: n == null ? void 0 : n.message }), super(t, { cause: { code:
|
|
2001
|
+
n && console.error(n, { stack: n == null ? void 0 : n.stack, message: n == null ? void 0 : n.message }), super(t, { cause: { code: cn[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
|
|
2025
2002
|
}
|
|
2026
2003
|
}
|
|
2027
2004
|
class x extends tt {
|
|
@@ -2035,7 +2012,7 @@ class x extends tt {
|
|
|
2035
2012
|
});
|
|
2036
2013
|
}
|
|
2037
2014
|
}
|
|
2038
|
-
const
|
|
2015
|
+
const bn = [
|
|
2039
2016
|
{
|
|
2040
2017
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
2041
2018
|
stateMutability: "nonpayable",
|
|
@@ -2126,7 +2103,7 @@ const ln = [
|
|
|
2126
2103
|
type: "function"
|
|
2127
2104
|
},
|
|
2128
2105
|
{ stateMutability: "payable", type: "receive" }
|
|
2129
|
-
],
|
|
2106
|
+
], _n = [
|
|
2130
2107
|
{
|
|
2131
2108
|
inputs: [
|
|
2132
2109
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -2270,7 +2247,7 @@ const ln = [
|
|
|
2270
2247
|
type: "function"
|
|
2271
2248
|
},
|
|
2272
2249
|
{ stateMutability: "payable", type: "receive" }
|
|
2273
|
-
],
|
|
2250
|
+
], fn = [
|
|
2274
2251
|
{
|
|
2275
2252
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
2276
2253
|
stateMutability: "nonpayable",
|
|
@@ -2375,7 +2352,7 @@ const ln = [
|
|
|
2375
2352
|
type: "function"
|
|
2376
2353
|
},
|
|
2377
2354
|
{ stateMutability: "payable", type: "receive" }
|
|
2378
|
-
],
|
|
2355
|
+
], An = [
|
|
2379
2356
|
{
|
|
2380
2357
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
2381
2358
|
stateMutability: "nonpayable",
|
|
@@ -2466,7 +2443,7 @@ const ln = [
|
|
|
2466
2443
|
type: "function"
|
|
2467
2444
|
},
|
|
2468
2445
|
{ stateMutability: "payable", type: "receive" }
|
|
2469
|
-
],
|
|
2446
|
+
], hn = [
|
|
2470
2447
|
{
|
|
2471
2448
|
inputs: [
|
|
2472
2449
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -2610,7 +2587,7 @@ const ln = [
|
|
|
2610
2587
|
type: "function"
|
|
2611
2588
|
},
|
|
2612
2589
|
{ stateMutability: "payable", type: "receive" }
|
|
2613
|
-
],
|
|
2590
|
+
], En = [
|
|
2614
2591
|
{
|
|
2615
2592
|
inputs: [
|
|
2616
2593
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -5656,7 +5633,7 @@ const ln = [
|
|
|
5656
5633
|
type: "function"
|
|
5657
5634
|
},
|
|
5658
5635
|
{ stateMutability: "payable", type: "receive" }
|
|
5659
|
-
],
|
|
5636
|
+
], Rn = [
|
|
5660
5637
|
{
|
|
5661
5638
|
inputs: [
|
|
5662
5639
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -5995,7 +5972,7 @@ const ln = [
|
|
|
5995
5972
|
type: "function"
|
|
5996
5973
|
},
|
|
5997
5974
|
{ stateMutability: "payable", type: "receive" }
|
|
5998
|
-
],
|
|
5975
|
+
], On = [
|
|
5999
5976
|
{
|
|
6000
5977
|
inputs: [
|
|
6001
5978
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -6334,7 +6311,7 @@ const ln = [
|
|
|
6334
6311
|
type: "function"
|
|
6335
6312
|
},
|
|
6336
6313
|
{ stateMutability: "payable", type: "receive" }
|
|
6337
|
-
],
|
|
6314
|
+
], Sn = [
|
|
6338
6315
|
{
|
|
6339
6316
|
inputs: [
|
|
6340
6317
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -6673,7 +6650,7 @@ const ln = [
|
|
|
6673
6650
|
type: "function"
|
|
6674
6651
|
},
|
|
6675
6652
|
{ stateMutability: "payable", type: "receive" }
|
|
6676
|
-
],
|
|
6653
|
+
], wn = [
|
|
6677
6654
|
{
|
|
6678
6655
|
inputs: [
|
|
6679
6656
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -7012,7 +6989,7 @@ const ln = [
|
|
|
7012
6989
|
type: "function"
|
|
7013
6990
|
},
|
|
7014
6991
|
{ stateMutability: "payable", type: "receive" }
|
|
7015
|
-
],
|
|
6992
|
+
], Mn = [
|
|
7016
6993
|
{
|
|
7017
6994
|
inputs: [
|
|
7018
6995
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -7265,7 +7242,7 @@ const ln = [
|
|
|
7265
7242
|
type: "function"
|
|
7266
7243
|
},
|
|
7267
7244
|
{ stateMutability: "payable", type: "receive" }
|
|
7268
|
-
],
|
|
7245
|
+
], In = [
|
|
7269
7246
|
{
|
|
7270
7247
|
inputs: [
|
|
7271
7248
|
{ internalType: "address", name: "_weth", type: "address" },
|
|
@@ -7435,23 +7412,23 @@ const ln = [
|
|
|
7435
7412
|
type: "function"
|
|
7436
7413
|
},
|
|
7437
7414
|
{ stateMutability: "payable", type: "receive" }
|
|
7438
|
-
],
|
|
7415
|
+
], gn = {
|
|
7439
7416
|
// AVAX
|
|
7440
|
-
["0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106".toLowerCase()]:
|
|
7441
|
-
["0xC22FBb3133dF781E6C25ea6acebe2D2Bb8CeA2f9".toLowerCase()]:
|
|
7442
|
-
["0x60aE616a2155Ee3d9A68541Ba4544862310933d4".toLowerCase()]:
|
|
7417
|
+
["0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106".toLowerCase()]: Rn,
|
|
7418
|
+
["0xC22FBb3133dF781E6C25ea6acebe2D2Bb8CeA2f9".toLowerCase()]: In,
|
|
7419
|
+
["0x60aE616a2155Ee3d9A68541Ba4544862310933d4".toLowerCase()]: Sn,
|
|
7443
7420
|
["0x1111111254fb6c44bAC0beD2854e76F90643097d".toLowerCase()]: xe,
|
|
7444
7421
|
["0x6131B5fae19EA4f9D964eAc0408E4408b66337b5".toLowerCase()]: ke,
|
|
7445
7422
|
// BSC
|
|
7446
7423
|
["0x10ED43C718714eb63d5aA57B78B54704E256024E".toLowerCase()]: Be,
|
|
7447
7424
|
// ETH
|
|
7448
7425
|
["0x6131B5fae19EA4f9D964eAc0408E4408b66337b5".toLowerCase()]: ke,
|
|
7449
|
-
["0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f".toLowerCase()]:
|
|
7426
|
+
["0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f".toLowerCase()]: On,
|
|
7450
7427
|
["0xEfF92A263d31888d860bD50809A8D171709b7b1c".toLowerCase()]: Be,
|
|
7451
|
-
["0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D".toLowerCase()]:
|
|
7452
|
-
["0xE592427A0AEce92De3Edee1F18E0157C05861564".toLowerCase()]:
|
|
7428
|
+
["0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D".toLowerCase()]: wn,
|
|
7429
|
+
["0xE592427A0AEce92De3Edee1F18E0157C05861564".toLowerCase()]: Mn,
|
|
7453
7430
|
["0x1111111254fb6c44bac0bed2854e76f90643097d".toLowerCase()]: xe
|
|
7454
|
-
},
|
|
7431
|
+
}, Cn = [
|
|
7455
7432
|
{
|
|
7456
7433
|
inputs: [
|
|
7457
7434
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7570,7 +7547,7 @@ const ln = [
|
|
|
7570
7547
|
type: "function"
|
|
7571
7548
|
},
|
|
7572
7549
|
{ stateMutability: "payable", type: "receive" }
|
|
7573
|
-
],
|
|
7550
|
+
], vn = [
|
|
7574
7551
|
{
|
|
7575
7552
|
inputs: [
|
|
7576
7553
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7689,7 +7666,7 @@ const ln = [
|
|
|
7689
7666
|
type: "function"
|
|
7690
7667
|
},
|
|
7691
7668
|
{ stateMutability: "payable", type: "receive" }
|
|
7692
|
-
],
|
|
7669
|
+
], Nn = [
|
|
7693
7670
|
{
|
|
7694
7671
|
inputs: [
|
|
7695
7672
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7808,7 +7785,7 @@ const ln = [
|
|
|
7808
7785
|
type: "function"
|
|
7809
7786
|
},
|
|
7810
7787
|
{ stateMutability: "payable", type: "receive" }
|
|
7811
|
-
],
|
|
7788
|
+
], Dn = [
|
|
7812
7789
|
{
|
|
7813
7790
|
inputs: [
|
|
7814
7791
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7935,7 +7912,7 @@ const ln = [
|
|
|
7935
7912
|
type: "function"
|
|
7936
7913
|
},
|
|
7937
7914
|
{ stateMutability: "payable", type: "receive" }
|
|
7938
|
-
],
|
|
7915
|
+
], Pn = [
|
|
7939
7916
|
{
|
|
7940
7917
|
inputs: [
|
|
7941
7918
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8062,7 +8039,7 @@ const ln = [
|
|
|
8062
8039
|
type: "function"
|
|
8063
8040
|
},
|
|
8064
8041
|
{ stateMutability: "payable", type: "receive" }
|
|
8065
|
-
],
|
|
8042
|
+
], kn = [
|
|
8066
8043
|
{
|
|
8067
8044
|
inputs: [
|
|
8068
8045
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8189,7 +8166,7 @@ const ln = [
|
|
|
8189
8166
|
type: "function"
|
|
8190
8167
|
},
|
|
8191
8168
|
{ stateMutability: "payable", type: "receive" }
|
|
8192
|
-
],
|
|
8169
|
+
], xn = [
|
|
8193
8170
|
{
|
|
8194
8171
|
inputs: [
|
|
8195
8172
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8316,7 +8293,7 @@ const ln = [
|
|
|
8316
8293
|
type: "function"
|
|
8317
8294
|
},
|
|
8318
8295
|
{ stateMutability: "payable", type: "receive" }
|
|
8319
|
-
],
|
|
8296
|
+
], Bn = [
|
|
8320
8297
|
{
|
|
8321
8298
|
inputs: [
|
|
8322
8299
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8444,34 +8421,34 @@ const ln = [
|
|
|
8444
8421
|
},
|
|
8445
8422
|
{ stateMutability: "payable", type: "receive" }
|
|
8446
8423
|
], at = {
|
|
8447
|
-
["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]:
|
|
8448
|
-
["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]:
|
|
8449
|
-
["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]:
|
|
8450
|
-
},
|
|
8451
|
-
...
|
|
8424
|
+
["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: bn,
|
|
8425
|
+
["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: fn,
|
|
8426
|
+
["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: An
|
|
8427
|
+
}, Ln = {
|
|
8428
|
+
...gn,
|
|
8452
8429
|
...at,
|
|
8453
8430
|
// AVAX
|
|
8454
|
-
["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]:
|
|
8455
|
-
["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]:
|
|
8456
|
-
["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]:
|
|
8431
|
+
["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: En,
|
|
8432
|
+
["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: _n,
|
|
8433
|
+
["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: vn,
|
|
8457
8434
|
// BSC
|
|
8458
|
-
["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]:
|
|
8435
|
+
["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: hn,
|
|
8459
8436
|
// ETH
|
|
8460
|
-
["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]:
|
|
8461
|
-
["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]:
|
|
8462
|
-
["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]:
|
|
8463
|
-
["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]:
|
|
8464
|
-
["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]:
|
|
8465
|
-
["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]:
|
|
8466
|
-
["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]:
|
|
8467
|
-
},
|
|
8437
|
+
["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: Cn,
|
|
8438
|
+
["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Nn,
|
|
8439
|
+
["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: Dn,
|
|
8440
|
+
["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: Pn,
|
|
8441
|
+
["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: kn,
|
|
8442
|
+
["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: xn,
|
|
8443
|
+
["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: Bn
|
|
8444
|
+
}, Vn = ({
|
|
8468
8445
|
streamSwap: e,
|
|
8469
8446
|
contractAddress: t,
|
|
8470
8447
|
recipient: n,
|
|
8471
8448
|
toChecksumAddress: a,
|
|
8472
8449
|
calldata: {
|
|
8473
8450
|
amount: i,
|
|
8474
|
-
amountOutMin:
|
|
8451
|
+
amountOutMin: s = "",
|
|
8475
8452
|
data: p = "",
|
|
8476
8453
|
deadline: u,
|
|
8477
8454
|
memo: y,
|
|
@@ -8484,10 +8461,10 @@ const ln = [
|
|
|
8484
8461
|
token: O
|
|
8485
8462
|
}
|
|
8486
8463
|
}) => {
|
|
8487
|
-
const
|
|
8488
|
-
if (
|
|
8464
|
+
const S = !!at[t.toLowerCase()];
|
|
8465
|
+
if (S && !l)
|
|
8489
8466
|
throw new Error("Router is required on calldata for swapIn with GenericContract");
|
|
8490
|
-
const
|
|
8467
|
+
const w = T || y, B = e && m || w;
|
|
8491
8468
|
if (!h && !R)
|
|
8492
8469
|
throw new Error("TC Vault is required on calldata");
|
|
8493
8470
|
if (!_ && !l)
|
|
@@ -8503,77 +8480,77 @@ const ln = [
|
|
|
8503
8480
|
B.replace("{recipientAddress}", n),
|
|
8504
8481
|
a(O),
|
|
8505
8482
|
i
|
|
8506
|
-
], it =
|
|
8483
|
+
], it = S ? [a(l), p, u] : [s, u];
|
|
8507
8484
|
return [...Te, ...it];
|
|
8508
|
-
},
|
|
8485
|
+
}, Hn = ({ chain: e, txHash: t }) => {
|
|
8509
8486
|
const n = We[e];
|
|
8510
8487
|
switch (e) {
|
|
8511
|
-
case
|
|
8512
|
-
case
|
|
8513
|
-
case
|
|
8514
|
-
case
|
|
8488
|
+
case r.Binance:
|
|
8489
|
+
case r.Maya:
|
|
8490
|
+
case r.Kujira:
|
|
8491
|
+
case r.THORChain:
|
|
8515
8492
|
return `${n}/tx/${t.startsWith("0x") ? t.slice(2) : t}`;
|
|
8516
|
-
case
|
|
8517
|
-
case
|
|
8518
|
-
case
|
|
8519
|
-
case
|
|
8520
|
-
case
|
|
8521
|
-
case
|
|
8493
|
+
case r.Arbitrum:
|
|
8494
|
+
case r.Avalanche:
|
|
8495
|
+
case r.BinanceSmartChain:
|
|
8496
|
+
case r.Ethereum:
|
|
8497
|
+
case r.Optimism:
|
|
8498
|
+
case r.Polygon:
|
|
8522
8499
|
return `${n}/tx/${t.startsWith("0x") ? t : `0x${t}`}`;
|
|
8523
|
-
case
|
|
8500
|
+
case r.Cosmos:
|
|
8524
8501
|
return `${n}/transactions/${t}`;
|
|
8525
|
-
case
|
|
8526
|
-
case
|
|
8527
|
-
case
|
|
8528
|
-
case
|
|
8502
|
+
case r.Litecoin:
|
|
8503
|
+
case r.Bitcoin:
|
|
8504
|
+
case r.BitcoinCash:
|
|
8505
|
+
case r.Dogecoin:
|
|
8529
8506
|
return `${n}/transaction/${t.toLowerCase()}`;
|
|
8530
8507
|
default:
|
|
8531
8508
|
throw new Error(`Unsupported chain: ${e}`);
|
|
8532
8509
|
}
|
|
8533
|
-
},
|
|
8510
|
+
}, Fn = ({ chain: e, address: t }) => {
|
|
8534
8511
|
const n = We[e];
|
|
8535
8512
|
switch (e) {
|
|
8536
|
-
case
|
|
8537
|
-
case
|
|
8538
|
-
case
|
|
8539
|
-
case
|
|
8540
|
-
case
|
|
8541
|
-
case
|
|
8542
|
-
case
|
|
8543
|
-
case
|
|
8544
|
-
case
|
|
8545
|
-
case
|
|
8546
|
-
case
|
|
8547
|
-
case
|
|
8548
|
-
case
|
|
8549
|
-
case
|
|
8513
|
+
case r.Arbitrum:
|
|
8514
|
+
case r.Avalanche:
|
|
8515
|
+
case r.Binance:
|
|
8516
|
+
case r.BinanceSmartChain:
|
|
8517
|
+
case r.Bitcoin:
|
|
8518
|
+
case r.BitcoinCash:
|
|
8519
|
+
case r.Dogecoin:
|
|
8520
|
+
case r.Ethereum:
|
|
8521
|
+
case r.Kujira:
|
|
8522
|
+
case r.Litecoin:
|
|
8523
|
+
case r.Maya:
|
|
8524
|
+
case r.Optimism:
|
|
8525
|
+
case r.Polygon:
|
|
8526
|
+
case r.THORChain:
|
|
8550
8527
|
return `${n}/address/${t}`;
|
|
8551
|
-
case
|
|
8528
|
+
case r.Cosmos:
|
|
8552
8529
|
return `${n}/account/${t}`;
|
|
8553
8530
|
default:
|
|
8554
8531
|
throw new Error(`Unsupported chain: ${e}`);
|
|
8555
8532
|
}
|
|
8556
|
-
},
|
|
8533
|
+
}, Un = (e) => {
|
|
8557
8534
|
const t = e ? Q.ThornodeStagenet : Q.ThornodeMainnet;
|
|
8558
8535
|
return g.get(`${t}/thorchain/inbound_addresses`);
|
|
8559
|
-
},
|
|
8536
|
+
}, Wn = (e) => {
|
|
8560
8537
|
const t = e ? Q.ThornodeStagenet : Q.ThornodeMainnet;
|
|
8561
8538
|
return g.get(`${t}/thorchain/mimir`);
|
|
8562
|
-
}, Le = () => Object.values(
|
|
8539
|
+
}, Le = () => Object.values(r).reduce(
|
|
8563
8540
|
(e, t) => (e[t] = null, e),
|
|
8564
8541
|
{}
|
|
8565
|
-
),
|
|
8542
|
+
), $n = async ({ chain: e, address: t }) => {
|
|
8566
8543
|
if (!t)
|
|
8567
8544
|
return !1;
|
|
8568
8545
|
switch (e) {
|
|
8569
|
-
case
|
|
8546
|
+
case r.Bitcoin:
|
|
8570
8547
|
return !t.startsWith("bc1p");
|
|
8571
8548
|
default:
|
|
8572
8549
|
return !0;
|
|
8573
8550
|
}
|
|
8574
8551
|
};
|
|
8575
8552
|
var U, ye, Z, v, z, ee;
|
|
8576
|
-
class
|
|
8553
|
+
class la {
|
|
8577
8554
|
constructor({ stagenet: t } = {}) {
|
|
8578
8555
|
b(this, "connectedChains", Le());
|
|
8579
8556
|
b(this, "connectedWallets", Le());
|
|
@@ -8582,9 +8559,9 @@ class ua {
|
|
|
8582
8559
|
var n;
|
|
8583
8560
|
return ((n = this.connectedChains[t]) == null ? void 0 : n.address) || "";
|
|
8584
8561
|
});
|
|
8585
|
-
b(this, "getExplorerTxUrl", (t, n) =>
|
|
8562
|
+
b(this, "getExplorerTxUrl", (t, n) => Hn({ chain: t, txHash: n }));
|
|
8586
8563
|
b(this, "getWallet", (t) => this.connectedWallets[t]);
|
|
8587
|
-
b(this, "getExplorerAddressUrl", (t, n) =>
|
|
8564
|
+
b(this, "getExplorerAddressUrl", (t, n) => Fn({ chain: t, address: n }));
|
|
8588
8565
|
b(this, "getBalance", async (t, n) => {
|
|
8589
8566
|
const a = await this.getWalletByChain(t, n);
|
|
8590
8567
|
return (a == null ? void 0 : a.balance) || [];
|
|
@@ -8592,12 +8569,12 @@ class ua {
|
|
|
8592
8569
|
b(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
|
|
8593
8570
|
var u, y;
|
|
8594
8571
|
const {
|
|
8595
|
-
meta: { quoteMode:
|
|
8572
|
+
meta: { quoteMode: s }
|
|
8596
8573
|
// evmTransactionDetails: contractCallParams,
|
|
8597
|
-
} = a, p =
|
|
8574
|
+
} = a, p = s.startsWith("ERC20-") ? r.Ethereum : s.startsWith("ARC20-") ? r.Avalanche : s.startsWith("BEP20-") ? r.BinanceSmartChain : void 0;
|
|
8598
8575
|
if (!a.complete)
|
|
8599
8576
|
throw new c("core_swap_route_not_complete");
|
|
8600
|
-
if (Tt.includes(
|
|
8577
|
+
if (Tt.includes(s) && p) {
|
|
8601
8578
|
const l = this.connectedWallets[p];
|
|
8602
8579
|
if (!(l != null && l.sendTransaction))
|
|
8603
8580
|
throw new c("core_wallet_connection_not_found");
|
|
@@ -8612,7 +8589,7 @@ class ua {
|
|
|
8612
8589
|
};
|
|
8613
8590
|
return l.sendTransaction(O, i);
|
|
8614
8591
|
}
|
|
8615
|
-
if (bt.includes(
|
|
8592
|
+
if (bt.includes(s)) {
|
|
8616
8593
|
if (!a.calldata.fromAsset)
|
|
8617
8594
|
throw new c("core_swap_asset_not_recognized");
|
|
8618
8595
|
const l = await P.fromString(a.calldata.fromAsset);
|
|
@@ -8621,28 +8598,28 @@ class ua {
|
|
|
8621
8598
|
const { address: m } = await A(this, U).call(this, l.chain), {
|
|
8622
8599
|
contract: T,
|
|
8623
8600
|
calldata: { expiration: _, amountIn: h, memo: R, memoStreamingSwap: O }
|
|
8624
|
-
} = a,
|
|
8601
|
+
} = a, S = l.add(x.fromBigInt(BigInt(h), l.decimal)), w = t && O || R;
|
|
8625
8602
|
return this.deposit({
|
|
8626
8603
|
expiration: _,
|
|
8627
|
-
assetValue:
|
|
8628
|
-
memo:
|
|
8604
|
+
assetValue: S,
|
|
8605
|
+
memo: w,
|
|
8629
8606
|
feeOptionKey: i,
|
|
8630
8607
|
router: T,
|
|
8631
8608
|
recipient: m
|
|
8632
8609
|
});
|
|
8633
8610
|
}
|
|
8634
|
-
if (ct.includes(
|
|
8611
|
+
if (ct.includes(s) && p) {
|
|
8635
8612
|
const { calldata: l, contract: m } = a;
|
|
8636
8613
|
if (!m)
|
|
8637
8614
|
throw new c("core_swap_contract_not_found");
|
|
8638
8615
|
const T = this.connectedWallets[p], _ = this.getAddress(p);
|
|
8639
8616
|
if (!(T != null && T.sendTransaction) || !_)
|
|
8640
8617
|
throw new c("core_wallet_connection_not_found");
|
|
8641
|
-
const { getProvider: h, toChecksumAddress: R } = await import("@swapkit/toolbox-evm"), O = h(p),
|
|
8642
|
-
if (!
|
|
8618
|
+
const { getProvider: h, toChecksumAddress: R } = await import("@swapkit/toolbox-evm"), O = h(p), S = Ln[m.toLowerCase()];
|
|
8619
|
+
if (!S)
|
|
8643
8620
|
throw new c("core_swap_contract_not_supported", { contractAddress: m });
|
|
8644
|
-
const B = await (await ((y = T.createContract) == null ? void 0 : y.call(T, m,
|
|
8645
|
-
...
|
|
8621
|
+
const B = await (await ((y = T.createContract) == null ? void 0 : y.call(T, m, S, O))).getFunction("swapIn").populateTransaction(
|
|
8622
|
+
...Vn({
|
|
8646
8623
|
streamSwap: t,
|
|
8647
8624
|
toChecksumAddress: R,
|
|
8648
8625
|
contractAddress: m,
|
|
@@ -8653,23 +8630,23 @@ class ua {
|
|
|
8653
8630
|
);
|
|
8654
8631
|
return T.sendTransaction(B, i);
|
|
8655
8632
|
}
|
|
8656
|
-
throw new c("core_swap_quote_mode_not_supported", { quoteMode:
|
|
8633
|
+
throw new c("core_swap_quote_mode_not_supported", { quoteMode: s });
|
|
8657
8634
|
});
|
|
8658
8635
|
b(this, "getWalletByChain", async (t, n) => {
|
|
8659
8636
|
var p, u;
|
|
8660
8637
|
const a = this.getAddress(t);
|
|
8661
8638
|
if (!a)
|
|
8662
8639
|
return null;
|
|
8663
|
-
const i = [P.fromChainOrSignature(t)],
|
|
8640
|
+
const i = [P.fromChainOrSignature(t)], s = (p = this.connectedChains[t]) == null ? void 0 : p.walletType;
|
|
8664
8641
|
try {
|
|
8665
8642
|
const y = await ((u = this.getWallet(t)) == null ? void 0 : u.getBalance(a, n));
|
|
8666
8643
|
return this.connectedChains[t] = {
|
|
8667
8644
|
address: a,
|
|
8668
8645
|
balance: y != null && y.length ? y : i,
|
|
8669
|
-
walletType:
|
|
8646
|
+
walletType: s
|
|
8670
8647
|
}, { ...this.connectedChains[t] };
|
|
8671
8648
|
} catch (y) {
|
|
8672
|
-
return console.error(y), { address: a, balance: i, walletType:
|
|
8649
|
+
return console.error(y), { address: a, balance: i, walletType: s };
|
|
8673
8650
|
}
|
|
8674
8651
|
});
|
|
8675
8652
|
b(this, "approveAssetValue", (t, n) => A(this, Z).call(this, { assetValue: t, type: "approve", contractAddress: n }));
|
|
@@ -8694,33 +8671,33 @@ class ua {
|
|
|
8694
8671
|
router: a,
|
|
8695
8672
|
...i
|
|
8696
8673
|
}) => {
|
|
8697
|
-
const { chain:
|
|
8698
|
-
if (!await
|
|
8674
|
+
const { chain: s, symbol: p, ticker: u } = t, y = this.connectedWallets[s];
|
|
8675
|
+
if (!await $n({
|
|
8699
8676
|
address: await (y == null ? void 0 : y.getAddress()),
|
|
8700
|
-
chain:
|
|
8677
|
+
chain: s
|
|
8701
8678
|
}))
|
|
8702
8679
|
throw new c("core_transaction_invalid_sender_address");
|
|
8703
8680
|
if (!y)
|
|
8704
8681
|
throw new c("core_wallet_connection_not_found");
|
|
8705
8682
|
const m = A(this, ee).call(this, { assetValue: t, recipient: n, router: a, ...i });
|
|
8706
8683
|
try {
|
|
8707
|
-
switch (
|
|
8708
|
-
case
|
|
8709
|
-
case
|
|
8684
|
+
switch (s) {
|
|
8685
|
+
case r.THORChain:
|
|
8686
|
+
case r.Maya: {
|
|
8710
8687
|
const T = y;
|
|
8711
8688
|
return await (n === "" ? T.deposit(m) : T.transfer(m));
|
|
8712
8689
|
}
|
|
8713
|
-
case
|
|
8714
|
-
case
|
|
8715
|
-
case
|
|
8716
|
-
const { getChecksumAddressFromAsset: T } = await import("@swapkit/toolbox-evm"), _ =
|
|
8690
|
+
case r.Ethereum:
|
|
8691
|
+
case r.BinanceSmartChain:
|
|
8692
|
+
case r.Avalanche: {
|
|
8693
|
+
const { getChecksumAddressFromAsset: T } = await import("@swapkit/toolbox-evm"), _ = s === r.Avalanche ? dt : s === r.BinanceSmartChain ? lt : ot;
|
|
8717
8694
|
return await y.call({
|
|
8718
8695
|
abi: _,
|
|
8719
|
-
contractAddress: a || (await A(this, U).call(this,
|
|
8696
|
+
contractAddress: a || (await A(this, U).call(this, s)).router,
|
|
8720
8697
|
funcName: "depositWithExpiry",
|
|
8721
8698
|
funcParams: [
|
|
8722
8699
|
n,
|
|
8723
|
-
T({ chain:
|
|
8700
|
+
T({ chain: s, symbol: p, ticker: u }, s),
|
|
8724
8701
|
t.getBaseValue("string"),
|
|
8725
8702
|
m.memo,
|
|
8726
8703
|
i.expiration || parseInt(`${((/* @__PURE__ */ new Date()).getTime() + 15 * 60 * 1e3) / 1e3}`)
|
|
@@ -8735,8 +8712,8 @@ class ua {
|
|
|
8735
8712
|
return await y.transfer(m);
|
|
8736
8713
|
}
|
|
8737
8714
|
} catch (T) {
|
|
8738
|
-
const _ = ((T == null ? void 0 : T.message) || (T == null ? void 0 : T.toString())).toLowerCase(), h = _ == null ? void 0 : _.includes("insufficient funds"), R = _ == null ? void 0 : _.includes("gas"), O = _ == null ? void 0 : _.includes("server"),
|
|
8739
|
-
throw new c(
|
|
8715
|
+
const _ = ((T == null ? void 0 : T.message) || (T == null ? void 0 : T.toString())).toLowerCase(), h = _ == null ? void 0 : _.includes("insufficient funds"), R = _ == null ? void 0 : _.includes("gas"), O = _ == null ? void 0 : _.includes("server"), S = _ == null ? void 0 : _.includes("user rejected"), w = h ? "core_transaction_deposit_insufficient_funds_error" : R ? "core_transaction_deposit_gas_error" : O ? "core_transaction_deposit_server_error" : S ? "core_transaction_user_rejected" : "core_transaction_deposit_error";
|
|
8716
|
+
throw new c(w, T);
|
|
8740
8717
|
}
|
|
8741
8718
|
});
|
|
8742
8719
|
/**
|
|
@@ -8757,19 +8734,19 @@ class ua {
|
|
|
8757
8734
|
address: this.getAddress(n.chain)
|
|
8758
8735
|
})
|
|
8759
8736
|
});
|
|
8760
|
-
} catch (
|
|
8761
|
-
throw new c("core_transaction_create_liquidity_rune_error",
|
|
8737
|
+
} catch (s) {
|
|
8738
|
+
throw new c("core_transaction_create_liquidity_rune_error", s);
|
|
8762
8739
|
}
|
|
8763
8740
|
try {
|
|
8764
8741
|
i = await A(this, v).call(this, {
|
|
8765
8742
|
assetValue: n,
|
|
8766
8743
|
memo: D(f.DEPOSIT, {
|
|
8767
8744
|
...n,
|
|
8768
|
-
address: this.getAddress(
|
|
8745
|
+
address: this.getAddress(r.THORChain)
|
|
8769
8746
|
})
|
|
8770
8747
|
});
|
|
8771
|
-
} catch (
|
|
8772
|
-
throw new c("core_transaction_create_liquidity_asset_error",
|
|
8748
|
+
} catch (s) {
|
|
8749
|
+
throw new c("core_transaction_create_liquidity_asset_error", s);
|
|
8773
8750
|
}
|
|
8774
8751
|
return { runeTx: a, assetTx: i };
|
|
8775
8752
|
});
|
|
@@ -8778,34 +8755,34 @@ class ua {
|
|
|
8778
8755
|
assetValue: n,
|
|
8779
8756
|
runeAddr: a,
|
|
8780
8757
|
assetAddr: i,
|
|
8781
|
-
isPendingSymmAsset:
|
|
8758
|
+
isPendingSymmAsset: s,
|
|
8782
8759
|
mode: p = "sym"
|
|
8783
8760
|
}) => {
|
|
8784
|
-
const { chain: u, symbol: y } = n, l = p === "sym", m = (t == null ? void 0 : t.gt(0)) && (l || p === "rune"), T = (n == null ? void 0 : n.gt(0)) && (l || p === "asset"), _ =
|
|
8761
|
+
const { chain: u, symbol: y } = n, l = p === "sym", m = (t == null ? void 0 : t.gt(0)) && (l || p === "rune"), T = (n == null ? void 0 : n.gt(0)) && (l || p === "asset"), _ = s || m, h = _ ? a || this.getAddress(r.THORChain) : "", R = l || p === "asset" ? i || this.getAddress(u) : "";
|
|
8785
8762
|
if (!m && !T)
|
|
8786
8763
|
throw new c("core_transaction_add_liquidity_invalid_params");
|
|
8787
8764
|
if (_ && !h)
|
|
8788
8765
|
throw new c("core_transaction_add_liquidity_no_rune_address");
|
|
8789
|
-
let O,
|
|
8766
|
+
let O, S;
|
|
8790
8767
|
if (m && t)
|
|
8791
8768
|
try {
|
|
8792
8769
|
O = await A(this, v).call(this, {
|
|
8793
8770
|
assetValue: t,
|
|
8794
8771
|
memo: D(f.DEPOSIT, { chain: u, symbol: y, address: R })
|
|
8795
8772
|
});
|
|
8796
|
-
} catch (
|
|
8797
|
-
throw new c("core_transaction_add_liquidity_rune_error",
|
|
8773
|
+
} catch (w) {
|
|
8774
|
+
throw new c("core_transaction_add_liquidity_rune_error", w);
|
|
8798
8775
|
}
|
|
8799
8776
|
if (T && n)
|
|
8800
8777
|
try {
|
|
8801
|
-
|
|
8778
|
+
S = await A(this, v).call(this, {
|
|
8802
8779
|
assetValue: n,
|
|
8803
8780
|
memo: D(f.DEPOSIT, { chain: u, symbol: y, address: h })
|
|
8804
8781
|
});
|
|
8805
|
-
} catch (
|
|
8806
|
-
throw new c("core_transaction_add_liquidity_asset_error",
|
|
8782
|
+
} catch (w) {
|
|
8783
|
+
throw new c("core_transaction_add_liquidity_asset_error", w);
|
|
8807
8784
|
}
|
|
8808
|
-
return { runeTx: O, assetTx:
|
|
8785
|
+
return { runeTx: O, assetTx: S };
|
|
8809
8786
|
});
|
|
8810
8787
|
b(this, "addLiquidityPart", ({
|
|
8811
8788
|
assetValue: t,
|
|
@@ -8815,21 +8792,21 @@ class ua {
|
|
|
8815
8792
|
}) => {
|
|
8816
8793
|
if (i && !a)
|
|
8817
8794
|
throw new c("core_transaction_add_liquidity_invalid_params");
|
|
8818
|
-
const
|
|
8795
|
+
const s = D(f.DEPOSIT, {
|
|
8819
8796
|
chain: n.split(".")[0],
|
|
8820
8797
|
symbol: n.split(".")[1],
|
|
8821
8798
|
address: i ? a : ""
|
|
8822
8799
|
});
|
|
8823
|
-
return A(this, v).call(this, { assetValue: t, memo:
|
|
8800
|
+
return A(this, v).call(this, { assetValue: t, memo: s });
|
|
8824
8801
|
});
|
|
8825
8802
|
b(this, "withdraw", async ({
|
|
8826
8803
|
memo: t,
|
|
8827
8804
|
assetValue: n,
|
|
8828
8805
|
percent: a,
|
|
8829
8806
|
from: i,
|
|
8830
|
-
to:
|
|
8807
|
+
to: s
|
|
8831
8808
|
}) => {
|
|
8832
|
-
const p =
|
|
8809
|
+
const p = s === "rune" && i !== "rune" ? P.fromChainOrSignature(r.THORChain) : i === "sym" && s === "sym" || i === "rune" || i === "asset" ? void 0 : n, u = fe(i === "asset" ? n.chain : r.THORChain), y = t || D(f.WITHDRAW, {
|
|
8833
8810
|
symbol: n.symbol,
|
|
8834
8811
|
chain: n.chain,
|
|
8835
8812
|
ticker: n.ticker,
|
|
@@ -8845,13 +8822,13 @@ class ua {
|
|
|
8845
8822
|
percent: a,
|
|
8846
8823
|
type: i
|
|
8847
8824
|
}) => {
|
|
8848
|
-
const
|
|
8825
|
+
const s = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || D(s, {
|
|
8849
8826
|
ticker: t.ticker,
|
|
8850
8827
|
symbol: t.symbol,
|
|
8851
8828
|
chain: t.chain,
|
|
8852
8829
|
singleSide: !0,
|
|
8853
8830
|
basisPoints: a ? Math.min(1e4, Math.round(a * 100)) : void 0
|
|
8854
|
-
}), u =
|
|
8831
|
+
}), u = s === f.DEPOSIT ? t : fe(t.chain);
|
|
8855
8832
|
return A(this, v).call(this, { memo: p, assetValue: u });
|
|
8856
8833
|
});
|
|
8857
8834
|
b(this, "loan", ({
|
|
@@ -8872,13 +8849,13 @@ class ua {
|
|
|
8872
8849
|
assetValue: n,
|
|
8873
8850
|
address: a
|
|
8874
8851
|
}) => {
|
|
8875
|
-
const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE,
|
|
8852
|
+
const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, s = D(i, {
|
|
8876
8853
|
address: a,
|
|
8877
8854
|
unbondAmount: t === "unbond" ? n.getBaseValue("number") : void 0
|
|
8878
8855
|
});
|
|
8879
8856
|
return A(this, z).call(this, {
|
|
8880
|
-
memo:
|
|
8881
|
-
assetValue: t === "bond" ? n : fe(
|
|
8857
|
+
memo: s,
|
|
8858
|
+
assetValue: t === "bond" ? n : fe(r.THORChain)
|
|
8882
8859
|
});
|
|
8883
8860
|
});
|
|
8884
8861
|
b(this, "registerThorname", ({
|
|
@@ -8887,16 +8864,16 @@ class ua {
|
|
|
8887
8864
|
}) => A(this, z).call(this, { assetValue: t, memo: D(f.THORNAME_REGISTER, n) }));
|
|
8888
8865
|
b(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
|
|
8889
8866
|
try {
|
|
8890
|
-
t.forEach((
|
|
8891
|
-
this[
|
|
8867
|
+
t.forEach((s) => {
|
|
8868
|
+
this[s.connectMethodName] = s.connect({
|
|
8892
8869
|
addChain: A(this, ye),
|
|
8893
8870
|
config: n || {},
|
|
8894
8871
|
apis: a,
|
|
8895
8872
|
rpcUrls: i
|
|
8896
8873
|
});
|
|
8897
8874
|
});
|
|
8898
|
-
} catch (
|
|
8899
|
-
throw new c("core_extend_error",
|
|
8875
|
+
} catch (s) {
|
|
8876
|
+
throw new c("core_extend_error", s);
|
|
8900
8877
|
}
|
|
8901
8878
|
});
|
|
8902
8879
|
b(this, "estimateMaxSendableAmount", async ({
|
|
@@ -8905,26 +8882,26 @@ class ua {
|
|
|
8905
8882
|
}) => {
|
|
8906
8883
|
const a = this.getWallet(t);
|
|
8907
8884
|
switch (t) {
|
|
8908
|
-
case
|
|
8909
|
-
case
|
|
8910
|
-
case
|
|
8911
|
-
case
|
|
8912
|
-
case
|
|
8913
|
-
case
|
|
8885
|
+
case r.Arbitrum:
|
|
8886
|
+
case r.Avalanche:
|
|
8887
|
+
case r.BinanceSmartChain:
|
|
8888
|
+
case r.Ethereum:
|
|
8889
|
+
case r.Optimism:
|
|
8890
|
+
case r.Polygon: {
|
|
8914
8891
|
const { estimateMaxSendableAmount: i } = await import("@swapkit/toolbox-evm");
|
|
8915
8892
|
return i({
|
|
8916
8893
|
...n,
|
|
8917
8894
|
toolbox: a
|
|
8918
8895
|
});
|
|
8919
8896
|
}
|
|
8920
|
-
case
|
|
8921
|
-
case
|
|
8922
|
-
case
|
|
8923
|
-
case
|
|
8897
|
+
case r.Bitcoin:
|
|
8898
|
+
case r.BitcoinCash:
|
|
8899
|
+
case r.Dogecoin:
|
|
8900
|
+
case r.Litecoin:
|
|
8924
8901
|
return a.estimateMaxSendableAmount(n);
|
|
8925
|
-
case
|
|
8926
|
-
case
|
|
8927
|
-
case
|
|
8902
|
+
case r.Binance:
|
|
8903
|
+
case r.THORChain:
|
|
8904
|
+
case r.Cosmos: {
|
|
8928
8905
|
const { estimateMaxSendableAmount: i } = await import("@swapkit/toolbox-cosmos");
|
|
8929
8906
|
return i({
|
|
8930
8907
|
...n,
|
|
@@ -8970,11 +8947,11 @@ class ua {
|
|
|
8970
8947
|
});
|
|
8971
8948
|
V(this, U, async (t) => {
|
|
8972
8949
|
switch (t) {
|
|
8973
|
-
case
|
|
8974
|
-
case
|
|
8950
|
+
case r.Maya:
|
|
8951
|
+
case r.THORChain:
|
|
8975
8952
|
return { gas_rate: "0", router: "", address: "", halted: !1, chain: t };
|
|
8976
8953
|
default: {
|
|
8977
|
-
const a = (await
|
|
8954
|
+
const a = (await Un(this.stagenet)).find((i) => i.chain === t);
|
|
8978
8955
|
if (!a)
|
|
8979
8956
|
throw new c("core_inbound_data_not_found");
|
|
8980
8957
|
if (a != null && a.halted)
|
|
@@ -8991,16 +8968,16 @@ class ua {
|
|
|
8991
8968
|
type: n = "checkOnly",
|
|
8992
8969
|
contractAddress: a
|
|
8993
8970
|
}) => {
|
|
8994
|
-
const { address: i, chain:
|
|
8971
|
+
const { address: i, chain: s, isGasAsset: p, isSynthetic: u } = t, y = [r.Ethereum, r.Avalanche, r.BinanceSmartChain].includes(s);
|
|
8995
8972
|
if (y && p || !y || u)
|
|
8996
8973
|
return !0;
|
|
8997
|
-
const m = this.connectedWallets[
|
|
8974
|
+
const m = this.connectedWallets[s], T = n === "checkOnly" ? m == null ? void 0 : m.isApproved : m == null ? void 0 : m.approve;
|
|
8998
8975
|
if (!T)
|
|
8999
8976
|
throw new c("core_wallet_connection_not_found");
|
|
9000
|
-
const _ = this.getAddress(
|
|
8977
|
+
const _ = this.getAddress(s);
|
|
9001
8978
|
if (!i || !_)
|
|
9002
8979
|
throw new c("core_approve_asset_address_or_from_not_found");
|
|
9003
|
-
const h = a || (await A(this, U).call(this,
|
|
8980
|
+
const h = a || (await A(this, U).call(this, s)).router;
|
|
9004
8981
|
return T({
|
|
9005
8982
|
amount: t.getBaseValue("bigint"),
|
|
9006
8983
|
assetAddress: i,
|
|
@@ -9015,19 +8992,19 @@ class ua {
|
|
|
9015
8992
|
}) => {
|
|
9016
8993
|
const {
|
|
9017
8994
|
gas_rate: i,
|
|
9018
|
-
router:
|
|
8995
|
+
router: s,
|
|
9019
8996
|
address: p
|
|
9020
|
-
} = await A(this, U).call(this, t.chain), u = (parseInt(i) || 0) *
|
|
8997
|
+
} = await A(this, U).call(this, t.chain), u = (parseInt(i) || 0) * an[a];
|
|
9021
8998
|
return this.deposit({
|
|
9022
8999
|
assetValue: t,
|
|
9023
9000
|
recipient: p,
|
|
9024
9001
|
memo: n,
|
|
9025
|
-
router:
|
|
9002
|
+
router: s,
|
|
9026
9003
|
feeRate: u
|
|
9027
9004
|
});
|
|
9028
9005
|
});
|
|
9029
9006
|
V(this, z, async ({ memo: t, assetValue: n }) => {
|
|
9030
|
-
const a = await
|
|
9007
|
+
const a = await Wn(this.stagenet);
|
|
9031
9008
|
if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
|
|
9032
9009
|
throw new c("core_chain_halted");
|
|
9033
9010
|
return this.deposit({ assetValue: n, recipient: "", memo: t });
|
|
@@ -9045,71 +9022,75 @@ U = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), v = new WeakMap(), z =
|
|
|
9045
9022
|
export {
|
|
9046
9023
|
Tt as AGG_SWAP,
|
|
9047
9024
|
k as ApiEndpoints,
|
|
9048
|
-
|
|
9025
|
+
Xn as ApiError,
|
|
9049
9026
|
Q as ApiUrl,
|
|
9050
9027
|
P as AssetValue,
|
|
9051
9028
|
E as BaseDecimal,
|
|
9052
9029
|
tt as BigIntArithmetics,
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9030
|
+
r as Chain,
|
|
9031
|
+
Se as ChainId,
|
|
9032
|
+
zn as ChainIdToChain,
|
|
9056
9033
|
Ue as ChainToChainId,
|
|
9057
9034
|
We as ChainToExplorerUrl,
|
|
9058
|
-
|
|
9059
|
-
|
|
9035
|
+
Zn as ChainToHexChainId,
|
|
9036
|
+
It as ChainToRPC,
|
|
9060
9037
|
At as ContractAddress,
|
|
9061
|
-
|
|
9038
|
+
Qn as CosmosChainList,
|
|
9039
|
+
St as CosmosChains,
|
|
9062
9040
|
ht as DerivationPath,
|
|
9063
9041
|
o as ERROR_CODE,
|
|
9064
9042
|
_t as ERROR_MODULE,
|
|
9065
9043
|
Ve as ERROR_TYPE,
|
|
9066
|
-
|
|
9044
|
+
Rt as EVMChainList,
|
|
9045
|
+
Et as EVMChains,
|
|
9067
9046
|
X as FeeOption,
|
|
9068
|
-
|
|
9047
|
+
Ct as LedgerErrorCode,
|
|
9069
9048
|
f as MemoType,
|
|
9070
|
-
|
|
9049
|
+
jn as NetworkDerivationPath,
|
|
9071
9050
|
mt as QuoteMode,
|
|
9072
9051
|
Fe as RPCUrl,
|
|
9073
9052
|
g as RequestClient,
|
|
9074
9053
|
ct as SWAP_IN,
|
|
9075
9054
|
bt as SWAP_OUT,
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9055
|
+
Jt as StreamingSwapProgressStatus,
|
|
9056
|
+
Kn as SubstrateChainList,
|
|
9057
|
+
ta as SwapKitApi,
|
|
9058
|
+
la as SwapKitCore,
|
|
9080
9059
|
c as SwapKitError,
|
|
9081
9060
|
x as SwapKitNumber,
|
|
9082
9061
|
dt as TCAvalancheDepositABI,
|
|
9083
9062
|
lt as TCBscDepositABI,
|
|
9084
9063
|
ot as TCEthereumVaultAbi,
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9064
|
+
Jn as TCSupportedChainList,
|
|
9065
|
+
wt as TCSupportedChains,
|
|
9066
|
+
Yt as TransactionType,
|
|
9067
|
+
Qt as TxStatus,
|
|
9068
|
+
Yn as UTXOChainList,
|
|
9069
|
+
Ot as UTXOChains,
|
|
9070
|
+
gt as WalletOption,
|
|
9071
|
+
na as assetFromString,
|
|
9091
9072
|
Qe as defaultRequestHeaders,
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9073
|
+
da as derivationPathToString,
|
|
9074
|
+
Gn as erc20ABI,
|
|
9075
|
+
aa as filterAssets,
|
|
9095
9076
|
me as formatBigIntToSafeValue,
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9077
|
+
an as gasFeeMultiplier,
|
|
9078
|
+
rn as getAssetType,
|
|
9079
|
+
on as getAsymmetricAssetShare,
|
|
9080
|
+
sa as getAsymmetricAssetWithdrawAmount,
|
|
9081
|
+
yn as getAsymmetricRuneShare,
|
|
9082
|
+
ia as getAsymmetricRuneWithdrawAmount,
|
|
9083
|
+
sn as getCommonAssetInfo,
|
|
9084
|
+
nn as getDecimal,
|
|
9085
|
+
pa as getEstimatedPoolShare,
|
|
9086
|
+
ua as getLiquiditySlippage,
|
|
9106
9087
|
D as getMemoFor,
|
|
9107
9088
|
fe as getMinAmountByChain,
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9089
|
+
dn as getSymmetricPoolShare,
|
|
9090
|
+
ra as getSymmetricWithdraw,
|
|
9091
|
+
ya as getTHORNameCost,
|
|
9111
9092
|
Ze as isGasAsset,
|
|
9112
|
-
|
|
9113
|
-
|
|
9093
|
+
ea as setRequestClientConfig,
|
|
9094
|
+
oa as validateTHORName
|
|
9114
9095
|
};
|
|
9115
9096
|
//# sourceMappingURL=index.es.js.map
|