@swapkit/core 1.0.0-rc.7 → 1.0.0-rc.71

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.es.js CHANGED
@@ -1,16 +1,16 @@
1
- var Me = Object.defineProperty;
2
- var Ce = (e, t, n) => t in e ? Me(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var m = (e, t, n) => (Ce(e, typeof t != "symbol" ? t + "" : t, n), n), Ne = (e, t, n) => {
1
+ var qe = Object.defineProperty;
2
+ var We = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var T = (e, t, n) => (We(e, typeof t != "symbol" ? t + "" : t, n), n), je = (e, t, n) => {
4
4
  if (!t.has(e))
5
5
  throw TypeError("Cannot " + n);
6
6
  };
7
- var A = (e, t, n) => (Ne(e, t, "read from private field"), n ? n.call(e) : t.get(e)), B = (e, t, n) => {
7
+ var f = (e, t, n) => (je(e, t, "read from private field"), n ? n.call(e) : t.get(e)), P = (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 xe = Object.defineProperty, De = (e, t, n) => t in e ? xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (De(e, typeof t != "symbol" ? t + "" : t, n), n);
13
- const Vt = [
12
+ var Ke = Object.defineProperty, Xe = (e, t, n) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (Xe(e, typeof t != "symbol" ? t + "" : t, n), n);
13
+ const fn = [
14
14
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
15
15
  {
16
16
  anonymous: !1,
@@ -108,7 +108,7 @@ const Vt = [
108
108
  stateMutability: "nonpayable",
109
109
  type: "function"
110
110
  }
111
- ], Be = [
111
+ ], Ye = [
112
112
  {
113
113
  inputs: [{ internalType: "address", name: "rune", type: "address" }],
114
114
  stateMutability: "nonpayable",
@@ -283,7 +283,7 @@ const Vt = [
283
283
  stateMutability: "view",
284
284
  type: "function"
285
285
  }
286
- ], Pe = [
286
+ ], Je = [
287
287
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
288
288
  {
289
289
  anonymous: !1,
@@ -447,7 +447,7 @@ const Vt = [
447
447
  stateMutability: "view",
448
448
  type: "function"
449
449
  }
450
- ], Ve = [
450
+ ], Qe = [
451
451
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
452
452
  {
453
453
  anonymous: !1,
@@ -600,13 +600,13 @@ const Vt = [
600
600
  type: "function"
601
601
  }
602
602
  ];
603
- var Le = /* @__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))(Le || {});
604
- const Ue = [
603
+ var ze = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e))(ze || {});
604
+ const Ze = [
605
605
  "ERC20-ERC20",
606
606
  "ARC20-ARC20",
607
607
  "BEP20-BEP20"
608
608
  /* BSC_TO_BSC */
609
- ], He = [
609
+ ], et = [
610
610
  "ERC20-TC",
611
611
  "ERC20-ARC20",
612
612
  "ERC20-BEP20",
@@ -617,95 +617,95 @@ const Ue = [
617
617
  "BEP20-ERC20",
618
618
  "BEP20-ARC20"
619
619
  /* BSC_TO_AVAX */
620
- ], $e = [
620
+ ], tt = [
621
621
  "TC-TC",
622
622
  "TC-ERC20",
623
623
  "TC-ARC20",
624
624
  "TC-BEP20"
625
625
  /* TC_SUPPORTED_TO_BSC */
626
626
  ];
627
- var be = /* @__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))(be || {}), ke = /* @__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))(ke || {}), d = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(d || {});
628
- const Fe = {
629
- [d.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
630
- [d.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
631
- [d.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
632
- [d.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
633
- [d.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
634
- [d.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
635
- [d.INVALID_TYPE_GENERIC]: "Invalid type",
636
- [d.INVALID_NUMBER_STRING]: "Invalid number string.",
637
- [d.INVALID_NUMBER]: "Invalid number.",
638
- [d.INVALID_BOOLEAN]: "Invalid boolean.",
639
- [d.INVALID_OBJECT]: "Invalid object.",
640
- [d.INVALID_ARRAY]: "Invalid array.",
641
- [d.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
642
- [d.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
643
- [d.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
644
- [d.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
645
- [d.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
646
- [d.AFF_BPS_INTEGER_0_100]: "affiliateBasisPoints must be an integer between 0 and 100.",
647
- [d.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
648
- [d.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
649
- [d.PREFERRED_PROFVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
650
- [d.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
651
- [d.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
652
- [d.INVALID_PROVIDER]: "Invalid provider {0}.",
653
- [d.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
654
- [d.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
655
- [d.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
656
- [d.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
657
- [d.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
658
- [d.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
659
- [d.INVALID_CHAIN]: "Invalid chain {0}.",
660
- [d.INVALID_ASSET]: "Invalid asset {0}.",
661
- [d.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
662
- [d.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
663
- [d.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
664
- [d.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
665
- [d.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
666
- [d.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
667
- [d.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
668
- [d.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
669
- [d.INVALID_QUOTE_MODE]: "Invalid quote mode.",
670
- [d.NO_QUOTES]: "No quotes to service this request.",
671
- [d.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
672
- [d.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
673
- [d.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
674
- [d.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
675
- [d.NO_PRICE]: "No price for asset {0}.",
676
- [d.PRICE_IS_STALE]: "Price is stale for asset {0}.",
677
- [d.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
678
- [d.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
679
- }, te = (e, t) => {
680
- let n = Fe[e];
627
+ var Ie = /* @__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))(Ie || {}), nt = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(nt || {}), y = /* @__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))(y || {});
628
+ const at = {
629
+ [y.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
630
+ [y.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
631
+ [y.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
632
+ [y.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
633
+ [y.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
634
+ [y.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
635
+ [y.INVALID_TYPE_GENERIC]: "Invalid type",
636
+ [y.INVALID_NUMBER_STRING]: "Invalid number string.",
637
+ [y.INVALID_NUMBER]: "Invalid number.",
638
+ [y.INVALID_BOOLEAN]: "Invalid boolean.",
639
+ [y.INVALID_OBJECT]: "Invalid object.",
640
+ [y.INVALID_ARRAY]: "Invalid array.",
641
+ [y.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
642
+ [y.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
643
+ [y.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
644
+ [y.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
645
+ [y.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
646
+ [y.AFF_BPS_INTEGER_MAX_500]: "affiliateBasisPoints must be an integer between 0 and 100.",
647
+ [y.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
648
+ [y.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
649
+ [y.PREFERRED_PROVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
650
+ [y.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
651
+ [y.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
652
+ [y.INVALID_PROVIDER]: "Invalid provider {0}.",
653
+ [y.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
654
+ [y.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
655
+ [y.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
656
+ [y.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
657
+ [y.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
658
+ [y.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
659
+ [y.INVALID_CHAIN]: "Invalid chain {0}.",
660
+ [y.INVALID_ASSET]: "Invalid asset {0}.",
661
+ [y.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
662
+ [y.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
663
+ [y.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
664
+ [y.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
665
+ [y.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
666
+ [y.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
667
+ [y.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
668
+ [y.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
669
+ [y.INVALID_QUOTE_MODE]: "Invalid quote mode.",
670
+ [y.NO_QUOTES]: "No quotes to service this request.",
671
+ [y.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
672
+ [y.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
673
+ [y.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
674
+ [y.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
675
+ [y.NO_PRICE]: "No price for asset {0}.",
676
+ [y.PRICE_IS_STALE]: "Price is stale for asset {0}.",
677
+ [y.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
678
+ [y.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
679
+ }, pe = (e, t) => {
680
+ let n = at[e];
681
681
  for (let a = 0; a < t.length; a++)
682
682
  n = n.replace(`{${a}}`, t[a]);
683
683
  return t.length === 0 ? n.replace("{0}", "") : n;
684
684
  };
685
- class Ae extends Error {
685
+ let bn = class ve extends Error {
686
686
  constructor({
687
687
  status: t,
688
688
  revision: n,
689
689
  module: a,
690
- code: i,
690
+ code: s,
691
691
  message: r,
692
- type: p,
693
- options: { shouldLog: o, shouldThrow: y, shouldTrace: T } = {
692
+ type: o,
693
+ options: { shouldLog: p, shouldThrow: d, shouldTrace: l } = {
694
694
  shouldLog: !0,
695
695
  shouldThrow: !0,
696
696
  shouldTrace: !0
697
697
  },
698
698
  displayMessageParams: u
699
699
  }) {
700
- const l = r || te(i, u || []) || "";
701
- super(l), C(this, "status"), C(this, "revision"), C(this, "type"), C(this, "module"), C(this, "code"), C(this, "message"), C(this, "display"), C(this, "stack"), C(this, "options"), C(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = l, this.display = te(i, u || []), this.code = i, this.type = p || be.UNHANDLED_ERROR, this.options = {
702
- shouldLog: o || !0,
703
- shouldTrace: T || !0,
704
- shouldThrow: y || !1
700
+ const m = r || pe(s, u || []) || "";
701
+ super(m), C(this, "status"), C(this, "revision"), C(this, "type"), C(this, "module"), C(this, "code"), C(this, "message"), C(this, "display"), C(this, "stack"), C(this, "options"), C(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = m, this.display = pe(s, u || []), this.code = s, this.type = o || Ie.UNHANDLED_ERROR, this.options = {
702
+ shouldLog: p || !0,
703
+ shouldTrace: l || !0,
704
+ shouldThrow: d || !1
705
705
  }, this.displayMessageParams = u || [], this.options.shouldTrace && Error.captureStackTrace(this);
706
706
  }
707
707
  static fromErrorInfo(t) {
708
- return new Ae(t);
708
+ return new ve(t);
709
709
  }
710
710
  toErrorInfo() {
711
711
  return { ...this, identifier: this.identifier };
@@ -714,7 +714,7 @@ class Ae extends Error {
714
714
  return `${this.revision}-${this.type || "NO_TYPE"}-${this.module}-${this.code}`;
715
715
  }
716
716
  get displayMessage() {
717
- return te(this.code, this.displayMessageParams || []);
717
+ return pe(this.code, this.displayMessageParams || []);
718
718
  }
719
719
  handle() {
720
720
  const t = `[${this.identifier}]: ${this.message}`;
@@ -723,9 +723,9 @@ class Ae extends Error {
723
723
  throw Error(t, { cause: this.stack });
724
724
  return this.toErrorInfo();
725
725
  }
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 || {}), Ge = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(Ge || {}), We = /* @__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))(We || {});
728
- const Lt = {
726
+ };
727
+ var i = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dogecoin = "DOGE", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(i || {}), st = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(st || {}), it = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0", e.AVAX = "m/44'/60'/0'/0", e.BCH = "m/44'/145'/0'/0", e.BNB = "m/44'/714'/0'/0", e.BSC = "m/44'/60'/0'/0", e.BTC = "m/84'/0'/0'/0", e.DOGE = "m/44'/3'/0'/0", e.ETH = "m/44'/60'/0'/0", e.GAIA = "m/44'/118'/0'/0", e.KUJI = "m/44'/118'/0'/0", e.LTC = "m/84'/2'/0'/0", e.MATIC = "m/44'/60'/0'/0", e.MAYA = "m/44'/931'/0'/0", e.OP = "m/44'/60'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(it || {});
728
+ const wn = {
729
729
  ARB: [44, 60, 0, 0, 0],
730
730
  AVAX: [44, 60, 0, 0, 0],
731
731
  BCH: [44, 145, 0, 0, 0],
@@ -742,8 +742,8 @@ const Lt = {
742
742
  OP: [44, 60, 0, 0, 0],
743
743
  THOR: [44, 931, 0, 0, 0]
744
744
  };
745
- var E = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DOGE = 8] = "DOGE", e[e.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))(E || {});
746
- const Ut = [
745
+ var b = /* @__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))(b || {});
746
+ const rt = [
747
747
  "ETH",
748
748
  "AVAX",
749
749
  "BSC",
@@ -751,38 +751,50 @@ const Ut = [
751
751
  "OP",
752
752
  "MATIC"
753
753
  /* Polygon */
754
- ], Ht = [
754
+ ], An = [
755
755
  "BTC",
756
756
  "BCH",
757
757
  "DOGE",
758
758
  "LTC"
759
759
  /* Litecoin */
760
- ], $t = [
760
+ ], En = [
761
761
  "GAIA",
762
762
  "THOR",
763
763
  "BNB"
764
764
  /* Binance */
765
+ ], Rn = [
766
+ "AVAX",
767
+ "BNB",
768
+ "BSC",
769
+ "BTC",
770
+ "BCH",
771
+ "GAIA",
772
+ "DOGE",
773
+ "ETH",
774
+ "LTC",
775
+ "THOR"
776
+ /* THORChain */
765
777
  ];
766
- var le = /* @__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))(le || {}), we = /* @__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))(we || {}), W = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(W || {});
767
- const Z = Object.values(s), qe = Object.keys(s), ce = Z.reduce(
778
+ var _e = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(_e || {}), Ce = /* @__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))(Ce || {}), j = /* @__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))(j || {});
779
+ const ie = Object.values(i), ot = Object.keys(i), fe = ie.reduce(
768
780
  (e, t) => {
769
- const n = qe.find((a) => s[a] === t);
781
+ const n = ot.find((a) => i[a] === t);
770
782
  return n && (e[t] = n), e;
771
783
  },
772
784
  {}
773
- ), Ke = Z.reduce(
774
- (e, t) => (e[t] = le[ce[t]], e),
785
+ ), pt = ie.reduce(
786
+ (e, t) => (e[t] = _e[fe[t]], e),
775
787
  {}
776
- ), Ye = Z.reduce(
777
- (e, t) => (e[t] = we[ce[t]], e),
788
+ ), dt = ie.reduce(
789
+ (e, t) => (e[t] = Ce[fe[t]], e),
778
790
  {}
779
- ), kt = Z.reduce(
791
+ ), gn = ie.reduce(
780
792
  (e, t) => {
781
- const n = `${ce[t]}Hex`;
782
- return e[t] = le[n], e;
793
+ const n = `${fe[t]}Hex`;
794
+ return e[t] = _e[n], e;
783
795
  },
784
796
  {}
785
- ), Ft = {
797
+ ), On = {
786
798
  "0xa4b1": "ARB",
787
799
  42161: "ARB",
788
800
  "0xa86a": "AVAX",
@@ -807,332 +819,709 @@ const Z = Object.values(s), qe = Object.keys(s), ce = Z.reduce(
807
819
  "thorchain-stagenet-v2": "THOR",
808
820
  "thorchain-mainnet-v1": "THOR"
809
821
  /* THORChain */
810
- }, Ee = {
822
+ }, Me = {
811
823
  ARB: "https://arbiscan.io",
812
824
  AVAX: "https://snowtrace.io",
813
825
  BSC: "https://bscscan.com",
814
826
  BNB: "https://explorer.binance.org",
815
- BCH: "https://www.blockchain.com/bch",
816
- BTC: "https://blockstream.info",
827
+ BCH: "https://www.blockchair.com/bitcoin-cash",
828
+ BTC: "https://blockchair.com/bitcoin",
817
829
  GAIA: "https://cosmos.bigdipper.live",
818
830
  DOGE: "https://blockchair.com/dogecoin",
819
831
  KUJI: "https://finder.kujira.network/kaiyo-1",
820
832
  ETH: "https://etherscan.io",
821
- LTC: "https://ltc.bitaps.com",
833
+ LTC: "https://blockchair.com/litecoin",
822
834
  MAYA: "https://www.mayascan.org",
823
835
  OP: "https://optimistic.etherscan.io",
824
836
  MATIC: "https://polygonscan.com",
825
- THOR: "https://viewblock.io/thorchain"
837
+ THOR: "https://runescan.io"
826
838
  };
827
- var Xe = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(Xe || {}), f = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(f || {}), k = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(k || {}), je = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(je || {}), Qe = Object.defineProperty, Je = (e, t, n) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, N = (e, t, n) => (Je(e, typeof t != "symbol" ? t + "" : t, n), n), ze = (e, t, n) => {
839
+ var ut = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(ut || {}), h = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(h || {}), F = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(F || {}), lt = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.OKX_MOBILE = "OKX_MOBILE", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(lt || {}), yt = Object.defineProperty, ct = (e, t, n) => t in e ? yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, I = (e, t, n) => (ct(e, typeof t != "symbol" ? t + "" : t, n), n), mt = (e, t, n) => {
828
840
  if (!t.has(e))
829
841
  throw TypeError("Cannot " + n);
830
- }, V = (e, t, n) => {
842
+ }, H = (e, t, n) => {
831
843
  if (t.has(e))
832
844
  throw TypeError("Cannot add the same private member more than once");
833
845
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
834
- }, g = (e, t, n) => (ze(e, t, "access private method"), n);
835
- const Gt = (e) => {
836
- if (e < 0)
837
- throw new Error("Invalid number of year");
838
- return 10 + e;
839
- }, Wt = (e) => {
840
- if (e.length > 30)
841
- return !1;
842
- const t = /^[a-zA-Z0-9+_-]+$/g;
843
- return !!e.match(t);
844
- }, qt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Re = async (e, t) => {
845
- try {
846
- const n = Object.entries(t || {}).reduce(
847
- (a, [i, r]) => (r && (a[i] = r), a),
848
- {}
849
- );
850
- return (await fetch(
851
- `${e}${t ? `?${new URLSearchParams(n).toString()}` : ""}`,
852
- { method: "GET", mode: "cors", credentials: "omit", referrer: "https://sk.thorswap.net" }
853
- )).json();
854
- } catch (n) {
855
- return console.error(n), {};
856
- }
857
- }, Ze = async (e, t, n, a = !1) => {
858
- try {
859
- const i = await fetch(`${e}`, {
860
- body: t,
861
- headers: n,
862
- method: "POST",
863
- referrer: "https://sk.thorswap.net"
864
- });
865
- return a ? i.text() : i.json();
866
- } catch {
867
- return {};
868
- }
869
- }, et = "0x313ce567", Oe = async ({ chain: e, to: t }) => {
846
+ }, R = (e, t, n) => (mt(e, t, "access private method"), n);
847
+ const Tt = "0x313ce567", Ne = async ({ chain: e, to: t }) => {
870
848
  try {
871
- const n = await Ze(
872
- Ye[e],
873
- JSON.stringify({
874
- method: "eth_call",
875
- params: [{ to: t.toLowerCase(), data: et }, "latest"],
849
+ const { result: n } = await we.post(dt[e], {
850
+ headers: {
851
+ accept: "*/*",
852
+ "content-type": "application/json",
853
+ "cache-control": "no-cache"
854
+ },
855
+ body: JSON.stringify({
876
856
  id: 44,
877
- jsonrpc: "2.0"
878
- }),
879
- { accept: "*/*", "cache-control": "no-cache", "content-type": "application/json" },
880
- !0
881
- ), { result: a } = JSON.parse(n);
882
- return parseInt(BigInt(a).toString());
857
+ jsonrpc: "2.0",
858
+ method: "eth_call",
859
+ params: [{ to: t.toLowerCase(), data: Tt }, "latest"]
860
+ })
861
+ });
862
+ return parseInt(BigInt(n).toString());
883
863
  } catch (n) {
884
- return console.error(n), E[e];
864
+ return console.error(n), b[e];
885
865
  }
886
- }, tt = async (e) => {
887
- if (e === s.Ethereum)
888
- return E.ETH;
866
+ }, ht = async (e) => {
867
+ if (e === i.Ethereum)
868
+ return b.ETH;
889
869
  const [, t] = e.split("-");
890
- return t != null && t.startsWith("0x") ? Oe({ chain: s.Ethereum, to: t }) : E.ETH;
891
- }, nt = async (e) => {
870
+ return t != null && t.startsWith("0x") ? Ne({ chain: i.Ethereum, to: t }) : b.ETH;
871
+ }, _t = async (e) => {
892
872
  const [, t] = e.split("-");
893
- return t != null && t.startsWith("0x") ? Oe({ chain: s.Avalanche, to: t.toLowerCase() }) : E.AVAX;
894
- }, at = async (e) => (e === s.BinanceSmartChain, E.BSC), Ie = async ({ chain: e, symbol: t }) => {
873
+ return t != null && t.startsWith("0x") ? Ne({ chain: i.Avalanche, to: t.toLowerCase() }) : b.AVAX;
874
+ }, ft = async (e) => (e === i.BinanceSmartChain, b.BSC), bt = async ({ chain: e, symbol: t }) => {
895
875
  switch (e) {
896
- case s.Ethereum:
897
- return tt(t);
898
- case s.Avalanche:
899
- return nt(t);
900
- case s.BinanceSmartChain:
901
- return at(t);
876
+ case i.Ethereum:
877
+ return ht(t);
878
+ case i.Avalanche:
879
+ return _t(t);
880
+ case i.BinanceSmartChain:
881
+ return ft(t);
902
882
  default:
903
- return E[e];
883
+ return b[e];
904
884
  }
905
- }, st = {
906
- [k.Average]: 1.2,
907
- [k.Fast]: 1.5,
908
- [k.Fastest]: 2
909
- }, it = ({ chain: e, symbol: t }) => {
885
+ }, wt = {
886
+ [F.Average]: 1.2,
887
+ [F.Fast]: 1.5,
888
+ [F.Fastest]: 2
889
+ }, xe = ({ chain: e, symbol: t }) => {
910
890
  switch (e) {
911
- case s.Bitcoin:
912
- case s.BitcoinCash:
913
- case s.Litecoin:
914
- case s.Dogecoin:
915
- case s.Binance:
916
- case s.Ethereum:
917
- case s.Avalanche:
891
+ case i.Bitcoin:
892
+ case i.BitcoinCash:
893
+ case i.Litecoin:
894
+ case i.Dogecoin:
895
+ case i.Binance:
896
+ case i.Ethereum:
897
+ case i.Avalanche:
918
898
  return t === e;
919
- case s.Arbitrum:
920
- case s.Optimism:
899
+ case i.Arbitrum:
900
+ case i.Optimism:
921
901
  return t === "ETH";
922
- case s.Maya:
902
+ case i.Maya:
923
903
  return t === "CACAO";
924
- case s.Kujira:
904
+ case i.Kujira:
925
905
  return t === "KUJI";
926
- case s.Cosmos:
906
+ case i.Cosmos:
927
907
  return t === "ATOM";
928
- case s.Polygon:
908
+ case i.Polygon:
929
909
  return t === "MATIC";
930
- case s.BinanceSmartChain:
910
+ case i.BinanceSmartChain:
931
911
  return t === "BNB";
932
- case s.THORChain:
912
+ case i.THORChain:
933
913
  return t === "RUNE";
934
914
  }
935
- }, rt = (e) => {
915
+ }, At = (e) => {
936
916
  switch (e) {
937
917
  case "ETH.THOR":
938
918
  return { identifier: "ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044", decimal: 18 };
939
919
  case "ETH.vTHOR":
940
920
  return { identifier: "ETH.vTHOR-0x815c23eca83261b6ec689b60cc4a58b54bc24d8d", decimal: 18 };
941
- case s.Cosmos:
942
- return { identifier: "GAIA.ATOM", decimal: E[e] };
943
- case s.THORChain:
944
- return { identifier: "THOR.RUNE", decimal: E[e] };
945
- case s.BinanceSmartChain:
946
- return { identifier: "BSC.BNB", decimal: E[e] };
947
- case s.Maya:
948
- return { identifier: "MAYA.CACAO", decimal: E.MAYA };
921
+ case i.Cosmos:
922
+ return { identifier: "GAIA.ATOM", decimal: b[e] };
923
+ case i.THORChain:
924
+ return { identifier: "THOR.RUNE", decimal: b[e] };
925
+ case i.BinanceSmartChain:
926
+ return { identifier: "BSC.BNB", decimal: b[e] };
927
+ case i.Maya:
928
+ return { identifier: "MAYA.CACAO", decimal: b.MAYA };
949
929
  case "MAYA.MAYA":
950
930
  return { identifier: "MAYA.MAYA", decimal: 4 };
951
- case s.Kujira:
952
- case s.Arbitrum:
953
- case s.Optimism:
954
- case s.BitcoinCash:
955
- case s.Litecoin:
956
- case s.Dogecoin:
957
- case s.Binance:
958
- case s.Avalanche:
959
- case s.Polygon:
960
- case s.Bitcoin:
961
- case s.Ethereum:
962
- return { identifier: `${e}.${e}`, decimal: E[e] };
963
- }
964
- }, pt = ({ chain: e, symbol: t }) => {
931
+ case i.Kujira:
932
+ case i.Arbitrum:
933
+ case i.Optimism:
934
+ case i.BitcoinCash:
935
+ case i.Litecoin:
936
+ case i.Dogecoin:
937
+ case i.Binance:
938
+ case i.Avalanche:
939
+ case i.Polygon:
940
+ case i.Bitcoin:
941
+ case i.Ethereum:
942
+ return { identifier: `${e}.${e}`, decimal: b[e] };
943
+ }
944
+ }, Et = ({ chain: e, symbol: t }) => {
965
945
  if (t.includes("/"))
966
946
  return "Synth";
967
947
  switch (e) {
968
- case s.Bitcoin:
969
- case s.BitcoinCash:
970
- case s.Dogecoin:
971
- case s.Litecoin:
972
- case s.Maya:
973
- case s.THORChain:
948
+ case i.Bitcoin:
949
+ case i.BitcoinCash:
950
+ case i.Dogecoin:
951
+ case i.Litecoin:
952
+ case i.Maya:
953
+ case i.THORChain:
974
954
  return "Native";
975
- case s.Cosmos:
976
- return t === "ATOM" ? "Native" : "GAIA";
977
- case s.Kujira:
978
- return t === "KUJI" ? "Native" : "KUJI";
979
- case s.Binance:
980
- return t === s.Binance ? "Native" : "BEP2";
981
- case s.BinanceSmartChain:
982
- return t === s.Binance ? "Native" : "BEP20";
983
- case s.Ethereum:
984
- return t === s.Ethereum ? "Native" : "ERC20";
985
- case s.Avalanche:
986
- return t === s.Avalanche ? "Native" : "AVAX";
987
- case s.Polygon:
988
- return t === s.Polygon ? "Native" : "POLYGON";
989
- case s.Arbitrum:
990
- return [s.Ethereum, s.Arbitrum].includes(t) ? "Native" : "ARBITRUM";
991
- case s.Optimism:
992
- return [s.Ethereum, s.Optimism].includes(t) ? "Native" : "OPTIMISM";
993
- }
994
- }, Kt = (e) => {
955
+ case i.Cosmos:
956
+ return t === "ATOM" ? "Native" : i.Cosmos;
957
+ case i.Kujira:
958
+ return t === i.Kujira ? "Native" : i.Kujira;
959
+ case i.Binance:
960
+ return t === i.Binance ? "Native" : "BEP2";
961
+ case i.BinanceSmartChain:
962
+ return t === i.Binance ? "Native" : "BEP20";
963
+ case i.Ethereum:
964
+ return t === i.Ethereum ? "Native" : "ERC20";
965
+ case i.Avalanche:
966
+ return t === i.Avalanche ? "Native" : i.Avalanche;
967
+ case i.Polygon:
968
+ return t === i.Polygon ? "Native" : "POLYGON";
969
+ case i.Arbitrum:
970
+ return [i.Ethereum, i.Arbitrum].includes(t) ? "Native" : "ARBITRUM";
971
+ case i.Optimism:
972
+ return [i.Ethereum, i.Optimism].includes(t) ? "Native" : "OPTIMISM";
973
+ }
974
+ }, Sn = (e) => {
995
975
  var t;
996
- const [n, ...a] = e.split("."), i = e.includes("/"), r = a.join("."), p = (t = r == null ? void 0 : r.split("-")) == null ? void 0 : t[0];
997
- return { chain: n, symbol: r, ticker: p, synth: i };
998
- }, ot = ({
976
+ const [n, ...a] = e.split("."), s = e.includes("/"), r = a.join("."), o = (t = r == null ? void 0 : r.split("-")) == null ? void 0 : t[0];
977
+ return { chain: n, symbol: r, ticker: o, synth: s };
978
+ }, Rt = new RegExp(
979
+ /(.)\1{6}|\.ORG|\.NET|\.FINANCE|\.COM|WWW|HTTP|\\\\|\/\/|[\s$%:[\]]/,
980
+ "gmi"
981
+ ), gt = (e) => {
982
+ const [t, n] = e.split(".");
983
+ if (!rt.includes(t))
984
+ return !0;
985
+ const [, a] = n.split("-");
986
+ return xe({ chain: t, symbol: n }) || !!a;
987
+ }, In = (e) => e.filter((t) => {
988
+ const n = `${t.chain}.${t.symbol}`;
989
+ return !Rt.test(n) && gt(n) && t.value !== "0";
990
+ });
991
+ function Ot({
999
992
  liquidityUnits: e,
1000
993
  poolUnits: t,
1001
994
  runeDepth: n
1002
- }) => {
1003
- const a = w(e), i = w(t), r = w(n), p = a.mul(r), o = i.mul(i).mul(2), y = i.mul(a).mul(2), T = a.mul(a), u = i.mul(i).mul(i);
1004
- return p.mul(o.sub(y).add(T)).div(u);
1005
- }, dt = ({
995
+ }) {
996
+ const a = g(e), s = g(t), r = g(n), o = a.mul(r), p = s.mul(s).mul(2), d = s.mul(a).mul(2), l = a.mul(a), u = s.mul(s).mul(s);
997
+ return o.mul(p.sub(d).add(l)).div(u);
998
+ }
999
+ function St({
1006
1000
  liquidityUnits: e,
1007
1001
  poolUnits: t,
1008
1002
  assetDepth: n
1009
- }) => {
1010
- const a = w(e), i = w(t), r = w(n), p = a.mul(r), o = i.mul(i).mul(2), y = i.mul(a).mul(2), T = a.mul(a), u = p.mul(o.sub(y).add(T)), l = i.mul(i).mul(i);
1011
- return u.div(l);
1012
- }, Yt = ({
1003
+ }) {
1004
+ const a = g(e), s = g(t), r = g(n), o = a.mul(r), p = s.mul(s).mul(2), d = s.mul(a).mul(2), l = a.mul(a), u = o.mul(p.sub(d).add(l)), m = s.mul(s).mul(s);
1005
+ return u.div(m);
1006
+ }
1007
+ function vn({
1013
1008
  percent: e,
1014
1009
  runeDepth: t,
1015
1010
  liquidityUnits: n,
1016
1011
  poolUnits: a
1017
- }) => ot({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), Xt = ({
1012
+ }) {
1013
+ return Ot({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
1014
+ }
1015
+ function Cn({
1018
1016
  percent: e,
1019
1017
  assetDepth: t,
1020
1018
  liquidityUnits: n,
1021
1019
  poolUnits: a
1022
- }) => dt({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), w = (e) => new ye({ value: e, decimal: E.THOR }), ut = ({
1020
+ }) {
1021
+ return St({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e);
1022
+ }
1023
+ function g(e) {
1024
+ return x.fromBigInt(BigInt(e), b.THOR);
1025
+ }
1026
+ function It({
1023
1027
  liquidityUnits: e,
1024
1028
  poolUnits: t,
1025
1029
  runeDepth: n,
1026
1030
  assetDepth: a
1027
- }) => ({
1028
- assetAmount: w(a).mul(e).div(t),
1029
- runeAmount: w(n).mul(e).div(t)
1030
- }), jt = ({
1031
+ }) {
1032
+ return {
1033
+ assetAmount: g(a).mul(e).div(t),
1034
+ runeAmount: g(n).mul(e).div(t)
1035
+ };
1036
+ }
1037
+ function Mn({
1031
1038
  liquidityUnits: e,
1032
1039
  poolUnits: t,
1033
1040
  runeDepth: n,
1034
1041
  assetDepth: a,
1035
- percent: i
1036
- }) => Object.fromEntries(
1037
- Object.entries(ut({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
1038
- ([r, p]) => [r, p.mul(i)]
1039
- )
1040
- ), Qt = ({
1042
+ percent: s
1043
+ }) {
1044
+ return Object.fromEntries(
1045
+ Object.entries(It({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
1046
+ ([r, o]) => [r, o.mul(s)]
1047
+ )
1048
+ );
1049
+ }
1050
+ function Nn({
1041
1051
  runeDepth: e,
1042
1052
  poolUnits: t,
1043
1053
  assetDepth: n,
1044
1054
  liquidityUnits: a,
1045
- runeAmount: i,
1055
+ runeAmount: s,
1046
1056
  assetAmount: r
1047
- }) => {
1048
- const p = w(e), o = w(n), y = w(t), T = w(i), u = w(r), l = T.mul(o), h = u.mul(p), _ = T.mul(u), R = p.mul(o), O = y.mul(l.add(h.add(_.mul(2)))), S = l.add(h.add(R.mul(2))), I = O.div(S), b = w(a).add(I);
1049
- if (I.baseValueNumber === 0)
1050
- return b.div(y).baseValueNumber;
1051
- const M = y.add(b);
1052
- return b.div(M).baseValueNumber;
1053
- }, Jt = ({
1057
+ }) {
1058
+ const o = new x({ value: e, decimal: 8 }), p = new x({ value: n, decimal: 8 }), d = new x({ value: t, decimal: 8 }), l = new x({ value: s, decimal: 8 }), u = new x({ value: r, decimal: 8 }), m = l.mul(p), _ = u.mul(o), w = l.mul(u), A = o.mul(p), E = d.mul(m.add(_.add(w.mul(2)))), O = m.add(_.add(A.mul(2))), S = E.div(O), D = g(a).add(S);
1059
+ if (S.getBaseValue("number") === 0)
1060
+ return D.div(d).getBaseValue("number");
1061
+ const oe = d.add(D);
1062
+ return D.div(oe).getBaseValue("number");
1063
+ }
1064
+ function xn({
1054
1065
  runeAmount: e,
1055
1066
  assetAmount: t,
1056
1067
  runeDepth: n,
1057
1068
  assetDepth: a
1058
- }) => {
1059
- const i = w(n), r = w(a), p = w(t), o = w(e), y = p.mul(i).sub(r.mul(o)), T = r.mul(o).add(i.mul(r));
1060
- return Math.abs(y.div(T).baseValueNumber);
1061
- }, yt = ({
1062
- symbol: e,
1063
- ticker: t,
1064
- chain: n
1065
- }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, D = (e, t) => {
1069
+ }) {
1070
+ if (e === "0" || t === "0" || n === "0" || a === "0")
1071
+ return 0;
1072
+ const s = g(n), r = g(a), o = g(t), p = g(e), d = o.mul(s).sub(r.mul(p)), l = r.mul(p).add(s.mul(r));
1073
+ return Math.abs(d.div(l).getBaseValue("number"));
1074
+ }
1075
+ const M = (e, t) => {
1066
1076
  switch (e) {
1067
- case f.LEAVE:
1068
- case f.BOND: {
1077
+ case h.LEAVE:
1078
+ case h.BOND: {
1069
1079
  const { address: n } = t;
1070
1080
  return `${e}:${n}`;
1071
1081
  }
1072
- case f.UNBOND: {
1082
+ case h.UNBOND: {
1073
1083
  const { address: n, unbondAmount: a } = t;
1074
1084
  return `${e}:${n}:${a * 10 ** 8}`;
1075
1085
  }
1076
- case f.THORNAME_REGISTER: {
1077
- const { name: n, chain: a, address: i, owner: r } = t;
1078
- return `${e}:${n}:${a}:${i}${r ? `:${r}` : ""}`;
1086
+ case h.THORNAME_REGISTER: {
1087
+ const { name: n, chain: a, address: s, owner: r } = t;
1088
+ return `${e}:${n}:${a}:${s}${r ? `:${r}` : ""}`;
1079
1089
  }
1080
- case f.DEPOSIT: {
1081
- const { chain: n, symbol: a, address: i, singleSide: r } = t;
1082
- return r ? `${e}:${n}/${a}::t:0` : `${e}:${n}.${a}:${i || ""}:t:0`;
1090
+ case h.DEPOSIT: {
1091
+ const { chain: n, symbol: a, address: s, singleSide: r } = t;
1092
+ return r ? `${e}:${n}/${a}::t:0` : `${e}:${((o, p) => {
1093
+ switch (o) {
1094
+ case i.Litecoin:
1095
+ return "l";
1096
+ case i.Dogecoin:
1097
+ return "d";
1098
+ case i.BitcoinCash:
1099
+ return "c";
1100
+ default:
1101
+ return `${o}.${p}`;
1102
+ }
1103
+ })(n, a)}:${s || ""}:t:0`;
1083
1104
  }
1084
- case f.WITHDRAW: {
1085
- const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: o } = t, y = !o && p ? `:${p}` : "", T = yt({ chain: n, symbol: i, ticker: a });
1086
- return `${e}:${n}${o ? "/" : "."}${T}:${r}${y}`;
1105
+ case h.WITHDRAW: {
1106
+ const { chain: n, ticker: a, symbol: s, basisPoints: r, targetAssetString: o, singleSide: p } = t, d = n === "ETH" && a !== "ETH" ? `${a}-${s.slice(-3)}` : s, l = !p && o ? `:${o}` : "";
1107
+ return `${e}:${n}${p ? "/" : "."}${d}:${r}${l}`;
1087
1108
  }
1088
- case f.OPEN_LOAN:
1089
- case f.CLOSE_LOAN: {
1109
+ case h.OPEN_LOAN:
1110
+ case h.CLOSE_LOAN: {
1090
1111
  const { asset: n, address: a } = t;
1091
1112
  return `${e}:${n}:${a}`;
1092
1113
  }
1093
1114
  default:
1094
1115
  return "";
1095
1116
  }
1096
- }, me = Object.values(s), lt = (e = "") => {
1117
+ };
1118
+ function Dn(e) {
1119
+ if (e < 0)
1120
+ throw new Error("Invalid number of year");
1121
+ return 10 + e;
1122
+ }
1123
+ function Pn(e) {
1124
+ if (e.length > 30)
1125
+ return !1;
1126
+ const t = /^[a-zA-Z0-9+_-]+$/g;
1127
+ return !!e.match(t);
1128
+ }
1129
+ function Bn([e, t, n, a, s]) {
1130
+ return `${e}'/${t}'/${n}'/${a}${typeof s != "number" ? "" : `/${s}`}`;
1131
+ }
1132
+ class Ae extends Error {
1133
+ constructor(t, n, a) {
1134
+ const s = t.status || t.status === 0 ? t.status : "", r = t.statusText || "", o = `${s} ${r}`.trim(), p = o ? `status code ${o}` : "an unknown error";
1135
+ super(`Request failed with ${p}`), Object.defineProperty(this, "response", {
1136
+ enumerable: !0,
1137
+ configurable: !0,
1138
+ writable: !0,
1139
+ value: void 0
1140
+ }), Object.defineProperty(this, "request", {
1141
+ enumerable: !0,
1142
+ configurable: !0,
1143
+ writable: !0,
1144
+ value: void 0
1145
+ }), Object.defineProperty(this, "options", {
1146
+ enumerable: !0,
1147
+ configurable: !0,
1148
+ writable: !0,
1149
+ value: void 0
1150
+ }), this.name = "HTTPError", this.response = t, this.request = n, this.options = a;
1151
+ }
1152
+ }
1153
+ class De extends Error {
1154
+ constructor(t) {
1155
+ super("Request timed out"), Object.defineProperty(this, "request", {
1156
+ enumerable: !0,
1157
+ configurable: !0,
1158
+ writable: !0,
1159
+ value: void 0
1160
+ }), this.name = "TimeoutError", this.request = t;
1161
+ }
1162
+ }
1163
+ const z = (e) => e !== null && typeof e == "object", Q = (...e) => {
1164
+ for (const t of e)
1165
+ if ((!z(t) || Array.isArray(t)) && t !== void 0)
1166
+ throw new TypeError("The `options` argument must be an object");
1167
+ return be({}, ...e);
1168
+ }, Pe = (e = {}, t = {}) => {
1169
+ const n = new globalThis.Headers(e), a = t instanceof globalThis.Headers, s = new globalThis.Headers(t);
1170
+ for (const [r, o] of s.entries())
1171
+ a && o === "undefined" || o === void 0 ? n.delete(r) : n.set(r, o);
1172
+ return n;
1173
+ }, be = (...e) => {
1174
+ let t = {}, n = {};
1175
+ for (const a of e)
1176
+ if (Array.isArray(a))
1177
+ Array.isArray(t) || (t = []), t = [...t, ...a];
1178
+ else if (z(a)) {
1179
+ for (let [s, r] of Object.entries(a))
1180
+ z(r) && s in t && (r = be(t[s], r)), t = { ...t, [s]: r };
1181
+ z(a.headers) && (n = Pe(n, a.headers), t.headers = n);
1182
+ }
1183
+ return t;
1184
+ }, vt = (() => {
1185
+ let e = !1, t = !1;
1186
+ const n = typeof globalThis.ReadableStream == "function", a = typeof globalThis.Request == "function";
1187
+ return n && a && (t = new globalThis.Request("https://empty.invalid", {
1188
+ body: new globalThis.ReadableStream(),
1189
+ method: "POST",
1190
+ // @ts-expect-error - Types are outdated.
1191
+ get duplex() {
1192
+ return e = !0, "half";
1193
+ }
1194
+ }).headers.has("Content-Type")), e && !t;
1195
+ })(), Ct = typeof globalThis.AbortController == "function", Mt = typeof globalThis.ReadableStream == "function", Nt = typeof globalThis.FormData == "function", Be = ["get", "post", "put", "patch", "head", "delete"], xt = {
1196
+ json: "application/json",
1197
+ text: "text/*",
1198
+ formData: "multipart/form-data",
1199
+ arrayBuffer: "*/*",
1200
+ blob: "*/*"
1201
+ }, de = 2147483647, Le = Symbol("stop"), Dt = {
1202
+ json: !0,
1203
+ parseJson: !0,
1204
+ searchParams: !0,
1205
+ prefixUrl: !0,
1206
+ retry: !0,
1207
+ timeout: !0,
1208
+ hooks: !0,
1209
+ throwHttpErrors: !0,
1210
+ onDownloadProgress: !0,
1211
+ fetch: !0
1212
+ }, Pt = {
1213
+ method: !0,
1214
+ headers: !0,
1215
+ body: !0,
1216
+ mode: !0,
1217
+ credentials: !0,
1218
+ cache: !0,
1219
+ redirect: !0,
1220
+ referrer: !0,
1221
+ referrerPolicy: !0,
1222
+ integrity: !0,
1223
+ keepalive: !0,
1224
+ signal: !0,
1225
+ window: !0,
1226
+ dispatcher: !0,
1227
+ duplex: !0
1228
+ }, Bt = (e) => Be.includes(e) ? e.toUpperCase() : e, Lt = ["get", "put", "head", "delete", "options", "trace"], Vt = [408, 413, 429, 500, 502, 503, 504], Ve = [413, 429, 503], Ee = {
1229
+ limit: 2,
1230
+ methods: Lt,
1231
+ statusCodes: Vt,
1232
+ afterStatusCodes: Ve,
1233
+ maxRetryAfter: Number.POSITIVE_INFINITY,
1234
+ backoffLimit: Number.POSITIVE_INFINITY,
1235
+ delay: (e) => 0.3 * 2 ** (e - 1) * 1e3
1236
+ }, Ut = (e = {}) => {
1237
+ if (typeof e == "number")
1238
+ return {
1239
+ ...Ee,
1240
+ limit: e
1241
+ };
1242
+ if (e.methods && !Array.isArray(e.methods))
1243
+ throw new Error("retry.methods must be an array");
1244
+ if (e.statusCodes && !Array.isArray(e.statusCodes))
1245
+ throw new Error("retry.statusCodes must be an array");
1246
+ return {
1247
+ ...Ee,
1248
+ ...e,
1249
+ afterStatusCodes: Ve
1250
+ };
1251
+ };
1252
+ async function $t(e, t, n, a) {
1253
+ return new Promise((s, r) => {
1254
+ const o = setTimeout(() => {
1255
+ n && n.abort(), r(new De(e));
1256
+ }, a.timeout);
1257
+ a.fetch(e, t).then(s).catch(r).then(() => {
1258
+ clearTimeout(o);
1259
+ });
1260
+ });
1261
+ }
1262
+ async function Ht(e, { signal: t }) {
1263
+ return new Promise((n, a) => {
1264
+ t && (t.throwIfAborted(), t.addEventListener("abort", s, { once: !0 }));
1265
+ function s() {
1266
+ clearTimeout(r), a(t.reason);
1267
+ }
1268
+ const r = setTimeout(() => {
1269
+ t == null || t.removeEventListener("abort", s), n();
1270
+ }, e);
1271
+ });
1272
+ }
1273
+ const kt = (e, t) => {
1274
+ const n = {};
1275
+ for (const a in t)
1276
+ !(a in Pt) && !(a in Dt) && !(a in e) && (n[a] = t[a]);
1277
+ return n;
1278
+ };
1279
+ class te {
1280
+ static create(t, n) {
1281
+ const a = new te(t, n), s = async () => {
1282
+ if (typeof a._options.timeout == "number" && a._options.timeout > de)
1283
+ throw new RangeError(`The \`timeout\` option cannot be greater than ${de}`);
1284
+ await Promise.resolve();
1285
+ let o = await a._fetch();
1286
+ for (const p of a._options.hooks.afterResponse) {
1287
+ const d = await p(a.request, a._options, a._decorateResponse(o.clone()));
1288
+ d instanceof globalThis.Response && (o = d);
1289
+ }
1290
+ if (a._decorateResponse(o), !o.ok && a._options.throwHttpErrors) {
1291
+ let p = new Ae(o, a.request, a._options);
1292
+ for (const d of a._options.hooks.beforeError)
1293
+ p = await d(p);
1294
+ throw p;
1295
+ }
1296
+ if (a._options.onDownloadProgress) {
1297
+ if (typeof a._options.onDownloadProgress != "function")
1298
+ throw new TypeError("The `onDownloadProgress` option must be a function");
1299
+ if (!Mt)
1300
+ throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
1301
+ return a._stream(o.clone(), a._options.onDownloadProgress);
1302
+ }
1303
+ return o;
1304
+ }, r = a._options.retry.methods.includes(a.request.method.toLowerCase()) ? a._retry(s) : s();
1305
+ for (const [o, p] of Object.entries(xt))
1306
+ r[o] = async () => {
1307
+ a.request.headers.set("accept", a.request.headers.get("accept") || p);
1308
+ const d = (await r).clone();
1309
+ if (o === "json") {
1310
+ if (d.status === 204 || (await d.clone().arrayBuffer()).byteLength === 0)
1311
+ return "";
1312
+ if (n.parseJson)
1313
+ return n.parseJson(await d.text());
1314
+ }
1315
+ return d[o]();
1316
+ };
1317
+ return r;
1318
+ }
1319
+ // eslint-disable-next-line complexity
1320
+ constructor(t, n = {}) {
1321
+ if (Object.defineProperty(this, "request", {
1322
+ enumerable: !0,
1323
+ configurable: !0,
1324
+ writable: !0,
1325
+ value: void 0
1326
+ }), Object.defineProperty(this, "abortController", {
1327
+ enumerable: !0,
1328
+ configurable: !0,
1329
+ writable: !0,
1330
+ value: void 0
1331
+ }), Object.defineProperty(this, "_retryCount", {
1332
+ enumerable: !0,
1333
+ configurable: !0,
1334
+ writable: !0,
1335
+ value: 0
1336
+ }), Object.defineProperty(this, "_input", {
1337
+ enumerable: !0,
1338
+ configurable: !0,
1339
+ writable: !0,
1340
+ value: void 0
1341
+ }), Object.defineProperty(this, "_options", {
1342
+ enumerable: !0,
1343
+ configurable: !0,
1344
+ writable: !0,
1345
+ value: void 0
1346
+ }), this._input = t, this._options = {
1347
+ // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208
1348
+ credentials: this._input.credentials || "same-origin",
1349
+ ...n,
1350
+ headers: Pe(this._input.headers, n.headers),
1351
+ hooks: be({
1352
+ beforeRequest: [],
1353
+ beforeRetry: [],
1354
+ beforeError: [],
1355
+ afterResponse: []
1356
+ }, n.hooks),
1357
+ method: Bt(n.method ?? this._input.method),
1358
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
1359
+ prefixUrl: String(n.prefixUrl || ""),
1360
+ retry: Ut(n.retry),
1361
+ throwHttpErrors: n.throwHttpErrors !== !1,
1362
+ timeout: n.timeout ?? 1e4,
1363
+ fetch: n.fetch ?? globalThis.fetch.bind(globalThis)
1364
+ }, typeof this._input != "string" && !(this._input instanceof URL || this._input instanceof globalThis.Request))
1365
+ throw new TypeError("`input` must be a string, URL, or Request");
1366
+ if (this._options.prefixUrl && typeof this._input == "string") {
1367
+ if (this._input.startsWith("/"))
1368
+ throw new Error("`input` must not begin with a slash when using `prefixUrl`");
1369
+ this._options.prefixUrl.endsWith("/") || (this._options.prefixUrl += "/"), this._input = this._options.prefixUrl + this._input;
1370
+ }
1371
+ if (Ct) {
1372
+ if (this.abortController = new globalThis.AbortController(), this._options.signal) {
1373
+ const a = this._options.signal;
1374
+ this._options.signal.addEventListener("abort", () => {
1375
+ this.abortController.abort(a.reason);
1376
+ });
1377
+ }
1378
+ this._options.signal = this.abortController.signal;
1379
+ }
1380
+ if (vt && (this._options.duplex = "half"), this.request = new globalThis.Request(this._input, this._options), this._options.searchParams) {
1381
+ const a = "?" + (typeof this._options.searchParams == "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString()), s = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, a);
1382
+ (Nt && 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(s, { ...this.request }), this._options);
1383
+ }
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
+ }
1386
+ _calculateRetryDelay(t) {
1387
+ if (this._retryCount++, this._retryCount < this._options.retry.limit && !(t instanceof De)) {
1388
+ if (t instanceof Ae) {
1389
+ if (!this._options.retry.statusCodes.includes(t.response.status))
1390
+ return 0;
1391
+ const a = t.response.headers.get("Retry-After");
1392
+ if (a && this._options.retry.afterStatusCodes.includes(t.response.status)) {
1393
+ let s = Number(a);
1394
+ return Number.isNaN(s) ? s = Date.parse(a) - Date.now() : s *= 1e3, this._options.retry.maxRetryAfter !== void 0 && s > this._options.retry.maxRetryAfter ? 0 : s;
1395
+ }
1396
+ if (t.response.status === 413)
1397
+ return 0;
1398
+ }
1399
+ const n = this._options.retry.delay(this._retryCount);
1400
+ return Math.min(this._options.retry.backoffLimit, n);
1401
+ }
1402
+ return 0;
1403
+ }
1404
+ _decorateResponse(t) {
1405
+ return this._options.parseJson && (t.json = async () => this._options.parseJson(await t.text())), t;
1406
+ }
1407
+ async _retry(t) {
1408
+ try {
1409
+ return await t();
1410
+ } catch (n) {
1411
+ const a = Math.min(this._calculateRetryDelay(n), de);
1412
+ if (a !== 0 && this._retryCount > 0) {
1413
+ await Ht(a, { signal: this._options.signal });
1414
+ for (const s of this._options.hooks.beforeRetry)
1415
+ if (await s({
1416
+ request: this.request,
1417
+ options: this._options,
1418
+ error: n,
1419
+ retryCount: this._retryCount
1420
+ }) === Le)
1421
+ return;
1422
+ return this._retry(t);
1423
+ }
1424
+ throw n;
1425
+ }
1426
+ }
1427
+ async _fetch() {
1428
+ for (const n of this._options.hooks.beforeRequest) {
1429
+ const a = await n(this.request, this._options);
1430
+ if (a instanceof Request) {
1431
+ this.request = a;
1432
+ break;
1433
+ }
1434
+ if (a instanceof Response)
1435
+ return a;
1436
+ }
1437
+ const t = kt(this.request, this._options);
1438
+ return this._options.timeout === !1 ? this._options.fetch(this.request.clone(), t) : $t(this.request.clone(), t, this.abortController, this._options);
1439
+ }
1440
+ /* istanbul ignore next */
1441
+ _stream(t, n) {
1442
+ const a = Number(t.headers.get("content-length")) || 0;
1443
+ let s = 0;
1444
+ return t.status === 204 ? (n && n({ percent: 1, totalBytes: a, transferredBytes: s }, new Uint8Array()), new globalThis.Response(null, {
1445
+ status: t.status,
1446
+ statusText: t.statusText,
1447
+ headers: t.headers
1448
+ })) : new globalThis.Response(new globalThis.ReadableStream({
1449
+ async start(r) {
1450
+ const o = t.body.getReader();
1451
+ n && n({ percent: 0, transferredBytes: 0, totalBytes: a }, new Uint8Array());
1452
+ async function p() {
1453
+ const { done: d, value: l } = await o.read();
1454
+ if (d) {
1455
+ r.close();
1456
+ return;
1457
+ }
1458
+ if (n) {
1459
+ s += l.byteLength;
1460
+ const u = a === 0 ? 0 : s / a;
1461
+ n({ percent: u, transferredBytes: s, totalBytes: a }, l);
1462
+ }
1463
+ r.enqueue(l), await p();
1464
+ }
1465
+ await p();
1466
+ }
1467
+ }), {
1468
+ status: t.status,
1469
+ statusText: t.statusText,
1470
+ headers: t.headers
1471
+ });
1472
+ }
1473
+ }
1474
+ /*! MIT License © Sindre Sorhus */
1475
+ const ce = (e) => {
1476
+ const t = (n, a) => te.create(n, Q(e, a));
1477
+ for (const n of Be)
1478
+ t[n] = (a, s) => te.create(a, Q(e, s, { method: n }));
1479
+ return t.create = (n) => ce(Q(n)), t.extend = (n) => ce(Q(e, n)), t.stop = Le, t;
1480
+ }, Ft = ce(), Gt = Ft, qt = typeof window < "u" ? {} : { referrer: "https://sk.thorswap.net", referer: "https://sk.thorswap.net" }, Re = Gt.create({ headers: qt }), we = {
1481
+ get: (e, t) => Re.get(e, t).json(),
1482
+ post: (e, t) => Re.post(e, t).json()
1483
+ }, ge = [...Object.values(i), "TERRA"];
1484
+ function Wt(e = "") {
1097
1485
  const t = e.toUpperCase(), [n] = t.split(".");
1098
- if (me.includes(n))
1486
+ if (ge.includes(n))
1099
1487
  return !0;
1100
1488
  const [a] = t.split("/");
1101
- if (me.includes(a))
1489
+ if (ge.includes(a))
1102
1490
  return !0;
1103
1491
  throw new Error(
1104
1492
  `Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
1105
1493
  );
1106
- }, q = 8, U = (e) => 10n ** BigInt(e), F = (e) => Math.log10(parseFloat(e.toString()));
1107
- function ge({
1494
+ }
1495
+ const K = 8, L = (e) => 10n ** BigInt(e), G = (e) => Math.log10(parseFloat(e.toString()));
1496
+ function re({
1108
1497
  value: e,
1109
- bigIntDecimal: t = q,
1110
- decimal: n = q
1498
+ bigIntDecimal: t = K,
1499
+ decimal: n = K
1111
1500
  }) {
1501
+ if (n === 0)
1502
+ return e.toString();
1112
1503
  const a = e < 0n;
1113
- let i = e.toString().substring(a ? 1 : 0);
1114
- const r = n - (i.length - 1);
1115
- r > 0 && (i = "0".repeat(r) + i);
1116
- const p = i.length - n;
1117
- let o = i.slice(-n);
1118
- return parseInt(o[t]) >= 5 ? o = `${o.substring(0, t - 1)}${(parseInt(o[t - 1]) + 1).toString()}` : o = o.substring(0, t), `${a ? "-" : ""}${i.slice(0, p)}.${o}`.replace(
1504
+ let s = e.toString().substring(a ? 1 : 0);
1505
+ const r = n - (s.length - 1);
1506
+ r > 0 && (s = "0".repeat(r) + s);
1507
+ const o = s.length - n;
1508
+ let p = s.slice(-n);
1509
+ return parseInt(p[t]) >= 5 ? p = `${p.substring(0, t - 1)}${(parseInt(p[t - 1]) + 1).toString()}` : p = p.substring(0, t), `${a ? "-" : ""}${s.slice(0, o)}.${p}`.replace(
1119
1510
  /\.?0*$/,
1120
1511
  ""
1121
1512
  );
1122
1513
  }
1123
- var L, $, ae, Se, se, Te, Q, ie, H, G, J, re;
1124
- const ct = class j {
1514
+ var U, k, B, $, me, Ue, Z, ue, ne, Te;
1515
+ const jt = class $e {
1125
1516
  constructor(t) {
1126
- V(this, L), V(this, ae), V(this, se), V(this, Q), V(this, H), V(this, J), N(this, "decimalMultiplier", 10n ** 8n), N(this, "bigIntValue", 0n), N(this, "decimal");
1127
- const n = oe(t);
1128
- this.decimal = typeof t == "object" ? t.decimal : void 0, this.decimalMultiplier = U(
1129
- Math.max(g(this, J, re).call(this, g(this, H, G).call(this, n)), this.decimal || 0)
1130
- ), g(this, ae, Se).call(this, n);
1517
+ H(this, U), H(this, B), H(this, me), H(this, Z), H(this, ne), I(this, "decimalMultiplier", 10n ** 8n), I(this, "bigIntValue", 0n), I(this, "decimal");
1518
+ const n = he(t), a = typeof t == "object";
1519
+ this.decimal = a ? t.decimal : void 0, this.decimalMultiplier = a && "decimalMultiplier" in t ? t.decimalMultiplier : L(Math.max(ke(ae(n)), this.decimal || 0)), R(this, me, Ue).call(this, n);
1131
1520
  }
1132
1521
  static fromBigInt(t, n) {
1133
- return new j({
1522
+ return new $e({
1134
1523
  decimal: n,
1135
- value: ge({ value: t, bigIntDecimal: n, decimal: n })
1524
+ value: re({ value: t, bigIntDecimal: n, decimal: n })
1136
1525
  });
1137
1526
  }
1138
1527
  static shiftDecimals({
@@ -1140,238 +1529,291 @@ const ct = class j {
1140
1529
  from: n,
1141
1530
  to: a
1142
1531
  }) {
1143
- return j.fromBigInt(
1144
- new j(t).bigIntValue * U(a) / U(n),
1532
+ return this.fromBigInt(
1533
+ t.getBaseValue("bigint") * L(a) / L(n),
1145
1534
  a
1146
1535
  );
1147
1536
  }
1148
- get baseValue() {
1149
- return this.getBaseValue("string");
1150
- }
1151
- get baseValueNumber() {
1152
- return this.getBaseValue("number");
1153
- }
1154
- get baseValueBigInt() {
1155
- return this.getBaseValue("bigint");
1156
- }
1157
1537
  set(t) {
1158
1538
  return new this.constructor({ decimal: this.decimal, value: t, identifier: this.toString() });
1159
1539
  }
1160
1540
  add(...t) {
1161
- return g(this, L, $).call(this, "add", ...t);
1541
+ return R(this, U, k).call(this, "add", ...t);
1162
1542
  }
1163
1543
  sub(...t) {
1164
- return g(this, L, $).call(this, "sub", ...t);
1544
+ return R(this, U, k).call(this, "sub", ...t);
1165
1545
  }
1166
1546
  mul(...t) {
1167
- return g(this, L, $).call(this, "mul", ...t);
1547
+ return R(this, U, k).call(this, "mul", ...t);
1168
1548
  }
1169
1549
  div(...t) {
1170
- return g(this, L, $).call(this, "div", ...t);
1550
+ return R(this, U, k).call(this, "div", ...t);
1171
1551
  }
1172
1552
  gt(t) {
1173
- return this.bigIntValue > this.getBigIntValue(t);
1553
+ return R(this, B, $).call(this, "gt", t);
1174
1554
  }
1175
1555
  gte(t) {
1176
- return this.bigIntValue >= this.getBigIntValue(t);
1556
+ return R(this, B, $).call(this, "gte", t);
1177
1557
  }
1178
1558
  lt(t) {
1179
- return this.bigIntValue < this.getBigIntValue(t);
1559
+ return R(this, B, $).call(this, "lt", t);
1180
1560
  }
1181
1561
  lte(t) {
1182
- return this.bigIntValue <= this.getBigIntValue(t);
1562
+ return R(this, B, $).call(this, "lte", t);
1183
1563
  }
1184
1564
  eqValue(t) {
1185
- return this.bigIntValue === this.getBigIntValue(t);
1565
+ return R(this, B, $).call(this, "eqValue", t);
1186
1566
  }
1567
+ // @ts-expect-error False positive
1187
1568
  getValue(t) {
1188
1569
  const n = this.formatBigIntToSafeValue(
1189
1570
  this.bigIntValue,
1190
- this.decimal || F(this.decimalMultiplier)
1571
+ this.decimal || G(this.decimalMultiplier)
1191
1572
  );
1192
1573
  switch (t) {
1193
1574
  case "number":
1194
1575
  return Number(n);
1195
1576
  case "string":
1196
1577
  return n;
1197
- default:
1198
- return this.bigIntValue;
1578
+ case "bigint":
1579
+ return this.bigIntValue * 10n ** BigInt(this.decimal || 8n) / this.decimalMultiplier;
1199
1580
  }
1200
1581
  }
1582
+ // @ts-expect-error
1201
1583
  getBaseValue(t) {
1202
- const n = this.decimalMultiplier / U(this.decimal || 0), a = this.bigIntValue / n;
1584
+ const n = this.decimalMultiplier / L(this.decimal || b.THOR), a = this.bigIntValue / n;
1203
1585
  switch (t) {
1204
1586
  case "number":
1205
1587
  return Number(a);
1206
1588
  case "string":
1207
1589
  return a.toString();
1208
- default:
1209
- return this.bigIntValue;
1590
+ case "bigint":
1591
+ return a;
1210
1592
  }
1211
1593
  }
1212
1594
  getBigIntValue(t, n) {
1213
- return !n && typeof t == "object" ? t.bigIntValue : g(this, Q, ie).call(this, g(this, H, G).call(this, oe(t)), n);
1214
- }
1215
- formatBigIntToSafeValue(t, n) {
1216
- const a = n || this.decimal || q, i = Math.max(
1217
- a,
1218
- F(this.decimalMultiplier)
1219
- ), r = t < 0n, p = t.toString().substring(r ? 1 : 0), o = i - (p.length - 1), y = o > 0 ? "0".repeat(o) + p : p, T = y.length - i;
1220
- let u = y.slice(-i);
1221
- return parseInt(u[a]) >= 5 ? u = `${u.substring(0, a - 1)}${(parseInt(u[a - 1]) + 1).toString()}` : u = u.substring(0, a), `${r ? "-" : ""}${y.slice(
1222
- 0,
1223
- T
1224
- )}.${u}`.replace(/\.?0*$/, "");
1595
+ if (!n && typeof t == "object")
1596
+ return t.bigIntValue;
1597
+ const a = he(t), s = ae(a);
1598
+ return s === "0" || s === "undefined" ? 0n : R(this, ne, Te).call(this, s, n);
1225
1599
  }
1226
1600
  toSignificant(t = 6) {
1227
- const [n, a] = this.getValue("string").split("."), i = n || "", r = a || "", p = parseInt(i) ? i.length + r.length : r.length;
1228
- if (p <= t)
1601
+ const [n, a] = this.getValue("string").split("."), s = n || "", r = a || "";
1602
+ if ((parseInt(s) ? s.length + r.length : r.length) <= t)
1229
1603
  return this.getValue("string");
1230
- if (i.length >= t)
1231
- return i.slice(0, t).padEnd(i.length, "0");
1232
- if (parseInt(i))
1233
- return `${i}.${r.slice(0, t - i.length)}`.padEnd(
1234
- p - t,
1604
+ if (s.length >= t)
1605
+ return s.slice(0, t).padEnd(s.length, "0");
1606
+ if (parseInt(s))
1607
+ return `${s}.${r.slice(0, t - s.length)}`.padEnd(
1608
+ t - s.length,
1235
1609
  "0"
1236
1610
  );
1237
- const o = parseInt(r), y = `${o}`.slice(0, t);
1238
- return `0.${y.padStart(
1239
- r.length - `${o}`.length + y.length,
1611
+ const o = parseInt(r), p = `${o}`.slice(0, t);
1612
+ return `0.${p.padStart(
1613
+ r.length - `${o}`.length + p.length,
1614
+ "0"
1615
+ )}`;
1616
+ }
1617
+ toFixed(t = 6) {
1618
+ const [n, a] = this.getValue("string").split("."), s = n || "", r = a || "";
1619
+ if (parseInt(s))
1620
+ return `${s}.${r.slice(0, t)}`.padEnd(t, "0");
1621
+ const o = parseInt(r), p = `${o}`.slice(0, t);
1622
+ return `0.${p.padStart(
1623
+ r.length - `${o}`.length + p.length,
1240
1624
  "0"
1241
1625
  )}`;
1242
1626
  }
1627
+ toAbbreviation(t = 2) {
1628
+ const n = this.getValue("number"), a = ["", "K", "M", "B", "T", "Q", "Qi", "S"], s = Math.floor(Math.log10(Math.abs(n)) / 3), r = a[s];
1629
+ if (!r)
1630
+ return this.getValue("string");
1631
+ const o = 10 ** (s * 3);
1632
+ return `${(n / o).toFixed(t)}${r}`;
1633
+ }
1634
+ toCurrency(t = "$", {
1635
+ currencyPosition: n = "start",
1636
+ decimal: a = 2,
1637
+ decimalSeparator: s = ".",
1638
+ thousandSeparator: r = ","
1639
+ } = {}) {
1640
+ const o = this.getValue("number"), [p, d = ""] = o.toFixed(6).split("."), l = p.replace(/\B(?=(\d{3})+(?!\d))/g, r), u = !p && !d ? "0.00" : p === "0" ? `${parseFloat(`0.${d}`)}`.replace(".", s) : `${l}${parseInt(d) ? `${s}${d.slice(0, a)}` : ""}`;
1641
+ return `${n === "start" ? t : ""}${u}${n === "end" ? t : ""}`;
1642
+ }
1643
+ formatBigIntToSafeValue(t, n) {
1644
+ const a = n || this.decimal || K, s = Math.max(
1645
+ a,
1646
+ G(this.decimalMultiplier)
1647
+ ), r = t < 0n, o = t.toString().substring(r ? 1 : 0), p = s - (o.length - 1), d = p > 0 ? "0".repeat(p) + o : o, l = d.length - s;
1648
+ let u = d.slice(-s);
1649
+ return parseInt(u[a]) >= 5 ? u = `${u.substring(0, a - 1)}${(parseInt(u[a - 1]) + 1).toString()}` : u = u.substring(0, a), `${r ? "-" : ""}${d.slice(
1650
+ 0,
1651
+ l
1652
+ )}.${u}`.replace(/\.?0*$/, "");
1653
+ }
1243
1654
  };
1244
- L = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1245
- const n = g(this, se, Te).call(this, this, ...t), a = U(n), i = t.reduce(
1246
- (p, o) => {
1247
- const y = this.getBigIntValue(o, n);
1655
+ U = /* @__PURE__ */ new WeakSet(), k = function(e, ...t) {
1656
+ const n = R(this, Z, ue).call(this, this, ...t), a = Math.max(n, G(this.decimalMultiplier)), s = L(a), r = t.reduce(
1657
+ (p, d) => {
1658
+ const l = this.getBigIntValue(d, a);
1248
1659
  switch (e) {
1249
1660
  case "add":
1250
- return p + y;
1661
+ return p + l;
1251
1662
  case "sub":
1252
- return p - y;
1663
+ return p - l;
1253
1664
  case "mul":
1254
- return p * y / a;
1665
+ return p * l / s;
1255
1666
  case "div": {
1256
- if (y === 0n)
1667
+ if (l === 0n)
1257
1668
  throw new RangeError("Division by zero");
1258
- return p * a / y;
1669
+ return p * s / l;
1259
1670
  }
1260
1671
  default:
1261
1672
  return p;
1262
1673
  }
1263
1674
  },
1264
1675
  //normalize is to precision multiplier base
1265
- this.bigIntValue * a / this.decimalMultiplier
1266
- ), r = ge({
1267
- bigIntDecimal: n,
1268
- decimal: Math.max(n, F(this.decimalMultiplier)),
1269
- value: i
1676
+ this.bigIntValue * s / this.decimalMultiplier
1677
+ ), o = re({
1678
+ bigIntDecimal: a,
1679
+ decimal: a,
1680
+ value: r
1270
1681
  });
1271
- return new this.constructor({ decimal: this.decimal, value: r, identifier: this.toString() });
1272
- }, ae = /* @__PURE__ */ new WeakSet(), Se = function(e) {
1273
- const t = g(this, H, G).call(this, e) || "0";
1274
- this.bigIntValue = g(this, Q, ie).call(this, t);
1275
- }, se = /* @__PURE__ */ new WeakSet(), Te = function(...e) {
1276
- const t = e.map(
1277
- (n) => typeof n == "object" ? n.decimal || F(n.decimalMultiplier) : g(this, J, re).call(this, g(this, H, G).call(this, n))
1278
- ).filter(Boolean);
1279
- return Math.max(...t, q);
1280
- }, Q = /* @__PURE__ */ new WeakSet(), ie = function(e, t) {
1281
- const n = t ? U(t) : this.decimalMultiplier, a = F(n), [i, r = ""] = e.split(".");
1282
- return BigInt(`${i}${r.padEnd(a, "0")}`);
1283
- }, H = /* @__PURE__ */ new WeakSet(), G = function(e) {
1284
- const t = `${typeof e == "number" ? Number(e).toLocaleString("fullwide", {
1285
- useGrouping: !1,
1286
- maximumFractionDigits: 20
1287
- }) : oe(e)}`.replaceAll(",", ".").split(".");
1682
+ return new this.constructor({
1683
+ decimalMultiplier: L(a),
1684
+ decimal: this.decimal,
1685
+ value: o,
1686
+ identifier: this.toString()
1687
+ });
1688
+ }, B = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1689
+ const n = R(this, Z, ue).call(this, this, ...t), a = this.getBigIntValue(t[0], n), s = this.getBigIntValue(this, n);
1690
+ switch (e) {
1691
+ case "gt":
1692
+ return s > a;
1693
+ case "gte":
1694
+ return s >= a;
1695
+ case "lt":
1696
+ return s < a;
1697
+ case "lte":
1698
+ return s <= a;
1699
+ case "eqValue":
1700
+ return s === a;
1701
+ }
1702
+ }, me = /* @__PURE__ */ new WeakSet(), Ue = function(e) {
1703
+ const t = ae(e) || "0";
1704
+ this.bigIntValue = R(this, ne, Te).call(this, t);
1705
+ }, Z = /* @__PURE__ */ new WeakSet(), ue = function(...e) {
1706
+ const t = e.map((n) => typeof n == "object" ? n.decimal || G(n.decimalMultiplier) : ke(ae(n))).filter(Boolean);
1707
+ return Math.max(...t, K);
1708
+ }, ne = /* @__PURE__ */ new WeakSet(), Te = function(e, t) {
1709
+ const n = t ? L(t) : this.decimalMultiplier, a = G(n), [s = "", r = ""] = e.split(".");
1710
+ return BigInt(`${s}${r.padEnd(a, "0")}`);
1711
+ };
1712
+ let He = jt;
1713
+ const Kt = Intl.NumberFormat("fullwide", {
1714
+ useGrouping: !1,
1715
+ maximumFractionDigits: 20
1716
+ });
1717
+ function ae(e) {
1718
+ const t = `${typeof e == "number" ? Kt.format(e) : he(e)}`.replaceAll(",", ".").split(".");
1288
1719
  return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
1289
- }, J = /* @__PURE__ */ new WeakSet(), re = function(e) {
1720
+ }
1721
+ function ke(e) {
1290
1722
  var t;
1291
1723
  const n = ((t = e.split(".")[1]) == null ? void 0 : t.length) || 0;
1292
- return Math.max(n, q);
1293
- };
1294
- let pe = ct;
1295
- function oe(e) {
1724
+ return Math.max(n, K);
1725
+ }
1726
+ function he(e) {
1296
1727
  return typeof e == "object" ? "getValue" in e ? e.getValue("string") : e.value : e;
1297
1728
  }
1298
- let de;
1299
- const ne = (e) => {
1300
- if (!de)
1301
- throw new Error("Static assets not loaded, call await AssetValue.loadStaticAssets() first");
1302
- return de.get(e.toUpperCase()) || { decimal: E.THOR, identifier: "" };
1303
- }, _e = async (e, t = 0) => {
1304
- lt(e);
1305
- const n = await Ie(ue(e));
1306
- return new v({ decimal: n, value: t, identifier: e });
1307
- };
1308
- class v extends pe {
1309
- constructor(t) {
1310
- super(
1311
- t.value instanceof pe ? t.value : { decimal: t.decimal, value: t.value }
1312
- ), N(this, "address"), N(this, "chain"), N(this, "isSynthetic", !1), N(this, "isGasAsset", !1), N(this, "symbol"), N(this, "ticker"), N(this, "type");
1313
- const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`, a = ue(n);
1314
- this.type = pt(a), this.chain = a.chain, this.ticker = a.ticker, this.symbol = a.symbol, this.address = a.address, this.isSynthetic = a.isSynthetic, this.isGasAsset = a.isGasAsset;
1315
- }
1316
- get assetValue() {
1317
- return `${this.getValue("string")} ${this.ticker}`;
1729
+ const q = /* @__PURE__ */ new Map();
1730
+ class N extends He {
1731
+ constructor({
1732
+ value: t,
1733
+ decimal: n,
1734
+ tax: a,
1735
+ chain: s,
1736
+ symbol: r,
1737
+ identifier: o
1738
+ }) {
1739
+ super(typeof t == "object" ? t : { decimal: n, value: t }), I(this, "address"), I(this, "chain"), I(this, "isGasAsset", !1), I(this, "isSynthetic", !1), I(this, "symbol"), I(this, "tax"), I(this, "ticker"), I(this, "type");
1740
+ const p = ee(o || `${s}.${r}`);
1741
+ this.type = Et(p), this.tax = a, this.chain = p.chain, this.ticker = p.ticker, this.symbol = p.symbol, this.address = p.address, this.isSynthetic = p.isSynthetic, this.isGasAsset = p.isGasAsset;
1318
1742
  }
1319
1743
  toString() {
1320
- return `${this.chain}.${this.symbol}`;
1744
+ return this.isSynthetic ? this.symbol : `${this.chain}.${this.symbol}`;
1745
+ }
1746
+ toUrl() {
1747
+ return this.isSynthetic ? `${this.chain}.${this.symbol.replace("/", ".")}` : this.toString();
1321
1748
  }
1322
1749
  eq({ chain: t, symbol: n }) {
1323
1750
  return this.chain === t && this.symbol === n;
1324
1751
  }
1325
- static async fromString(t, n = 0) {
1326
- return _e(t, n);
1752
+ // THOR.RUNE
1753
+ // THOR.ETH.ETH
1754
+ // ETH.THOR-0x1234567890
1755
+ static fromUrl(t, n = 0) {
1756
+ const [a, s, r] = t.split(".");
1757
+ if (!a || !s)
1758
+ throw new Error("Invalid asset url");
1759
+ const o = a === i.THORChain && r ? `${a}.${s}/${r}` : t;
1760
+ return ye(o, n);
1761
+ }
1762
+ static fromString(t, n = 0) {
1763
+ return ye(t, n);
1764
+ }
1765
+ static fromIdentifier(t, n = 0) {
1766
+ return ye(t, n);
1327
1767
  }
1328
1768
  static fromStringSync(t, n = 0) {
1329
- const { decimal: a, identifier: i } = ne(
1330
- t
1769
+ const { chain: a, isSynthetic: s } = ee(t), r = q.get(t.toUpperCase());
1770
+ if (s)
1771
+ return Oe(t, n);
1772
+ r || console.error(
1773
+ `Asset ${t} is not loaded. Use AssetValue.loadStaticAssets() to load it`
1331
1774
  );
1332
- return i ? new v({ decimal: a, identifier: i, value: n }) : void 0;
1333
- }
1334
- static async fromIdentifier(t, n = 0) {
1335
- return _e(t, n);
1775
+ const { tax: o, decimal: p, identifier: d } = r || {
1776
+ decimal: b[a],
1777
+ identifier: t
1778
+ };
1779
+ return new N({
1780
+ tax: o,
1781
+ value: W(n, p),
1782
+ identifier: s ? t : d,
1783
+ decimal: s ? 8 : p
1784
+ });
1336
1785
  }
1337
1786
  static fromIdentifierSync(t, n = 0) {
1338
- const { decimal: a, identifier: i } = ne(t);
1339
- return new v({ decimal: a, identifier: i, value: n });
1787
+ const { chain: a, isSynthetic: s } = ee(t), r = q.get(t);
1788
+ if (s)
1789
+ return Oe(t, n);
1790
+ r || console.error(
1791
+ `Asset ${t} is not loaded. - Loading with base Chain. Use AssetValue.loadStaticAssets() to load it`
1792
+ );
1793
+ const { tax: o, decimal: p, identifier: d } = r || {
1794
+ decimal: b[a],
1795
+ identifier: t
1796
+ };
1797
+ return new N({ tax: o, decimal: p, identifier: d, value: W(n, p) });
1340
1798
  }
1341
1799
  static fromChainOrSignature(t, n = 0) {
1342
- const { decimal: a, identifier: i } = rt(t);
1343
- return new v({ value: n, decimal: a, identifier: i });
1344
- }
1345
- static async fromTCQuote(t, n = 0) {
1346
- const a = await Ie(ue(t)), i = this.shiftDecimals({ value: n, from: E.THOR, to: a });
1347
- return new v({ value: i, identifier: t, decimal: a });
1348
- }
1349
- static fromTCQuoteStatic(t, n = 0) {
1350
- const a = ne(t), i = this.shiftDecimals({
1351
- value: n,
1352
- from: E.THOR,
1353
- to: a.decimal
1354
- });
1355
- return new v({ ...a, value: i });
1800
+ const { decimal: a, identifier: s } = At(t);
1801
+ return new N({ value: W(n, a), decimal: a, identifier: s });
1356
1802
  }
1357
- static async loadStaticAssets() {
1803
+ static loadStaticAssets() {
1358
1804
  return new Promise(
1359
1805
  async (t, n) => {
1360
1806
  try {
1361
- const {
1362
- // Omit ThorchainList from import to avoid decimals conflict (TC uses 8 for all)
1363
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1364
- ThorchainList: a,
1365
- NativeList: i,
1366
- ...r
1367
- } = await import("@swapkit/tokens");
1368
- de = [i, ...Object.values(r)].reduce(
1369
- (p, { tokens: o }) => (o.forEach(({ identifier: y, chain: T, ...u }) => {
1370
- const l = "decimals" in u ? u.decimals : E[T];
1371
- p.set(y, { identifier: y, decimal: l });
1372
- }), p),
1373
- /* @__PURE__ */ new Map()
1374
- ), t({ ok: !0 });
1807
+ const a = await import("@swapkit/tokens");
1808
+ Object.values(a).forEach((s) => {
1809
+ var r;
1810
+ (r = s == null ? void 0 : s.tokens) == null || r.forEach(({ identifier: o, chain: p, ...d }) => {
1811
+ q.set(o.toUpperCase(), {
1812
+ identifier: o,
1813
+ decimal: "decimals" in d ? d.decimals : b[p]
1814
+ });
1815
+ });
1816
+ }), t({ ok: !0 });
1375
1817
  } catch (a) {
1376
1818
  console.error(a), n({
1377
1819
  ok: !1,
@@ -1383,35 +1825,53 @@ class v extends pe {
1383
1825
  );
1384
1826
  }
1385
1827
  }
1386
- const he = (e) => {
1387
- const t = v.fromChainOrSignature(e);
1828
+ function le(e) {
1829
+ const t = N.fromChainOrSignature(e);
1388
1830
  switch (e) {
1389
- case s.Bitcoin:
1390
- case s.Litecoin:
1391
- case s.BitcoinCash:
1392
- return t.add(10001);
1393
- case s.Dogecoin:
1394
- return t.add(100000001);
1395
- case s.Avalanche:
1396
- case s.Ethereum:
1397
- return t.add(10 * 10 ** 9);
1398
- case s.THORChain:
1399
- case s.Maya:
1400
- return t.add(0);
1831
+ case i.Bitcoin:
1832
+ case i.Litecoin:
1833
+ case i.BitcoinCash:
1834
+ return t.set(10001e-8);
1835
+ case i.Dogecoin:
1836
+ return t.set(1.00000001);
1837
+ case i.Avalanche:
1838
+ case i.Ethereum:
1839
+ return t.set(1e-8);
1840
+ case i.THORChain:
1841
+ case i.Maya:
1842
+ return t.set(0);
1401
1843
  default:
1402
- return t.add(1);
1844
+ return t.set(1e-8);
1403
1845
  }
1404
- }, ue = (e) => {
1405
- const t = e.slice(0, 14).includes("/"), n = e.includes(".") ? e : `${s.THORChain}.${e}`, [a, i] = n.split("."), [r, p] = i.split("-");
1846
+ }
1847
+ async function ye(e, t = 0) {
1848
+ Wt(e);
1849
+ const n = q.get(e.toUpperCase()), a = (n == null ? void 0 : n.decimal) || await bt(ee(e));
1850
+ return n || q.set(e.toUpperCase(), { identifier: e, decimal: a }), new N({ decimal: a, value: W(t, a), identifier: e });
1851
+ }
1852
+ function Oe(e, t = 0) {
1853
+ const [n, a] = e.split("/");
1854
+ return new N({
1855
+ decimal: 8,
1856
+ value: W(t, 8),
1857
+ identifier: `${i.THORChain}.${n}/${a}`
1858
+ });
1859
+ }
1860
+ function W(e, t) {
1861
+ return typeof e == "bigint" ? re({ value: e, bigIntDecimal: t, decimal: t }) : e;
1862
+ }
1863
+ function ee(e) {
1864
+ const t = e.slice(0, 14).includes("/"), [n, a] = e.split(".").pop().split("/"), s = e.includes(".") && !t ? e : `${i.THORChain}.${a}`, [r, o] = s.split("."), [p, d] = (t ? a : o).split("-");
1406
1865
  return {
1407
- address: p == null ? void 0 : p.toLowerCase(),
1408
- chain: a,
1409
- isGasAsset: it({ chain: a, symbol: i }),
1866
+ address: d == null ? void 0 : d.toLowerCase(),
1867
+ chain: r,
1868
+ isGasAsset: xe({ chain: r, symbol: o }),
1410
1869
  isSynthetic: t,
1411
- symbol: p ? `${r}-${(p == null ? void 0 : p.toLowerCase()) ?? ""}` : i,
1412
- ticker: t ? i : r
1870
+ symbol: (t ? `${n}/` : "") + (d ? `${p}-${(d == null ? void 0 : d.toLowerCase()) ?? ""}` : o),
1871
+ ticker: p
1413
1872
  };
1414
- }, mt = {
1873
+ }
1874
+ const Xt = {
1415
1875
  /**
1416
1876
  * Core
1417
1877
  */
@@ -1458,6 +1918,7 @@ const he = (e) => {
1458
1918
  core_transaction_deposit_to_pool_error: 10310,
1459
1919
  core_transaction_deposit_insufficient_funds_error: 10311,
1460
1920
  core_transaction_deposit_gas_error: 10312,
1921
+ core_transaction_invalid_sender_address: 10313,
1461
1922
  core_transaction_deposit_server_error: 10313,
1462
1923
  /**
1463
1924
  * Wallets
@@ -1470,15 +1931,21 @@ const he = (e) => {
1470
1931
  };
1471
1932
  class c extends Error {
1472
1933
  constructor(t, n) {
1473
- console.error(n), super(t, { cause: { code: mt[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
1934
+ console.error(n, { stack: n == null ? void 0 : n.stack, message: n == null ? void 0 : n.message }), super(t, { cause: { code: Xt[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
1474
1935
  }
1475
1936
  }
1476
- class ye extends pe {
1937
+ class x extends He {
1477
1938
  eq(t) {
1478
1939
  return this.eqValue(t);
1479
1940
  }
1941
+ static fromBigInt(t, n) {
1942
+ return new x({
1943
+ decimal: n,
1944
+ value: re({ value: t, bigIntDecimal: n, decimal: n })
1945
+ });
1946
+ }
1480
1947
  }
1481
- const Tt = [
1948
+ const Yt = [
1482
1949
  {
1483
1950
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1484
1951
  stateMutability: "nonpayable",
@@ -1569,7 +2036,7 @@ const Tt = [
1569
2036
  type: "function"
1570
2037
  },
1571
2038
  { stateMutability: "payable", type: "receive" }
1572
- ], _t = [
2039
+ ], Jt = [
1573
2040
  {
1574
2041
  inputs: [
1575
2042
  { internalType: "address", name: "_ttp", type: "address" },
@@ -1713,7 +2180,7 @@ const Tt = [
1713
2180
  type: "function"
1714
2181
  },
1715
2182
  { stateMutability: "payable", type: "receive" }
1716
- ], ht = [
2183
+ ], Qt = [
1717
2184
  {
1718
2185
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1719
2186
  stateMutability: "nonpayable",
@@ -1818,7 +2285,7 @@ const Tt = [
1818
2285
  type: "function"
1819
2286
  },
1820
2287
  { stateMutability: "payable", type: "receive" }
1821
- ], ft = [
2288
+ ], zt = [
1822
2289
  {
1823
2290
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1824
2291
  stateMutability: "nonpayable",
@@ -1909,7 +2376,7 @@ const Tt = [
1909
2376
  type: "function"
1910
2377
  },
1911
2378
  { stateMutability: "payable", type: "receive" }
1912
- ], bt = [
2379
+ ], Zt = [
1913
2380
  {
1914
2381
  inputs: [
1915
2382
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2053,7 +2520,7 @@ const Tt = [
2053
2520
  type: "function"
2054
2521
  },
2055
2522
  { stateMutability: "payable", type: "receive" }
2056
- ], At = [
2523
+ ], en = [
2057
2524
  {
2058
2525
  inputs: [
2059
2526
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2172,7 +2639,7 @@ const Tt = [
2172
2639
  type: "function"
2173
2640
  },
2174
2641
  { stateMutability: "payable", type: "receive" }
2175
- ], wt = [
2642
+ ], tn = [
2176
2643
  {
2177
2644
  inputs: [
2178
2645
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2291,7 +2758,7 @@ const Tt = [
2291
2758
  type: "function"
2292
2759
  },
2293
2760
  { stateMutability: "payable", type: "receive" }
2294
- ], Et = [
2761
+ ], nn = [
2295
2762
  {
2296
2763
  inputs: [
2297
2764
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2410,7 +2877,7 @@ const Tt = [
2410
2877
  type: "function"
2411
2878
  },
2412
2879
  { stateMutability: "payable", type: "receive" }
2413
- ], Rt = [
2880
+ ], an = [
2414
2881
  {
2415
2882
  inputs: [
2416
2883
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2529,7 +2996,7 @@ const Tt = [
2529
2996
  type: "function"
2530
2997
  },
2531
2998
  { stateMutability: "payable", type: "receive" }
2532
- ], Ot = [
2999
+ ], sn = [
2533
3000
  {
2534
3001
  inputs: [
2535
3002
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2656,7 +3123,7 @@ const Tt = [
2656
3123
  type: "function"
2657
3124
  },
2658
3125
  { stateMutability: "payable", type: "receive" }
2659
- ], It = [
3126
+ ], rn = [
2660
3127
  {
2661
3128
  inputs: [
2662
3129
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2783,7 +3250,7 @@ const Tt = [
2783
3250
  type: "function"
2784
3251
  },
2785
3252
  { stateMutability: "payable", type: "receive" }
2786
- ], gt = [
3253
+ ], on = [
2787
3254
  {
2788
3255
  inputs: [
2789
3256
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2910,7 +3377,7 @@ const Tt = [
2910
3377
  type: "function"
2911
3378
  },
2912
3379
  { stateMutability: "payable", type: "receive" }
2913
- ], St = [
3380
+ ], pn = [
2914
3381
  {
2915
3382
  inputs: [
2916
3383
  { internalType: "address", name: "_ttp", type: "address" },
@@ -3037,7 +3504,7 @@ const Tt = [
3037
3504
  type: "function"
3038
3505
  },
3039
3506
  { stateMutability: "payable", type: "receive" }
3040
- ], vt = [
3507
+ ], dn = [
3041
3508
  {
3042
3509
  inputs: [
3043
3510
  { internalType: "address", name: "_ttp", type: "address" },
@@ -3164,297 +3631,312 @@ const Tt = [
3164
3631
  type: "function"
3165
3632
  },
3166
3633
  { stateMutability: "payable", type: "receive" }
3167
- ], ve = {
3168
- ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: Tt,
3169
- ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: ht,
3170
- ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: ft
3171
- }, Mt = {
3172
- ...ve,
3634
+ ], Fe = {
3635
+ ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: Yt,
3636
+ ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: Qt,
3637
+ ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: zt
3638
+ }, un = {
3639
+ ...Fe,
3173
3640
  // AVAX
3174
- ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: At,
3175
- ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: _t,
3176
- ["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: Et,
3641
+ ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: en,
3642
+ ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: Jt,
3643
+ ["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: nn,
3177
3644
  // BSC
3178
- ["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: bt,
3645
+ ["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: Zt,
3179
3646
  // ETH
3180
- ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: wt,
3181
- ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Rt,
3182
- ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: Ot,
3183
- ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: It,
3184
- ["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: gt,
3185
- ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: St,
3186
- ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: vt
3187
- }, Ct = ({
3647
+ ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: tn,
3648
+ ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: an,
3649
+ ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: sn,
3650
+ ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: rn,
3651
+ ["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: on,
3652
+ ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: pn,
3653
+ ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: dn
3654
+ }, ln = ({
3188
3655
  streamSwap: e,
3189
3656
  contractAddress: t,
3190
3657
  recipient: n,
3191
3658
  toChecksumAddress: a,
3192
3659
  calldata: {
3193
- amount: i,
3660
+ amount: s,
3194
3661
  amountOutMin: r = "",
3195
- data: p = "",
3196
- deadline: o,
3197
- memo: y,
3198
- router: T,
3662
+ data: o = "",
3663
+ deadline: p,
3664
+ memo: d,
3665
+ router: l,
3199
3666
  memoStreamingSwap: u,
3200
- tcMemo: l,
3201
- tcRouter: h,
3202
- tcVault: _,
3203
- vault: R,
3204
- token: O
3667
+ tcMemo: m,
3668
+ tcRouter: _,
3669
+ tcVault: w,
3670
+ vault: A,
3671
+ token: E
3205
3672
  }
3206
3673
  }) => {
3207
- const S = !!ve[t.toLowerCase()];
3208
- if (S && !T)
3674
+ const O = !!Fe[t.toLowerCase()];
3675
+ if (O && !l)
3209
3676
  throw new Error("Router is required on calldata for swapIn with GenericContract");
3210
- const I = l || y, b = e && u || I;
3211
- if (!_ && !R)
3677
+ const S = m || d, D = e && u || S;
3678
+ if (!w && !A)
3212
3679
  throw new Error("TC Vault is required on calldata");
3213
- if (!h && !T)
3680
+ if (!_ && !l)
3214
3681
  throw new Error("TC Router is required on calldata");
3215
- if (!b)
3682
+ if (!D)
3216
3683
  throw new Error("TC Memo is required on calldata");
3217
- if (!O)
3684
+ if (!E)
3218
3685
  throw new Error("Token is required on calldata");
3219
- const M = [
3686
+ const oe = [
3220
3687
  // v2 contracts don't have tcVault, tcRouter, tcMemo but vault, router, memo
3221
- a(h || T),
3222
- a(_ || R),
3223
- b.replace("{recipientAddress}", n),
3224
- a(O),
3225
- i
3226
- ], ee = S ? [a(T), p, o] : [r, o];
3227
- return [...M, ...ee];
3228
- }, Nt = ({ chain: e, txHash: t }) => {
3229
- const n = Ee[e];
3688
+ a(_ || l),
3689
+ a(w || A),
3690
+ D.replace("{recipientAddress}", n),
3691
+ a(E),
3692
+ s
3693
+ ], Ge = O ? [a(l), o, p] : [r, p];
3694
+ return [...oe, ...Ge];
3695
+ }, yn = ({ chain: e, txHash: t }) => {
3696
+ const n = Me[e];
3230
3697
  switch (e) {
3231
- case s.Binance:
3232
- case s.Bitcoin:
3233
- case s.BitcoinCash:
3234
- case s.Maya:
3235
- case s.Kujira:
3236
- case s.THORChain:
3237
- return `${n}/tx/${t}`;
3238
- case s.Arbitrum:
3239
- case s.Avalanche:
3240
- case s.BinanceSmartChain:
3241
- case s.Ethereum:
3242
- case s.Optimism:
3243
- case s.Polygon:
3698
+ case i.Binance:
3699
+ case i.Maya:
3700
+ case i.Kujira:
3701
+ case i.THORChain:
3702
+ return `${n}/tx/${t.startsWith("0x") ? t.slice(2) : t}`;
3703
+ case i.Arbitrum:
3704
+ case i.Avalanche:
3705
+ case i.BinanceSmartChain:
3706
+ case i.Ethereum:
3707
+ case i.Optimism:
3708
+ case i.Polygon:
3244
3709
  return `${n}/tx/${t.startsWith("0x") ? t : `0x${t}`}`;
3245
- case s.Cosmos:
3710
+ case i.Cosmos:
3246
3711
  return `${n}/transactions/${t}`;
3247
- case s.Dogecoin:
3712
+ case i.Litecoin:
3713
+ case i.Bitcoin:
3714
+ case i.BitcoinCash:
3715
+ case i.Dogecoin:
3248
3716
  return `${n}/transaction/${t.toLowerCase()}`;
3249
- case s.Litecoin:
3250
- return `${n}/${t}`;
3251
3717
  default:
3252
3718
  throw new Error(`Unsupported chain: ${e}`);
3253
3719
  }
3254
- }, xt = ({ chain: e, address: t }) => {
3255
- const n = Ee[e];
3720
+ }, cn = ({ chain: e, address: t }) => {
3721
+ const n = Me[e];
3256
3722
  switch (e) {
3257
- case s.Arbitrum:
3258
- case s.Avalanche:
3259
- case s.Binance:
3260
- case s.BinanceSmartChain:
3261
- case s.Bitcoin:
3262
- case s.BitcoinCash:
3263
- case s.Dogecoin:
3264
- case s.Ethereum:
3265
- case s.Maya:
3266
- case s.Optimism:
3267
- case s.Polygon:
3268
- case s.Kujira:
3269
- case s.THORChain:
3723
+ case i.Arbitrum:
3724
+ case i.Avalanche:
3725
+ case i.Binance:
3726
+ case i.BinanceSmartChain:
3727
+ case i.Bitcoin:
3728
+ case i.BitcoinCash:
3729
+ case i.Dogecoin:
3730
+ case i.Ethereum:
3731
+ case i.Kujira:
3732
+ case i.Litecoin:
3733
+ case i.Maya:
3734
+ case i.Optimism:
3735
+ case i.Polygon:
3736
+ case i.THORChain:
3270
3737
  return `${n}/address/${t}`;
3271
- case s.Cosmos:
3738
+ case i.Cosmos:
3272
3739
  return `${n}/account/${t}`;
3273
- case s.Litecoin:
3274
- return `${n}/${t}`;
3275
3740
  default:
3276
3741
  throw new Error(`Unsupported chain: ${e}`);
3277
3742
  }
3278
- }, Dt = (e) => {
3279
- const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3280
- return Re(`${t}/thorchain/inbound_addresses`);
3281
- }, Bt = (e) => {
3282
- const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3283
- return Re(`${t}/thorchain/mimir`);
3284
- }, fe = () => Object.values(s).reduce(
3743
+ }, mn = (e) => {
3744
+ const t = e ? j.ThornodeStagenet : j.ThornodeMainnet;
3745
+ return we.get(`${t}/thorchain/inbound_addresses`);
3746
+ }, Tn = (e) => {
3747
+ const t = e ? j.ThornodeStagenet : j.ThornodeMainnet;
3748
+ return we.get(`${t}/thorchain/mimir`);
3749
+ }, Se = () => Object.values(i).reduce(
3285
3750
  (e, t) => (e[t] = null, e),
3286
3751
  {}
3287
- );
3288
- var P, z, K, x, Y, X;
3289
- class zt {
3752
+ ), hn = async ({ chain: e, address: t }) => {
3753
+ if (!t)
3754
+ return !1;
3755
+ switch (e) {
3756
+ case i.Bitcoin:
3757
+ return !t.startsWith("bc1p");
3758
+ default:
3759
+ return !0;
3760
+ }
3761
+ };
3762
+ var V, se, X, v, Y, J;
3763
+ class Ln {
3290
3764
  constructor({ stagenet: t } = {}) {
3291
- m(this, "connectedChains", fe());
3292
- m(this, "connectedWallets", fe());
3293
- m(this, "stagenet", !1);
3294
- m(this, "getAddress", (t) => {
3765
+ T(this, "connectedChains", Se());
3766
+ T(this, "connectedWallets", Se());
3767
+ T(this, "stagenet", !1);
3768
+ T(this, "getAddress", (t) => {
3295
3769
  var n;
3296
3770
  return ((n = this.connectedChains[t]) == null ? void 0 : n.address) || "";
3297
3771
  });
3298
- m(this, "getExplorerTxUrl", (t, n) => Nt({ chain: t, txHash: n }));
3299
- m(this, "getWallet", (t) => this.connectedWallets[t]);
3300
- m(this, "getExplorerAddressUrl", (t, n) => xt({ chain: t, address: n }));
3301
- m(this, "getBalance", async (t, n) => {
3302
- var i;
3303
- if (!n)
3304
- return ((i = this.connectedChains[t]) == null ? void 0 : i.balance) || [];
3305
- const a = await this.getWalletByChain(t);
3772
+ T(this, "getExplorerTxUrl", (t, n) => yn({ chain: t, txHash: n }));
3773
+ T(this, "getWallet", (t) => this.connectedWallets[t]);
3774
+ T(this, "getExplorerAddressUrl", (t, n) => cn({ chain: t, address: n }));
3775
+ T(this, "getBalance", async (t, n) => {
3776
+ const a = await this.getWalletByChain(t, n);
3306
3777
  return (a == null ? void 0 : a.balance) || [];
3307
3778
  });
3308
- m(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3309
- var o, y, T, u;
3310
- const { quoteMode: r } = a.meta, p = r.startsWith("ERC20-") ? s.Ethereum : r.startsWith("ARC20-") ? s.Avalanche : s.BinanceSmartChain;
3779
+ T(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: s }) => {
3780
+ var p, d;
3781
+ const { quoteMode: r } = a.meta, o = r.startsWith("ERC20-") ? i.Ethereum : r.startsWith("ARC20-") ? i.Avalanche : i.BinanceSmartChain;
3311
3782
  if (!a.complete)
3312
3783
  throw new c("core_swap_route_not_complete");
3313
3784
  try {
3314
- if (Ue.includes(r)) {
3315
- const l = this.connectedWallets[p];
3785
+ if (Ze.includes(r)) {
3786
+ const l = this.connectedWallets[o];
3316
3787
  if (!(l != null && l.sendTransaction))
3317
3788
  throw new c("core_wallet_connection_not_found");
3318
- if (!(t ? (o = a == null ? void 0 : a.streamingSwap) == null ? void 0 : o.transaction : a == null ? void 0 : a.transaction))
3789
+ if (!(t ? (p = a == null ? void 0 : a.streamingSwap) == null ? void 0 : p.transaction : a == null ? void 0 : a.transaction))
3319
3790
  throw new c("core_swap_route_transaction_not_found");
3320
- const { isHexString: _, parseUnits: R } = await import("./index-cf1865cd.js"), { data: O, from: S, to: I, value: b } = a.transaction, M = {
3321
- data: O,
3322
- from: S,
3323
- to: I.toLowerCase(),
3324
- chainId: BigInt(Ke[p]),
3325
- value: b ? new ye({
3326
- value: _(b) ? b : R(b, "wei").toString(16)
3327
- }).baseValueBigInt : 0n
3791
+ const { data: m, from: _, to: w, value: A } = a.transaction, E = {
3792
+ data: m,
3793
+ from: _,
3794
+ to: w.toLowerCase(),
3795
+ chainId: BigInt(pt[o]),
3796
+ value: A ? BigInt(A) : 0n
3328
3797
  };
3329
- return l.sendTransaction(M, i);
3798
+ return l.sendTransaction(E, s);
3330
3799
  }
3331
- if ($e.includes(r)) {
3800
+ if (tt.includes(r)) {
3332
3801
  if (!a.calldata.fromAsset)
3333
3802
  throw new c("core_swap_asset_not_recognized");
3334
- const l = await v.fromString(a.calldata.fromAsset);
3803
+ const l = await N.fromString(a.calldata.fromAsset);
3335
3804
  if (!l)
3336
3805
  throw new c("core_swap_asset_not_recognized");
3337
- const { address: h } = await A(this, P).call(this, l.chain), {
3338
- contract: _,
3339
- calldata: { amountIn: R, memo: O, memoStreamingSwap: S }
3340
- } = a, I = l.add(ye.fromBigInt(BigInt(R), l.decimal)), b = t && S || O;
3341
- return this.deposit({ assetValue: I, memo: b, feeOptionKey: i, router: _, recipient: h });
3806
+ const { address: u } = await f(this, V).call(this, l.chain), {
3807
+ contract: m,
3808
+ calldata: { expiration: _, amountIn: w, memo: A, memoStreamingSwap: E }
3809
+ } = a, O = l.add(x.fromBigInt(BigInt(w), l.decimal)), S = t && E || A;
3810
+ return this.deposit({
3811
+ expiration: _,
3812
+ assetValue: O,
3813
+ memo: S,
3814
+ feeOptionKey: s,
3815
+ router: m,
3816
+ recipient: u
3817
+ });
3342
3818
  }
3343
- if (He.includes(r)) {
3344
- const { calldata: l, contract: h } = a;
3345
- if (!h)
3819
+ if (et.includes(r)) {
3820
+ const { calldata: l, contract: u } = a;
3821
+ if (!u)
3346
3822
  throw new c("core_swap_contract_not_found");
3347
- const _ = this.connectedWallets[p], R = this.getAddress(p);
3348
- if (!(_ != null && _.sendTransaction) || !R)
3823
+ const m = this.connectedWallets[o], _ = this.getAddress(o);
3824
+ if (!(m != null && m.sendTransaction) || !_)
3349
3825
  throw new c("core_wallet_connection_not_found");
3350
- const { getProvider: O, toChecksumAddress: S } = await import("@swapkit/toolbox-evm"), I = O(p), b = Mt[h.toLowerCase()];
3351
- if (!b)
3352
- throw new c("core_swap_contract_not_supported", { contractAddress: h });
3353
- const ee = await ((u = (T = (await ((y = _.createContract) == null ? void 0 : y.call(_, h, b, I))).populateTransaction).swapIn) == null ? void 0 : u.call(
3354
- T,
3355
- ...Ct({
3826
+ const { getProvider: w, toChecksumAddress: A } = await import("@swapkit/toolbox-evm"), E = w(o), O = un[u.toLowerCase()];
3827
+ if (!O)
3828
+ throw new c("core_swap_contract_not_supported", { contractAddress: u });
3829
+ const D = await (await ((d = m.createContract) == null ? void 0 : d.call(m, u, O, E))).getFunction("swapIn").populateTransaction(
3830
+ ...ln({
3356
3831
  streamSwap: t,
3357
- toChecksumAddress: S,
3358
- contractAddress: h,
3832
+ toChecksumAddress: A,
3833
+ contractAddress: u,
3359
3834
  recipient: n,
3360
3835
  calldata: l
3361
3836
  }),
3362
- { from: R }
3363
- ));
3364
- return _.sendTransaction(ee, i);
3837
+ { from: _ }
3838
+ );
3839
+ return m.sendTransaction(D, s);
3365
3840
  }
3366
3841
  throw new c("core_swap_quote_mode_not_supported", { quoteMode: r });
3367
3842
  } catch (l) {
3368
3843
  throw new c("core_swap_transaction_error", l);
3369
3844
  }
3370
3845
  });
3371
- m(this, "getWalletByChain", async (t) => {
3372
- var i, r;
3373
- const n = this.getAddress(t);
3374
- if (!n)
3846
+ T(this, "getWalletByChain", async (t, n) => {
3847
+ var o, p;
3848
+ const a = this.getAddress(t);
3849
+ if (!a)
3375
3850
  return null;
3376
- const a = await ((i = this.getWallet(t)) == null ? void 0 : i.getBalance(n)) ?? [
3377
- v.fromChainOrSignature(t)
3378
- ];
3379
- return this.connectedChains[t] = {
3380
- address: n,
3381
- balance: a,
3382
- walletType: (r = this.connectedChains[t]) == null ? void 0 : r.walletType
3383
- }, { ...this.connectedChains[t] };
3851
+ const s = [N.fromChainOrSignature(t)], r = (o = this.connectedChains[t]) == null ? void 0 : o.walletType;
3852
+ try {
3853
+ const d = await ((p = this.getWallet(t)) == null ? void 0 : p.getBalance(a, n));
3854
+ return this.connectedChains[t] = {
3855
+ address: a,
3856
+ balance: d != null && d.length ? d : s,
3857
+ walletType: r
3858
+ }, { ...this.connectedChains[t] };
3859
+ } catch (d) {
3860
+ return console.error(d), { address: a, balance: s, walletType: r };
3861
+ }
3384
3862
  });
3385
- m(this, "approveAssetValue", (t, n) => A(this, K).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3386
- m(this, "isAssetValueApproved", (t, n) => A(this, K).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3387
- m(this, "validateAddress", ({ address: t, chain: n }) => {
3388
- var a, i;
3389
- return (i = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : i.call(a, t);
3863
+ T(this, "approveAssetValue", (t, n) => f(this, X).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3864
+ T(this, "isAssetValueApproved", (t, n) => f(this, X).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3865
+ T(this, "validateAddress", ({ address: t, chain: n }) => {
3866
+ var a, s;
3867
+ return (s = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : s.call(a, t);
3390
3868
  });
3391
- m(this, "transfer", async (t) => {
3869
+ T(this, "transfer", async (t) => {
3392
3870
  const n = this.connectedWallets[t.assetValue.chain];
3393
3871
  if (!n)
3394
3872
  throw new c("core_wallet_connection_not_found");
3395
3873
  try {
3396
- return await n.transfer(A(this, X).call(this, t));
3874
+ return await n.transfer(f(this, J).call(this, t));
3397
3875
  } catch (a) {
3398
3876
  throw new c("core_swap_transaction_error", a);
3399
3877
  }
3400
3878
  });
3401
- m(this, "deposit", async ({
3879
+ T(this, "deposit", async ({
3402
3880
  assetValue: t,
3403
3881
  recipient: n,
3404
3882
  router: a,
3405
- ...i
3883
+ ...s
3406
3884
  }) => {
3407
- const { chain: r, symbol: p, ticker: o } = t, y = this.connectedWallets[r];
3408
- if (!y)
3885
+ const { chain: r, symbol: o, ticker: p } = t, d = this.connectedWallets[r];
3886
+ if (!await hn({ address: await (d == null ? void 0 : d.getAddress()), chain: r }))
3887
+ throw new c("core_transaction_invalid_sender_address");
3888
+ if (!d)
3409
3889
  throw new c("core_wallet_connection_not_found");
3410
- const T = A(this, X).call(this, { assetValue: t, recipient: n, router: a, ...i });
3890
+ const l = f(this, J).call(this, { assetValue: t, recipient: n, router: a, ...s });
3411
3891
  try {
3412
3892
  switch (r) {
3413
- case s.THORChain: {
3414
- const u = y;
3415
- return await (n === "" ? u.deposit(T) : u.transfer(T));
3893
+ case i.THORChain: {
3894
+ const u = d;
3895
+ return await (n === "" ? u.deposit(l) : u.transfer(l));
3416
3896
  }
3417
- case s.Ethereum:
3418
- case s.BinanceSmartChain:
3419
- case s.Avalanche: {
3420
- const { getChecksumAddressFromAsset: u } = await import("@swapkit/toolbox-evm"), l = r === s.Avalanche ? Pe : r === s.BinanceSmartChain ? Ve : Be;
3421
- return await y.call({
3422
- abi: l,
3423
- contractAddress: a || (await A(this, P).call(this, r)).router,
3897
+ case i.Ethereum:
3898
+ case i.BinanceSmartChain:
3899
+ case i.Avalanche: {
3900
+ const { getChecksumAddressFromAsset: u } = await import("@swapkit/toolbox-evm"), m = r === i.Avalanche ? Je : r === i.BinanceSmartChain ? Qe : Ye;
3901
+ return await d.call({
3902
+ abi: m,
3903
+ contractAddress: a || (await f(this, V).call(this, r)).router,
3424
3904
  funcName: "depositWithExpiry",
3425
3905
  funcParams: [
3426
3906
  n,
3427
- u({ chain: r, symbol: p, ticker: o }, r),
3428
- // TODO: (@Towan) Re-Check on that conversion 🙏
3429
- t.baseValueBigInt.toString(),
3430
- T.memo,
3431
- i.expiration
3907
+ u({ chain: r, symbol: o, ticker: p }, r),
3908
+ t.getBaseValue("string"),
3909
+ l.memo,
3910
+ s.expiration || parseInt(`${((/* @__PURE__ */ new Date()).getTime() + 15 * 60 * 1e3) / 1e3}`)
3432
3911
  ],
3433
- txOverrides: { from: T.from, value: t.baseValueBigInt }
3912
+ txOverrides: {
3913
+ from: l.from,
3914
+ value: t.isGasAsset ? t.getBaseValue("bigint") : void 0
3915
+ }
3434
3916
  });
3435
3917
  }
3436
3918
  default:
3437
- return await y.transfer(T);
3919
+ return await d.transfer(l);
3438
3920
  }
3439
3921
  } catch (u) {
3440
- const l = ((u == null ? void 0 : u.message) || (u == null ? void 0 : u.toString())).toLowerCase(), h = l == null ? void 0 : l.includes("insufficient funds"), _ = l == null ? void 0 : l.includes("gas"), R = l == null ? void 0 : l.includes("server"), O = h ? "core_transaction_deposit_insufficient_funds_error" : _ ? "core_transaction_deposit_gas_error" : R ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
3441
- throw new c(O, u);
3922
+ const m = ((u == null ? void 0 : u.message) || (u == null ? void 0 : u.toString())).toLowerCase(), _ = m == null ? void 0 : m.includes("insufficient funds"), w = m == null ? void 0 : m.includes("gas"), A = m == null ? void 0 : m.includes("server"), E = _ ? "core_transaction_deposit_insufficient_funds_error" : w ? "core_transaction_deposit_gas_error" : A ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
3923
+ throw new c(E, u);
3442
3924
  }
3443
3925
  });
3444
3926
  /**
3445
3927
  * TC related Methods
3446
3928
  */
3447
- m(this, "createLiquidity", async ({
3929
+ T(this, "createLiquidity", async ({
3448
3930
  runeAssetValue: t,
3449
3931
  assetValue: n
3450
3932
  }) => {
3451
3933
  if (t.lte(0) || n.lte(0))
3452
3934
  throw new c("core_transaction_create_liquidity_invalid_params");
3453
- let a = "", i = "";
3935
+ let a = "", s = "";
3454
3936
  try {
3455
- a = await A(this, x).call(this, {
3937
+ a = await f(this, v).call(this, {
3456
3938
  assetValue: t,
3457
- memo: D(f.DEPOSIT, {
3939
+ memo: M(h.DEPOSIT, {
3458
3940
  ...n,
3459
3941
  address: this.getAddress(n.chain)
3460
3942
  })
@@ -3463,166 +3945,172 @@ class zt {
3463
3945
  throw new c("core_transaction_create_liquidity_rune_error", r);
3464
3946
  }
3465
3947
  try {
3466
- i = await A(this, x).call(this, {
3948
+ s = await f(this, v).call(this, {
3467
3949
  assetValue: n,
3468
- memo: D(f.DEPOSIT, {
3950
+ memo: M(h.DEPOSIT, {
3469
3951
  ...n,
3470
- address: this.getAddress(s.THORChain)
3952
+ address: this.getAddress(i.THORChain)
3471
3953
  })
3472
3954
  });
3473
3955
  } catch (r) {
3474
3956
  throw new c("core_transaction_create_liquidity_asset_error", r);
3475
3957
  }
3476
- return { runeTx: a, assetTx: i };
3958
+ return { runeTx: a, assetTx: s };
3477
3959
  });
3478
- m(this, "addLiquidity", async ({
3479
- poolIdentifier: t,
3480
- runeAssetValue: n,
3481
- assetValue: a,
3482
- runeAddr: i,
3483
- assetAddr: r,
3484
- isPendingSymmAsset: p,
3960
+ T(this, "addLiquidity", async ({
3961
+ runeAssetValue: t,
3962
+ assetValue: n,
3963
+ runeAddr: a,
3964
+ assetAddr: s,
3965
+ isPendingSymmAsset: r,
3485
3966
  mode: o = "sym"
3486
3967
  }) => {
3487
- const [y, ...T] = t.split("."), u = o === "sym", l = (n == null ? void 0 : n.gt(0)) && (u || o === "rune"), h = (a == null ? void 0 : a.gt(0)) && (u || o === "asset"), _ = p || l, R = _ ? i || this.getAddress(s.THORChain) : "", O = u || o === "asset" ? r || this.getAddress(y) : "";
3488
- if (!l && !h)
3968
+ const { chain: p, symbol: d } = n, l = o === "sym", u = (t == null ? void 0 : t.gt(0)) && (l || o === "rune"), m = (n == null ? void 0 : n.gt(0)) && (l || o === "asset"), _ = r || u, w = _ ? a || this.getAddress(i.THORChain) : "", A = l || o === "asset" ? s || this.getAddress(p) : "";
3969
+ if (!u && !m)
3489
3970
  throw new c("core_transaction_add_liquidity_invalid_params");
3490
- if (_ && !R)
3971
+ if (_ && !w)
3491
3972
  throw new c("core_transaction_add_liquidity_no_rune_address");
3492
- let S, I;
3493
- const b = { chain: y, symbol: T.join(".") };
3494
- if (l && n)
3973
+ let E, O;
3974
+ if (u && t)
3495
3975
  try {
3496
- S = await A(this, x).call(this, {
3497
- assetValue: n,
3498
- memo: D(f.DEPOSIT, { ...b, address: O })
3976
+ E = await f(this, v).call(this, {
3977
+ assetValue: t,
3978
+ memo: M(h.DEPOSIT, { chain: p, symbol: d, address: A })
3499
3979
  });
3500
- } catch (M) {
3501
- throw new c("core_transaction_add_liquidity_rune_error", M);
3980
+ } catch (S) {
3981
+ throw new c("core_transaction_add_liquidity_rune_error", S);
3502
3982
  }
3503
- if (h && a)
3983
+ if (m && n)
3504
3984
  try {
3505
- I = await A(this, x).call(this, {
3506
- assetValue: a,
3507
- memo: D(f.DEPOSIT, { ...b, address: R })
3985
+ O = await f(this, v).call(this, {
3986
+ assetValue: n,
3987
+ memo: M(h.DEPOSIT, { chain: p, symbol: d, address: w })
3508
3988
  });
3509
- } catch (M) {
3510
- throw new c("core_transaction_add_liquidity_asset_error", M);
3989
+ } catch (S) {
3990
+ throw new c("core_transaction_add_liquidity_asset_error", S);
3511
3991
  }
3512
- return { runeTx: S, assetTx: I };
3992
+ return { runeTx: E, assetTx: O };
3513
3993
  });
3514
- m(this, "withdraw", async ({
3994
+ T(this, "addLiquidityPart", ({
3995
+ assetValue: t,
3996
+ poolAddress: n,
3997
+ address: a,
3998
+ symmetric: s
3999
+ }) => {
4000
+ if (s && !a)
4001
+ throw new c("core_transaction_add_liquidity_invalid_params");
4002
+ const r = M(h.DEPOSIT, {
4003
+ chain: n.split(".")[0],
4004
+ symbol: n.split(".")[1],
4005
+ address: s ? a : ""
4006
+ });
4007
+ return f(this, v).call(this, { assetValue: t, memo: r });
4008
+ });
4009
+ T(this, "withdraw", async ({
3515
4010
  memo: t,
3516
4011
  assetValue: n,
3517
4012
  percent: a,
3518
- from: i,
4013
+ from: s,
3519
4014
  to: r
3520
4015
  }) => {
3521
- const p = r === "rune" ? v.fromChainOrSignature(s.THORChain) : i === "sym" && r === "sym" || i === "rune" || i === "asset" ? void 0 : n;
3522
- try {
3523
- return await A(this, x).call(this, {
3524
- assetValue: he(i === "asset" ? n.chain : s.THORChain),
3525
- memo: t || D(f.WITHDRAW, {
3526
- symbol: n.symbol,
3527
- chain: n.chain,
3528
- ticker: n.ticker,
3529
- basisPoints: Math.max(1e4, Math.round(a * 100)),
3530
- targetAssetString: p == null ? void 0 : p.toString(),
3531
- singleSide: !1
3532
- })
3533
- });
3534
- } catch (o) {
3535
- throw new c("core_transaction_withdraw_error", o);
3536
- }
4016
+ const o = r === "rune" ? N.fromChainOrSignature(i.THORChain) : s === "sym" && r === "sym" || s === "rune" || s === "asset" ? void 0 : n, p = le(s === "asset" ? n.chain : i.THORChain), d = t || M(h.WITHDRAW, {
4017
+ symbol: n.symbol,
4018
+ chain: n.chain,
4019
+ ticker: n.ticker,
4020
+ basisPoints: Math.min(1e4, Math.round(a * 100)),
4021
+ targetAssetString: o == null ? void 0 : o.toString(),
4022
+ singleSide: !1
4023
+ });
4024
+ return f(this, v).call(this, { assetValue: p, memo: d });
3537
4025
  });
3538
- m(this, "savings", async ({
4026
+ T(this, "savings", async ({
3539
4027
  assetValue: t,
3540
4028
  memo: n,
3541
4029
  percent: a,
3542
- type: i
4030
+ type: s
3543
4031
  }) => {
3544
- const r = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || D(r, {
4032
+ const r = s === "add" ? h.DEPOSIT : h.WITHDRAW, o = n || M(r, {
3545
4033
  ticker: t.ticker,
3546
4034
  symbol: t.symbol,
3547
4035
  chain: t.chain,
3548
4036
  singleSide: !0,
3549
- basisPoints: a ? Math.max(1e4, Math.round(a * 100)) : void 0
3550
- });
3551
- return A(this, x).call(this, { assetValue: t, memo: p });
4037
+ basisPoints: a ? Math.min(1e4, Math.round(a * 100)) : void 0
4038
+ }), p = r === h.DEPOSIT ? t : le(t.chain);
4039
+ return f(this, v).call(this, { memo: o, assetValue: p });
3552
4040
  });
3553
- m(this, "loan", ({
4041
+ T(this, "loan", ({
3554
4042
  assetValue: t,
3555
4043
  memo: n,
3556
4044
  minAmount: a,
3557
- type: i
3558
- }) => A(this, x).call(this, {
4045
+ type: s
4046
+ }) => f(this, v).call(this, {
3559
4047
  assetValue: t,
3560
- memo: n || D(i === "open" ? f.OPEN_LOAN : f.CLOSE_LOAN, {
4048
+ memo: n || M(s === "open" ? h.OPEN_LOAN : h.CLOSE_LOAN, {
3561
4049
  asset: t.toString(),
3562
4050
  minAmount: a.toString(),
3563
4051
  address: this.getAddress(t.chain)
3564
4052
  })
3565
4053
  }));
3566
- m(this, "nodeAction", ({
4054
+ T(this, "nodeAction", ({
3567
4055
  type: t,
3568
4056
  assetValue: n,
3569
4057
  address: a
3570
4058
  }) => {
3571
- const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, r = D(i, {
4059
+ const s = t === "bond" ? h.BOND : t === "unbond" ? h.UNBOND : h.LEAVE, r = M(s, {
3572
4060
  address: a,
3573
- unbondAmount: t === "unbond" ? n.baseValueNumber : void 0
4061
+ unbondAmount: t === "unbond" ? n.getBaseValue("number") : void 0
3574
4062
  });
3575
- return A(this, Y).call(this, {
4063
+ return f(this, Y).call(this, {
3576
4064
  memo: r,
3577
- assetValue: t === "bond" ? n : he(s.THORChain)
4065
+ assetValue: t === "bond" ? n : le(i.THORChain)
3578
4066
  });
3579
4067
  });
3580
- m(this, "registerThorname", ({
4068
+ T(this, "registerThorname", ({
3581
4069
  assetValue: t,
3582
4070
  ...n
3583
- }) => A(this, Y).call(this, { assetValue: t, memo: D(f.THORNAME_REGISTER, n) }));
3584
- m(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
4071
+ }) => f(this, Y).call(this, { assetValue: t, memo: M(h.THORNAME_REGISTER, n) }));
4072
+ T(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: s = {} }) => {
3585
4073
  try {
3586
4074
  t.forEach((r) => {
3587
4075
  this[r.connectMethodName] = r.connect({
3588
- addChain: A(this, z),
4076
+ addChain: f(this, se),
3589
4077
  config: n || {},
3590
4078
  apis: a,
3591
- rpcUrls: i
4079
+ rpcUrls: s
3592
4080
  });
3593
4081
  });
3594
4082
  } catch (r) {
3595
4083
  throw new c("core_extend_error", r);
3596
4084
  }
3597
4085
  });
3598
- m(this, "estimateMaxSendableAmount", async ({
4086
+ T(this, "estimateMaxSendableAmount", async ({
3599
4087
  chain: t,
3600
4088
  params: n
3601
4089
  }) => {
3602
4090
  const a = this.getWallet(t);
3603
4091
  switch (t) {
3604
- case s.Arbitrum:
3605
- case s.Avalanche:
3606
- case s.BinanceSmartChain:
3607
- case s.Ethereum:
3608
- case s.Optimism:
3609
- case s.Polygon: {
3610
- const { estimateMaxSendableAmount: i } = await import("@swapkit/toolbox-evm");
3611
- return i({
4092
+ case i.Arbitrum:
4093
+ case i.Avalanche:
4094
+ case i.BinanceSmartChain:
4095
+ case i.Ethereum:
4096
+ case i.Optimism:
4097
+ case i.Polygon: {
4098
+ const { estimateMaxSendableAmount: s } = await import("@swapkit/toolbox-evm");
4099
+ return s({
3612
4100
  ...n,
3613
4101
  toolbox: a
3614
4102
  });
3615
4103
  }
3616
- case s.Bitcoin:
3617
- case s.BitcoinCash:
3618
- case s.Dogecoin:
3619
- case s.Litecoin:
4104
+ case i.Bitcoin:
4105
+ case i.BitcoinCash:
4106
+ case i.Dogecoin:
4107
+ case i.Litecoin:
3620
4108
  return a.estimateMaxSendableAmount(n);
3621
- case s.Binance:
3622
- case s.THORChain:
3623
- case s.Cosmos: {
3624
- const { estimateMaxSendableAmount: i } = await import("@swapkit/toolbox-cosmos");
3625
- return i({
4109
+ case i.Binance:
4110
+ case i.THORChain:
4111
+ case i.Cosmos: {
4112
+ const { estimateMaxSendableAmount: s } = await import("@swapkit/toolbox-cosmos");
4113
+ return s({
3626
4114
  ...n,
3627
4115
  toolbox: a
3628
4116
  });
@@ -3634,99 +4122,99 @@ class zt {
3634
4122
  /**
3635
4123
  * Wallet connection methods
3636
4124
  */
3637
- m(this, "connectXDEFI", async (t) => {
4125
+ T(this, "connectXDEFI", async (t) => {
3638
4126
  throw new c("core_wallet_xdefi_not_installed");
3639
4127
  });
3640
- m(this, "connectEVMWallet", async (t, n) => {
4128
+ T(this, "connectEVMWallet", async (t, n) => {
3641
4129
  throw new c("core_wallet_evmwallet_not_installed");
3642
4130
  });
3643
- m(this, "connectWalletconnect", async (t, n) => {
4131
+ T(this, "connectWalletconnect", async (t, n) => {
3644
4132
  throw new c("core_wallet_walletconnect_not_installed");
3645
4133
  });
3646
- m(this, "connectKeystore", async (t, n) => {
4134
+ T(this, "connectKeystore", async (t, n) => {
3647
4135
  throw new c("core_wallet_keystore_not_installed");
3648
4136
  });
3649
- m(this, "connectLedger", async (t, n) => {
4137
+ T(this, "connectLedger", async (t, n) => {
3650
4138
  throw new c("core_wallet_ledger_not_installed");
3651
4139
  });
3652
- m(this, "connectTrezor", async (t, n) => {
4140
+ T(this, "connectTrezor", async (t, n) => {
3653
4141
  throw new c("core_wallet_trezor_not_installed");
3654
4142
  });
3655
- m(this, "connectKeplr", async (t) => {
4143
+ T(this, "connectKeplr", async (t) => {
3656
4144
  throw new c("core_wallet_keplr_not_installed");
3657
4145
  });
3658
- m(this, "connectOkx", async (t) => {
4146
+ T(this, "connectOkx", async (t) => {
3659
4147
  throw new c("core_wallet_okx_not_installed");
3660
4148
  });
3661
- m(this, "disconnectChain", (t) => {
4149
+ T(this, "disconnectChain", (t) => {
3662
4150
  this.connectedChains[t] = null, this.connectedWallets[t] = null;
3663
4151
  });
3664
- B(this, P, async (t) => {
3665
- if (t === s.THORChain)
4152
+ P(this, V, async (t) => {
4153
+ if (t === i.THORChain)
3666
4154
  return {
3667
4155
  gas_rate: "0",
3668
4156
  router: "0",
3669
4157
  address: "",
3670
4158
  halted: !1,
3671
- chain: s.THORChain
4159
+ chain: i.THORChain
3672
4160
  };
3673
- const a = (await Dt(this.stagenet)).find((i) => i.chain === t);
4161
+ const a = (await mn(this.stagenet)).find((s) => s.chain === t);
3674
4162
  if (!a)
3675
4163
  throw new c("core_inbound_data_not_found");
3676
4164
  if (a != null && a.halted)
3677
4165
  throw new c("core_chain_halted");
3678
4166
  return a;
3679
4167
  });
3680
- B(this, z, ({ chain: t, wallet: n, walletMethods: a }) => {
4168
+ P(this, se, ({ chain: t, wallet: n, walletMethods: a }) => {
3681
4169
  this.connectedChains[t] = n, this.connectedWallets[t] = a;
3682
4170
  });
3683
- B(this, K, async ({
3684
- assetValue: { baseValueBigInt: t, address: n, chain: a, isGasAsset: i, isSynthetic: r },
3685
- type: p = "checkOnly",
3686
- contractAddress: o
4171
+ P(this, X, async ({
4172
+ assetValue: t,
4173
+ type: n = "checkOnly",
4174
+ contractAddress: a
3687
4175
  }) => {
3688
- const y = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(a);
3689
- if (y && i || !y || r)
4176
+ const { address: s, chain: r, isGasAsset: o, isSynthetic: p } = t, d = [i.Ethereum, i.Avalanche, i.BinanceSmartChain].includes(r);
4177
+ if (d && o || !d || p)
3690
4178
  return !0;
3691
- const u = this.connectedWallets[a], l = p === "checkOnly" ? u == null ? void 0 : u.isApproved : u == null ? void 0 : u.approve;
3692
- if (!l)
4179
+ const u = this.connectedWallets[r], m = n === "checkOnly" ? u == null ? void 0 : u.isApproved : u == null ? void 0 : u.approve;
4180
+ if (!m)
3693
4181
  throw new c("core_wallet_connection_not_found");
3694
- const h = this.getAddress(a);
3695
- if (!n || !h)
4182
+ const _ = this.getAddress(r);
4183
+ if (!s || !_)
3696
4184
  throw new c("core_approve_asset_address_or_from_not_found");
3697
- const _ = o || (await A(this, P).call(this, a)).router;
3698
- return l({
3699
- amount: t,
3700
- assetAddress: n,
3701
- from: h,
3702
- spenderAddress: _
4185
+ const w = a || (await f(this, V).call(this, r)).router;
4186
+ return m({
4187
+ amount: t.getBaseValue("bigint"),
4188
+ assetAddress: s,
4189
+ from: _,
4190
+ spenderAddress: w
3703
4191
  });
3704
4192
  });
3705
- B(this, x, async ({
4193
+ P(this, v, async ({
3706
4194
  assetValue: t,
3707
4195
  memo: n,
3708
- feeOptionKey: a = k.Fast
4196
+ feeOptionKey: a = F.Fast
3709
4197
  }) => {
3710
4198
  const {
3711
- gas_rate: i,
4199
+ gas_rate: s,
3712
4200
  router: r,
3713
- address: p
3714
- } = await A(this, P).call(this, t.chain), o = (parseInt(i) || 0) * st[a];
4201
+ address: o
4202
+ } = await f(this, V).call(this, t.chain), p = (parseInt(s) || 0) * wt[a];
3715
4203
  return this.deposit({
3716
4204
  assetValue: t,
3717
- recipient: p,
4205
+ recipient: o,
3718
4206
  memo: n,
3719
4207
  router: r,
3720
- feeRate: o
4208
+ feeRate: p
3721
4209
  });
3722
4210
  });
3723
- B(this, Y, async ({ memo: t, assetValue: n }) => {
3724
- const a = await Bt(this.stagenet);
4211
+ P(this, Y, async ({ memo: t, assetValue: n }) => {
4212
+ const a = await Tn(this.stagenet);
3725
4213
  if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
3726
4214
  throw new c("core_chain_halted");
3727
4215
  return this.deposit({ assetValue: n, recipient: "", memo: t });
3728
4216
  });
3729
- B(this, X, ({ assetValue: t, ...n }) => ({
4217
+ P(this, J, ({ assetValue: t, ...n }) => ({
3730
4218
  ...n,
3731
4219
  memo: n.memo || "",
3732
4220
  from: this.getAddress(t.chain),
@@ -3735,65 +4223,67 @@ class zt {
3735
4223
  this.stagenet = !!t;
3736
4224
  }
3737
4225
  }
3738
- P = new WeakMap(), z = new WeakMap(), K = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
4226
+ V = new WeakMap(), se = new WeakMap(), X = new WeakMap(), v = new WeakMap(), Y = new WeakMap(), J = new WeakMap();
3739
4227
  export {
3740
- Ue as AGG_SWAP,
3741
- Ae as ApiError,
3742
- W as ApiUrl,
3743
- v as AssetValue,
3744
- E as BaseDecimal,
3745
- pe as BigIntArithmetics,
3746
- s as Chain,
3747
- le as ChainId,
3748
- Ft as ChainIdToChain,
3749
- Ke as ChainToChainId,
3750
- Ee as ChainToExplorerUrl,
3751
- kt as ChainToHexChainId,
3752
- Ye as ChainToRPC,
3753
- Ge as ContractAddress,
3754
- $t as CosmosChainList,
3755
- We as DerivationPath,
3756
- d as ERROR_CODE,
3757
- ke as ERROR_MODULE,
3758
- be as ERROR_TYPE,
3759
- Ut as EVMChainList,
3760
- Xe as ErrorCode,
3761
- k as FeeOption,
3762
- f as MemoType,
3763
- Lt as NetworkDerivationPath,
3764
- Le as QuoteMode,
3765
- we as RPCUrl,
3766
- He as SWAP_IN,
3767
- $e as SWAP_OUT,
3768
- zt as SwapKitCore,
4228
+ Ze as AGG_SWAP,
4229
+ bn as ApiError,
4230
+ j as ApiUrl,
4231
+ N as AssetValue,
4232
+ b as BaseDecimal,
4233
+ He as BigIntArithmetics,
4234
+ i as Chain,
4235
+ _e as ChainId,
4236
+ On as ChainIdToChain,
4237
+ pt as ChainToChainId,
4238
+ Me as ChainToExplorerUrl,
4239
+ gn as ChainToHexChainId,
4240
+ dt as ChainToRPC,
4241
+ st as ContractAddress,
4242
+ En as CosmosChainList,
4243
+ it as DerivationPath,
4244
+ y as ERROR_CODE,
4245
+ nt as ERROR_MODULE,
4246
+ Ie as ERROR_TYPE,
4247
+ rt as EVMChainList,
4248
+ ut as ErrorCode,
4249
+ F as FeeOption,
4250
+ h as MemoType,
4251
+ wn as NetworkDerivationPath,
4252
+ ze as QuoteMode,
4253
+ Ce as RPCUrl,
4254
+ we as RequestClient,
4255
+ et as SWAP_IN,
4256
+ tt as SWAP_OUT,
4257
+ Ln as SwapKitCore,
3769
4258
  c as SwapKitError,
3770
- ye as SwapKitNumber,
3771
- Pe as TCAvalancheDepositABI,
3772
- Ve as TCBscDepositABI,
3773
- Be as TCEthereumVaultAbi,
3774
- Ht as UTXOChainList,
3775
- je as WalletOption,
3776
- Kt as assetFromString,
3777
- qt as derivationPathToString,
3778
- Vt as erc20ABI,
3779
- ge as formatBigIntToSafeValue,
3780
- st as gasFeeMultiplier,
3781
- pt as getAssetType,
3782
- dt as getAsymmetricAssetShare,
3783
- Xt as getAsymmetricAssetWithdrawAmount,
3784
- ot as getAsymmetricRuneShare,
3785
- Yt as getAsymmetricRuneWithdrawAmount,
3786
- rt as getCommonAssetInfo,
3787
- Ie as getDecimal,
3788
- Qt as getEstimatedPoolShare,
3789
- Jt as getLiquiditySlippage,
3790
- D as getMemoFor,
3791
- he as getMinAmountByChain,
3792
- Re as getRequest,
3793
- ut as getSymmetricPoolShare,
3794
- jt as getSymmetricWithdraw,
3795
- Gt as getTHORNameCost,
3796
- it as isGasAsset,
3797
- Ze as postRequest,
3798
- Wt as validateTHORName
4259
+ x as SwapKitNumber,
4260
+ Je as TCAvalancheDepositABI,
4261
+ Qe as TCBscDepositABI,
4262
+ Ye as TCEthereumVaultAbi,
4263
+ Rn as TCSupportedChainList,
4264
+ An as UTXOChainList,
4265
+ lt as WalletOption,
4266
+ Sn as assetFromString,
4267
+ Bn as derivationPathToString,
4268
+ fn as erc20ABI,
4269
+ In as filterAssets,
4270
+ re as formatBigIntToSafeValue,
4271
+ wt as gasFeeMultiplier,
4272
+ Et as getAssetType,
4273
+ St as getAsymmetricAssetShare,
4274
+ Cn as getAsymmetricAssetWithdrawAmount,
4275
+ Ot as getAsymmetricRuneShare,
4276
+ vn as getAsymmetricRuneWithdrawAmount,
4277
+ At as getCommonAssetInfo,
4278
+ bt as getDecimal,
4279
+ Nn as getEstimatedPoolShare,
4280
+ xn as getLiquiditySlippage,
4281
+ M as getMemoFor,
4282
+ le as getMinAmountByChain,
4283
+ It as getSymmetricPoolShare,
4284
+ Mn as getSymmetricWithdraw,
4285
+ Dn as getTHORNameCost,
4286
+ xe as isGasAsset,
4287
+ Pn as validateTHORName
3799
4288
  };
4289
+ //# sourceMappingURL=index.es.js.map