@swapkit/core 1.0.0-rc.11 → 1.0.0-rc.13

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,15 +1,15 @@
1
1
  var Me = Object.defineProperty;
2
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) => {
3
+ var T = (e, t, n) => (Ce(e, typeof t != "symbol" ? t + "" : t, n), n), Ne = (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)), P = (e, t, n) => {
7
+ var f = (e, t, n) => (Ne(e, t, "read from private field"), n ? n.call(e) : t.get(e)), B = (e, t, n) => {
8
8
  if (t.has(e))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
11
11
  };
12
- var 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);
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, M = (e, t, n) => (De(e, typeof t != "symbol" ? t + "" : t, n), n);
13
13
  const Lt = [
14
14
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
15
15
  {
@@ -108,7 +108,7 @@ const Lt = [
108
108
  stateMutability: "nonpayable",
109
109
  type: "function"
110
110
  }
111
- ], Pe = [
111
+ ], Be = [
112
112
  {
113
113
  inputs: [{ internalType: "address", name: "rune", type: "address" }],
114
114
  stateMutability: "nonpayable",
@@ -283,7 +283,7 @@ const Lt = [
283
283
  stateMutability: "view",
284
284
  type: "function"
285
285
  }
286
- ], Be = [
286
+ ], Pe = [
287
287
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
288
288
  {
289
289
  anonymous: !1,
@@ -624,65 +624,65 @@ const Ue = [
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 || {});
627
+ var fe = /* @__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))(fe || {}), 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 || {}), u = /* @__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))(u || {});
628
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) => {
629
+ [u.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
630
+ [u.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
631
+ [u.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
632
+ [u.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
633
+ [u.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
634
+ [u.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
635
+ [u.INVALID_TYPE_GENERIC]: "Invalid type",
636
+ [u.INVALID_NUMBER_STRING]: "Invalid number string.",
637
+ [u.INVALID_NUMBER]: "Invalid number.",
638
+ [u.INVALID_BOOLEAN]: "Invalid boolean.",
639
+ [u.INVALID_OBJECT]: "Invalid object.",
640
+ [u.INVALID_ARRAY]: "Invalid array.",
641
+ [u.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
642
+ [u.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
643
+ [u.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
644
+ [u.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
645
+ [u.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
646
+ [u.AFF_BPS_INTEGER_0_100]: "affiliateBasisPoints must be an integer between 0 and 100.",
647
+ [u.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
648
+ [u.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
649
+ [u.PREFERRED_PROFVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
650
+ [u.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
651
+ [u.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
652
+ [u.INVALID_PROVIDER]: "Invalid provider {0}.",
653
+ [u.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
654
+ [u.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
655
+ [u.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
656
+ [u.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
657
+ [u.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
658
+ [u.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
659
+ [u.INVALID_CHAIN]: "Invalid chain {0}.",
660
+ [u.INVALID_ASSET]: "Invalid asset {0}.",
661
+ [u.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
662
+ [u.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
663
+ [u.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
664
+ [u.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
665
+ [u.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
666
+ [u.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
667
+ [u.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
668
+ [u.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
669
+ [u.INVALID_QUOTE_MODE]: "Invalid quote mode.",
670
+ [u.NO_QUOTES]: "No quotes to service this request.",
671
+ [u.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
672
+ [u.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
673
+ [u.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
674
+ [u.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
675
+ [u.NO_PRICE]: "No price for asset {0}.",
676
+ [u.PRICE_IS_STALE]: "Price is stale for asset {0}.",
677
+ [u.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
678
+ [u.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
679
+ }, ee = (e, t) => {
680
680
  let n = Fe[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
+ class be extends Error {
686
686
  constructor({
687
687
  status: t,
688
688
  revision: n,
@@ -690,22 +690,22 @@ class Ae extends Error {
690
690
  code: i,
691
691
  message: r,
692
692
  type: p,
693
- options: { shouldLog: o, shouldThrow: y, shouldTrace: T } = {
693
+ options: { shouldLog: d, shouldThrow: y, shouldTrace: l } = {
694
694
  shouldLog: !0,
695
695
  shouldThrow: !0,
696
696
  shouldTrace: !0
697
697
  },
698
- displayMessageParams: u
698
+ displayMessageParams: o
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,
700
+ const c = r || ee(i, o || []) || "";
701
+ super(c), M(this, "status"), M(this, "revision"), M(this, "type"), M(this, "module"), M(this, "code"), M(this, "message"), M(this, "display"), M(this, "stack"), M(this, "options"), M(this, "displayMessageParams"), this.status = t, this.revision = n || "NO_REVISION", this.module = a, this.message = c, this.display = ee(i, o || []), this.code = i, this.type = p || fe.UNHANDLED_ERROR, this.options = {
702
+ shouldLog: d || !0,
703
+ shouldTrace: l || !0,
704
704
  shouldThrow: y || !1
705
- }, this.displayMessageParams = u || [], this.options.shouldTrace && Error.captureStackTrace(this);
705
+ }, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
706
706
  }
707
707
  static fromErrorInfo(t) {
708
- return new Ae(t);
708
+ return new be(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 ee(this.code, this.displayMessageParams || []);
718
718
  }
719
719
  handle() {
720
720
  const t = `[${this.identifier}]: ${this.message}`;
@@ -742,7 +742,7 @@ const Ut = {
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 || {});
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
746
  const Ht = [
747
747
  "ETH",
748
748
  "AVAX",
@@ -763,23 +763,23 @@ const Ht = [
763
763
  "BNB"
764
764
  /* Binance */
765
765
  ];
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(
766
+ var ye = /* @__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))(ye || {}), Ae = /* @__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))(Ae || {}), 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), le = Z.reduce(
768
768
  (e, t) => {
769
769
  const n = qe.find((a) => s[a] === t);
770
770
  return n && (e[t] = n), e;
771
771
  },
772
772
  {}
773
773
  ), Ke = Z.reduce(
774
- (e, t) => (e[t] = le[ce[t]], e),
774
+ (e, t) => (e[t] = ye[le[t]], e),
775
775
  {}
776
776
  ), Ye = Z.reduce(
777
- (e, t) => (e[t] = we[ce[t]], e),
777
+ (e, t) => (e[t] = Ae[le[t]], e),
778
778
  {}
779
779
  ), Ft = Z.reduce(
780
780
  (e, t) => {
781
- const n = `${ce[t]}Hex`;
782
- return e[t] = le[n], e;
781
+ const n = `${le[t]}Hex`;
782
+ return e[t] = ye[n], e;
783
783
  },
784
784
  {}
785
785
  ), Gt = {
@@ -807,7 +807,7 @@ const Z = Object.values(s), qe = Object.keys(s), ce = Z.reduce(
807
807
  "thorchain-stagenet-v2": "THOR",
808
808
  "thorchain-mainnet-v1": "THOR"
809
809
  /* THORChain */
810
- }, Ee = {
810
+ }, we = {
811
811
  ARB: "https://arbiscan.io",
812
812
  AVAX: "https://snowtrace.io",
813
813
  BSC: "https://bscscan.com",
@@ -824,7 +824,7 @@ const Z = Object.values(s), qe = Object.keys(s), ce = Z.reduce(
824
824
  MATIC: "https://polygonscan.com",
825
825
  THOR: "https://viewblock.io/thorchain"
826
826
  };
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) => {
827
+ var Xe = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(Xe || {}), _ = /* @__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))(_ || {}), 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, C = (e, t, n) => (Je(e, typeof t != "symbol" ? t + "" : t, n), n), ze = (e, t, n) => {
828
828
  if (!t.has(e))
829
829
  throw TypeError("Cannot " + n);
830
830
  }, V = (e, t, n) => {
@@ -841,7 +841,7 @@ const Wt = (e) => {
841
841
  return !1;
842
842
  const t = /^[a-zA-Z0-9+_-]+$/g;
843
843
  return !!e.match(t);
844
- }, Kt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Re = async (e, t) => {
844
+ }, Kt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Ee = async (e, t) => {
845
845
  try {
846
846
  const n = Object.entries(t || {}).reduce(
847
847
  (a, [i, r]) => (r && (a[i] = r), a),
@@ -866,7 +866,7 @@ const Wt = (e) => {
866
866
  } catch {
867
867
  return {};
868
868
  }
869
- }, et = "0x313ce567", Oe = async ({ chain: e, to: t }) => {
869
+ }, et = "0x313ce567", Re = async ({ chain: e, to: t }) => {
870
870
  try {
871
871
  const n = await Ze(
872
872
  Ye[e],
@@ -881,17 +881,17 @@ const Wt = (e) => {
881
881
  ), { result: a } = JSON.parse(n);
882
882
  return parseInt(BigInt(a).toString());
883
883
  } catch (n) {
884
- return console.error(n), E[e];
884
+ return console.error(n), b[e];
885
885
  }
886
886
  }, tt = async (e) => {
887
887
  if (e === s.Ethereum)
888
- return E.ETH;
888
+ return b.ETH;
889
889
  const [, t] = e.split("-");
890
- return t != null && t.startsWith("0x") ? Oe({ chain: s.Ethereum, to: t }) : E.ETH;
890
+ return t != null && t.startsWith("0x") ? Re({ chain: s.Ethereum, to: t }) : b.ETH;
891
891
  }, nt = async (e) => {
892
892
  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 }) => {
893
+ return t != null && t.startsWith("0x") ? Re({ chain: s.Avalanche, to: t.toLowerCase() }) : b.AVAX;
894
+ }, at = async (e) => (e === s.BinanceSmartChain, b.BSC), Oe = async ({ chain: e, symbol: t }) => {
895
895
  switch (e) {
896
896
  case s.Ethereum:
897
897
  return tt(t);
@@ -900,7 +900,7 @@ const Wt = (e) => {
900
900
  case s.BinanceSmartChain:
901
901
  return at(t);
902
902
  default:
903
- return E[e];
903
+ return b[e];
904
904
  }
905
905
  }, st = {
906
906
  [k.Average]: 1.2,
@@ -939,13 +939,13 @@ const Wt = (e) => {
939
939
  case "ETH.vTHOR":
940
940
  return { identifier: "ETH.vTHOR-0x815c23eca83261b6ec689b60cc4a58b54bc24d8d", decimal: 18 };
941
941
  case s.Cosmos:
942
- return { identifier: "GAIA.ATOM", decimal: E[e] };
942
+ return { identifier: "GAIA.ATOM", decimal: b[e] };
943
943
  case s.THORChain:
944
- return { identifier: "THOR.RUNE", decimal: E[e] };
944
+ return { identifier: "THOR.RUNE", decimal: b[e] };
945
945
  case s.BinanceSmartChain:
946
- return { identifier: "BSC.BNB", decimal: E[e] };
946
+ return { identifier: "BSC.BNB", decimal: b[e] };
947
947
  case s.Maya:
948
- return { identifier: "MAYA.CACAO", decimal: E.MAYA };
948
+ return { identifier: "MAYA.CACAO", decimal: b.MAYA };
949
949
  case "MAYA.MAYA":
950
950
  return { identifier: "MAYA.MAYA", decimal: 4 };
951
951
  case s.Kujira:
@@ -959,7 +959,7 @@ const Wt = (e) => {
959
959
  case s.Polygon:
960
960
  case s.Bitcoin:
961
961
  case s.Ethereum:
962
- return { identifier: `${e}.${e}`, decimal: E[e] };
962
+ return { identifier: `${e}.${e}`, decimal: b[e] };
963
963
  }
964
964
  }, pt = ({ chain: e, symbol: t }) => {
965
965
  if (t.includes("/"))
@@ -973,9 +973,9 @@ const Wt = (e) => {
973
973
  case s.THORChain:
974
974
  return "Native";
975
975
  case s.Cosmos:
976
- return t === "ATOM" ? "Native" : "GAIA";
976
+ return t === "ATOM" ? "Native" : s.Cosmos;
977
977
  case s.Kujira:
978
- return t === "KUJI" ? "Native" : "KUJI";
978
+ return t === s.Kujira ? "Native" : s.Kujira;
979
979
  case s.Binance:
980
980
  return t === s.Binance ? "Native" : "BEP2";
981
981
  case s.BinanceSmartChain:
@@ -983,7 +983,7 @@ const Wt = (e) => {
983
983
  case s.Ethereum:
984
984
  return t === s.Ethereum ? "Native" : "ERC20";
985
985
  case s.Avalanche:
986
- return t === s.Avalanche ? "Native" : "AVAX";
986
+ return t === s.Avalanche ? "Native" : s.Avalanche;
987
987
  case s.Polygon:
988
988
  return t === s.Polygon ? "Native" : "POLYGON";
989
989
  case s.Arbitrum:
@@ -998,20 +998,22 @@ const Wt = (e) => {
998
998
  }, ot = new RegExp(
999
999
  /(.)\1{6}|\.ORG|\.NET|\.FINANCE|\.COM|WWW|HTTP|\\\\|\/\/|[\s$%:[\]]/,
1000
1000
  "gmi"
1001
- ), Xt = (e) => e.filter((t) => !ot.test(t.toString())), dt = ({
1001
+ ), Xt = (e) => e.filter(
1002
+ (t) => !ot.test(t.toString()) && !t.toString().includes("undefined")
1003
+ ), dt = ({
1002
1004
  liquidityUnits: e,
1003
1005
  poolUnits: t,
1004
1006
  runeDepth: n
1005
1007
  }) => {
1006
- 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);
1007
- return p.mul(o.sub(y).add(T)).div(u);
1008
+ const a = A(e), i = A(t), r = A(n), p = a.mul(r), d = i.mul(i).mul(2), y = i.mul(a).mul(2), l = a.mul(a), o = i.mul(i).mul(i);
1009
+ return p.mul(d.sub(y).add(l)).div(o);
1008
1010
  }, ut = ({
1009
1011
  liquidityUnits: e,
1010
1012
  poolUnits: t,
1011
1013
  assetDepth: n
1012
1014
  }) => {
1013
- 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);
1014
- return u.div(l);
1015
+ const a = A(e), i = A(t), r = A(n), p = a.mul(r), d = i.mul(i).mul(2), y = i.mul(a).mul(2), l = a.mul(a), o = p.mul(d.sub(y).add(l)), c = i.mul(i).mul(i);
1016
+ return o.div(c);
1015
1017
  }, jt = ({
1016
1018
  percent: e,
1017
1019
  runeDepth: t,
@@ -1022,14 +1024,14 @@ const Wt = (e) => {
1022
1024
  assetDepth: t,
1023
1025
  liquidityUnits: n,
1024
1026
  poolUnits: a
1025
- }) => ut({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), w = (e) => new ye({ value: e, decimal: E.THOR }), yt = ({
1027
+ }) => ut({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), A = (e) => new ue({ value: e, decimal: b.THOR }), yt = ({
1026
1028
  liquidityUnits: e,
1027
1029
  poolUnits: t,
1028
1030
  runeDepth: n,
1029
1031
  assetDepth: a
1030
1032
  }) => ({
1031
- assetAmount: w(a).mul(e).div(t),
1032
- runeAmount: w(n).mul(e).div(t)
1033
+ assetAmount: A(a).mul(e).div(t),
1034
+ runeAmount: A(n).mul(e).div(t)
1033
1035
  }), Jt = ({
1034
1036
  liquidityUnits: e,
1035
1037
  poolUnits: t,
@@ -1048,60 +1050,60 @@ const Wt = (e) => {
1048
1050
  runeAmount: i,
1049
1051
  assetAmount: r
1050
1052
  }) => {
1051
- 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);
1053
+ const p = A(e), d = A(n), y = A(t), l = A(i), o = A(r), c = l.mul(d), h = o.mul(p), w = l.mul(o), R = p.mul(d), O = y.mul(c.add(h.add(w.mul(2)))), E = c.add(h.add(R.mul(2))), I = O.div(E), S = A(a).add(I);
1052
1054
  if (I.baseValueNumber === 0)
1053
- return b.div(y).baseValueNumber;
1054
- const M = y.add(b);
1055
- return b.div(M).baseValueNumber;
1055
+ return S.div(y).baseValueNumber;
1056
+ const D = y.add(S);
1057
+ return S.div(D).baseValueNumber;
1056
1058
  }, Zt = ({
1057
1059
  runeAmount: e,
1058
1060
  assetAmount: t,
1059
1061
  runeDepth: n,
1060
1062
  assetDepth: a
1061
1063
  }) => {
1062
- 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));
1063
- return Math.abs(y.div(T).baseValueNumber);
1064
+ const i = A(n), r = A(a), p = A(t), d = A(e), y = p.mul(i).sub(r.mul(d)), l = r.mul(d).add(i.mul(r));
1065
+ return Math.abs(y.div(l).baseValueNumber);
1064
1066
  }, lt = ({
1065
1067
  symbol: e,
1066
1068
  ticker: t,
1067
1069
  chain: n
1068
- }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, D = (e, t) => {
1070
+ }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, x = (e, t) => {
1069
1071
  switch (e) {
1070
- case f.LEAVE:
1071
- case f.BOND: {
1072
+ case _.LEAVE:
1073
+ case _.BOND: {
1072
1074
  const { address: n } = t;
1073
1075
  return `${e}:${n}`;
1074
1076
  }
1075
- case f.UNBOND: {
1077
+ case _.UNBOND: {
1076
1078
  const { address: n, unbondAmount: a } = t;
1077
1079
  return `${e}:${n}:${a * 10 ** 8}`;
1078
1080
  }
1079
- case f.THORNAME_REGISTER: {
1081
+ case _.THORNAME_REGISTER: {
1080
1082
  const { name: n, chain: a, address: i, owner: r } = t;
1081
1083
  return `${e}:${n}:${a}:${i}${r ? `:${r}` : ""}`;
1082
1084
  }
1083
- case f.DEPOSIT: {
1085
+ case _.DEPOSIT: {
1084
1086
  const { chain: n, symbol: a, address: i, singleSide: r } = t;
1085
1087
  return r ? `${e}:${n}/${a}::t:0` : `${e}:${n}.${a}:${i || ""}:t:0`;
1086
1088
  }
1087
- case f.WITHDRAW: {
1088
- const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: o } = t, y = !o && p ? `:${p}` : "", T = lt({ chain: n, symbol: i, ticker: a });
1089
- return `${e}:${n}${o ? "/" : "."}${T}:${r}${y}`;
1089
+ case _.WITHDRAW: {
1090
+ const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: d } = t, y = !d && p ? `:${p}` : "", l = lt({ chain: n, symbol: i, ticker: a });
1091
+ return `${e}:${n}${d ? "/" : "."}${l}:${r}${y}`;
1090
1092
  }
1091
- case f.OPEN_LOAN:
1092
- case f.CLOSE_LOAN: {
1093
+ case _.OPEN_LOAN:
1094
+ case _.CLOSE_LOAN: {
1093
1095
  const { asset: n, address: a } = t;
1094
1096
  return `${e}:${n}:${a}`;
1095
1097
  }
1096
1098
  default:
1097
1099
  return "";
1098
1100
  }
1099
- }, me = Object.values(s), ct = (e = "") => {
1101
+ }, ce = Object.values(s), ct = (e = "") => {
1100
1102
  const t = e.toUpperCase(), [n] = t.split(".");
1101
- if (me.includes(n))
1103
+ if (ce.includes(n))
1102
1104
  return !0;
1103
1105
  const [a] = t.split("/");
1104
- if (me.includes(a))
1106
+ if (ce.includes(a))
1105
1107
  return !0;
1106
1108
  throw new Error(
1107
1109
  `Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
@@ -1117,20 +1119,20 @@ function ge({
1117
1119
  const r = n - (i.length - 1);
1118
1120
  r > 0 && (i = "0".repeat(r) + i);
1119
1121
  const p = i.length - n;
1120
- let o = i.slice(-n);
1121
- 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(
1122
+ let d = i.slice(-n);
1123
+ return parseInt(d[t]) >= 5 ? d = `${d.substring(0, t - 1)}${(parseInt(d[t - 1]) + 1).toString()}` : d = d.substring(0, t), `${a ? "-" : ""}${i.slice(0, p)}.${d}`.replace(
1122
1124
  /\.?0*$/,
1123
1125
  ""
1124
1126
  );
1125
1127
  }
1126
- var L, $, ae, Se, se, Te, Q, ie, H, G, J, re;
1128
+ var L, $, ne, Ie, ae, me, Q, se, H, G, J, ie;
1127
1129
  const mt = class j {
1128
1130
  constructor(t) {
1129
- 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");
1130
- const n = oe(t);
1131
+ V(this, L), V(this, ne), V(this, ae), V(this, Q), V(this, H), V(this, J), C(this, "decimalMultiplier", 10n ** 8n), C(this, "bigIntValue", 0n), C(this, "decimal");
1132
+ const n = pe(t);
1131
1133
  this.decimal = typeof t == "object" ? t.decimal : void 0, this.decimalMultiplier = U(
1132
- Math.max(g(this, J, re).call(this, g(this, H, G).call(this, n)), this.decimal || 0)
1133
- ), g(this, ae, Se).call(this, n);
1134
+ Math.max(g(this, J, ie).call(this, g(this, H, G).call(this, n)), this.decimal || 0)
1135
+ ), g(this, ne, Ie).call(this, n);
1134
1136
  }
1135
1137
  static fromBigInt(t, n) {
1136
1138
  return new j({
@@ -1207,33 +1209,36 @@ const mt = class j {
1207
1209
  case "string":
1208
1210
  return n;
1209
1211
  default:
1210
- return this.bigIntValue;
1212
+ return this.bigIntValue * BigInt(this.decimal || 8n) / this.decimalMultiplier;
1211
1213
  }
1212
1214
  }
1213
1215
  getBaseValue(t) {
1214
- const n = this.decimalMultiplier / U(this.decimal || 0), a = this.bigIntValue / n;
1216
+ const n = this.decimalMultiplier / U(this.decimal || b.THOR), a = this.bigIntValue / n;
1215
1217
  switch (t) {
1216
1218
  case "number":
1217
1219
  return Number(a);
1218
1220
  case "string":
1219
1221
  return a.toString();
1220
1222
  default:
1221
- return this.bigIntValue;
1223
+ return a;
1222
1224
  }
1223
1225
  }
1224
1226
  getBigIntValue(t, n) {
1225
- return !n && typeof t == "object" ? t.bigIntValue : g(this, Q, ie).call(this, g(this, H, G).call(this, oe(t)), n);
1227
+ if (!n && typeof t == "object")
1228
+ return t.bigIntValue;
1229
+ const a = pe(t), i = g(this, H, G).call(this, a);
1230
+ return i === "0" || i === "undefined" ? 0n : g(this, Q, se).call(this, i, n);
1226
1231
  }
1227
1232
  formatBigIntToSafeValue(t, n) {
1228
1233
  const a = n || this.decimal || q, i = Math.max(
1229
1234
  a,
1230
1235
  F(this.decimalMultiplier)
1231
- ), 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;
1232
- let u = y.slice(-i);
1233
- 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(
1236
+ ), r = t < 0n, p = t.toString().substring(r ? 1 : 0), d = i - (p.length - 1), y = d > 0 ? "0".repeat(d) + p : p, l = y.length - i;
1237
+ let o = y.slice(-i);
1238
+ return parseInt(o[a]) >= 5 ? o = `${o.substring(0, a - 1)}${(parseInt(o[a - 1]) + 1).toString()}` : o = o.substring(0, a), `${r ? "-" : ""}${y.slice(
1234
1239
  0,
1235
- T
1236
- )}.${u}`.replace(/\.?0*$/, "");
1240
+ l
1241
+ )}.${o}`.replace(/\.?0*$/, "");
1237
1242
  }
1238
1243
  toSignificant(t = 6) {
1239
1244
  const [n, a] = this.getValue("string").split("."), i = n || "", r = a || "", p = parseInt(i) ? i.length + r.length : r.length;
@@ -1246,17 +1251,17 @@ const mt = class j {
1246
1251
  p - t,
1247
1252
  "0"
1248
1253
  );
1249
- const o = parseInt(r), y = `${o}`.slice(0, t);
1254
+ const d = parseInt(r), y = `${d}`.slice(0, t);
1250
1255
  return `0.${y.padStart(
1251
- r.length - `${o}`.length + y.length,
1256
+ r.length - `${d}`.length + y.length,
1252
1257
  "0"
1253
1258
  )}`;
1254
1259
  }
1255
1260
  };
1256
1261
  L = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1257
- const n = g(this, se, Te).call(this, this, ...t), a = U(n), i = t.reduce(
1258
- (p, o) => {
1259
- const y = this.getBigIntValue(o, n);
1262
+ const n = g(this, ae, me).call(this, this, ...t), a = U(n), i = t.reduce(
1263
+ (p, d) => {
1264
+ const y = this.getBigIntValue(d, n);
1260
1265
  switch (e) {
1261
1266
  case "add":
1262
1267
  return p + y;
@@ -1281,48 +1286,48 @@ L = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1281
1286
  value: i
1282
1287
  });
1283
1288
  return new this.constructor({ decimal: this.decimal, value: r, identifier: this.toString() });
1284
- }, ae = /* @__PURE__ */ new WeakSet(), Se = function(e) {
1289
+ }, ne = /* @__PURE__ */ new WeakSet(), Ie = function(e) {
1285
1290
  const t = g(this, H, G).call(this, e) || "0";
1286
- this.bigIntValue = g(this, Q, ie).call(this, t);
1287
- }, se = /* @__PURE__ */ new WeakSet(), Te = function(...e) {
1291
+ this.bigIntValue = g(this, Q, se).call(this, t);
1292
+ }, ae = /* @__PURE__ */ new WeakSet(), me = function(...e) {
1288
1293
  const t = e.map(
1289
- (n) => typeof n == "object" ? n.decimal || F(n.decimalMultiplier) : g(this, J, re).call(this, g(this, H, G).call(this, n))
1294
+ (n) => typeof n == "object" ? n.decimal || F(n.decimalMultiplier) : g(this, J, ie).call(this, g(this, H, G).call(this, n))
1290
1295
  ).filter(Boolean);
1291
1296
  return Math.max(...t, q);
1292
- }, Q = /* @__PURE__ */ new WeakSet(), ie = function(e, t) {
1293
- const n = t ? U(t) : this.decimalMultiplier, a = F(n), [i, r = ""] = e.split(".");
1297
+ }, Q = /* @__PURE__ */ new WeakSet(), se = function(e, t) {
1298
+ const n = t ? U(t) : this.decimalMultiplier, a = F(n), [i = "", r = ""] = e.split(".");
1294
1299
  return BigInt(`${i}${r.padEnd(a, "0")}`);
1295
1300
  }, H = /* @__PURE__ */ new WeakSet(), G = function(e) {
1296
1301
  const t = `${typeof e == "number" ? Number(e).toLocaleString("fullwide", {
1297
1302
  useGrouping: !1,
1298
1303
  maximumFractionDigits: 20
1299
- }) : oe(e)}`.replaceAll(",", ".").split(".");
1304
+ }) : pe(e)}`.replaceAll(",", ".").split(".");
1300
1305
  return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
1301
- }, J = /* @__PURE__ */ new WeakSet(), re = function(e) {
1306
+ }, J = /* @__PURE__ */ new WeakSet(), ie = function(e) {
1302
1307
  var t;
1303
1308
  const n = ((t = e.split(".")[1]) == null ? void 0 : t.length) || 0;
1304
1309
  return Math.max(n, q);
1305
1310
  };
1306
- let pe = mt;
1307
- function oe(e) {
1311
+ let re = mt;
1312
+ function pe(e) {
1308
1313
  return typeof e == "object" ? "getValue" in e ? e.getValue("string") : e.value : e;
1309
1314
  }
1310
- let de;
1311
- const ne = (e) => {
1312
- if (!de)
1315
+ let oe;
1316
+ const te = (e) => {
1317
+ if (!oe)
1313
1318
  throw new Error("Static assets not loaded, call await AssetValue.loadStaticAssets() first");
1314
- return de.get(e.toUpperCase()) || { decimal: E.THOR, identifier: "" };
1315
- }, _e = async (e, t = 0) => {
1319
+ return oe.get(e.toUpperCase()) || { decimal: b.THOR, identifier: "" };
1320
+ }, Te = async (e, t = 0) => {
1316
1321
  ct(e);
1317
- const n = await Ie(ue(e));
1322
+ const n = await Oe(de(e));
1318
1323
  return new v({ decimal: n, value: t, identifier: e });
1319
1324
  };
1320
- class v extends pe {
1325
+ class v extends re {
1321
1326
  constructor(t) {
1322
1327
  super(
1323
- t.value instanceof pe ? t.value : { decimal: t.decimal, value: t.value }
1324
- ), N(this, "address"), N(this, "chain"), N(this, "isSynthetic", !1), N(this, "isGasAsset", !1), N(this, "symbol"), N(this, "ticker"), N(this, "type");
1325
- const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`, a = ue(n);
1328
+ t.value instanceof re ? t.value : { decimal: t.decimal, value: t.value }
1329
+ ), C(this, "address"), C(this, "chain"), C(this, "isSynthetic", !1), C(this, "isGasAsset", !1), C(this, "symbol"), C(this, "ticker"), C(this, "type");
1330
+ const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`, a = de(n);
1326
1331
  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;
1327
1332
  }
1328
1333
  get assetValue() {
@@ -1339,19 +1344,19 @@ class v extends pe {
1339
1344
  return this.chain === t && this.symbol === n;
1340
1345
  }
1341
1346
  static async fromString(t, n = 0) {
1342
- return _e(t, n);
1347
+ return Te(t, n);
1343
1348
  }
1344
1349
  static fromStringSync(t, n = 0) {
1345
- const { decimal: a, identifier: i } = ne(
1350
+ const { decimal: a, identifier: i } = te(
1346
1351
  t
1347
1352
  );
1348
1353
  return i ? new v({ decimal: a, identifier: i, value: n }) : void 0;
1349
1354
  }
1350
1355
  static async fromIdentifier(t, n = 0) {
1351
- return _e(t, n);
1356
+ return Te(t, n);
1352
1357
  }
1353
1358
  static fromIdentifierSync(t, n = 0) {
1354
- const { decimal: a, identifier: i } = ne(t);
1359
+ const { decimal: a, identifier: i } = te(t);
1355
1360
  return new v({ decimal: a, identifier: i, value: n });
1356
1361
  }
1357
1362
  static fromChainOrSignature(t, n = 0) {
@@ -1359,13 +1364,13 @@ class v extends pe {
1359
1364
  return new v({ value: n, decimal: a, identifier: i });
1360
1365
  }
1361
1366
  static async fromTCQuote(t, n = 0) {
1362
- const a = await Ie(ue(t)), i = this.shiftDecimals({ value: n, from: E.THOR, to: a });
1367
+ const a = await Oe(de(t)), i = this.shiftDecimals({ value: n, from: b.THOR, to: a });
1363
1368
  return new v({ value: i, identifier: t, decimal: a });
1364
1369
  }
1365
1370
  static fromTCQuoteStatic(t, n = 0) {
1366
- const a = ne(t), i = this.shiftDecimals({
1371
+ const a = te(t), i = this.shiftDecimals({
1367
1372
  value: n,
1368
- from: E.THOR,
1373
+ from: b.THOR,
1369
1374
  to: a.decimal
1370
1375
  });
1371
1376
  return new v({ ...a, value: i });
@@ -1381,10 +1386,10 @@ class v extends pe {
1381
1386
  NativeList: i,
1382
1387
  ...r
1383
1388
  } = await import("@swapkit/tokens");
1384
- de = [i, ...Object.values(r)].reduce(
1385
- (p, { tokens: o }) => (o.forEach(({ identifier: y, chain: T, ...u }) => {
1386
- const l = "decimals" in u ? u.decimals : E[T];
1387
- p.set(y, { identifier: y, decimal: l });
1389
+ oe = [i, ...Object.values(r)].reduce(
1390
+ (p, { tokens: d }) => (d.forEach(({ identifier: y, chain: l, ...o }) => {
1391
+ const c = "decimals" in o ? o.decimals : b[l];
1392
+ p.set(y, { identifier: y, decimal: c });
1388
1393
  }), p),
1389
1394
  /* @__PURE__ */ new Map()
1390
1395
  ), t({ ok: !0 });
@@ -1399,7 +1404,7 @@ class v extends pe {
1399
1404
  );
1400
1405
  }
1401
1406
  }
1402
- const he = (e) => {
1407
+ const _e = (e) => {
1403
1408
  const t = v.fromChainOrSignature(e);
1404
1409
  switch (e) {
1405
1410
  case s.Bitcoin:
@@ -1417,7 +1422,7 @@ const he = (e) => {
1417
1422
  default:
1418
1423
  return t.add(1);
1419
1424
  }
1420
- }, ue = (e) => {
1425
+ }, de = (e) => {
1421
1426
  const t = e.slice(0, 14).includes("/"), n = e.includes(".") ? e : `${s.THORChain}.${e}`, [a, i] = n.split("."), [r, p] = i.split("-");
1422
1427
  return {
1423
1428
  address: p == null ? void 0 : p.toLowerCase(),
@@ -1484,12 +1489,12 @@ const he = (e) => {
1484
1489
  */
1485
1490
  helpers_number_different_decimals: 99101
1486
1491
  };
1487
- class c extends Error {
1492
+ class m extends Error {
1488
1493
  constructor(t, n) {
1489
- console.error(n), super(t, { cause: { code: Tt[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
1494
+ console.error(n), super(t, { cause: { code: Tt[t], message: t } }), Object.setPrototypeOf(this, m.prototype);
1490
1495
  }
1491
1496
  }
1492
- class ye extends pe {
1497
+ class ue extends re {
1493
1498
  eq(t) {
1494
1499
  return this.eqValue(t);
1495
1500
  }
@@ -2545,7 +2550,7 @@ const _t = [
2545
2550
  type: "function"
2546
2551
  },
2547
2552
  { stateMutability: "payable", type: "receive" }
2548
- ], It = [
2553
+ ], gt = [
2549
2554
  {
2550
2555
  inputs: [
2551
2556
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2672,7 +2677,7 @@ const _t = [
2672
2677
  type: "function"
2673
2678
  },
2674
2679
  { stateMutability: "payable", type: "receive" }
2675
- ], gt = [
2680
+ ], It = [
2676
2681
  {
2677
2682
  inputs: [
2678
2683
  { internalType: "address", name: "_ttp", type: "address" },
@@ -3180,12 +3185,12 @@ const _t = [
3180
3185
  type: "function"
3181
3186
  },
3182
3187
  { stateMutability: "payable", type: "receive" }
3183
- ], ve = {
3188
+ ], Se = {
3184
3189
  ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: _t,
3185
3190
  ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: ft,
3186
3191
  ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: bt
3187
3192
  }, Ct = {
3188
- ...ve,
3193
+ ...Se,
3189
3194
  // AVAX
3190
3195
  ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: wt,
3191
3196
  ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: ht,
@@ -3195,8 +3200,8 @@ const _t = [
3195
3200
  // ETH
3196
3201
  ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: Et,
3197
3202
  ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Ot,
3198
- ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: It,
3199
- ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: gt,
3203
+ ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: gt,
3204
+ ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: It,
3200
3205
  ["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: St,
3201
3206
  ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: vt,
3202
3207
  ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: Mt
@@ -3209,40 +3214,40 @@ const _t = [
3209
3214
  amount: i,
3210
3215
  amountOutMin: r = "",
3211
3216
  data: p = "",
3212
- deadline: o,
3217
+ deadline: d,
3213
3218
  memo: y,
3214
- router: T,
3215
- memoStreamingSwap: u,
3216
- tcMemo: l,
3219
+ router: l,
3220
+ memoStreamingSwap: o,
3221
+ tcMemo: c,
3217
3222
  tcRouter: h,
3218
- tcVault: _,
3223
+ tcVault: w,
3219
3224
  vault: R,
3220
3225
  token: O
3221
3226
  }
3222
3227
  }) => {
3223
- const S = !!ve[t.toLowerCase()];
3224
- if (S && !T)
3228
+ const E = !!Se[t.toLowerCase()];
3229
+ if (E && !l)
3225
3230
  throw new Error("Router is required on calldata for swapIn with GenericContract");
3226
- const I = l || y, b = e && u || I;
3227
- if (!_ && !R)
3231
+ const I = c || y, S = e && o || I;
3232
+ if (!w && !R)
3228
3233
  throw new Error("TC Vault is required on calldata");
3229
- if (!h && !T)
3234
+ if (!h && !l)
3230
3235
  throw new Error("TC Router is required on calldata");
3231
- if (!b)
3236
+ if (!S)
3232
3237
  throw new Error("TC Memo is required on calldata");
3233
3238
  if (!O)
3234
3239
  throw new Error("Token is required on calldata");
3235
- const M = [
3240
+ const D = [
3236
3241
  // v2 contracts don't have tcVault, tcRouter, tcMemo but vault, router, memo
3237
- a(h || T),
3238
- a(_ || R),
3239
- b.replace("{recipientAddress}", n),
3242
+ a(h || l),
3243
+ a(w || R),
3244
+ S.replace("{recipientAddress}", n),
3240
3245
  a(O),
3241
3246
  i
3242
- ], ee = S ? [a(T), p, o] : [r, o];
3243
- return [...M, ...ee];
3247
+ ], ve = E ? [a(l), p, d] : [r, d];
3248
+ return [...D, ...ve];
3244
3249
  }, xt = ({ chain: e, txHash: t }) => {
3245
- const n = Ee[e];
3250
+ const n = we[e];
3246
3251
  switch (e) {
3247
3252
  case s.Binance:
3248
3253
  case s.Bitcoin:
@@ -3268,7 +3273,7 @@ const _t = [
3268
3273
  throw new Error(`Unsupported chain: ${e}`);
3269
3274
  }
3270
3275
  }, Dt = ({ chain: e, address: t }) => {
3271
- const n = Ee[e];
3276
+ const n = we[e];
3272
3277
  switch (e) {
3273
3278
  case s.Arbitrum:
3274
3279
  case s.Avalanche:
@@ -3291,97 +3296,103 @@ const _t = [
3291
3296
  default:
3292
3297
  throw new Error(`Unsupported chain: ${e}`);
3293
3298
  }
3294
- }, Pt = (e) => {
3295
- const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3296
- return Re(`${t}/thorchain/inbound_addresses`);
3297
3299
  }, Bt = (e) => {
3298
3300
  const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3299
- return Re(`${t}/thorchain/mimir`);
3300
- }, fe = () => Object.values(s).reduce(
3301
+ return Ee(`${t}/thorchain/inbound_addresses`);
3302
+ }, Pt = (e) => {
3303
+ const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3304
+ return Ee(`${t}/thorchain/mimir`);
3305
+ }, he = () => Object.values(s).reduce(
3301
3306
  (e, t) => (e[t] = null, e),
3302
3307
  {}
3303
3308
  );
3304
- var B, z, K, x, Y, X;
3309
+ var P, z, K, N, Y, X;
3305
3310
  class en {
3306
3311
  constructor({ stagenet: t } = {}) {
3307
- m(this, "connectedChains", fe());
3308
- m(this, "connectedWallets", fe());
3309
- m(this, "stagenet", !1);
3310
- m(this, "getAddress", (t) => {
3312
+ T(this, "connectedChains", he());
3313
+ T(this, "connectedWallets", he());
3314
+ T(this, "stagenet", !1);
3315
+ T(this, "getAddress", (t) => {
3311
3316
  var n;
3312
3317
  return ((n = this.connectedChains[t]) == null ? void 0 : n.address) || "";
3313
3318
  });
3314
- m(this, "getExplorerTxUrl", (t, n) => xt({ chain: t, txHash: n }));
3315
- m(this, "getWallet", (t) => this.connectedWallets[t]);
3316
- m(this, "getExplorerAddressUrl", (t, n) => Dt({ chain: t, address: n }));
3317
- m(this, "getBalance", async (t, n) => {
3319
+ T(this, "getExplorerTxUrl", (t, n) => xt({ chain: t, txHash: n }));
3320
+ T(this, "getWallet", (t) => this.connectedWallets[t]);
3321
+ T(this, "getExplorerAddressUrl", (t, n) => Dt({ chain: t, address: n }));
3322
+ T(this, "getBalance", async (t, n) => {
3318
3323
  const a = await this.getWalletByChain(t, n);
3319
3324
  return (a == null ? void 0 : a.balance) || [];
3320
3325
  });
3321
- m(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3322
- var o, y, T, u;
3326
+ T(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3327
+ var d, y;
3323
3328
  const { quoteMode: r } = a.meta, p = r.startsWith("ERC20-") ? s.Ethereum : r.startsWith("ARC20-") ? s.Avalanche : s.BinanceSmartChain;
3324
3329
  if (!a.complete)
3325
- throw new c("core_swap_route_not_complete");
3330
+ throw new m("core_swap_route_not_complete");
3326
3331
  try {
3327
3332
  if (Ue.includes(r)) {
3328
3333
  const l = this.connectedWallets[p];
3329
3334
  if (!(l != null && l.sendTransaction))
3330
- throw new c("core_wallet_connection_not_found");
3331
- if (!(t ? (o = a == null ? void 0 : a.streamingSwap) == null ? void 0 : o.transaction : a == null ? void 0 : a.transaction))
3332
- throw new c("core_swap_route_transaction_not_found");
3333
- const { isHexString: _, parseUnits: R } = await import("./index-cf1865cd.js"), { data: O, from: S, to: I, value: b } = a.transaction, M = {
3334
- data: O,
3335
- from: S,
3336
- to: I.toLowerCase(),
3335
+ throw new m("core_wallet_connection_not_found");
3336
+ if (!(t ? (d = a == null ? void 0 : a.streamingSwap) == null ? void 0 : d.transaction : a == null ? void 0 : a.transaction))
3337
+ throw new m("core_swap_route_transaction_not_found");
3338
+ const { isHexString: c, parseUnits: h } = await import("./index-cf1865cd.js"), { data: w, from: R, to: O, value: E } = a.transaction, I = {
3339
+ data: w,
3340
+ from: R,
3341
+ to: O.toLowerCase(),
3337
3342
  chainId: BigInt(Ke[p]),
3338
- value: b ? new ye({
3339
- value: _(b) ? b : R(b, "wei").toString(16)
3343
+ value: E ? new ue({
3344
+ value: c(E) ? E : h(E, "wei").toString(16)
3340
3345
  }).baseValueBigInt : 0n
3341
3346
  };
3342
- return l.sendTransaction(M, i);
3347
+ return l.sendTransaction(I, i);
3343
3348
  }
3344
3349
  if ($e.includes(r)) {
3345
3350
  if (!a.calldata.fromAsset)
3346
- throw new c("core_swap_asset_not_recognized");
3351
+ throw new m("core_swap_asset_not_recognized");
3347
3352
  const l = await v.fromString(a.calldata.fromAsset);
3348
3353
  if (!l)
3349
- throw new c("core_swap_asset_not_recognized");
3350
- const { address: h } = await A(this, B).call(this, l.chain), {
3351
- contract: _,
3352
- calldata: { amountIn: R, memo: O, memoStreamingSwap: S }
3353
- } = a, I = l.add(ye.fromBigInt(BigInt(R), l.decimal)), b = t && S || O;
3354
- return this.deposit({ assetValue: I, memo: b, feeOptionKey: i, router: _, recipient: h });
3354
+ throw new m("core_swap_asset_not_recognized");
3355
+ const { address: o } = await f(this, P).call(this, l.chain), {
3356
+ contract: c,
3357
+ calldata: { expiration: h, amountIn: w, memo: R, memoStreamingSwap: O }
3358
+ } = a, E = l.add(ue.fromBigInt(BigInt(w), l.decimal)), I = t && O || R;
3359
+ return this.deposit({
3360
+ expiration: h,
3361
+ assetValue: E,
3362
+ memo: I,
3363
+ feeOptionKey: i,
3364
+ router: c,
3365
+ recipient: o
3366
+ });
3355
3367
  }
3356
3368
  if (He.includes(r)) {
3357
- const { calldata: l, contract: h } = a;
3358
- if (!h)
3359
- throw new c("core_swap_contract_not_found");
3360
- const _ = this.connectedWallets[p], R = this.getAddress(p);
3361
- if (!(_ != null && _.sendTransaction) || !R)
3362
- throw new c("core_wallet_connection_not_found");
3363
- const { getProvider: O, toChecksumAddress: S } = await import("@swapkit/toolbox-evm"), I = O(p), b = Ct[h.toLowerCase()];
3364
- if (!b)
3365
- throw new c("core_swap_contract_not_supported", { contractAddress: h });
3366
- const ee = await ((u = (T = (await ((y = _.createContract) == null ? void 0 : y.call(_, h, b, I))).populateTransaction).swapIn) == null ? void 0 : u.call(
3367
- T,
3369
+ const { calldata: l, contract: o } = a;
3370
+ if (!o)
3371
+ throw new m("core_swap_contract_not_found");
3372
+ const c = this.connectedWallets[p], h = this.getAddress(p);
3373
+ if (!(c != null && c.sendTransaction) || !h)
3374
+ throw new m("core_wallet_connection_not_found");
3375
+ const { getProvider: w, toChecksumAddress: R } = await import("@swapkit/toolbox-evm"), O = w(p), E = Ct[o.toLowerCase()];
3376
+ if (!E)
3377
+ throw new m("core_swap_contract_not_supported", { contractAddress: o });
3378
+ const S = await (await ((y = c.createContract) == null ? void 0 : y.call(c, o, E, O))).getFunction("swapIn").populateTransaction(
3368
3379
  ...Nt({
3369
3380
  streamSwap: t,
3370
- toChecksumAddress: S,
3371
- contractAddress: h,
3381
+ toChecksumAddress: R,
3382
+ contractAddress: o,
3372
3383
  recipient: n,
3373
3384
  calldata: l
3374
3385
  }),
3375
- { from: R }
3376
- ));
3377
- return _.sendTransaction(ee, i);
3386
+ { from: h }
3387
+ );
3388
+ return c.sendTransaction(S, i);
3378
3389
  }
3379
- throw new c("core_swap_quote_mode_not_supported", { quoteMode: r });
3390
+ throw new m("core_swap_quote_mode_not_supported", { quoteMode: r });
3380
3391
  } catch (l) {
3381
- throw new c("core_swap_transaction_error", l);
3392
+ throw new m("core_swap_transaction_error", l);
3382
3393
  }
3383
3394
  });
3384
- m(this, "getWalletByChain", async (t, n) => {
3395
+ T(this, "getWalletByChain", async (t, n) => {
3385
3396
  var r, p;
3386
3397
  const a = this.getAddress(t);
3387
3398
  if (!a)
@@ -3395,136 +3406,139 @@ class en {
3395
3406
  walletType: (p = this.connectedChains[t]) == null ? void 0 : p.walletType
3396
3407
  }, { ...this.connectedChains[t] };
3397
3408
  });
3398
- m(this, "approveAssetValue", (t, n) => A(this, K).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3399
- m(this, "isAssetValueApproved", (t, n) => A(this, K).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3400
- m(this, "validateAddress", ({ address: t, chain: n }) => {
3409
+ T(this, "approveAssetValue", (t, n) => f(this, K).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3410
+ T(this, "isAssetValueApproved", (t, n) => f(this, K).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3411
+ T(this, "validateAddress", ({ address: t, chain: n }) => {
3401
3412
  var a, i;
3402
3413
  return (i = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : i.call(a, t);
3403
3414
  });
3404
- m(this, "transfer", async (t) => {
3415
+ T(this, "transfer", async (t) => {
3405
3416
  const n = this.connectedWallets[t.assetValue.chain];
3406
3417
  if (!n)
3407
- throw new c("core_wallet_connection_not_found");
3418
+ throw new m("core_wallet_connection_not_found");
3408
3419
  try {
3409
- return await n.transfer(A(this, X).call(this, t));
3420
+ return await n.transfer(f(this, X).call(this, t));
3410
3421
  } catch (a) {
3411
- throw new c("core_swap_transaction_error", a);
3422
+ throw new m("core_swap_transaction_error", a);
3412
3423
  }
3413
3424
  });
3414
- m(this, "deposit", async ({
3425
+ T(this, "deposit", async ({
3415
3426
  assetValue: t,
3416
3427
  recipient: n,
3417
3428
  router: a,
3418
3429
  ...i
3419
3430
  }) => {
3420
- const { chain: r, symbol: p, ticker: o } = t, y = this.connectedWallets[r];
3431
+ const { chain: r, symbol: p, ticker: d } = t, y = this.connectedWallets[r];
3421
3432
  if (!y)
3422
- throw new c("core_wallet_connection_not_found");
3423
- const T = A(this, X).call(this, { assetValue: t, recipient: n, router: a, ...i });
3433
+ throw new m("core_wallet_connection_not_found");
3434
+ const l = f(this, X).call(this, { assetValue: t, recipient: n, router: a, ...i });
3424
3435
  try {
3425
3436
  switch (r) {
3426
3437
  case s.THORChain: {
3427
- const u = y;
3428
- return await (n === "" ? u.deposit(T) : u.transfer(T));
3438
+ const o = y;
3439
+ return await (n === "" ? o.deposit(l) : o.transfer(l));
3429
3440
  }
3430
3441
  case s.Ethereum:
3431
3442
  case s.BinanceSmartChain:
3432
3443
  case s.Avalanche: {
3433
- const { getChecksumAddressFromAsset: u } = await import("@swapkit/toolbox-evm"), l = r === s.Avalanche ? Be : r === s.BinanceSmartChain ? Ve : Pe;
3444
+ const { getChecksumAddressFromAsset: o } = await import("@swapkit/toolbox-evm"), c = r === s.Avalanche ? Pe : r === s.BinanceSmartChain ? Ve : Be;
3434
3445
  return await y.call({
3435
- abi: l,
3436
- contractAddress: a || (await A(this, B).call(this, r)).router,
3446
+ abi: c,
3447
+ contractAddress: a || (await f(this, P).call(this, r)).router,
3437
3448
  funcName: "depositWithExpiry",
3438
3449
  funcParams: [
3439
3450
  n,
3440
- u({ chain: r, symbol: p, ticker: o }, r),
3451
+ o({ chain: r, symbol: p, ticker: d }, r),
3441
3452
  // TODO: (@Towan) Re-Check on that conversion 🙏
3442
- t.baseValueBigInt.toString(),
3443
- T.memo,
3453
+ t.getBaseValue("bigint").toString(),
3454
+ l.memo,
3444
3455
  i.expiration
3445
3456
  ],
3446
- txOverrides: { from: T.from, value: t.baseValueBigInt }
3457
+ txOverrides: {
3458
+ from: l.from,
3459
+ value: t.isGasAsset ? t.getBaseValue("bigint") : void 0
3460
+ }
3447
3461
  });
3448
3462
  }
3449
3463
  default:
3450
- return await y.transfer(T);
3464
+ return await y.transfer(l);
3451
3465
  }
3452
- } catch (u) {
3453
- 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";
3454
- throw new c(O, u);
3466
+ } catch (o) {
3467
+ const c = ((o == null ? void 0 : o.message) || (o == null ? void 0 : o.toString())).toLowerCase(), h = c == null ? void 0 : c.includes("insufficient funds"), w = c == null ? void 0 : c.includes("gas"), R = c == null ? void 0 : c.includes("server"), O = h ? "core_transaction_deposit_insufficient_funds_error" : w ? "core_transaction_deposit_gas_error" : R ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
3468
+ throw new m(O, o);
3455
3469
  }
3456
3470
  });
3457
3471
  /**
3458
3472
  * TC related Methods
3459
3473
  */
3460
- m(this, "createLiquidity", async ({
3474
+ T(this, "createLiquidity", async ({
3461
3475
  runeAssetValue: t,
3462
3476
  assetValue: n
3463
3477
  }) => {
3464
3478
  if (t.lte(0) || n.lte(0))
3465
- throw new c("core_transaction_create_liquidity_invalid_params");
3479
+ throw new m("core_transaction_create_liquidity_invalid_params");
3466
3480
  let a = "", i = "";
3467
3481
  try {
3468
- a = await A(this, x).call(this, {
3482
+ a = await f(this, N).call(this, {
3469
3483
  assetValue: t,
3470
- memo: D(f.DEPOSIT, {
3484
+ memo: x(_.DEPOSIT, {
3471
3485
  ...n,
3472
3486
  address: this.getAddress(n.chain)
3473
3487
  })
3474
3488
  });
3475
3489
  } catch (r) {
3476
- throw new c("core_transaction_create_liquidity_rune_error", r);
3490
+ throw new m("core_transaction_create_liquidity_rune_error", r);
3477
3491
  }
3478
3492
  try {
3479
- i = await A(this, x).call(this, {
3493
+ i = await f(this, N).call(this, {
3480
3494
  assetValue: n,
3481
- memo: D(f.DEPOSIT, {
3495
+ memo: x(_.DEPOSIT, {
3482
3496
  ...n,
3483
3497
  address: this.getAddress(s.THORChain)
3484
3498
  })
3485
3499
  });
3486
3500
  } catch (r) {
3487
- throw new c("core_transaction_create_liquidity_asset_error", r);
3501
+ throw new m("core_transaction_create_liquidity_asset_error", r);
3488
3502
  }
3489
3503
  return { runeTx: a, assetTx: i };
3490
3504
  });
3491
- m(this, "addLiquidity", async ({
3505
+ T(this, "addLiquidity", async ({
3492
3506
  poolIdentifier: t,
3493
3507
  runeAssetValue: n,
3494
3508
  assetValue: a,
3495
3509
  runeAddr: i,
3496
3510
  assetAddr: r,
3497
3511
  isPendingSymmAsset: p,
3498
- mode: o = "sym"
3512
+ mode: d = "sym"
3499
3513
  }) => {
3500
- 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) : "";
3501
- if (!l && !h)
3502
- throw new c("core_transaction_add_liquidity_invalid_params");
3503
- if (_ && !R)
3504
- throw new c("core_transaction_add_liquidity_no_rune_address");
3505
- let S, I;
3506
- const b = { chain: y, symbol: T.join(".") };
3507
- if (l && n)
3514
+ const [y, ...l] = t.split("."), o = d === "sym", c = (n == null ? void 0 : n.gt(0)) && (o || d === "rune"), h = (a == null ? void 0 : a.gt(0)) && (o || d === "asset"), w = p || c, R = w ? i || this.getAddress(s.THORChain) : "", O = o || d === "asset" ? r || this.getAddress(y) : "";
3515
+ if (!c && !h)
3516
+ throw new m("core_transaction_add_liquidity_invalid_params");
3517
+ if (w && !R)
3518
+ throw new m("core_transaction_add_liquidity_no_rune_address");
3519
+ let E, I;
3520
+ const S = { chain: y, symbol: l.join(".") };
3521
+ if (c && n)
3508
3522
  try {
3509
- S = await A(this, x).call(this, {
3523
+ E = await f(this, N).call(this, {
3510
3524
  assetValue: n,
3511
- memo: D(f.DEPOSIT, { ...b, address: O })
3525
+ memo: x(_.DEPOSIT, { ...S, address: O })
3512
3526
  });
3513
- } catch (M) {
3514
- throw new c("core_transaction_add_liquidity_rune_error", M);
3527
+ } catch (D) {
3528
+ throw new m("core_transaction_add_liquidity_rune_error", D);
3515
3529
  }
3516
3530
  if (h && a)
3517
3531
  try {
3518
- I = await A(this, x).call(this, {
3532
+ I = await f(this, N).call(this, {
3519
3533
  assetValue: a,
3520
- memo: D(f.DEPOSIT, { ...b, address: R })
3534
+ memo: x(_.DEPOSIT, { ...S, address: R })
3521
3535
  });
3522
- } catch (M) {
3523
- throw new c("core_transaction_add_liquidity_asset_error", M);
3536
+ } catch (D) {
3537
+ throw new m("core_transaction_add_liquidity_asset_error", D);
3524
3538
  }
3525
- return { runeTx: S, assetTx: I };
3539
+ return { runeTx: E, assetTx: I };
3526
3540
  });
3527
- m(this, "withdraw", async ({
3541
+ T(this, "withdraw", async ({
3528
3542
  memo: t,
3529
3543
  assetValue: n,
3530
3544
  percent: a,
@@ -3533,9 +3547,9 @@ class en {
3533
3547
  }) => {
3534
3548
  const p = r === "rune" ? v.fromChainOrSignature(s.THORChain) : i === "sym" && r === "sym" || i === "rune" || i === "asset" ? void 0 : n;
3535
3549
  try {
3536
- return await A(this, x).call(this, {
3537
- assetValue: he(i === "asset" ? n.chain : s.THORChain),
3538
- memo: t || D(f.WITHDRAW, {
3550
+ return await f(this, N).call(this, {
3551
+ assetValue: _e(i === "asset" ? n.chain : s.THORChain),
3552
+ memo: t || x(_.WITHDRAW, {
3539
3553
  symbol: n.symbol,
3540
3554
  chain: n.chain,
3541
3555
  ticker: n.ticker,
@@ -3544,71 +3558,71 @@ class en {
3544
3558
  singleSide: !1
3545
3559
  })
3546
3560
  });
3547
- } catch (o) {
3548
- throw new c("core_transaction_withdraw_error", o);
3561
+ } catch (d) {
3562
+ throw new m("core_transaction_withdraw_error", d);
3549
3563
  }
3550
3564
  });
3551
- m(this, "savings", async ({
3565
+ T(this, "savings", async ({
3552
3566
  assetValue: t,
3553
3567
  memo: n,
3554
3568
  percent: a,
3555
3569
  type: i
3556
3570
  }) => {
3557
- const r = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || D(r, {
3571
+ const r = i === "add" ? _.DEPOSIT : _.WITHDRAW, p = n || x(r, {
3558
3572
  ticker: t.ticker,
3559
3573
  symbol: t.symbol,
3560
3574
  chain: t.chain,
3561
3575
  singleSide: !0,
3562
3576
  basisPoints: a ? Math.max(1e4, Math.round(a * 100)) : void 0
3563
3577
  });
3564
- return A(this, x).call(this, { assetValue: t, memo: p });
3578
+ return f(this, N).call(this, { assetValue: t, memo: p });
3565
3579
  });
3566
- m(this, "loan", ({
3580
+ T(this, "loan", ({
3567
3581
  assetValue: t,
3568
3582
  memo: n,
3569
3583
  minAmount: a,
3570
3584
  type: i
3571
- }) => A(this, x).call(this, {
3585
+ }) => f(this, N).call(this, {
3572
3586
  assetValue: t,
3573
- memo: n || D(i === "open" ? f.OPEN_LOAN : f.CLOSE_LOAN, {
3587
+ memo: n || x(i === "open" ? _.OPEN_LOAN : _.CLOSE_LOAN, {
3574
3588
  asset: t.toString(),
3575
3589
  minAmount: a.toString(),
3576
3590
  address: this.getAddress(t.chain)
3577
3591
  })
3578
3592
  }));
3579
- m(this, "nodeAction", ({
3593
+ T(this, "nodeAction", ({
3580
3594
  type: t,
3581
3595
  assetValue: n,
3582
3596
  address: a
3583
3597
  }) => {
3584
- const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, r = D(i, {
3598
+ const i = t === "bond" ? _.BOND : t === "unbond" ? _.UNBOND : _.LEAVE, r = x(i, {
3585
3599
  address: a,
3586
3600
  unbondAmount: t === "unbond" ? n.baseValueNumber : void 0
3587
3601
  });
3588
- return A(this, Y).call(this, {
3602
+ return f(this, Y).call(this, {
3589
3603
  memo: r,
3590
- assetValue: t === "bond" ? n : he(s.THORChain)
3604
+ assetValue: t === "bond" ? n : _e(s.THORChain)
3591
3605
  });
3592
3606
  });
3593
- m(this, "registerThorname", ({
3607
+ T(this, "registerThorname", ({
3594
3608
  assetValue: t,
3595
3609
  ...n
3596
- }) => A(this, Y).call(this, { assetValue: t, memo: D(f.THORNAME_REGISTER, n) }));
3597
- m(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
3610
+ }) => f(this, Y).call(this, { assetValue: t, memo: x(_.THORNAME_REGISTER, n) }));
3611
+ T(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
3598
3612
  try {
3599
3613
  t.forEach((r) => {
3600
3614
  this[r.connectMethodName] = r.connect({
3601
- addChain: A(this, z),
3615
+ addChain: f(this, z),
3602
3616
  config: n || {},
3603
3617
  apis: a,
3604
3618
  rpcUrls: i
3605
3619
  });
3606
3620
  });
3607
3621
  } catch (r) {
3608
- throw new c("core_extend_error", r);
3622
+ throw new m("core_extend_error", r);
3609
3623
  }
3610
3624
  });
3611
- m(this, "estimateMaxSendableAmount", async ({
3625
+ T(this, "estimateMaxSendableAmount", async ({
3612
3626
  chain: t,
3613
3627
  params: n
3614
3628
  }) => {
@@ -3641,40 +3655,40 @@ class en {
3641
3655
  });
3642
3656
  }
3643
3657
  default:
3644
- throw new c("core_estimated_max_spendable_chain_not_supported");
3658
+ throw new m("core_estimated_max_spendable_chain_not_supported");
3645
3659
  }
3646
3660
  });
3647
3661
  /**
3648
3662
  * Wallet connection methods
3649
3663
  */
3650
- m(this, "connectXDEFI", async (t) => {
3651
- throw new c("core_wallet_xdefi_not_installed");
3664
+ T(this, "connectXDEFI", async (t) => {
3665
+ throw new m("core_wallet_xdefi_not_installed");
3652
3666
  });
3653
- m(this, "connectEVMWallet", async (t, n) => {
3654
- throw new c("core_wallet_evmwallet_not_installed");
3667
+ T(this, "connectEVMWallet", async (t, n) => {
3668
+ throw new m("core_wallet_evmwallet_not_installed");
3655
3669
  });
3656
- m(this, "connectWalletconnect", async (t, n) => {
3657
- throw new c("core_wallet_walletconnect_not_installed");
3670
+ T(this, "connectWalletconnect", async (t, n) => {
3671
+ throw new m("core_wallet_walletconnect_not_installed");
3658
3672
  });
3659
- m(this, "connectKeystore", async (t, n) => {
3660
- throw new c("core_wallet_keystore_not_installed");
3673
+ T(this, "connectKeystore", async (t, n) => {
3674
+ throw new m("core_wallet_keystore_not_installed");
3661
3675
  });
3662
- m(this, "connectLedger", async (t, n) => {
3663
- throw new c("core_wallet_ledger_not_installed");
3676
+ T(this, "connectLedger", async (t, n) => {
3677
+ throw new m("core_wallet_ledger_not_installed");
3664
3678
  });
3665
- m(this, "connectTrezor", async (t, n) => {
3666
- throw new c("core_wallet_trezor_not_installed");
3679
+ T(this, "connectTrezor", async (t, n) => {
3680
+ throw new m("core_wallet_trezor_not_installed");
3667
3681
  });
3668
- m(this, "connectKeplr", async (t) => {
3669
- throw new c("core_wallet_keplr_not_installed");
3682
+ T(this, "connectKeplr", async (t) => {
3683
+ throw new m("core_wallet_keplr_not_installed");
3670
3684
  });
3671
- m(this, "connectOkx", async (t) => {
3672
- throw new c("core_wallet_okx_not_installed");
3685
+ T(this, "connectOkx", async (t) => {
3686
+ throw new m("core_wallet_okx_not_installed");
3673
3687
  });
3674
- m(this, "disconnectChain", (t) => {
3688
+ T(this, "disconnectChain", (t) => {
3675
3689
  this.connectedChains[t] = null, this.connectedWallets[t] = null;
3676
3690
  });
3677
- P(this, B, async (t) => {
3691
+ B(this, P, async (t) => {
3678
3692
  if (t === s.THORChain)
3679
3693
  return {
3680
3694
  gas_rate: "0",
@@ -3683,39 +3697,39 @@ class en {
3683
3697
  halted: !1,
3684
3698
  chain: s.THORChain
3685
3699
  };
3686
- const a = (await Pt(this.stagenet)).find((i) => i.chain === t);
3700
+ const a = (await Bt(this.stagenet)).find((i) => i.chain === t);
3687
3701
  if (!a)
3688
- throw new c("core_inbound_data_not_found");
3702
+ throw new m("core_inbound_data_not_found");
3689
3703
  if (a != null && a.halted)
3690
- throw new c("core_chain_halted");
3704
+ throw new m("core_chain_halted");
3691
3705
  return a;
3692
3706
  });
3693
- P(this, z, ({ chain: t, wallet: n, walletMethods: a }) => {
3707
+ B(this, z, ({ chain: t, wallet: n, walletMethods: a }) => {
3694
3708
  this.connectedChains[t] = n, this.connectedWallets[t] = a;
3695
3709
  });
3696
- P(this, K, async ({
3710
+ B(this, K, async ({
3697
3711
  assetValue: { baseValueBigInt: t, address: n, chain: a, isGasAsset: i, isSynthetic: r },
3698
3712
  type: p = "checkOnly",
3699
- contractAddress: o
3713
+ contractAddress: d
3700
3714
  }) => {
3701
3715
  const y = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(a);
3702
3716
  if (y && i || !y || r)
3703
3717
  return !0;
3704
- const u = this.connectedWallets[a], l = p === "checkOnly" ? u == null ? void 0 : u.isApproved : u == null ? void 0 : u.approve;
3705
- if (!l)
3706
- throw new c("core_wallet_connection_not_found");
3718
+ const o = this.connectedWallets[a], c = p === "checkOnly" ? o == null ? void 0 : o.isApproved : o == null ? void 0 : o.approve;
3719
+ if (!c)
3720
+ throw new m("core_wallet_connection_not_found");
3707
3721
  const h = this.getAddress(a);
3708
3722
  if (!n || !h)
3709
- throw new c("core_approve_asset_address_or_from_not_found");
3710
- const _ = o || (await A(this, B).call(this, a)).router;
3711
- return l({
3723
+ throw new m("core_approve_asset_address_or_from_not_found");
3724
+ const w = d || (await f(this, P).call(this, a)).router;
3725
+ return c({
3712
3726
  amount: t,
3713
3727
  assetAddress: n,
3714
3728
  from: h,
3715
- spenderAddress: _
3729
+ spenderAddress: w
3716
3730
  });
3717
3731
  });
3718
- P(this, x, async ({
3732
+ B(this, N, async ({
3719
3733
  assetValue: t,
3720
3734
  memo: n,
3721
3735
  feeOptionKey: a = k.Fast
@@ -3724,22 +3738,22 @@ class en {
3724
3738
  gas_rate: i,
3725
3739
  router: r,
3726
3740
  address: p
3727
- } = await A(this, B).call(this, t.chain), o = (parseInt(i) || 0) * st[a];
3741
+ } = await f(this, P).call(this, t.chain), d = (parseInt(i) || 0) * st[a];
3728
3742
  return this.deposit({
3729
3743
  assetValue: t,
3730
3744
  recipient: p,
3731
3745
  memo: n,
3732
3746
  router: r,
3733
- feeRate: o
3747
+ feeRate: d
3734
3748
  });
3735
3749
  });
3736
- P(this, Y, async ({ memo: t, assetValue: n }) => {
3737
- const a = await Bt(this.stagenet);
3750
+ B(this, Y, async ({ memo: t, assetValue: n }) => {
3751
+ const a = await Pt(this.stagenet);
3738
3752
  if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
3739
- throw new c("core_chain_halted");
3753
+ throw new m("core_chain_halted");
3740
3754
  return this.deposit({ assetValue: n, recipient: "", memo: t });
3741
3755
  });
3742
- P(this, X, ({ assetValue: t, ...n }) => ({
3756
+ B(this, X, ({ assetValue: t, ...n }) => ({
3743
3757
  ...n,
3744
3758
  memo: n.memo || "",
3745
3759
  from: this.getAddress(t.chain),
@@ -3748,42 +3762,42 @@ class en {
3748
3762
  this.stagenet = !!t;
3749
3763
  }
3750
3764
  }
3751
- B = new WeakMap(), z = new WeakMap(), K = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
3765
+ P = new WeakMap(), z = new WeakMap(), K = new WeakMap(), N = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
3752
3766
  export {
3753
3767
  Ue as AGG_SWAP,
3754
- Ae as ApiError,
3768
+ be as ApiError,
3755
3769
  W as ApiUrl,
3756
3770
  v as AssetValue,
3757
- E as BaseDecimal,
3758
- pe as BigIntArithmetics,
3771
+ b as BaseDecimal,
3772
+ re as BigIntArithmetics,
3759
3773
  s as Chain,
3760
- le as ChainId,
3774
+ ye as ChainId,
3761
3775
  Gt as ChainIdToChain,
3762
3776
  Ke as ChainToChainId,
3763
- Ee as ChainToExplorerUrl,
3777
+ we as ChainToExplorerUrl,
3764
3778
  Ft as ChainToHexChainId,
3765
3779
  Ye as ChainToRPC,
3766
3780
  Ge as ContractAddress,
3767
3781
  kt as CosmosChainList,
3768
3782
  We as DerivationPath,
3769
- d as ERROR_CODE,
3783
+ u as ERROR_CODE,
3770
3784
  ke as ERROR_MODULE,
3771
- be as ERROR_TYPE,
3785
+ fe as ERROR_TYPE,
3772
3786
  Ht as EVMChainList,
3773
3787
  Xe as ErrorCode,
3774
3788
  k as FeeOption,
3775
- f as MemoType,
3789
+ _ as MemoType,
3776
3790
  Ut as NetworkDerivationPath,
3777
3791
  Le as QuoteMode,
3778
- we as RPCUrl,
3792
+ Ae as RPCUrl,
3779
3793
  He as SWAP_IN,
3780
3794
  $e as SWAP_OUT,
3781
3795
  en as SwapKitCore,
3782
- c as SwapKitError,
3783
- ye as SwapKitNumber,
3784
- Be as TCAvalancheDepositABI,
3796
+ m as SwapKitError,
3797
+ ue as SwapKitNumber,
3798
+ Pe as TCAvalancheDepositABI,
3785
3799
  Ve as TCBscDepositABI,
3786
- Pe as TCEthereumVaultAbi,
3800
+ Be as TCEthereumVaultAbi,
3787
3801
  $t as UTXOChainList,
3788
3802
  je as WalletOption,
3789
3803
  Yt as assetFromString,
@@ -3798,12 +3812,12 @@ export {
3798
3812
  dt as getAsymmetricRuneShare,
3799
3813
  jt as getAsymmetricRuneWithdrawAmount,
3800
3814
  rt as getCommonAssetInfo,
3801
- Ie as getDecimal,
3815
+ Oe as getDecimal,
3802
3816
  zt as getEstimatedPoolShare,
3803
3817
  Zt as getLiquiditySlippage,
3804
- D as getMemoFor,
3805
- he as getMinAmountByChain,
3806
- Re as getRequest,
3818
+ x as getMemoFor,
3819
+ _e as getMinAmountByChain,
3820
+ Ee as getRequest,
3807
3821
  yt as getSymmetricPoolShare,
3808
3822
  Jt as getSymmetricWithdraw,
3809
3823
  Wt as getTHORNameCost,