@swapkit/core 1.0.0-rc.80 → 1.0.0-rc.81
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.es.js +525 -539
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +23 -22
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (e, t, n) => (
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var Ke = (e, t, n) => t in e ? je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var c = (e, t, n) => (Ke(e, typeof t != "symbol" ? t + "" : t, n), n), Ye = (e, t, n) => {
|
|
4
4
|
if (!t.has(e))
|
|
5
5
|
throw TypeError("Cannot " + n);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var h = (e, t, n) => (Ye(e, t, "read from private field"), n ? n.call(e) : t.get(e)), B = (e, t, n) => {
|
|
8
8
|
if (t.has(e))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var Qe = Object.defineProperty, Je = (e, t, n) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, S = (e, t, n) => (Je(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
13
13
|
const In = [
|
|
14
14
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
15
15
|
{
|
|
@@ -108,7 +108,7 @@ const In = [
|
|
|
108
108
|
stateMutability: "nonpayable",
|
|
109
109
|
type: "function"
|
|
110
110
|
}
|
|
111
|
-
],
|
|
111
|
+
], Ze = [
|
|
112
112
|
{
|
|
113
113
|
inputs: [{ internalType: "address", name: "rune", type: "address" }],
|
|
114
114
|
stateMutability: "nonpayable",
|
|
@@ -283,7 +283,7 @@ const In = [
|
|
|
283
283
|
stateMutability: "view",
|
|
284
284
|
type: "function"
|
|
285
285
|
}
|
|
286
|
-
],
|
|
286
|
+
], ze = [
|
|
287
287
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
288
288
|
{
|
|
289
289
|
anonymous: !1,
|
|
@@ -447,7 +447,7 @@ const In = [
|
|
|
447
447
|
stateMutability: "view",
|
|
448
448
|
type: "function"
|
|
449
449
|
}
|
|
450
|
-
],
|
|
450
|
+
], et = [
|
|
451
451
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
452
452
|
{
|
|
453
453
|
anonymous: !1,
|
|
@@ -600,13 +600,13 @@ const In = [
|
|
|
600
600
|
type: "function"
|
|
601
601
|
}
|
|
602
602
|
];
|
|
603
|
-
var
|
|
604
|
-
const
|
|
603
|
+
var tt = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e))(tt || {});
|
|
604
|
+
const nt = [
|
|
605
605
|
"ERC20-ERC20",
|
|
606
606
|
"ARC20-ARC20",
|
|
607
607
|
"BEP20-BEP20"
|
|
608
608
|
/* BSC_TO_BSC */
|
|
609
|
-
],
|
|
609
|
+
], at = [
|
|
610
610
|
"ERC20-TC",
|
|
611
611
|
"ERC20-ARC20",
|
|
612
612
|
"ERC20-BEP20",
|
|
@@ -617,80 +617,80 @@ const at = [
|
|
|
617
617
|
"BEP20-ERC20",
|
|
618
618
|
"BEP20-ARC20"
|
|
619
619
|
/* BSC_TO_AVAX */
|
|
620
|
-
],
|
|
620
|
+
], it = [
|
|
621
621
|
"TC-TC",
|
|
622
622
|
"TC-ERC20",
|
|
623
623
|
"TC-ARC20",
|
|
624
624
|
"TC-BEP20"
|
|
625
625
|
/* TC_SUPPORTED_TO_BSC */
|
|
626
626
|
];
|
|
627
|
-
var
|
|
628
|
-
const
|
|
629
|
-
[
|
|
630
|
-
[
|
|
631
|
-
[
|
|
632
|
-
[
|
|
633
|
-
[
|
|
634
|
-
[
|
|
635
|
-
[
|
|
636
|
-
[
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
[
|
|
640
|
-
[
|
|
641
|
-
[
|
|
642
|
-
[
|
|
643
|
-
[
|
|
644
|
-
[
|
|
645
|
-
[
|
|
646
|
-
[
|
|
647
|
-
[
|
|
648
|
-
[
|
|
649
|
-
[
|
|
650
|
-
[
|
|
651
|
-
[
|
|
652
|
-
[
|
|
653
|
-
[
|
|
654
|
-
[
|
|
655
|
-
[
|
|
656
|
-
[
|
|
657
|
-
[
|
|
658
|
-
[
|
|
659
|
-
[
|
|
660
|
-
[
|
|
661
|
-
[
|
|
662
|
-
[
|
|
663
|
-
[
|
|
664
|
-
[
|
|
665
|
-
[
|
|
666
|
-
[
|
|
667
|
-
[
|
|
668
|
-
[
|
|
669
|
-
[
|
|
670
|
-
[
|
|
671
|
-
[
|
|
672
|
-
[
|
|
673
|
-
[
|
|
674
|
-
[
|
|
675
|
-
[
|
|
676
|
-
[
|
|
677
|
-
[
|
|
678
|
-
[
|
|
627
|
+
var Ce = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(Ce || {}), st = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(st || {}), l = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_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.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(l || {});
|
|
628
|
+
const rt = {
|
|
629
|
+
[l.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
|
|
630
|
+
[l.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
|
|
631
|
+
[l.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
|
|
632
|
+
[l.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
|
|
633
|
+
[l.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
|
|
634
|
+
[l.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
|
|
635
|
+
[l.INVALID_TYPE_GENERIC]: "Invalid type",
|
|
636
|
+
[l.INVALID_NUMBER_STRING]: "Invalid number string.",
|
|
637
|
+
[l.INVALID_NUMBER]: "Invalid number.",
|
|
638
|
+
[l.INVALID_BOOLEAN]: "Invalid boolean.",
|
|
639
|
+
[l.INVALID_OBJECT]: "Invalid object.",
|
|
640
|
+
[l.INVALID_ARRAY]: "Invalid array.",
|
|
641
|
+
[l.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
|
|
642
|
+
[l.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
|
|
643
|
+
[l.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
|
|
644
|
+
[l.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
|
|
645
|
+
[l.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
|
|
646
|
+
[l.AFF_BPS_INTEGER_MAX_500]: "affiliateBasisPoints must be an integer between 0 and 100.",
|
|
647
|
+
[l.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
|
|
648
|
+
[l.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
|
|
649
|
+
[l.PREFERRED_PROVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
|
|
650
|
+
[l.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
|
|
651
|
+
[l.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
|
|
652
|
+
[l.INVALID_PROVIDER]: "Invalid provider {0}.",
|
|
653
|
+
[l.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
|
|
654
|
+
[l.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
|
|
655
|
+
[l.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
|
|
656
|
+
[l.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
|
|
657
|
+
[l.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
|
|
658
|
+
[l.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
|
|
659
|
+
[l.INVALID_CHAIN]: "Invalid chain {0}.",
|
|
660
|
+
[l.INVALID_ASSET]: "Invalid asset {0}.",
|
|
661
|
+
[l.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
|
|
662
|
+
[l.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
|
|
663
|
+
[l.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
|
|
664
|
+
[l.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
|
|
665
|
+
[l.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
|
|
666
|
+
[l.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
|
|
667
|
+
[l.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
|
|
668
|
+
[l.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
|
|
669
|
+
[l.INVALID_QUOTE_MODE]: "Invalid quote mode.",
|
|
670
|
+
[l.NO_QUOTES]: "No quotes to service this request.",
|
|
671
|
+
[l.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
|
|
672
|
+
[l.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
|
|
673
|
+
[l.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
|
|
674
|
+
[l.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
|
|
675
|
+
[l.NO_PRICE]: "No price for asset {0}.",
|
|
676
|
+
[l.PRICE_IS_STALE]: "Price is stale for asset {0}.",
|
|
677
|
+
[l.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
|
|
678
|
+
[l.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
|
|
679
679
|
}, ue = (e, t) => {
|
|
680
|
-
let n =
|
|
680
|
+
let n = rt[e];
|
|
681
681
|
for (let a = 0; a < t.length; a++)
|
|
682
682
|
n = n.replace(`{${a}}`, t[a]);
|
|
683
683
|
return t.length === 0 ? n.replace("{0}", "") : n;
|
|
684
684
|
};
|
|
685
|
-
let Sn = class
|
|
685
|
+
let Sn = class xe extends Error {
|
|
686
686
|
constructor({
|
|
687
687
|
status: t,
|
|
688
688
|
revision: n,
|
|
689
689
|
module: a,
|
|
690
690
|
code: i,
|
|
691
691
|
message: r,
|
|
692
|
-
type:
|
|
693
|
-
options: { shouldLog:
|
|
692
|
+
type: p,
|
|
693
|
+
options: { shouldLog: u, shouldThrow: y, shouldTrace: d } = {
|
|
694
694
|
shouldLog: !0,
|
|
695
695
|
shouldThrow: !0,
|
|
696
696
|
shouldTrace: !0
|
|
@@ -698,14 +698,14 @@ let Sn = class ke extends Error {
|
|
|
698
698
|
displayMessageParams: o
|
|
699
699
|
}) {
|
|
700
700
|
const T = r || ue(i, o || []) || "";
|
|
701
|
-
super(T), S(this, "status"), S(this, "revision"), S(this, "type"), S(this, "module"), S(this, "code"), S(this, "message"), S(this, "display"), S(this, "stack"), S(this, "options"), S(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = T, this.display = ue(i, o || []), this.code = i, this.type =
|
|
702
|
-
shouldLog:
|
|
703
|
-
shouldTrace:
|
|
701
|
+
super(T), S(this, "status"), S(this, "revision"), S(this, "type"), S(this, "module"), S(this, "code"), S(this, "message"), S(this, "display"), S(this, "stack"), S(this, "options"), S(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = T, this.display = ue(i, o || []), this.code = i, this.type = p || Ce.UNHANDLED_ERROR, this.options = {
|
|
702
|
+
shouldLog: u || !0,
|
|
703
|
+
shouldTrace: d || !0,
|
|
704
704
|
shouldThrow: y || !1
|
|
705
705
|
}, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
|
|
706
706
|
}
|
|
707
707
|
static fromErrorInfo(t) {
|
|
708
|
-
return new
|
|
708
|
+
return new xe(t);
|
|
709
709
|
}
|
|
710
710
|
toErrorInfo() {
|
|
711
711
|
return { ...this, identifier: this.identifier };
|
|
@@ -724,7 +724,7 @@ let Sn = class ke extends Error {
|
|
|
724
724
|
return this.toErrorInfo();
|
|
725
725
|
}
|
|
726
726
|
};
|
|
727
|
-
var s = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(s || {}),
|
|
727
|
+
var s = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(s || {}), pt = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(pt || {}), ut = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0", e.AVAX = "m/44'/60'/0'/0", e.BCH = "m/44'/145'/0'/0", e.BNB = "m/44'/714'/0'/0", e.BSC = "m/44'/60'/0'/0", e.BTC = "m/84'/0'/0'/0", e.DOGE = "m/44'/3'/0'/0", e.ETH = "m/44'/60'/0'/0", e.GAIA = "m/44'/118'/0'/0", e.KUJI = "m/44'/118'/0'/0", e.LTC = "m/84'/2'/0'/0", e.MATIC = "m/44'/60'/0'/0", e.MAYA = "m/44'/931'/0'/0", e.OP = "m/44'/60'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(ut || {});
|
|
728
728
|
const Cn = {
|
|
729
729
|
ARB: [44, 60, 0, 0, 0],
|
|
730
730
|
AVAX: [44, 60, 0, 0, 0],
|
|
@@ -743,7 +743,7 @@ const Cn = {
|
|
|
743
743
|
THOR: [44, 931, 0, 0, 0]
|
|
744
744
|
};
|
|
745
745
|
var A = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.THOR = 8] = "THOR", e))(A || {});
|
|
746
|
-
const
|
|
746
|
+
const yt = [
|
|
747
747
|
"ETH",
|
|
748
748
|
"AVAX",
|
|
749
749
|
"BSC",
|
|
@@ -775,20 +775,20 @@ const ot = [
|
|
|
775
775
|
"THOR"
|
|
776
776
|
/* THORChain */
|
|
777
777
|
];
|
|
778
|
-
var fe = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(fe || {}),
|
|
779
|
-
const
|
|
778
|
+
var fe = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(fe || {}), ke = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(ke || {}), X = /* @__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))(X || {});
|
|
779
|
+
const se = Object.values(s), ot = Object.keys(s), he = se.reduce(
|
|
780
780
|
(e, t) => {
|
|
781
|
-
const n =
|
|
781
|
+
const n = ot.find((a) => s[a] === t);
|
|
782
782
|
return n && (e[t] = n), e;
|
|
783
783
|
},
|
|
784
784
|
{}
|
|
785
|
-
),
|
|
785
|
+
), dt = se.reduce(
|
|
786
786
|
(e, t) => (e[t] = fe[he[t]], e),
|
|
787
787
|
{}
|
|
788
|
-
),
|
|
789
|
-
(e, t) => (e[t] =
|
|
788
|
+
), lt = se.reduce(
|
|
789
|
+
(e, t) => (e[t] = ke[he[t]], e),
|
|
790
790
|
{}
|
|
791
|
-
), Bn =
|
|
791
|
+
), Bn = se.reduce(
|
|
792
792
|
(e, t) => {
|
|
793
793
|
const n = `${he[t]}Hex`;
|
|
794
794
|
return e[t] = fe[n], e;
|
|
@@ -819,7 +819,7 @@ const re = Object.values(s), dt = Object.keys(s), he = re.reduce(
|
|
|
819
819
|
"thorchain-stagenet-v2": "THOR",
|
|
820
820
|
"thorchain-mainnet-v1": "THOR"
|
|
821
821
|
/* THORChain */
|
|
822
|
-
},
|
|
822
|
+
}, De = {
|
|
823
823
|
ARB: "https://arbiscan.io",
|
|
824
824
|
AVAX: "https://snowtrace.io",
|
|
825
825
|
BSC: "https://bscscan.com",
|
|
@@ -836,17 +836,17 @@ const re = Object.values(s), dt = Object.keys(s), he = re.reduce(
|
|
|
836
836
|
MATIC: "https://polygonscan.com",
|
|
837
837
|
THOR: "https://runescan.io"
|
|
838
838
|
};
|
|
839
|
-
var
|
|
839
|
+
var mt = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(mt || {}), b = /* @__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))(b || {}), q = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(q || {}), Tt = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.OKX_MOBILE = "OKX_MOBILE", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(Tt || {}), ct = Object.defineProperty, bt = (e, t, n) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, v = (e, t, n) => (bt(e, typeof t != "symbol" ? t + "" : t, n), n), ft = (e, t, n) => {
|
|
840
840
|
if (!t.has(e))
|
|
841
841
|
throw TypeError("Cannot " + n);
|
|
842
|
-
},
|
|
842
|
+
}, F = (e, t, n) => {
|
|
843
843
|
if (t.has(e))
|
|
844
844
|
throw TypeError("Cannot add the same private member more than once");
|
|
845
845
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
846
|
-
},
|
|
847
|
-
const
|
|
846
|
+
}, E = (e, t, n) => (ft(e, t, "access private method"), n);
|
|
847
|
+
const ht = "0x313ce567", Be = async ({ chain: e, to: t }) => {
|
|
848
848
|
try {
|
|
849
|
-
const { result: n } = await
|
|
849
|
+
const { result: n } = await _e.post(lt[e], {
|
|
850
850
|
headers: {
|
|
851
851
|
accept: "*/*",
|
|
852
852
|
"content-type": "application/json",
|
|
@@ -856,7 +856,7 @@ const _t = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
|
|
|
856
856
|
id: 44,
|
|
857
857
|
jsonrpc: "2.0",
|
|
858
858
|
method: "eth_call",
|
|
859
|
-
params: [{ to: t.toLowerCase(), data:
|
|
859
|
+
params: [{ to: t.toLowerCase(), data: ht }, "latest"]
|
|
860
860
|
})
|
|
861
861
|
});
|
|
862
862
|
return parseInt(BigInt(n).toString());
|
|
@@ -867,26 +867,26 @@ const _t = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
|
|
|
867
867
|
if (e === s.Ethereum)
|
|
868
868
|
return A.ETH;
|
|
869
869
|
const [, t] = e.split("-");
|
|
870
|
-
return t != null && t.startsWith("0x") ?
|
|
871
|
-
},
|
|
870
|
+
return t != null && t.startsWith("0x") ? Be({ chain: s.Ethereum, to: t }) : A.ETH;
|
|
871
|
+
}, _t = async (e) => {
|
|
872
872
|
const [, t] = e.split("-");
|
|
873
|
-
return t != null && t.startsWith("0x") ?
|
|
874
|
-
},
|
|
873
|
+
return t != null && t.startsWith("0x") ? Be({ chain: s.Avalanche, to: t.toLowerCase() }) : A.AVAX;
|
|
874
|
+
}, wt = async (e) => (e === s.BinanceSmartChain, A.BSC), Mt = async ({ chain: e, symbol: t }) => {
|
|
875
875
|
switch (e) {
|
|
876
876
|
case s.Ethereum:
|
|
877
877
|
return At(t);
|
|
878
878
|
case s.Avalanche:
|
|
879
|
-
return
|
|
879
|
+
return _t(t);
|
|
880
880
|
case s.BinanceSmartChain:
|
|
881
|
-
return
|
|
881
|
+
return wt(t);
|
|
882
882
|
default:
|
|
883
883
|
return A[e];
|
|
884
884
|
}
|
|
885
|
-
},
|
|
886
|
-
[
|
|
887
|
-
[
|
|
888
|
-
[
|
|
889
|
-
},
|
|
885
|
+
}, Et = {
|
|
886
|
+
[q.Average]: 1.2,
|
|
887
|
+
[q.Fast]: 1.5,
|
|
888
|
+
[q.Fastest]: 2
|
|
889
|
+
}, Ne = ({ chain: e, symbol: t }) => {
|
|
890
890
|
switch (e) {
|
|
891
891
|
case s.Bitcoin:
|
|
892
892
|
case s.BitcoinCash:
|
|
@@ -912,7 +912,7 @@ const _t = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
|
|
|
912
912
|
case s.THORChain:
|
|
913
913
|
return t === "RUNE";
|
|
914
914
|
}
|
|
915
|
-
},
|
|
915
|
+
}, gt = (e) => {
|
|
916
916
|
switch (e) {
|
|
917
917
|
case "ETH.THOR":
|
|
918
918
|
return { identifier: "ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044", decimal: 18 };
|
|
@@ -941,7 +941,7 @@ const _t = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
|
|
|
941
941
|
case s.Ethereum:
|
|
942
942
|
return { identifier: `${e}.${e}`, decimal: A[e] };
|
|
943
943
|
}
|
|
944
|
-
},
|
|
944
|
+
}, Rt = ({ chain: e, symbol: t }) => {
|
|
945
945
|
if (t.includes("/"))
|
|
946
946
|
return "Synth";
|
|
947
947
|
switch (e) {
|
|
@@ -973,35 +973,35 @@ const _t = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
|
|
|
973
973
|
}
|
|
974
974
|
}, Pn = (e) => {
|
|
975
975
|
var t;
|
|
976
|
-
const [n, ...a] = e.split("."), i = e.includes("/"), r = a.join("."),
|
|
977
|
-
return { chain: n, symbol: r, ticker:
|
|
978
|
-
},
|
|
976
|
+
const [n, ...a] = e.split("."), i = e.includes("/"), r = a.join("."), p = (t = r == null ? void 0 : r.split("-")) == null ? void 0 : t[0];
|
|
977
|
+
return { chain: n, symbol: r, ticker: p, synth: i };
|
|
978
|
+
}, Ot = new RegExp(
|
|
979
979
|
/(.)\1{6}|\.ORG|\.NET|\.FINANCE|\.COM|WWW|HTTP|\\\\|\/\/|[\s$%:[\]]/,
|
|
980
980
|
"gmi"
|
|
981
|
-
),
|
|
981
|
+
), vt = (e) => {
|
|
982
982
|
const [t, n] = e.split(".");
|
|
983
|
-
if (!
|
|
983
|
+
if (!yt.includes(t))
|
|
984
984
|
return !0;
|
|
985
985
|
const [, a] = n.split("-");
|
|
986
|
-
return
|
|
986
|
+
return Ne({ chain: t, symbol: n }) || !!a;
|
|
987
987
|
}, Ln = (e) => e.filter((t) => {
|
|
988
988
|
const n = `${t.chain}.${t.symbol}`;
|
|
989
|
-
return !
|
|
989
|
+
return !Ot.test(n) && vt(n) && t.value !== "0";
|
|
990
990
|
});
|
|
991
|
-
function
|
|
991
|
+
function It({
|
|
992
992
|
liquidityUnits: e,
|
|
993
993
|
poolUnits: t,
|
|
994
994
|
runeDepth: n
|
|
995
995
|
}) {
|
|
996
|
-
const a =
|
|
997
|
-
return
|
|
996
|
+
const a = g(e), i = g(t), r = g(n), p = a.mul(r), u = i.mul(i).mul(2), y = i.mul(a).mul(2), d = a.mul(a), o = i.mul(i).mul(i);
|
|
997
|
+
return p.mul(u.sub(y).add(d)).div(o);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function St({
|
|
1000
1000
|
liquidityUnits: e,
|
|
1001
1001
|
poolUnits: t,
|
|
1002
1002
|
assetDepth: n
|
|
1003
1003
|
}) {
|
|
1004
|
-
const a =
|
|
1004
|
+
const a = g(e), i = g(t), r = g(n), p = a.mul(r), u = i.mul(i).mul(2), y = i.mul(a).mul(2), d = a.mul(a), o = p.mul(u.sub(y).add(d)), T = i.mul(i).mul(i);
|
|
1005
1005
|
return o.div(T);
|
|
1006
1006
|
}
|
|
1007
1007
|
function Hn({
|
|
@@ -1010,7 +1010,7 @@ function Hn({
|
|
|
1010
1010
|
liquidityUnits: n,
|
|
1011
1011
|
poolUnits: a
|
|
1012
1012
|
}) {
|
|
1013
|
-
return
|
|
1013
|
+
return It({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
|
|
1014
1014
|
}
|
|
1015
1015
|
function Vn({
|
|
1016
1016
|
percent: e,
|
|
@@ -1018,20 +1018,20 @@ function Vn({
|
|
|
1018
1018
|
liquidityUnits: n,
|
|
1019
1019
|
poolUnits: a
|
|
1020
1020
|
}) {
|
|
1021
|
-
return
|
|
1021
|
+
return St({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1024
|
-
return
|
|
1023
|
+
function g(e) {
|
|
1024
|
+
return k.fromBigInt(BigInt(e), A.THOR);
|
|
1025
1025
|
}
|
|
1026
|
-
function
|
|
1026
|
+
function Ct({
|
|
1027
1027
|
liquidityUnits: e,
|
|
1028
1028
|
poolUnits: t,
|
|
1029
1029
|
runeDepth: n,
|
|
1030
1030
|
assetDepth: a
|
|
1031
1031
|
}) {
|
|
1032
1032
|
return {
|
|
1033
|
-
assetAmount:
|
|
1034
|
-
runeAmount:
|
|
1033
|
+
assetAmount: g(a).mul(e).div(t),
|
|
1034
|
+
runeAmount: g(n).mul(e).div(t)
|
|
1035
1035
|
};
|
|
1036
1036
|
}
|
|
1037
1037
|
function Fn({
|
|
@@ -1042,8 +1042,8 @@ function Fn({
|
|
|
1042
1042
|
percent: i
|
|
1043
1043
|
}) {
|
|
1044
1044
|
return Object.fromEntries(
|
|
1045
|
-
Object.entries(
|
|
1046
|
-
([r,
|
|
1045
|
+
Object.entries(Ct({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
|
|
1046
|
+
([r, p]) => [r, p.mul(i)]
|
|
1047
1047
|
)
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
@@ -1055,11 +1055,11 @@ function Un({
|
|
|
1055
1055
|
runeAmount: i,
|
|
1056
1056
|
assetAmount: r
|
|
1057
1057
|
}) {
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1060
|
-
return
|
|
1061
|
-
const
|
|
1062
|
-
return
|
|
1058
|
+
const p = new k({ value: e, decimal: 8 }), u = new k({ value: n, decimal: 8 }), y = new k({ value: t, decimal: 8 }), d = new k({ value: i, decimal: 8 }), o = new k({ value: r, decimal: 8 }), T = d.mul(u), f = o.mul(p), _ = d.mul(o), w = p.mul(u), M = y.mul(T.add(f.add(_.mul(2)))), R = T.add(f.add(w.mul(2))), O = M.div(R), D = g(a).add(O);
|
|
1059
|
+
if (O.getBaseValue("number") === 0)
|
|
1060
|
+
return D.div(y).getBaseValue("number");
|
|
1061
|
+
const pe = y.add(D);
|
|
1062
|
+
return D.div(pe).getBaseValue("number");
|
|
1063
1063
|
}
|
|
1064
1064
|
function qn({
|
|
1065
1065
|
runeAmount: e,
|
|
@@ -1069,28 +1069,28 @@ function qn({
|
|
|
1069
1069
|
}) {
|
|
1070
1070
|
if (e === "0" || t === "0" || n === "0" || a === "0")
|
|
1071
1071
|
return 0;
|
|
1072
|
-
const i =
|
|
1073
|
-
return Math.abs(y.div(
|
|
1072
|
+
const i = g(n), r = g(a), p = g(t), u = g(e), y = p.mul(i).sub(r.mul(u)), d = r.mul(u).add(i.mul(r));
|
|
1073
|
+
return Math.abs(y.div(d).getBaseValue("number"));
|
|
1074
1074
|
}
|
|
1075
1075
|
const C = (e, t) => {
|
|
1076
1076
|
switch (e) {
|
|
1077
|
-
case
|
|
1078
|
-
case
|
|
1077
|
+
case b.LEAVE:
|
|
1078
|
+
case b.BOND: {
|
|
1079
1079
|
const { address: n } = t;
|
|
1080
1080
|
return `${e}:${n}`;
|
|
1081
1081
|
}
|
|
1082
|
-
case
|
|
1082
|
+
case b.UNBOND: {
|
|
1083
1083
|
const { address: n, unbondAmount: a } = t;
|
|
1084
1084
|
return `${e}:${n}:${a}`;
|
|
1085
1085
|
}
|
|
1086
|
-
case
|
|
1086
|
+
case b.THORNAME_REGISTER: {
|
|
1087
1087
|
const { name: n, chain: a, address: i, owner: r } = t;
|
|
1088
1088
|
return `${e}:${n}:${a}:${i}${r ? `:${r}` : ""}`;
|
|
1089
1089
|
}
|
|
1090
|
-
case
|
|
1090
|
+
case b.DEPOSIT: {
|
|
1091
1091
|
const { chain: n, symbol: a, address: i, singleSide: r } = t;
|
|
1092
|
-
return r ? `${e}:${n}/${a}::t:0` : `${e}:${((
|
|
1093
|
-
switch (
|
|
1092
|
+
return r ? `${e}:${n}/${a}::t:0` : `${e}:${((p, u) => {
|
|
1093
|
+
switch (p) {
|
|
1094
1094
|
case s.Litecoin:
|
|
1095
1095
|
return "l";
|
|
1096
1096
|
case s.Dogecoin:
|
|
@@ -1098,16 +1098,16 @@ const C = (e, t) => {
|
|
|
1098
1098
|
case s.BitcoinCash:
|
|
1099
1099
|
return "c";
|
|
1100
1100
|
default:
|
|
1101
|
-
return `${
|
|
1101
|
+
return `${p}.${u}`;
|
|
1102
1102
|
}
|
|
1103
1103
|
})(n, a)}:${i || ""}:t:0`;
|
|
1104
1104
|
}
|
|
1105
|
-
case
|
|
1106
|
-
const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString:
|
|
1107
|
-
return `${e}:${n}${
|
|
1105
|
+
case b.WITHDRAW: {
|
|
1106
|
+
const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: u } = t, y = n === "ETH" && a !== "ETH" ? `${a}-${i.slice(-3)}` : i, d = !u && p ? `:${p}` : "";
|
|
1107
|
+
return `${e}:${n}${u ? "/" : "."}${y}:${r}${d}`;
|
|
1108
1108
|
}
|
|
1109
|
-
case
|
|
1110
|
-
case
|
|
1109
|
+
case b.OPEN_LOAN:
|
|
1110
|
+
case b.CLOSE_LOAN: {
|
|
1111
1111
|
const { asset: n, address: a } = t;
|
|
1112
1112
|
return `${e}:${n}:${a}`;
|
|
1113
1113
|
}
|
|
@@ -1131,8 +1131,8 @@ function Gn([e, t, n, a, i]) {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
class we extends Error {
|
|
1133
1133
|
constructor(t, n, a) {
|
|
1134
|
-
const i = t.status || t.status === 0 ? t.status : "", r = t.statusText || "",
|
|
1135
|
-
super(`Request failed with ${
|
|
1134
|
+
const i = t.status || t.status === 0 ? t.status : "", r = t.statusText || "", p = `${i} ${r}`.trim(), u = p ? `status code ${p}` : "an unknown error";
|
|
1135
|
+
super(`Request failed with ${u}`), Object.defineProperty(this, "response", {
|
|
1136
1136
|
enumerable: !0,
|
|
1137
1137
|
configurable: !0,
|
|
1138
1138
|
writable: !0,
|
|
@@ -1150,7 +1150,7 @@ class we extends Error {
|
|
|
1150
1150
|
}), this.name = "HTTPError", this.response = t, this.request = n, this.options = a;
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
|
-
class
|
|
1153
|
+
class Pe extends Error {
|
|
1154
1154
|
constructor(t) {
|
|
1155
1155
|
super("Request timed out"), Object.defineProperty(this, "request", {
|
|
1156
1156
|
enumerable: !0,
|
|
@@ -1160,28 +1160,28 @@ class Le extends Error {
|
|
|
1160
1160
|
}), this.name = "TimeoutError", this.request = t;
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1163
|
+
const Z = (e) => e !== null && typeof e == "object", J = (...e) => {
|
|
1164
1164
|
for (const t of e)
|
|
1165
|
-
if ((!
|
|
1165
|
+
if ((!Z(t) || Array.isArray(t)) && t !== void 0)
|
|
1166
1166
|
throw new TypeError("The `options` argument must be an object");
|
|
1167
|
-
return
|
|
1168
|
-
},
|
|
1167
|
+
return Ae({}, ...e);
|
|
1168
|
+
}, Le = (e = {}, t = {}) => {
|
|
1169
1169
|
const n = new globalThis.Headers(e), a = t instanceof globalThis.Headers, i = new globalThis.Headers(t);
|
|
1170
|
-
for (const [r,
|
|
1171
|
-
a &&
|
|
1170
|
+
for (const [r, p] of i.entries())
|
|
1171
|
+
a && p === "undefined" || p === void 0 ? n.delete(r) : n.set(r, p);
|
|
1172
1172
|
return n;
|
|
1173
|
-
},
|
|
1173
|
+
}, Ae = (...e) => {
|
|
1174
1174
|
let t = {}, n = {};
|
|
1175
1175
|
for (const a of e)
|
|
1176
1176
|
if (Array.isArray(a))
|
|
1177
1177
|
Array.isArray(t) || (t = []), t = [...t, ...a];
|
|
1178
|
-
else if (
|
|
1178
|
+
else if (Z(a)) {
|
|
1179
1179
|
for (let [i, r] of Object.entries(a))
|
|
1180
|
-
|
|
1181
|
-
|
|
1180
|
+
Z(r) && i in t && (r = Ae(t[i], r)), t = { ...t, [i]: r };
|
|
1181
|
+
Z(a.headers) && (n = Le(n, a.headers), t.headers = n);
|
|
1182
1182
|
}
|
|
1183
1183
|
return t;
|
|
1184
|
-
},
|
|
1184
|
+
}, xt = (() => {
|
|
1185
1185
|
let e = !1, t = !1;
|
|
1186
1186
|
const n = typeof globalThis.ReadableStream == "function", a = typeof globalThis.Request == "function";
|
|
1187
1187
|
return n && a && (t = new globalThis.Request("https://empty.invalid", {
|
|
@@ -1192,13 +1192,13 @@ const z = (e) => e !== null && typeof e == "object", Z = (...e) => {
|
|
|
1192
1192
|
return e = !0, "half";
|
|
1193
1193
|
}
|
|
1194
1194
|
}).headers.has("Content-Type")), e && !t;
|
|
1195
|
-
})(),
|
|
1195
|
+
})(), kt = typeof globalThis.AbortController == "function", Dt = typeof globalThis.ReadableStream == "function", Bt = typeof globalThis.FormData == "function", He = ["get", "post", "put", "patch", "head", "delete"], Nt = {
|
|
1196
1196
|
json: "application/json",
|
|
1197
1197
|
text: "text/*",
|
|
1198
1198
|
formData: "multipart/form-data",
|
|
1199
1199
|
arrayBuffer: "*/*",
|
|
1200
1200
|
blob: "*/*"
|
|
1201
|
-
}, ye = 2147483647,
|
|
1201
|
+
}, ye = 2147483647, Ve = Symbol("stop"), Pt = {
|
|
1202
1202
|
json: !0,
|
|
1203
1203
|
parseJson: !0,
|
|
1204
1204
|
searchParams: !0,
|
|
@@ -1209,7 +1209,7 @@ const z = (e) => e !== null && typeof e == "object", Z = (...e) => {
|
|
|
1209
1209
|
throwHttpErrors: !0,
|
|
1210
1210
|
onDownloadProgress: !0,
|
|
1211
1211
|
fetch: !0
|
|
1212
|
-
},
|
|
1212
|
+
}, Lt = {
|
|
1213
1213
|
method: !0,
|
|
1214
1214
|
headers: !0,
|
|
1215
1215
|
body: !0,
|
|
@@ -1225,15 +1225,15 @@ const z = (e) => e !== null && typeof e == "object", Z = (...e) => {
|
|
|
1225
1225
|
window: !0,
|
|
1226
1226
|
dispatcher: !0,
|
|
1227
1227
|
duplex: !0
|
|
1228
|
-
},
|
|
1228
|
+
}, Ht = (e) => He.includes(e) ? e.toUpperCase() : e, Vt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Fe = [413, 429, 503], Me = {
|
|
1229
1229
|
limit: 2,
|
|
1230
|
-
methods:
|
|
1231
|
-
statusCodes:
|
|
1232
|
-
afterStatusCodes:
|
|
1230
|
+
methods: Vt,
|
|
1231
|
+
statusCodes: Ft,
|
|
1232
|
+
afterStatusCodes: Fe,
|
|
1233
1233
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
1234
1234
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
1235
1235
|
delay: (e) => 0.3 * 2 ** (e - 1) * 1e3
|
|
1236
|
-
},
|
|
1236
|
+
}, Ut = (e = {}) => {
|
|
1237
1237
|
if (typeof e == "number")
|
|
1238
1238
|
return {
|
|
1239
1239
|
...Me,
|
|
@@ -1246,20 +1246,20 @@ const z = (e) => e !== null && typeof e == "object", Z = (...e) => {
|
|
|
1246
1246
|
return {
|
|
1247
1247
|
...Me,
|
|
1248
1248
|
...e,
|
|
1249
|
-
afterStatusCodes:
|
|
1249
|
+
afterStatusCodes: Fe
|
|
1250
1250
|
};
|
|
1251
1251
|
};
|
|
1252
|
-
async function
|
|
1252
|
+
async function qt(e, t, n, a) {
|
|
1253
1253
|
return new Promise((i, r) => {
|
|
1254
|
-
const
|
|
1255
|
-
n && n.abort(), r(new
|
|
1254
|
+
const p = setTimeout(() => {
|
|
1255
|
+
n && n.abort(), r(new Pe(e));
|
|
1256
1256
|
}, a.timeout);
|
|
1257
1257
|
a.fetch(e, t).then(i).catch(r).then(() => {
|
|
1258
|
-
clearTimeout(
|
|
1258
|
+
clearTimeout(p);
|
|
1259
1259
|
});
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
|
-
async function
|
|
1262
|
+
async function $t(e, { signal: t }) {
|
|
1263
1263
|
return new Promise((n, a) => {
|
|
1264
1264
|
t && (t.throwIfAborted(), t.addEventListener("abort", i, { once: !0 }));
|
|
1265
1265
|
function i() {
|
|
@@ -1270,49 +1270,49 @@ async function Wt(e, { signal: t }) {
|
|
|
1270
1270
|
}, e);
|
|
1271
1271
|
});
|
|
1272
1272
|
}
|
|
1273
|
-
const
|
|
1273
|
+
const Wt = (e, t) => {
|
|
1274
1274
|
const n = {};
|
|
1275
1275
|
for (const a in t)
|
|
1276
|
-
!(a in
|
|
1276
|
+
!(a in Lt) && !(a in Pt) && !(a in e) && (n[a] = t[a]);
|
|
1277
1277
|
return n;
|
|
1278
1278
|
};
|
|
1279
|
-
class
|
|
1279
|
+
class te {
|
|
1280
1280
|
static create(t, n) {
|
|
1281
|
-
const a = new
|
|
1281
|
+
const a = new te(t, n), i = async () => {
|
|
1282
1282
|
if (typeof a._options.timeout == "number" && a._options.timeout > ye)
|
|
1283
1283
|
throw new RangeError(`The \`timeout\` option cannot be greater than ${ye}`);
|
|
1284
1284
|
await Promise.resolve();
|
|
1285
|
-
let
|
|
1286
|
-
for (const
|
|
1287
|
-
const y = await
|
|
1288
|
-
y instanceof globalThis.Response && (
|
|
1285
|
+
let p = await a._fetch();
|
|
1286
|
+
for (const u of a._options.hooks.afterResponse) {
|
|
1287
|
+
const y = await u(a.request, a._options, a._decorateResponse(p.clone()));
|
|
1288
|
+
y instanceof globalThis.Response && (p = y);
|
|
1289
1289
|
}
|
|
1290
|
-
if (a._decorateResponse(
|
|
1291
|
-
let
|
|
1290
|
+
if (a._decorateResponse(p), !p.ok && a._options.throwHttpErrors) {
|
|
1291
|
+
let u = new we(p, a.request, a._options);
|
|
1292
1292
|
for (const y of a._options.hooks.beforeError)
|
|
1293
|
-
|
|
1294
|
-
throw
|
|
1293
|
+
u = await y(u);
|
|
1294
|
+
throw u;
|
|
1295
1295
|
}
|
|
1296
1296
|
if (a._options.onDownloadProgress) {
|
|
1297
1297
|
if (typeof a._options.onDownloadProgress != "function")
|
|
1298
1298
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
1299
|
-
if (!
|
|
1299
|
+
if (!Dt)
|
|
1300
1300
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
1301
|
-
return a._stream(
|
|
1301
|
+
return a._stream(p.clone(), a._options.onDownloadProgress);
|
|
1302
1302
|
}
|
|
1303
|
-
return
|
|
1303
|
+
return p;
|
|
1304
1304
|
}, r = a._options.retry.methods.includes(a.request.method.toLowerCase()) ? a._retry(i) : i();
|
|
1305
|
-
for (const [
|
|
1306
|
-
r[
|
|
1307
|
-
a.request.headers.set("accept", a.request.headers.get("accept") ||
|
|
1305
|
+
for (const [p, u] of Object.entries(Nt))
|
|
1306
|
+
r[p] = async () => {
|
|
1307
|
+
a.request.headers.set("accept", a.request.headers.get("accept") || u);
|
|
1308
1308
|
const y = (await r).clone();
|
|
1309
|
-
if (
|
|
1309
|
+
if (p === "json") {
|
|
1310
1310
|
if (y.status === 204 || (await y.clone().arrayBuffer()).byteLength === 0)
|
|
1311
1311
|
return "";
|
|
1312
1312
|
if (n.parseJson)
|
|
1313
1313
|
return n.parseJson(await y.text());
|
|
1314
1314
|
}
|
|
1315
|
-
return y[
|
|
1315
|
+
return y[p]();
|
|
1316
1316
|
};
|
|
1317
1317
|
return r;
|
|
1318
1318
|
}
|
|
@@ -1347,17 +1347,17 @@ class ne {
|
|
|
1347
1347
|
// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208
|
|
1348
1348
|
credentials: this._input.credentials || "same-origin",
|
|
1349
1349
|
...n,
|
|
1350
|
-
headers:
|
|
1351
|
-
hooks:
|
|
1350
|
+
headers: Le(this._input.headers, n.headers),
|
|
1351
|
+
hooks: Ae({
|
|
1352
1352
|
beforeRequest: [],
|
|
1353
1353
|
beforeRetry: [],
|
|
1354
1354
|
beforeError: [],
|
|
1355
1355
|
afterResponse: []
|
|
1356
1356
|
}, n.hooks),
|
|
1357
|
-
method:
|
|
1357
|
+
method: Ht(n.method ?? this._input.method),
|
|
1358
1358
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
1359
1359
|
prefixUrl: String(n.prefixUrl || ""),
|
|
1360
|
-
retry:
|
|
1360
|
+
retry: Ut(n.retry),
|
|
1361
1361
|
throwHttpErrors: n.throwHttpErrors !== !1,
|
|
1362
1362
|
timeout: n.timeout ?? 1e4,
|
|
1363
1363
|
fetch: n.fetch ?? globalThis.fetch.bind(globalThis)
|
|
@@ -1368,7 +1368,7 @@ class ne {
|
|
|
1368
1368
|
throw new Error("`input` must not begin with a slash when using `prefixUrl`");
|
|
1369
1369
|
this._options.prefixUrl.endsWith("/") || (this._options.prefixUrl += "/"), this._input = this._options.prefixUrl + this._input;
|
|
1370
1370
|
}
|
|
1371
|
-
if (
|
|
1371
|
+
if (kt) {
|
|
1372
1372
|
if (this.abortController = new globalThis.AbortController(), this._options.signal) {
|
|
1373
1373
|
const a = this._options.signal;
|
|
1374
1374
|
this._options.signal.addEventListener("abort", () => {
|
|
@@ -1377,14 +1377,14 @@ class ne {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
this._options.signal = this.abortController.signal;
|
|
1379
1379
|
}
|
|
1380
|
-
if (
|
|
1380
|
+
if (xt && (this._options.duplex = "half"), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) {
|
|
1381
1381
|
const a = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), i = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, a);
|
|
1382
|
-
(
|
|
1382
|
+
(Bt && 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);
|
|
1383
1383
|
}
|
|
1384
1384
|
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 }));
|
|
1385
1385
|
}
|
|
1386
1386
|
_calculateRetryDelay(t) {
|
|
1387
|
-
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(t instanceof
|
|
1387
|
+
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(t instanceof Pe)) {
|
|
1388
1388
|
if (t instanceof we) {
|
|
1389
1389
|
if (!this._options.retry.statusCodes.includes(t.response.status))
|
|
1390
1390
|
return 0;
|
|
@@ -1410,14 +1410,14 @@ class ne {
|
|
|
1410
1410
|
} catch (n) {
|
|
1411
1411
|
const a = Math.min(this._calculateRetryDelay(n), ye);
|
|
1412
1412
|
if (a !== 0 && this._retryCount > 0) {
|
|
1413
|
-
await
|
|
1413
|
+
await $t(a, { signal: this._options.signal });
|
|
1414
1414
|
for (const i of this._options.hooks.beforeRetry)
|
|
1415
1415
|
if (await i({
|
|
1416
1416
|
request: this.request,
|
|
1417
1417
|
options: this._options,
|
|
1418
1418
|
error: n,
|
|
1419
1419
|
retryCount: this._retryCount
|
|
1420
|
-
}) ===
|
|
1420
|
+
}) === Ve)
|
|
1421
1421
|
return;
|
|
1422
1422
|
return this._retry(t);
|
|
1423
1423
|
}
|
|
@@ -1434,8 +1434,8 @@ class ne {
|
|
|
1434
1434
|
if (a instanceof Response)
|
|
1435
1435
|
return a;
|
|
1436
1436
|
}
|
|
1437
|
-
const t =
|
|
1438
|
-
return this._options.timeout === !1 ? this._options.fetch(this.request.clone(), t) :
|
|
1437
|
+
const t = Wt(this.request, this._options);
|
|
1438
|
+
return this._options.timeout === !1 ? this._options.fetch(this.request.clone(), t) : qt(this.request.clone(), t, this.abortController, this._options);
|
|
1439
1439
|
}
|
|
1440
1440
|
/* istanbul ignore next */
|
|
1441
1441
|
_stream(t, n) {
|
|
@@ -1447,22 +1447,22 @@ class ne {
|
|
|
1447
1447
|
headers: t.headers
|
|
1448
1448
|
})) : new globalThis.Response(new globalThis.ReadableStream({
|
|
1449
1449
|
async start(r) {
|
|
1450
|
-
const
|
|
1450
|
+
const p = t.body.getReader();
|
|
1451
1451
|
n && n({ percent: 0, transferredBytes: 0, totalBytes: a }, new Uint8Array());
|
|
1452
|
-
async function
|
|
1453
|
-
const { done: y, value:
|
|
1452
|
+
async function u() {
|
|
1453
|
+
const { done: y, value: d } = await p.read();
|
|
1454
1454
|
if (y) {
|
|
1455
1455
|
r.close();
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
1458
|
if (n) {
|
|
1459
|
-
i +=
|
|
1459
|
+
i += d.byteLength;
|
|
1460
1460
|
const o = a === 0 ? 0 : i / a;
|
|
1461
|
-
n({ percent: o, transferredBytes: i, totalBytes: a },
|
|
1461
|
+
n({ percent: o, transferredBytes: i, totalBytes: a }, d);
|
|
1462
1462
|
}
|
|
1463
|
-
r.enqueue(
|
|
1463
|
+
r.enqueue(d), await u();
|
|
1464
1464
|
}
|
|
1465
|
-
await
|
|
1465
|
+
await u();
|
|
1466
1466
|
}
|
|
1467
1467
|
}), {
|
|
1468
1468
|
status: t.status,
|
|
@@ -1473,15 +1473,15 @@ class ne {
|
|
|
1473
1473
|
}
|
|
1474
1474
|
/*! MIT License © Sindre Sorhus */
|
|
1475
1475
|
const me = (e) => {
|
|
1476
|
-
const t = (n, a) =>
|
|
1477
|
-
for (const n of
|
|
1478
|
-
t[n] = (a, i) =>
|
|
1479
|
-
return t.create = (n) => me(
|
|
1480
|
-
},
|
|
1476
|
+
const t = (n, a) => te.create(n, J(e, a));
|
|
1477
|
+
for (const n of He)
|
|
1478
|
+
t[n] = (a, i) => te.create(a, J(e, i, { method: n }));
|
|
1479
|
+
return t.create = (n) => me(J(n)), t.extend = (n) => me(J(e, n)), t.stop = Ve, t;
|
|
1480
|
+
}, Gt = me(), Xt = Gt, jt = typeof window < "u" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" }, Ee = Xt.create({ headers: jt }), _e = {
|
|
1481
1481
|
get: (e, t) => Ee.get(e, t).json(),
|
|
1482
1482
|
post: (e, t) => Ee.post(e, t).json()
|
|
1483
1483
|
}, ge = [...Object.values(s), "TERRA"];
|
|
1484
|
-
function
|
|
1484
|
+
function Kt(e = "") {
|
|
1485
1485
|
const t = e.toUpperCase(), [n] = t.split(".");
|
|
1486
1486
|
if (ge.includes(n))
|
|
1487
1487
|
return !0;
|
|
@@ -1492,11 +1492,11 @@ function Yt(e = "") {
|
|
|
1492
1492
|
`Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
|
|
1493
1493
|
);
|
|
1494
1494
|
}
|
|
1495
|
-
const
|
|
1496
|
-
function
|
|
1495
|
+
const j = 8, P = (e) => 10n ** BigInt(e), $ = (e) => Math.log10(parseFloat(e.toString()));
|
|
1496
|
+
function re({
|
|
1497
1497
|
value: e,
|
|
1498
|
-
bigIntDecimal: t =
|
|
1499
|
-
decimal: n =
|
|
1498
|
+
bigIntDecimal: t = j,
|
|
1499
|
+
decimal: n = j
|
|
1500
1500
|
}) {
|
|
1501
1501
|
if (n === 0)
|
|
1502
1502
|
return e.toString();
|
|
@@ -1504,24 +1504,24 @@ function pe({
|
|
|
1504
1504
|
let i = e.toString().substring(a ? 1 : 0);
|
|
1505
1505
|
const r = n - (i.length - 1);
|
|
1506
1506
|
r > 0 && (i = "0".repeat(r) + i);
|
|
1507
|
-
const
|
|
1508
|
-
let
|
|
1509
|
-
return parseInt(
|
|
1507
|
+
const p = i.length - n;
|
|
1508
|
+
let u = i.slice(-n);
|
|
1509
|
+
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(
|
|
1510
1510
|
/\.?0*$/,
|
|
1511
1511
|
""
|
|
1512
1512
|
);
|
|
1513
1513
|
}
|
|
1514
|
-
var H,
|
|
1515
|
-
const
|
|
1514
|
+
var H, U, N, V, Te, Ue, z, oe, ne, ce;
|
|
1515
|
+
const Yt = class qe {
|
|
1516
1516
|
constructor(t) {
|
|
1517
|
-
|
|
1517
|
+
F(this, H), F(this, N), F(this, Te), F(this, z), F(this, ne), v(this, "decimalMultiplier", 10n ** 8n), v(this, "bigIntValue", 0n), v(this, "decimal");
|
|
1518
1518
|
const n = be(t), a = typeof t == "object";
|
|
1519
|
-
this.decimal = a ? t.decimal : void 0, this.decimalMultiplier = a && "decimalMultiplier" in t ? t.decimalMultiplier : P(Math.max(
|
|
1519
|
+
this.decimal = a ? t.decimal : void 0, this.decimalMultiplier = a && "decimalMultiplier" in t ? t.decimalMultiplier : P(Math.max(We(ae(n)), this.decimal || 0)), E(this, Te, Ue).call(this, n);
|
|
1520
1520
|
}
|
|
1521
1521
|
static fromBigInt(t, n) {
|
|
1522
|
-
return new
|
|
1522
|
+
return new qe({
|
|
1523
1523
|
decimal: n,
|
|
1524
|
-
value:
|
|
1524
|
+
value: re({ value: t, bigIntDecimal: n, decimal: n })
|
|
1525
1525
|
});
|
|
1526
1526
|
}
|
|
1527
1527
|
static shiftDecimals({
|
|
@@ -1538,37 +1538,37 @@ const Qt = class $e {
|
|
|
1538
1538
|
return new this.constructor({ decimal: this.decimal, value: t, identifier: this.toString() });
|
|
1539
1539
|
}
|
|
1540
1540
|
add(...t) {
|
|
1541
|
-
return
|
|
1541
|
+
return E(this, H, U).call(this, "add", ...t);
|
|
1542
1542
|
}
|
|
1543
1543
|
sub(...t) {
|
|
1544
|
-
return
|
|
1544
|
+
return E(this, H, U).call(this, "sub", ...t);
|
|
1545
1545
|
}
|
|
1546
1546
|
mul(...t) {
|
|
1547
|
-
return
|
|
1547
|
+
return E(this, H, U).call(this, "mul", ...t);
|
|
1548
1548
|
}
|
|
1549
1549
|
div(...t) {
|
|
1550
|
-
return
|
|
1550
|
+
return E(this, H, U).call(this, "div", ...t);
|
|
1551
1551
|
}
|
|
1552
1552
|
gt(t) {
|
|
1553
|
-
return
|
|
1553
|
+
return E(this, N, V).call(this, "gt", t);
|
|
1554
1554
|
}
|
|
1555
1555
|
gte(t) {
|
|
1556
|
-
return
|
|
1556
|
+
return E(this, N, V).call(this, "gte", t);
|
|
1557
1557
|
}
|
|
1558
1558
|
lt(t) {
|
|
1559
|
-
return
|
|
1559
|
+
return E(this, N, V).call(this, "lt", t);
|
|
1560
1560
|
}
|
|
1561
1561
|
lte(t) {
|
|
1562
|
-
return
|
|
1562
|
+
return E(this, N, V).call(this, "lte", t);
|
|
1563
1563
|
}
|
|
1564
1564
|
eqValue(t) {
|
|
1565
|
-
return
|
|
1565
|
+
return E(this, N, V).call(this, "eqValue", t);
|
|
1566
1566
|
}
|
|
1567
1567
|
// @ts-expect-error False positive
|
|
1568
1568
|
getValue(t) {
|
|
1569
1569
|
const n = this.formatBigIntToSafeValue(
|
|
1570
1570
|
this.bigIntValue,
|
|
1571
|
-
this.decimal ||
|
|
1571
|
+
this.decimal || $(this.decimalMultiplier)
|
|
1572
1572
|
);
|
|
1573
1573
|
switch (t) {
|
|
1574
1574
|
case "number":
|
|
@@ -1594,8 +1594,8 @@ const Qt = class $e {
|
|
|
1594
1594
|
getBigIntValue(t, n) {
|
|
1595
1595
|
if (!n && typeof t == "object")
|
|
1596
1596
|
return t.bigIntValue;
|
|
1597
|
-
const a = be(t), i =
|
|
1598
|
-
return i === "0" || i === "undefined" ? 0n :
|
|
1597
|
+
const a = be(t), i = ae(a);
|
|
1598
|
+
return i === "0" || i === "undefined" ? 0n : E(this, ne, ce).call(this, i, n);
|
|
1599
1599
|
}
|
|
1600
1600
|
toSignificant(t = 6) {
|
|
1601
1601
|
const [n, a] = this.getValue("string").split("."), i = n || "", r = a || "";
|
|
@@ -1608,9 +1608,9 @@ const Qt = class $e {
|
|
|
1608
1608
|
t - i.length,
|
|
1609
1609
|
"0"
|
|
1610
1610
|
);
|
|
1611
|
-
const
|
|
1612
|
-
return `0.${
|
|
1613
|
-
r.length - `${
|
|
1611
|
+
const p = parseInt(r), u = `${p}`.slice(0, t);
|
|
1612
|
+
return `0.${u.padStart(
|
|
1613
|
+
r.length - `${p}`.length + u.length,
|
|
1614
1614
|
"0"
|
|
1615
1615
|
)}`;
|
|
1616
1616
|
}
|
|
@@ -1618,9 +1618,9 @@ const Qt = class $e {
|
|
|
1618
1618
|
const [n, a] = this.getValue("string").split("."), i = n || "", r = a || "";
|
|
1619
1619
|
if (parseInt(i))
|
|
1620
1620
|
return `${i}.${r.slice(0, t)}`.padEnd(t, "0");
|
|
1621
|
-
const
|
|
1622
|
-
return `0.${
|
|
1623
|
-
r.length - `${
|
|
1621
|
+
const p = parseInt(r), u = `${p}`.slice(0, t);
|
|
1622
|
+
return `0.${u.padStart(
|
|
1623
|
+
r.length - `${p}`.length + u.length,
|
|
1624
1624
|
"0"
|
|
1625
1625
|
)}`;
|
|
1626
1626
|
}
|
|
@@ -1628,8 +1628,8 @@ const Qt = class $e {
|
|
|
1628
1628
|
const n = this.getValue("number"), a = ["", "K", "M", "B", "T", "Q", "Qi", "S"], i = Math.floor(Math.log10(Math.abs(n)) / 3), r = a[i];
|
|
1629
1629
|
if (!r)
|
|
1630
1630
|
return this.getValue("string");
|
|
1631
|
-
const
|
|
1632
|
-
return `${(n /
|
|
1631
|
+
const p = 10 ** (i * 3);
|
|
1632
|
+
return `${(n / p).toFixed(t)}${r}`;
|
|
1633
1633
|
}
|
|
1634
1634
|
toCurrency(t = "$", {
|
|
1635
1635
|
currencyPosition: n = "start",
|
|
@@ -1637,44 +1637,44 @@ const Qt = class $e {
|
|
|
1637
1637
|
decimalSeparator: i = ".",
|
|
1638
1638
|
thousandSeparator: r = ","
|
|
1639
1639
|
} = {}) {
|
|
1640
|
-
const
|
|
1640
|
+
const p = this.getValue("number"), [u, y = ""] = p.toFixed(6).split("."), d = u.replace(/\B(?=(\d{3})+(?!\d))/g, r), o = !u && !y ? "0.00" : u === "0" ? `${parseFloat(`0.${y}`)}`.replace(".", i) : `${d}${parseInt(y) ? `${i}${y.slice(0, a)}` : ""}`;
|
|
1641
1641
|
return `${n === "start" ? t : ""}${o}${n === "end" ? t : ""}`;
|
|
1642
1642
|
}
|
|
1643
1643
|
formatBigIntToSafeValue(t, n) {
|
|
1644
|
-
const a = n || this.decimal ||
|
|
1644
|
+
const a = n || this.decimal || j, i = Math.max(
|
|
1645
1645
|
a,
|
|
1646
|
-
|
|
1647
|
-
), r = t < 0n,
|
|
1646
|
+
$(this.decimalMultiplier)
|
|
1647
|
+
), r = t < 0n, p = t.toString().substring(r ? 1 : 0), u = i - (p.length - 1), y = u > 0 ? "0".repeat(u) + p : p, d = y.length - i;
|
|
1648
1648
|
let o = y.slice(-i);
|
|
1649
1649
|
return parseInt(o[a]) >= 5 ? o = `${o.substring(0, a - 1)}${(parseInt(o[a - 1]) + 1).toString()}` : o = o.substring(0, a), `${r ? "-" : ""}${y.slice(
|
|
1650
1650
|
0,
|
|
1651
|
-
|
|
1651
|
+
d
|
|
1652
1652
|
)}.${o}`.replace(/\.?0*$/, "");
|
|
1653
1653
|
}
|
|
1654
1654
|
};
|
|
1655
|
-
H = /* @__PURE__ */ new WeakSet(),
|
|
1656
|
-
const n =
|
|
1657
|
-
(
|
|
1658
|
-
const
|
|
1655
|
+
H = /* @__PURE__ */ new WeakSet(), U = function(e, ...t) {
|
|
1656
|
+
const n = E(this, z, oe).call(this, this, ...t), a = Math.max(n, $(this.decimalMultiplier)), i = P(a), r = t.reduce(
|
|
1657
|
+
(u, y) => {
|
|
1658
|
+
const d = this.getBigIntValue(y, a);
|
|
1659
1659
|
switch (e) {
|
|
1660
1660
|
case "add":
|
|
1661
|
-
return
|
|
1661
|
+
return u + d;
|
|
1662
1662
|
case "sub":
|
|
1663
|
-
return
|
|
1663
|
+
return u - d;
|
|
1664
1664
|
case "mul":
|
|
1665
|
-
return
|
|
1665
|
+
return u * d / i;
|
|
1666
1666
|
case "div": {
|
|
1667
|
-
if (
|
|
1667
|
+
if (d === 0n)
|
|
1668
1668
|
throw new RangeError("Division by zero");
|
|
1669
|
-
return
|
|
1669
|
+
return u * i / d;
|
|
1670
1670
|
}
|
|
1671
1671
|
default:
|
|
1672
|
-
return
|
|
1672
|
+
return u;
|
|
1673
1673
|
}
|
|
1674
1674
|
},
|
|
1675
1675
|
//normalize is to precision multiplier base
|
|
1676
1676
|
this.bigIntValue * i / this.decimalMultiplier
|
|
1677
|
-
),
|
|
1677
|
+
), p = re({
|
|
1678
1678
|
bigIntDecimal: a,
|
|
1679
1679
|
decimal: a,
|
|
1680
1680
|
value: r
|
|
@@ -1682,11 +1682,11 @@ H = /* @__PURE__ */ new WeakSet(), q = function(e, ...t) {
|
|
|
1682
1682
|
return new this.constructor({
|
|
1683
1683
|
decimalMultiplier: P(a),
|
|
1684
1684
|
decimal: this.decimal,
|
|
1685
|
-
value:
|
|
1685
|
+
value: p,
|
|
1686
1686
|
identifier: this.toString()
|
|
1687
1687
|
});
|
|
1688
1688
|
}, N = /* @__PURE__ */ new WeakSet(), V = function(e, ...t) {
|
|
1689
|
-
const n =
|
|
1689
|
+
const n = E(this, z, oe).call(this, this, ...t), a = this.getBigIntValue(t[0], n), i = this.getBigIntValue(this, n);
|
|
1690
1690
|
switch (e) {
|
|
1691
1691
|
case "gt":
|
|
1692
1692
|
return i > a;
|
|
@@ -1699,46 +1699,46 @@ H = /* @__PURE__ */ new WeakSet(), q = function(e, ...t) {
|
|
|
1699
1699
|
case "eqValue":
|
|
1700
1700
|
return i === a;
|
|
1701
1701
|
}
|
|
1702
|
-
}, Te = /* @__PURE__ */ new WeakSet(),
|
|
1703
|
-
const t =
|
|
1704
|
-
this.bigIntValue =
|
|
1705
|
-
},
|
|
1706
|
-
const t = e.map((n) => typeof n == "object" ? n.decimal ||
|
|
1707
|
-
return Math.max(...t,
|
|
1708
|
-
},
|
|
1709
|
-
const n = t ? P(t) : this.decimalMultiplier, a =
|
|
1702
|
+
}, Te = /* @__PURE__ */ new WeakSet(), Ue = function(e) {
|
|
1703
|
+
const t = ae(e) || "0";
|
|
1704
|
+
this.bigIntValue = E(this, ne, ce).call(this, t);
|
|
1705
|
+
}, z = /* @__PURE__ */ new WeakSet(), oe = function(...e) {
|
|
1706
|
+
const t = e.map((n) => typeof n == "object" ? n.decimal || $(n.decimalMultiplier) : We(ae(n))).filter(Boolean);
|
|
1707
|
+
return Math.max(...t, j);
|
|
1708
|
+
}, ne = /* @__PURE__ */ new WeakSet(), ce = function(e, t) {
|
|
1709
|
+
const n = t ? P(t) : this.decimalMultiplier, a = $(n), [i = "", r = ""] = e.split(".");
|
|
1710
1710
|
return BigInt(`${i}${r.padEnd(a, "0")}`);
|
|
1711
1711
|
};
|
|
1712
|
-
let
|
|
1713
|
-
const
|
|
1712
|
+
let $e = Yt;
|
|
1713
|
+
const Qt = Intl.NumberFormat("fullwide", {
|
|
1714
1714
|
useGrouping: !1,
|
|
1715
1715
|
maximumFractionDigits: 20
|
|
1716
1716
|
});
|
|
1717
|
-
function
|
|
1718
|
-
const t = `${typeof e == "number" ?
|
|
1717
|
+
function ae(e) {
|
|
1718
|
+
const t = `${typeof e == "number" ? Qt.format(e) : be(e)}`.replaceAll(",", ".").split(".");
|
|
1719
1719
|
return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function We(e) {
|
|
1722
1722
|
var t;
|
|
1723
1723
|
const n = ((t = e.split(".")[1]) == null ? void 0 : t.length) || 0;
|
|
1724
|
-
return Math.max(n,
|
|
1724
|
+
return Math.max(n, j);
|
|
1725
1725
|
}
|
|
1726
1726
|
function be(e) {
|
|
1727
1727
|
return typeof e == "object" ? "getValue" in e ? e.getValue("string") : e.value : e;
|
|
1728
1728
|
}
|
|
1729
|
-
const
|
|
1730
|
-
class x extends
|
|
1729
|
+
const W = /* @__PURE__ */ new Map();
|
|
1730
|
+
class x extends $e {
|
|
1731
1731
|
constructor({
|
|
1732
1732
|
value: t,
|
|
1733
1733
|
decimal: n,
|
|
1734
1734
|
tax: a,
|
|
1735
1735
|
chain: i,
|
|
1736
1736
|
symbol: r,
|
|
1737
|
-
identifier:
|
|
1737
|
+
identifier: p
|
|
1738
1738
|
}) {
|
|
1739
1739
|
super(typeof t == "object" ? t : { decimal: n, value: t }), v(this, "address"), v(this, "chain"), v(this, "isGasAsset", !1), v(this, "isSynthetic", !1), v(this, "symbol"), v(this, "tax"), v(this, "ticker"), v(this, "type");
|
|
1740
|
-
const
|
|
1741
|
-
this.type =
|
|
1740
|
+
const u = ee(p || `${i}.${r}`);
|
|
1741
|
+
this.type = Rt(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;
|
|
1742
1742
|
}
|
|
1743
1743
|
toString() {
|
|
1744
1744
|
return this.isSynthetic ? this.symbol : `${this.chain}.${this.symbol}`;
|
|
@@ -1756,8 +1756,8 @@ class x extends We {
|
|
|
1756
1756
|
const [a, i, r] = t.split(".");
|
|
1757
1757
|
if (!a || !i)
|
|
1758
1758
|
throw new Error("Invalid asset url");
|
|
1759
|
-
const
|
|
1760
|
-
return le(
|
|
1759
|
+
const p = a === s.THORChain && r ? `${a}.${i}/${r}` : t;
|
|
1760
|
+
return le(p, n);
|
|
1761
1761
|
}
|
|
1762
1762
|
static fromString(t, n = 0) {
|
|
1763
1763
|
return le(t, n);
|
|
@@ -1766,33 +1766,33 @@ class x extends We {
|
|
|
1766
1766
|
return le(t, n);
|
|
1767
1767
|
}
|
|
1768
1768
|
static fromStringSync(t, n = 0) {
|
|
1769
|
-
const { chain: a, isSynthetic: i } =
|
|
1769
|
+
const { chain: a, isSynthetic: i } = ee(t), r = W.get(t.toUpperCase());
|
|
1770
1770
|
if (i)
|
|
1771
1771
|
return Re(t, n);
|
|
1772
|
-
const { tax:
|
|
1772
|
+
const { tax: p, decimal: u, identifier: y } = r || {
|
|
1773
1773
|
decimal: A[a],
|
|
1774
1774
|
identifier: t
|
|
1775
1775
|
};
|
|
1776
1776
|
return new x({
|
|
1777
|
-
tax:
|
|
1778
|
-
value:
|
|
1777
|
+
tax: p,
|
|
1778
|
+
value: G(n, u),
|
|
1779
1779
|
identifier: i ? t : y,
|
|
1780
|
-
decimal: i ? 8 :
|
|
1780
|
+
decimal: i ? 8 : u
|
|
1781
1781
|
});
|
|
1782
1782
|
}
|
|
1783
1783
|
static fromIdentifierSync(t, n = 0) {
|
|
1784
|
-
const { chain: a, isSynthetic: i } =
|
|
1784
|
+
const { chain: a, isSynthetic: i } = ee(t), r = W.get(t);
|
|
1785
1785
|
if (i)
|
|
1786
1786
|
return Re(t, n);
|
|
1787
|
-
const { tax:
|
|
1787
|
+
const { tax: p, decimal: u, identifier: y } = r || {
|
|
1788
1788
|
decimal: A[a],
|
|
1789
1789
|
identifier: t
|
|
1790
1790
|
};
|
|
1791
|
-
return new x({ tax:
|
|
1791
|
+
return new x({ tax: p, decimal: u, identifier: y, value: G(n, u) });
|
|
1792
1792
|
}
|
|
1793
1793
|
static fromChainOrSignature(t, n = 0) {
|
|
1794
|
-
const { decimal: a, identifier: i } =
|
|
1795
|
-
return new x({ value:
|
|
1794
|
+
const { decimal: a, identifier: i } = gt(t);
|
|
1795
|
+
return new x({ value: G(n, a), decimal: a, identifier: i });
|
|
1796
1796
|
}
|
|
1797
1797
|
static loadStaticAssets() {
|
|
1798
1798
|
return new Promise(
|
|
@@ -1801,10 +1801,10 @@ class x extends We {
|
|
|
1801
1801
|
const a = await import("@swapkit/tokens");
|
|
1802
1802
|
Object.values(a).forEach((i) => {
|
|
1803
1803
|
var r;
|
|
1804
|
-
(r = i == null ? void 0 : i.tokens) == null || r.forEach(({ identifier:
|
|
1805
|
-
|
|
1806
|
-
identifier:
|
|
1807
|
-
decimal: "decimals" in y ? y.decimals : A[
|
|
1804
|
+
(r = i == null ? void 0 : i.tokens) == null || r.forEach(({ identifier: p, chain: u, ...y }) => {
|
|
1805
|
+
W.set(p.toUpperCase(), {
|
|
1806
|
+
identifier: p,
|
|
1807
|
+
decimal: "decimals" in y ? y.decimals : A[u]
|
|
1808
1808
|
});
|
|
1809
1809
|
});
|
|
1810
1810
|
}), t({ ok: !0 });
|
|
@@ -1841,9 +1841,9 @@ function de(e) {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
}
|
|
1843
1843
|
async function le(e, t = 0) {
|
|
1844
|
-
|
|
1845
|
-
const n =
|
|
1846
|
-
return n ||
|
|
1844
|
+
Kt(e);
|
|
1845
|
+
const n = W.get(e.toUpperCase()), a = (n == null ? void 0 : n.decimal) || await Mt(ee(e));
|
|
1846
|
+
return n || W.set(e.toUpperCase(), { identifier: e, decimal: a }), new x({ decimal: a, value: G(t, a), identifier: e });
|
|
1847
1847
|
}
|
|
1848
1848
|
function Re(e, t = 0) {
|
|
1849
1849
|
const [n, a] = e.split(".")[0].toUpperCase() === s.THORChain ? e.split(".").slice(1).join().split("/") : e.split("/");
|
|
@@ -1851,28 +1851,28 @@ function Re(e, t = 0) {
|
|
|
1851
1851
|
throw new Error("Invalid asset identifier");
|
|
1852
1852
|
return new x({
|
|
1853
1853
|
decimal: 8,
|
|
1854
|
-
value:
|
|
1854
|
+
value: G(t, 8),
|
|
1855
1855
|
identifier: `${s.THORChain}.${n}/${a}`
|
|
1856
1856
|
});
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1859
|
-
return typeof e == "bigint" ?
|
|
1858
|
+
function G(e, t) {
|
|
1859
|
+
return typeof e == "bigint" ? re({ value: e, bigIntDecimal: t, decimal: t }) : e;
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1861
|
+
function ee(e) {
|
|
1862
1862
|
const t = e.slice(0, 14).includes("/"), [n, a] = e.split(".")[0].toUpperCase() === s.THORChain ? e.split(".").slice(1).join().split("/") : e.split("/");
|
|
1863
1863
|
if (t && (!n || !a))
|
|
1864
1864
|
throw new Error("Invalid asset identifier");
|
|
1865
|
-
const i = e.includes(".") && !t ? e : `${s.THORChain}.${a}`, [r,
|
|
1865
|
+
const i = e.includes(".") && !t ? e : `${s.THORChain}.${a}`, [r, p] = i.split("."), [u, y] = (t ? a : p).split("-");
|
|
1866
1866
|
return {
|
|
1867
1867
|
address: y == null ? void 0 : y.toLowerCase(),
|
|
1868
1868
|
chain: r,
|
|
1869
|
-
isGasAsset:
|
|
1869
|
+
isGasAsset: Ne({ chain: r, symbol: p }),
|
|
1870
1870
|
isSynthetic: t,
|
|
1871
|
-
symbol: (t ? `${n}/` : "") + (y ? `${
|
|
1872
|
-
ticker:
|
|
1871
|
+
symbol: (t ? `${n}/` : "") + (y ? `${u}-${(y == null ? void 0 : y.toLowerCase()) ?? ""}` : p),
|
|
1872
|
+
ticker: u
|
|
1873
1873
|
};
|
|
1874
1874
|
}
|
|
1875
|
-
const
|
|
1875
|
+
const Jt = {
|
|
1876
1876
|
/**
|
|
1877
1877
|
* Core
|
|
1878
1878
|
*/
|
|
@@ -1932,21 +1932,21 @@ const Zt = {
|
|
|
1932
1932
|
};
|
|
1933
1933
|
class m extends Error {
|
|
1934
1934
|
constructor(t, n) {
|
|
1935
|
-
console.error(n, { stack: n == null ? void 0 : n.stack, message: n == null ? void 0 : n.message }), super(t, { cause: { code:
|
|
1935
|
+
console.error(n, { stack: n == null ? void 0 : n.stack, message: n == null ? void 0 : n.message }), super(t, { cause: { code: Jt[t], message: t } }), Object.setPrototypeOf(this, m.prototype);
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
class
|
|
1938
|
+
class k extends $e {
|
|
1939
1939
|
eq(t) {
|
|
1940
1940
|
return this.eqValue(t);
|
|
1941
1941
|
}
|
|
1942
1942
|
static fromBigInt(t, n) {
|
|
1943
|
-
return new
|
|
1943
|
+
return new k({
|
|
1944
1944
|
decimal: n,
|
|
1945
|
-
value:
|
|
1945
|
+
value: re({ value: t, bigIntDecimal: n, decimal: n })
|
|
1946
1946
|
});
|
|
1947
1947
|
}
|
|
1948
1948
|
}
|
|
1949
|
-
const
|
|
1949
|
+
const Zt = [
|
|
1950
1950
|
{
|
|
1951
1951
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
1952
1952
|
stateMutability: "nonpayable",
|
|
@@ -2037,7 +2037,7 @@ const zt = [
|
|
|
2037
2037
|
type: "function"
|
|
2038
2038
|
},
|
|
2039
2039
|
{ stateMutability: "payable", type: "receive" }
|
|
2040
|
-
],
|
|
2040
|
+
], zt = [
|
|
2041
2041
|
{
|
|
2042
2042
|
inputs: [
|
|
2043
2043
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -2181,7 +2181,7 @@ const zt = [
|
|
|
2181
2181
|
type: "function"
|
|
2182
2182
|
},
|
|
2183
2183
|
{ stateMutability: "payable", type: "receive" }
|
|
2184
|
-
],
|
|
2184
|
+
], en = [
|
|
2185
2185
|
{
|
|
2186
2186
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
2187
2187
|
stateMutability: "nonpayable",
|
|
@@ -2286,7 +2286,7 @@ const zt = [
|
|
|
2286
2286
|
type: "function"
|
|
2287
2287
|
},
|
|
2288
2288
|
{ stateMutability: "payable", type: "receive" }
|
|
2289
|
-
],
|
|
2289
|
+
], tn = [
|
|
2290
2290
|
{
|
|
2291
2291
|
inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
|
|
2292
2292
|
stateMutability: "nonpayable",
|
|
@@ -2377,7 +2377,7 @@ const zt = [
|
|
|
2377
2377
|
type: "function"
|
|
2378
2378
|
},
|
|
2379
2379
|
{ stateMutability: "payable", type: "receive" }
|
|
2380
|
-
],
|
|
2380
|
+
], nn = [
|
|
2381
2381
|
{
|
|
2382
2382
|
inputs: [
|
|
2383
2383
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -2521,7 +2521,7 @@ const zt = [
|
|
|
2521
2521
|
type: "function"
|
|
2522
2522
|
},
|
|
2523
2523
|
{ stateMutability: "payable", type: "receive" }
|
|
2524
|
-
],
|
|
2524
|
+
], an = [
|
|
2525
2525
|
{
|
|
2526
2526
|
inputs: [
|
|
2527
2527
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -5567,7 +5567,7 @@ const zt = [
|
|
|
5567
5567
|
type: "function"
|
|
5568
5568
|
},
|
|
5569
5569
|
{ stateMutability: "payable", type: "receive" }
|
|
5570
|
-
],
|
|
5570
|
+
], sn = [
|
|
5571
5571
|
{
|
|
5572
5572
|
inputs: [
|
|
5573
5573
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -5906,7 +5906,7 @@ const zt = [
|
|
|
5906
5906
|
type: "function"
|
|
5907
5907
|
},
|
|
5908
5908
|
{ stateMutability: "payable", type: "receive" }
|
|
5909
|
-
],
|
|
5909
|
+
], rn = [
|
|
5910
5910
|
{
|
|
5911
5911
|
inputs: [
|
|
5912
5912
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -6245,7 +6245,7 @@ const zt = [
|
|
|
6245
6245
|
type: "function"
|
|
6246
6246
|
},
|
|
6247
6247
|
{ stateMutability: "payable", type: "receive" }
|
|
6248
|
-
],
|
|
6248
|
+
], pn = [
|
|
6249
6249
|
{
|
|
6250
6250
|
inputs: [
|
|
6251
6251
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -6584,7 +6584,7 @@ const zt = [
|
|
|
6584
6584
|
type: "function"
|
|
6585
6585
|
},
|
|
6586
6586
|
{ stateMutability: "payable", type: "receive" }
|
|
6587
|
-
],
|
|
6587
|
+
], un = [
|
|
6588
6588
|
{
|
|
6589
6589
|
inputs: [
|
|
6590
6590
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -6923,7 +6923,7 @@ const zt = [
|
|
|
6923
6923
|
type: "function"
|
|
6924
6924
|
},
|
|
6925
6925
|
{ stateMutability: "payable", type: "receive" }
|
|
6926
|
-
],
|
|
6926
|
+
], yn = [
|
|
6927
6927
|
{
|
|
6928
6928
|
inputs: [
|
|
6929
6929
|
{ internalType: "address", name: "_factory", type: "address" },
|
|
@@ -7176,7 +7176,7 @@ const zt = [
|
|
|
7176
7176
|
type: "function"
|
|
7177
7177
|
},
|
|
7178
7178
|
{ stateMutability: "payable", type: "receive" }
|
|
7179
|
-
],
|
|
7179
|
+
], on = [
|
|
7180
7180
|
{
|
|
7181
7181
|
inputs: [
|
|
7182
7182
|
{ internalType: "address", name: "_weth", type: "address" },
|
|
@@ -7346,23 +7346,23 @@ const zt = [
|
|
|
7346
7346
|
type: "function"
|
|
7347
7347
|
},
|
|
7348
7348
|
{ stateMutability: "payable", type: "receive" }
|
|
7349
|
-
],
|
|
7349
|
+
], dn = {
|
|
7350
7350
|
// AVAX
|
|
7351
|
-
["0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106".toLowerCase()]:
|
|
7352
|
-
["0xC22FBb3133dF781E6C25ea6acebe2D2Bb8CeA2f9".toLowerCase()]:
|
|
7353
|
-
["0x60aE616a2155Ee3d9A68541Ba4544862310933d4".toLowerCase()]:
|
|
7351
|
+
["0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106".toLowerCase()]: sn,
|
|
7352
|
+
["0xC22FBb3133dF781E6C25ea6acebe2D2Bb8CeA2f9".toLowerCase()]: on,
|
|
7353
|
+
["0x60aE616a2155Ee3d9A68541Ba4544862310933d4".toLowerCase()]: pn,
|
|
7354
7354
|
["0x1111111254fb6c44bAC0beD2854e76F90643097d".toLowerCase()]: ve,
|
|
7355
7355
|
["0x6131B5fae19EA4f9D964eAc0408E4408b66337b5".toLowerCase()]: Oe,
|
|
7356
7356
|
// BSC
|
|
7357
7357
|
["0x10ED43C718714eb63d5aA57B78B54704E256024E".toLowerCase()]: Ie,
|
|
7358
7358
|
// ETH
|
|
7359
7359
|
["0x6131B5fae19EA4f9D964eAc0408E4408b66337b5".toLowerCase()]: Oe,
|
|
7360
|
-
["0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f".toLowerCase()]:
|
|
7360
|
+
["0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f".toLowerCase()]: rn,
|
|
7361
7361
|
["0xEfF92A263d31888d860bD50809A8D171709b7b1c".toLowerCase()]: Ie,
|
|
7362
|
-
["0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D".toLowerCase()]:
|
|
7363
|
-
["0xE592427A0AEce92De3Edee1F18E0157C05861564".toLowerCase()]:
|
|
7362
|
+
["0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D".toLowerCase()]: un,
|
|
7363
|
+
["0xE592427A0AEce92De3Edee1F18E0157C05861564".toLowerCase()]: yn,
|
|
7364
7364
|
["0x1111111254fb6c44bac0bed2854e76f90643097d".toLowerCase()]: ve
|
|
7365
|
-
},
|
|
7365
|
+
}, ln = [
|
|
7366
7366
|
{
|
|
7367
7367
|
inputs: [
|
|
7368
7368
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7481,7 +7481,7 @@ const zt = [
|
|
|
7481
7481
|
type: "function"
|
|
7482
7482
|
},
|
|
7483
7483
|
{ stateMutability: "payable", type: "receive" }
|
|
7484
|
-
],
|
|
7484
|
+
], mn = [
|
|
7485
7485
|
{
|
|
7486
7486
|
inputs: [
|
|
7487
7487
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7600,7 +7600,7 @@ const zt = [
|
|
|
7600
7600
|
type: "function"
|
|
7601
7601
|
},
|
|
7602
7602
|
{ stateMutability: "payable", type: "receive" }
|
|
7603
|
-
],
|
|
7603
|
+
], Tn = [
|
|
7604
7604
|
{
|
|
7605
7605
|
inputs: [
|
|
7606
7606
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7719,7 +7719,7 @@ const zt = [
|
|
|
7719
7719
|
type: "function"
|
|
7720
7720
|
},
|
|
7721
7721
|
{ stateMutability: "payable", type: "receive" }
|
|
7722
|
-
],
|
|
7722
|
+
], cn = [
|
|
7723
7723
|
{
|
|
7724
7724
|
inputs: [
|
|
7725
7725
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7846,7 +7846,7 @@ const zt = [
|
|
|
7846
7846
|
type: "function"
|
|
7847
7847
|
},
|
|
7848
7848
|
{ stateMutability: "payable", type: "receive" }
|
|
7849
|
-
],
|
|
7849
|
+
], bn = [
|
|
7850
7850
|
{
|
|
7851
7851
|
inputs: [
|
|
7852
7852
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -7973,7 +7973,7 @@ const zt = [
|
|
|
7973
7973
|
type: "function"
|
|
7974
7974
|
},
|
|
7975
7975
|
{ stateMutability: "payable", type: "receive" }
|
|
7976
|
-
],
|
|
7976
|
+
], fn = [
|
|
7977
7977
|
{
|
|
7978
7978
|
inputs: [
|
|
7979
7979
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8100,7 +8100,7 @@ const zt = [
|
|
|
8100
8100
|
type: "function"
|
|
8101
8101
|
},
|
|
8102
8102
|
{ stateMutability: "payable", type: "receive" }
|
|
8103
|
-
],
|
|
8103
|
+
], hn = [
|
|
8104
8104
|
{
|
|
8105
8105
|
inputs: [
|
|
8106
8106
|
{ internalType: "address", name: "_ttp", type: "address" },
|
|
@@ -8354,26 +8354,26 @@ const zt = [
|
|
|
8354
8354
|
type: "function"
|
|
8355
8355
|
},
|
|
8356
8356
|
{ stateMutability: "payable", type: "receive" }
|
|
8357
|
-
],
|
|
8358
|
-
["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]:
|
|
8359
|
-
["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]:
|
|
8360
|
-
["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]:
|
|
8361
|
-
},
|
|
8362
|
-
...
|
|
8363
|
-
...
|
|
8357
|
+
], Ge = {
|
|
8358
|
+
["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: Zt,
|
|
8359
|
+
["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: en,
|
|
8360
|
+
["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: tn
|
|
8361
|
+
}, _n = {
|
|
8362
|
+
...dn,
|
|
8363
|
+
...Ge,
|
|
8364
8364
|
// AVAX
|
|
8365
|
-
["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]:
|
|
8366
|
-
["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]:
|
|
8367
|
-
["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]:
|
|
8365
|
+
["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: an,
|
|
8366
|
+
["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: zt,
|
|
8367
|
+
["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: mn,
|
|
8368
8368
|
// BSC
|
|
8369
|
-
["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]:
|
|
8369
|
+
["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: nn,
|
|
8370
8370
|
// ETH
|
|
8371
|
-
["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]:
|
|
8372
|
-
["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]:
|
|
8373
|
-
["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]:
|
|
8374
|
-
["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]:
|
|
8375
|
-
["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]:
|
|
8376
|
-
["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]:
|
|
8371
|
+
["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: ln,
|
|
8372
|
+
["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Tn,
|
|
8373
|
+
["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: cn,
|
|
8374
|
+
["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: bn,
|
|
8375
|
+
["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: fn,
|
|
8376
|
+
["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: hn,
|
|
8377
8377
|
["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: An
|
|
8378
8378
|
}, wn = ({
|
|
8379
8379
|
streamSwap: e,
|
|
@@ -8383,41 +8383,41 @@ const zt = [
|
|
|
8383
8383
|
calldata: {
|
|
8384
8384
|
amount: i,
|
|
8385
8385
|
amountOutMin: r = "",
|
|
8386
|
-
data:
|
|
8387
|
-
deadline:
|
|
8386
|
+
data: p = "",
|
|
8387
|
+
deadline: u,
|
|
8388
8388
|
memo: y,
|
|
8389
|
-
router:
|
|
8389
|
+
router: d,
|
|
8390
8390
|
memoStreamingSwap: o,
|
|
8391
8391
|
tcMemo: T,
|
|
8392
|
-
tcRouter:
|
|
8393
|
-
tcVault:
|
|
8392
|
+
tcRouter: f,
|
|
8393
|
+
tcVault: _,
|
|
8394
8394
|
vault: w,
|
|
8395
8395
|
token: M
|
|
8396
8396
|
}
|
|
8397
8397
|
}) => {
|
|
8398
|
-
const R = !!
|
|
8399
|
-
if (R && !
|
|
8398
|
+
const R = !!Ge[t.toLowerCase()];
|
|
8399
|
+
if (R && !d)
|
|
8400
8400
|
throw new Error("Router is required on calldata for swapIn with GenericContract");
|
|
8401
|
-
const
|
|
8402
|
-
if (!
|
|
8401
|
+
const O = T || y, D = e && o || O;
|
|
8402
|
+
if (!_ && !w)
|
|
8403
8403
|
throw new Error("TC Vault is required on calldata");
|
|
8404
|
-
if (!
|
|
8404
|
+
if (!f && !d)
|
|
8405
8405
|
throw new Error("TC Router is required on calldata");
|
|
8406
|
-
if (!
|
|
8406
|
+
if (!D)
|
|
8407
8407
|
throw new Error("TC Memo is required on calldata");
|
|
8408
8408
|
if (!M)
|
|
8409
8409
|
throw new Error("Token is required on calldata");
|
|
8410
|
-
const
|
|
8410
|
+
const pe = [
|
|
8411
8411
|
// v2 contracts don't have tcVault, tcRouter, tcMemo but vault, router, memo
|
|
8412
|
-
a(
|
|
8413
|
-
a(
|
|
8414
|
-
|
|
8412
|
+
a(f || d),
|
|
8413
|
+
a(_ || w),
|
|
8414
|
+
D.replace("{recipientAddress}", n),
|
|
8415
8415
|
a(M),
|
|
8416
8416
|
i
|
|
8417
|
-
],
|
|
8418
|
-
return [...
|
|
8417
|
+
], Xe = R ? [a(d), p, u] : [r, u];
|
|
8418
|
+
return [...pe, ...Xe];
|
|
8419
8419
|
}, Mn = ({ chain: e, txHash: t }) => {
|
|
8420
|
-
const n =
|
|
8420
|
+
const n = De[e];
|
|
8421
8421
|
switch (e) {
|
|
8422
8422
|
case s.Binance:
|
|
8423
8423
|
case s.Maya:
|
|
@@ -8442,7 +8442,7 @@ const zt = [
|
|
|
8442
8442
|
throw new Error(`Unsupported chain: ${e}`);
|
|
8443
8443
|
}
|
|
8444
8444
|
}, En = ({ chain: e, address: t }) => {
|
|
8445
|
-
const n =
|
|
8445
|
+
const n = De[e];
|
|
8446
8446
|
switch (e) {
|
|
8447
8447
|
case s.Arbitrum:
|
|
8448
8448
|
case s.Avalanche:
|
|
@@ -8465,12 +8465,12 @@ const zt = [
|
|
|
8465
8465
|
throw new Error(`Unsupported chain: ${e}`);
|
|
8466
8466
|
}
|
|
8467
8467
|
}, gn = (e) => {
|
|
8468
|
-
const t = e ?
|
|
8469
|
-
return
|
|
8468
|
+
const t = e ? X.ThornodeStagenet : X.ThornodeMainnet;
|
|
8469
|
+
return _e.get(`${t}/thorchain/inbound_addresses`);
|
|
8470
8470
|
}, Rn = (e) => {
|
|
8471
|
-
const t = e ?
|
|
8472
|
-
return
|
|
8473
|
-
},
|
|
8471
|
+
const t = e ? X.ThornodeStagenet : X.ThornodeMainnet;
|
|
8472
|
+
return _e.get(`${t}/thorchain/mimir`);
|
|
8473
|
+
}, Se = () => Object.values(s).reduce(
|
|
8474
8474
|
(e, t) => (e[t] = null, e),
|
|
8475
8475
|
{}
|
|
8476
8476
|
), On = async ({ chain: e, address: t }) => {
|
|
@@ -8483,11 +8483,11 @@ const zt = [
|
|
|
8483
8483
|
return !0;
|
|
8484
8484
|
}
|
|
8485
8485
|
};
|
|
8486
|
-
var L,
|
|
8486
|
+
var L, ie, K, I, Y, Q;
|
|
8487
8487
|
class Xn {
|
|
8488
8488
|
constructor({ stagenet: t } = {}) {
|
|
8489
|
-
c(this, "connectedChains",
|
|
8490
|
-
c(this, "connectedWallets",
|
|
8489
|
+
c(this, "connectedChains", Se());
|
|
8490
|
+
c(this, "connectedWallets", Se());
|
|
8491
8491
|
c(this, "stagenet", !1);
|
|
8492
8492
|
c(this, "getAddress", (t) => {
|
|
8493
8493
|
var n;
|
|
@@ -8501,97 +8501,83 @@ class Xn {
|
|
|
8501
8501
|
return (a == null ? void 0 : a.balance) || [];
|
|
8502
8502
|
});
|
|
8503
8503
|
c(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
|
|
8504
|
-
var
|
|
8504
|
+
var u, y;
|
|
8505
8505
|
const {
|
|
8506
|
-
meta: { quoteMode: r }
|
|
8507
|
-
evmTransactionDetails:
|
|
8506
|
+
meta: { quoteMode: r }
|
|
8507
|
+
// evmTransactionDetails: contractCallParams,
|
|
8508
8508
|
} = a, p = r.startsWith("ERC20-") ? s.Ethereum : r.startsWith("ARC20-") ? s.Avalanche : r.startsWith("BEP20-") ? s.BinanceSmartChain : void 0;
|
|
8509
8509
|
if (!a.complete)
|
|
8510
8510
|
throw new m("core_swap_route_not_complete");
|
|
8511
8511
|
try {
|
|
8512
|
-
if (
|
|
8513
|
-
const
|
|
8514
|
-
if (!(
|
|
8515
|
-
throw new m("core_wallet_connection_not_found");
|
|
8516
|
-
const { contractAddress: T, contractMethod: b, contractParams: h, contractParamsStreaming: w } = u;
|
|
8517
|
-
if (!(t ? w : h))
|
|
8518
|
-
throw new m("core_swap_route_transaction_not_found");
|
|
8519
|
-
return await o.call({
|
|
8520
|
-
contractAddress: T,
|
|
8521
|
-
abi: Se[T.toLowerCase()],
|
|
8522
|
-
funcName: b,
|
|
8523
|
-
funcParams: t ? w : h
|
|
8524
|
-
});
|
|
8525
|
-
}
|
|
8526
|
-
if (at.includes(r) && p) {
|
|
8527
|
-
const o = this.connectedWallets[p];
|
|
8528
|
-
if (!(o != null && o.sendTransaction))
|
|
8512
|
+
if (nt.includes(r) && p) {
|
|
8513
|
+
const d = this.connectedWallets[p];
|
|
8514
|
+
if (!(d != null && d.sendTransaction))
|
|
8529
8515
|
throw new m("core_wallet_connection_not_found");
|
|
8530
|
-
if (!(t ? (
|
|
8516
|
+
if (!(t ? (u = a == null ? void 0 : a.streamingSwap) == null ? void 0 : u.transaction : a == null ? void 0 : a.transaction))
|
|
8531
8517
|
throw new m("core_swap_route_transaction_not_found");
|
|
8532
|
-
const { data:
|
|
8533
|
-
data:
|
|
8534
|
-
from:
|
|
8535
|
-
to:
|
|
8536
|
-
chainId: BigInt(
|
|
8537
|
-
value:
|
|
8518
|
+
const { data: T, from: f, to: _, value: w } = a.transaction, M = {
|
|
8519
|
+
data: T,
|
|
8520
|
+
from: f,
|
|
8521
|
+
to: _.toLowerCase(),
|
|
8522
|
+
chainId: BigInt(dt[p]),
|
|
8523
|
+
value: w ? BigInt(w) : 0n
|
|
8538
8524
|
};
|
|
8539
|
-
return
|
|
8525
|
+
return d.sendTransaction(M, i);
|
|
8540
8526
|
}
|
|
8541
|
-
if (
|
|
8527
|
+
if (it.includes(r)) {
|
|
8542
8528
|
if (!a.calldata.fromAsset)
|
|
8543
8529
|
throw new m("core_swap_asset_not_recognized");
|
|
8544
|
-
const
|
|
8545
|
-
if (!
|
|
8530
|
+
const d = await x.fromString(a.calldata.fromAsset);
|
|
8531
|
+
if (!d)
|
|
8546
8532
|
throw new m("core_swap_asset_not_recognized");
|
|
8547
|
-
const { address:
|
|
8548
|
-
contract:
|
|
8549
|
-
calldata: { expiration:
|
|
8550
|
-
} = a,
|
|
8533
|
+
const { address: o } = await h(this, L).call(this, d.chain), {
|
|
8534
|
+
contract: T,
|
|
8535
|
+
calldata: { expiration: f, amountIn: _, memo: w, memoStreamingSwap: M }
|
|
8536
|
+
} = a, R = d.add(k.fromBigInt(BigInt(_), d.decimal)), O = t && M || w;
|
|
8551
8537
|
return this.deposit({
|
|
8552
|
-
expiration:
|
|
8553
|
-
assetValue:
|
|
8554
|
-
memo:
|
|
8538
|
+
expiration: f,
|
|
8539
|
+
assetValue: R,
|
|
8540
|
+
memo: O,
|
|
8555
8541
|
feeOptionKey: i,
|
|
8556
|
-
router:
|
|
8557
|
-
recipient:
|
|
8542
|
+
router: T,
|
|
8543
|
+
recipient: o
|
|
8558
8544
|
});
|
|
8559
8545
|
}
|
|
8560
|
-
if (
|
|
8561
|
-
const { calldata:
|
|
8562
|
-
if (!
|
|
8546
|
+
if (at.includes(r) && p) {
|
|
8547
|
+
const { calldata: d, contract: o } = a;
|
|
8548
|
+
if (!o)
|
|
8563
8549
|
throw new m("core_swap_contract_not_found");
|
|
8564
|
-
const
|
|
8565
|
-
if (!(
|
|
8550
|
+
const T = this.connectedWallets[p], f = this.getAddress(p);
|
|
8551
|
+
if (!(T != null && T.sendTransaction) || !f)
|
|
8566
8552
|
throw new m("core_wallet_connection_not_found");
|
|
8567
|
-
const { getProvider:
|
|
8568
|
-
if (!
|
|
8569
|
-
throw new m("core_swap_contract_not_supported", { contractAddress:
|
|
8570
|
-
const
|
|
8553
|
+
const { getProvider: _, toChecksumAddress: w } = await import("@swapkit/toolbox-evm"), M = _(p), R = _n[o.toLowerCase()];
|
|
8554
|
+
if (!R)
|
|
8555
|
+
throw new m("core_swap_contract_not_supported", { contractAddress: o });
|
|
8556
|
+
const D = await (await ((y = T.createContract) == null ? void 0 : y.call(T, o, R, M))).getFunction("swapIn").populateTransaction(
|
|
8571
8557
|
...wn({
|
|
8572
8558
|
streamSwap: t,
|
|
8573
|
-
toChecksumAddress:
|
|
8574
|
-
contractAddress:
|
|
8559
|
+
toChecksumAddress: w,
|
|
8560
|
+
contractAddress: o,
|
|
8575
8561
|
recipient: n,
|
|
8576
|
-
calldata:
|
|
8562
|
+
calldata: d
|
|
8577
8563
|
}),
|
|
8578
|
-
{ from:
|
|
8564
|
+
{ from: f }
|
|
8579
8565
|
);
|
|
8580
|
-
return
|
|
8566
|
+
return T.sendTransaction(D, i);
|
|
8581
8567
|
}
|
|
8582
8568
|
throw new m("core_swap_quote_mode_not_supported", { quoteMode: r });
|
|
8583
|
-
} catch (
|
|
8584
|
-
throw new m("core_swap_transaction_error",
|
|
8569
|
+
} catch (d) {
|
|
8570
|
+
throw new m("core_swap_transaction_error", d);
|
|
8585
8571
|
}
|
|
8586
8572
|
});
|
|
8587
8573
|
c(this, "getWalletByChain", async (t, n) => {
|
|
8588
|
-
var
|
|
8574
|
+
var p, u;
|
|
8589
8575
|
const a = this.getAddress(t);
|
|
8590
8576
|
if (!a)
|
|
8591
8577
|
return null;
|
|
8592
|
-
const i = [x.fromChainOrSignature(t)], r = (
|
|
8578
|
+
const i = [x.fromChainOrSignature(t)], r = (p = this.connectedChains[t]) == null ? void 0 : p.walletType;
|
|
8593
8579
|
try {
|
|
8594
|
-
const y = await ((
|
|
8580
|
+
const y = await ((u = this.getWallet(t)) == null ? void 0 : u.getBalance(a, n));
|
|
8595
8581
|
return this.connectedChains[t] = {
|
|
8596
8582
|
address: a,
|
|
8597
8583
|
balance: y != null && y.length ? y : i,
|
|
@@ -8601,8 +8587,8 @@ class Xn {
|
|
|
8601
8587
|
return console.error(y), { address: a, balance: i, walletType: r };
|
|
8602
8588
|
}
|
|
8603
8589
|
});
|
|
8604
|
-
c(this, "approveAssetValue", (t, n) =>
|
|
8605
|
-
c(this, "isAssetValueApproved", (t, n) =>
|
|
8590
|
+
c(this, "approveAssetValue", (t, n) => h(this, K).call(this, { assetValue: t, type: "approve", contractAddress: n }));
|
|
8591
|
+
c(this, "isAssetValueApproved", (t, n) => h(this, K).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
|
|
8606
8592
|
c(this, "validateAddress", ({ address: t, chain: n }) => {
|
|
8607
8593
|
var a, i;
|
|
8608
8594
|
return (i = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : i.call(a, t);
|
|
@@ -8612,7 +8598,7 @@ class Xn {
|
|
|
8612
8598
|
if (!n)
|
|
8613
8599
|
throw new m("core_wallet_connection_not_found");
|
|
8614
8600
|
try {
|
|
8615
|
-
return await n.transfer(
|
|
8601
|
+
return await n.transfer(h(this, Q).call(this, t));
|
|
8616
8602
|
} catch (a) {
|
|
8617
8603
|
throw new m("core_swap_transaction_error", a);
|
|
8618
8604
|
}
|
|
@@ -8623,44 +8609,44 @@ class Xn {
|
|
|
8623
8609
|
router: a,
|
|
8624
8610
|
...i
|
|
8625
8611
|
}) => {
|
|
8626
|
-
const { chain: r, symbol:
|
|
8612
|
+
const { chain: r, symbol: p, ticker: u } = t, y = this.connectedWallets[r];
|
|
8627
8613
|
if (!await On({ address: await (y == null ? void 0 : y.getAddress()), chain: r }))
|
|
8628
8614
|
throw new m("core_transaction_invalid_sender_address");
|
|
8629
8615
|
if (!y)
|
|
8630
8616
|
throw new m("core_wallet_connection_not_found");
|
|
8631
|
-
const
|
|
8617
|
+
const d = h(this, Q).call(this, { assetValue: t, recipient: n, router: a, ...i });
|
|
8632
8618
|
try {
|
|
8633
8619
|
switch (r) {
|
|
8634
8620
|
case s.THORChain: {
|
|
8635
8621
|
const o = y;
|
|
8636
|
-
return await (n === "" ? o.deposit(
|
|
8622
|
+
return await (n === "" ? o.deposit(d) : o.transfer(d));
|
|
8637
8623
|
}
|
|
8638
8624
|
case s.Ethereum:
|
|
8639
8625
|
case s.BinanceSmartChain:
|
|
8640
8626
|
case s.Avalanche: {
|
|
8641
|
-
const { getChecksumAddressFromAsset: o } = await import("@swapkit/toolbox-evm"), T = r === s.Avalanche ?
|
|
8627
|
+
const { getChecksumAddressFromAsset: o } = await import("@swapkit/toolbox-evm"), T = r === s.Avalanche ? ze : r === s.BinanceSmartChain ? et : Ze;
|
|
8642
8628
|
return await y.call({
|
|
8643
8629
|
abi: T,
|
|
8644
|
-
contractAddress: a || (await
|
|
8630
|
+
contractAddress: a || (await h(this, L).call(this, r)).router,
|
|
8645
8631
|
funcName: "depositWithExpiry",
|
|
8646
8632
|
funcParams: [
|
|
8647
8633
|
n,
|
|
8648
|
-
o({ chain: r, symbol:
|
|
8634
|
+
o({ chain: r, symbol: p, ticker: u }, r),
|
|
8649
8635
|
t.getBaseValue("string"),
|
|
8650
|
-
|
|
8636
|
+
d.memo,
|
|
8651
8637
|
i.expiration || parseInt(`${((/* @__PURE__ */ new Date()).getTime() + 15 * 60 * 1e3) / 1e3}`)
|
|
8652
8638
|
],
|
|
8653
8639
|
txOverrides: {
|
|
8654
|
-
from:
|
|
8640
|
+
from: d.from,
|
|
8655
8641
|
value: t.isGasAsset ? t.getBaseValue("bigint") : void 0
|
|
8656
8642
|
}
|
|
8657
8643
|
});
|
|
8658
8644
|
}
|
|
8659
8645
|
default:
|
|
8660
|
-
return await y.transfer(
|
|
8646
|
+
return await y.transfer(d);
|
|
8661
8647
|
}
|
|
8662
8648
|
} catch (o) {
|
|
8663
|
-
const T = ((o == null ? void 0 : o.message) || (o == null ? void 0 : o.toString())).toLowerCase(),
|
|
8649
|
+
const T = ((o == null ? void 0 : o.message) || (o == null ? void 0 : o.toString())).toLowerCase(), f = T == null ? void 0 : T.includes("insufficient funds"), _ = T == null ? void 0 : T.includes("gas"), w = T == null ? void 0 : T.includes("server"), M = f ? "core_transaction_deposit_insufficient_funds_error" : _ ? "core_transaction_deposit_gas_error" : w ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
|
|
8664
8650
|
throw new m(M, o);
|
|
8665
8651
|
}
|
|
8666
8652
|
});
|
|
@@ -8675,9 +8661,9 @@ class Xn {
|
|
|
8675
8661
|
throw new m("core_transaction_create_liquidity_invalid_params");
|
|
8676
8662
|
let a = "", i = "";
|
|
8677
8663
|
try {
|
|
8678
|
-
a = await
|
|
8664
|
+
a = await h(this, I).call(this, {
|
|
8679
8665
|
assetValue: t,
|
|
8680
|
-
memo: C(
|
|
8666
|
+
memo: C(b.DEPOSIT, {
|
|
8681
8667
|
...n,
|
|
8682
8668
|
address: this.getAddress(n.chain)
|
|
8683
8669
|
})
|
|
@@ -8686,9 +8672,9 @@ class Xn {
|
|
|
8686
8672
|
throw new m("core_transaction_create_liquidity_rune_error", r);
|
|
8687
8673
|
}
|
|
8688
8674
|
try {
|
|
8689
|
-
i = await
|
|
8675
|
+
i = await h(this, I).call(this, {
|
|
8690
8676
|
assetValue: n,
|
|
8691
|
-
memo: C(
|
|
8677
|
+
memo: C(b.DEPOSIT, {
|
|
8692
8678
|
...n,
|
|
8693
8679
|
address: this.getAddress(s.THORChain)
|
|
8694
8680
|
})
|
|
@@ -8704,31 +8690,31 @@ class Xn {
|
|
|
8704
8690
|
runeAddr: a,
|
|
8705
8691
|
assetAddr: i,
|
|
8706
8692
|
isPendingSymmAsset: r,
|
|
8707
|
-
mode:
|
|
8693
|
+
mode: p = "sym"
|
|
8708
8694
|
}) => {
|
|
8709
|
-
const { chain:
|
|
8695
|
+
const { chain: u, symbol: y } = n, d = p === "sym", o = (t == null ? void 0 : t.gt(0)) && (d || p === "rune"), T = (n == null ? void 0 : n.gt(0)) && (d || p === "asset"), f = r || o, _ = f ? a || this.getAddress(s.THORChain) : "", w = d || p === "asset" ? i || this.getAddress(u) : "";
|
|
8710
8696
|
if (!o && !T)
|
|
8711
8697
|
throw new m("core_transaction_add_liquidity_invalid_params");
|
|
8712
|
-
if (
|
|
8698
|
+
if (f && !_)
|
|
8713
8699
|
throw new m("core_transaction_add_liquidity_no_rune_address");
|
|
8714
8700
|
let M, R;
|
|
8715
8701
|
if (o && t)
|
|
8716
8702
|
try {
|
|
8717
|
-
M = await
|
|
8703
|
+
M = await h(this, I).call(this, {
|
|
8718
8704
|
assetValue: t,
|
|
8719
|
-
memo: C(
|
|
8705
|
+
memo: C(b.DEPOSIT, { chain: u, symbol: y, address: w })
|
|
8720
8706
|
});
|
|
8721
|
-
} catch (
|
|
8722
|
-
throw new m("core_transaction_add_liquidity_rune_error",
|
|
8707
|
+
} catch (O) {
|
|
8708
|
+
throw new m("core_transaction_add_liquidity_rune_error", O);
|
|
8723
8709
|
}
|
|
8724
8710
|
if (T && n)
|
|
8725
8711
|
try {
|
|
8726
|
-
R = await
|
|
8712
|
+
R = await h(this, I).call(this, {
|
|
8727
8713
|
assetValue: n,
|
|
8728
|
-
memo: C(
|
|
8714
|
+
memo: C(b.DEPOSIT, { chain: u, symbol: y, address: _ })
|
|
8729
8715
|
});
|
|
8730
|
-
} catch (
|
|
8731
|
-
throw new m("core_transaction_add_liquidity_asset_error",
|
|
8716
|
+
} catch (O) {
|
|
8717
|
+
throw new m("core_transaction_add_liquidity_asset_error", O);
|
|
8732
8718
|
}
|
|
8733
8719
|
return { runeTx: M, assetTx: R };
|
|
8734
8720
|
});
|
|
@@ -8740,12 +8726,12 @@ class Xn {
|
|
|
8740
8726
|
}) => {
|
|
8741
8727
|
if (i && !a)
|
|
8742
8728
|
throw new m("core_transaction_add_liquidity_invalid_params");
|
|
8743
|
-
const r = C(
|
|
8729
|
+
const r = C(b.DEPOSIT, {
|
|
8744
8730
|
chain: n.split(".")[0],
|
|
8745
8731
|
symbol: n.split(".")[1],
|
|
8746
8732
|
address: i ? a : ""
|
|
8747
8733
|
});
|
|
8748
|
-
return
|
|
8734
|
+
return h(this, I).call(this, { assetValue: t, memo: r });
|
|
8749
8735
|
});
|
|
8750
8736
|
c(this, "withdraw", async ({
|
|
8751
8737
|
memo: t,
|
|
@@ -8754,15 +8740,15 @@ class Xn {
|
|
|
8754
8740
|
from: i,
|
|
8755
8741
|
to: r
|
|
8756
8742
|
}) => {
|
|
8757
|
-
const
|
|
8743
|
+
const p = r === "rune" && i !== "rune" ? x.fromChainOrSignature(s.THORChain) : i === "sym" && r === "sym" || i === "rune" || i === "asset" ? void 0 : n, u = de(i === "asset" ? n.chain : s.THORChain), y = t || C(b.WITHDRAW, {
|
|
8758
8744
|
symbol: n.symbol,
|
|
8759
8745
|
chain: n.chain,
|
|
8760
8746
|
ticker: n.ticker,
|
|
8761
8747
|
basisPoints: Math.min(1e4, Math.round(a * 100)),
|
|
8762
|
-
targetAssetString:
|
|
8748
|
+
targetAssetString: p == null ? void 0 : p.toString(),
|
|
8763
8749
|
singleSide: !1
|
|
8764
8750
|
});
|
|
8765
|
-
return
|
|
8751
|
+
return h(this, I).call(this, { assetValue: u, memo: y });
|
|
8766
8752
|
});
|
|
8767
8753
|
c(this, "savings", async ({
|
|
8768
8754
|
assetValue: t,
|
|
@@ -8770,23 +8756,23 @@ class Xn {
|
|
|
8770
8756
|
percent: a,
|
|
8771
8757
|
type: i
|
|
8772
8758
|
}) => {
|
|
8773
|
-
const r = i === "add" ?
|
|
8759
|
+
const r = i === "add" ? b.DEPOSIT : b.WITHDRAW, p = n || C(r, {
|
|
8774
8760
|
ticker: t.ticker,
|
|
8775
8761
|
symbol: t.symbol,
|
|
8776
8762
|
chain: t.chain,
|
|
8777
8763
|
singleSide: !0,
|
|
8778
8764
|
basisPoints: a ? Math.min(1e4, Math.round(a * 100)) : void 0
|
|
8779
|
-
}),
|
|
8780
|
-
return
|
|
8765
|
+
}), u = r === b.DEPOSIT ? t : de(t.chain);
|
|
8766
|
+
return h(this, I).call(this, { memo: p, assetValue: u });
|
|
8781
8767
|
});
|
|
8782
8768
|
c(this, "loan", ({
|
|
8783
8769
|
assetValue: t,
|
|
8784
8770
|
memo: n,
|
|
8785
8771
|
minAmount: a,
|
|
8786
8772
|
type: i
|
|
8787
|
-
}) =>
|
|
8773
|
+
}) => h(this, I).call(this, {
|
|
8788
8774
|
assetValue: t,
|
|
8789
|
-
memo: n || C(i === "open" ?
|
|
8775
|
+
memo: n || C(i === "open" ? b.OPEN_LOAN : b.CLOSE_LOAN, {
|
|
8790
8776
|
asset: t.toString(),
|
|
8791
8777
|
minAmount: a.toString(),
|
|
8792
8778
|
address: this.getAddress(t.chain)
|
|
@@ -8797,11 +8783,11 @@ class Xn {
|
|
|
8797
8783
|
assetValue: n,
|
|
8798
8784
|
address: a
|
|
8799
8785
|
}) => {
|
|
8800
|
-
const i = t === "bond" ?
|
|
8786
|
+
const i = t === "bond" ? b.BOND : t === "unbond" ? b.UNBOND : b.LEAVE, r = C(i, {
|
|
8801
8787
|
address: a,
|
|
8802
8788
|
unbondAmount: t === "unbond" ? n.getBaseValue("number") : void 0
|
|
8803
8789
|
});
|
|
8804
|
-
return
|
|
8790
|
+
return h(this, Y).call(this, {
|
|
8805
8791
|
memo: r,
|
|
8806
8792
|
assetValue: t === "bond" ? n : de(s.THORChain)
|
|
8807
8793
|
});
|
|
@@ -8809,12 +8795,12 @@ class Xn {
|
|
|
8809
8795
|
c(this, "registerThorname", ({
|
|
8810
8796
|
assetValue: t,
|
|
8811
8797
|
...n
|
|
8812
|
-
}) =>
|
|
8798
|
+
}) => h(this, Y).call(this, { assetValue: t, memo: C(b.THORNAME_REGISTER, n) }));
|
|
8813
8799
|
c(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
|
|
8814
8800
|
try {
|
|
8815
8801
|
t.forEach((r) => {
|
|
8816
8802
|
this[r.connectMethodName] = r.connect({
|
|
8817
|
-
addChain:
|
|
8803
|
+
addChain: h(this, ie),
|
|
8818
8804
|
config: n || {},
|
|
8819
8805
|
apis: a,
|
|
8820
8806
|
rpcUrls: i
|
|
@@ -8906,56 +8892,56 @@ class Xn {
|
|
|
8906
8892
|
throw new m("core_chain_halted");
|
|
8907
8893
|
return a;
|
|
8908
8894
|
});
|
|
8909
|
-
B(this,
|
|
8895
|
+
B(this, ie, ({ chain: t, wallet: n, walletMethods: a }) => {
|
|
8910
8896
|
this.connectedChains[t] = n, this.connectedWallets[t] = a;
|
|
8911
8897
|
});
|
|
8912
|
-
B(this,
|
|
8898
|
+
B(this, K, async ({
|
|
8913
8899
|
assetValue: t,
|
|
8914
8900
|
type: n = "checkOnly",
|
|
8915
8901
|
contractAddress: a
|
|
8916
8902
|
}) => {
|
|
8917
|
-
const { address: i, chain: r, isGasAsset:
|
|
8918
|
-
if (y &&
|
|
8903
|
+
const { address: i, chain: r, isGasAsset: p, isSynthetic: u } = t, y = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(r);
|
|
8904
|
+
if (y && p || !y || u)
|
|
8919
8905
|
return !0;
|
|
8920
8906
|
const o = this.connectedWallets[r], T = n === "checkOnly" ? o == null ? void 0 : o.isApproved : o == null ? void 0 : o.approve;
|
|
8921
8907
|
if (!T)
|
|
8922
8908
|
throw new m("core_wallet_connection_not_found");
|
|
8923
|
-
const
|
|
8924
|
-
if (!i || !
|
|
8909
|
+
const f = this.getAddress(r);
|
|
8910
|
+
if (!i || !f)
|
|
8925
8911
|
throw new m("core_approve_asset_address_or_from_not_found");
|
|
8926
|
-
const
|
|
8912
|
+
const _ = a || (await h(this, L).call(this, r)).router;
|
|
8927
8913
|
return T({
|
|
8928
8914
|
amount: t.getBaseValue("bigint"),
|
|
8929
8915
|
assetAddress: i,
|
|
8930
|
-
from:
|
|
8931
|
-
spenderAddress:
|
|
8916
|
+
from: f,
|
|
8917
|
+
spenderAddress: _
|
|
8932
8918
|
});
|
|
8933
8919
|
});
|
|
8934
8920
|
B(this, I, async ({
|
|
8935
8921
|
assetValue: t,
|
|
8936
8922
|
memo: n,
|
|
8937
|
-
feeOptionKey: a =
|
|
8923
|
+
feeOptionKey: a = q.Fast
|
|
8938
8924
|
}) => {
|
|
8939
8925
|
const {
|
|
8940
8926
|
gas_rate: i,
|
|
8941
8927
|
router: r,
|
|
8942
|
-
address:
|
|
8943
|
-
} = await
|
|
8928
|
+
address: p
|
|
8929
|
+
} = await h(this, L).call(this, t.chain), u = (parseInt(i) || 0) * Et[a];
|
|
8944
8930
|
return this.deposit({
|
|
8945
8931
|
assetValue: t,
|
|
8946
|
-
recipient:
|
|
8932
|
+
recipient: p,
|
|
8947
8933
|
memo: n,
|
|
8948
8934
|
router: r,
|
|
8949
|
-
feeRate:
|
|
8935
|
+
feeRate: u
|
|
8950
8936
|
});
|
|
8951
8937
|
});
|
|
8952
|
-
B(this,
|
|
8938
|
+
B(this, Y, async ({ memo: t, assetValue: n }) => {
|
|
8953
8939
|
const a = await Rn(this.stagenet);
|
|
8954
8940
|
if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
|
|
8955
8941
|
throw new m("core_chain_halted");
|
|
8956
8942
|
return this.deposit({ assetValue: n, recipient: "", memo: t });
|
|
8957
8943
|
});
|
|
8958
|
-
B(this,
|
|
8944
|
+
B(this, Q, ({ assetValue: t, ...n }) => ({
|
|
8959
8945
|
...n,
|
|
8960
8946
|
memo: n.memo || "",
|
|
8961
8947
|
from: this.getAddress(t.chain),
|
|
@@ -8964,67 +8950,67 @@ class Xn {
|
|
|
8964
8950
|
this.stagenet = !!t;
|
|
8965
8951
|
}
|
|
8966
8952
|
}
|
|
8967
|
-
L = new WeakMap(),
|
|
8953
|
+
L = new WeakMap(), ie = new WeakMap(), K = new WeakMap(), I = new WeakMap(), Y = new WeakMap(), Q = new WeakMap();
|
|
8968
8954
|
export {
|
|
8969
|
-
|
|
8955
|
+
nt as AGG_SWAP,
|
|
8970
8956
|
Sn as ApiError,
|
|
8971
|
-
|
|
8957
|
+
X as ApiUrl,
|
|
8972
8958
|
x as AssetValue,
|
|
8973
8959
|
A as BaseDecimal,
|
|
8974
|
-
|
|
8960
|
+
$e as BigIntArithmetics,
|
|
8975
8961
|
s as Chain,
|
|
8976
8962
|
fe as ChainId,
|
|
8977
8963
|
Nn as ChainIdToChain,
|
|
8978
|
-
|
|
8979
|
-
|
|
8964
|
+
dt as ChainToChainId,
|
|
8965
|
+
De as ChainToExplorerUrl,
|
|
8980
8966
|
Bn as ChainToHexChainId,
|
|
8981
|
-
|
|
8982
|
-
|
|
8967
|
+
lt as ChainToRPC,
|
|
8968
|
+
pt as ContractAddress,
|
|
8983
8969
|
kn as CosmosChainList,
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8970
|
+
ut as DerivationPath,
|
|
8971
|
+
l as ERROR_CODE,
|
|
8972
|
+
st as ERROR_MODULE,
|
|
8973
|
+
Ce as ERROR_TYPE,
|
|
8974
|
+
yt as EVMChainList,
|
|
8975
|
+
mt as ErrorCode,
|
|
8976
|
+
q as FeeOption,
|
|
8977
|
+
b as MemoType,
|
|
8992
8978
|
Cn as NetworkDerivationPath,
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8979
|
+
tt as QuoteMode,
|
|
8980
|
+
ke as RPCUrl,
|
|
8981
|
+
_e as RequestClient,
|
|
8982
|
+
at as SWAP_IN,
|
|
8983
|
+
it as SWAP_OUT,
|
|
8998
8984
|
Xn as SwapKitCore,
|
|
8999
8985
|
m as SwapKitError,
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
8986
|
+
k as SwapKitNumber,
|
|
8987
|
+
ze as TCAvalancheDepositABI,
|
|
8988
|
+
et as TCBscDepositABI,
|
|
8989
|
+
Ze as TCEthereumVaultAbi,
|
|
9004
8990
|
Dn as TCSupportedChainList,
|
|
9005
8991
|
xn as UTXOChainList,
|
|
9006
|
-
|
|
8992
|
+
Tt as WalletOption,
|
|
9007
8993
|
Pn as assetFromString,
|
|
9008
8994
|
Gn as derivationPathToString,
|
|
9009
8995
|
In as erc20ABI,
|
|
9010
8996
|
Ln as filterAssets,
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
8997
|
+
re as formatBigIntToSafeValue,
|
|
8998
|
+
Et as gasFeeMultiplier,
|
|
8999
|
+
Rt as getAssetType,
|
|
9000
|
+
St as getAsymmetricAssetShare,
|
|
9015
9001
|
Vn as getAsymmetricAssetWithdrawAmount,
|
|
9016
|
-
|
|
9002
|
+
It as getAsymmetricRuneShare,
|
|
9017
9003
|
Hn as getAsymmetricRuneWithdrawAmount,
|
|
9018
|
-
|
|
9019
|
-
|
|
9004
|
+
gt as getCommonAssetInfo,
|
|
9005
|
+
Mt as getDecimal,
|
|
9020
9006
|
Un as getEstimatedPoolShare,
|
|
9021
9007
|
qn as getLiquiditySlippage,
|
|
9022
9008
|
C as getMemoFor,
|
|
9023
9009
|
de as getMinAmountByChain,
|
|
9024
|
-
|
|
9010
|
+
Ct as getSymmetricPoolShare,
|
|
9025
9011
|
Fn as getSymmetricWithdraw,
|
|
9026
9012
|
$n as getTHORNameCost,
|
|
9027
|
-
|
|
9013
|
+
Ne as isGasAsset,
|
|
9028
9014
|
Wn as validateTHORName
|
|
9029
9015
|
};
|
|
9030
9016
|
//# sourceMappingURL=index.es.js.map
|