@swapkit/core 1.0.0-rc.6 → 1.0.0-rc.8

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 Ce = Object.defineProperty;
2
- var Ne = (e, t, n) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var T = (e, t, n) => (Ne(e, typeof t != "symbol" ? t + "" : t, n), n), De = (e, t, n) => {
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) => {
4
4
  if (!t.has(e))
5
5
  throw TypeError("Cannot " + n);
6
6
  };
7
- var A = (e, t, n) => (De(e, t, "read from private field"), n ? n.call(e) : t.get(e)), P = (e, t, n) => {
7
+ var A = (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, Pe = (e, t, n) => t in e ? xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, C = (e, t, n) => (Pe(e, typeof t != "symbol" ? t + "" : t, n), n);
13
- const Lt = [
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 = [
14
14
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
15
15
  {
16
16
  anonymous: !1,
@@ -283,7 +283,7 @@ const Lt = [
283
283
  stateMutability: "view",
284
284
  type: "function"
285
285
  }
286
- ], Ve = [
286
+ ], Pe = [
287
287
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
288
288
  {
289
289
  anonymous: !1,
@@ -447,7 +447,7 @@ const Lt = [
447
447
  stateMutability: "view",
448
448
  type: "function"
449
449
  }
450
- ], Le = [
450
+ ], Ve = [
451
451
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
452
452
  {
453
453
  anonymous: !1,
@@ -600,13 +600,13 @@ const Lt = [
600
600
  type: "function"
601
601
  }
602
602
  ];
603
- var Ue = /* @__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))(Ue || {});
604
- const He = [
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 = [
605
605
  "ERC20-ERC20",
606
606
  "ARC20-ARC20",
607
607
  "BEP20-BEP20"
608
608
  /* BSC_TO_BSC */
609
- ], $e = [
609
+ ], He = [
610
610
  "ERC20-TC",
611
611
  "ERC20-ARC20",
612
612
  "ERC20-BEP20",
@@ -617,72 +617,72 @@ const He = [
617
617
  "BEP20-ERC20",
618
618
  "BEP20-ARC20"
619
619
  /* BSC_TO_AVAX */
620
- ], ke = [
620
+ ], $e = [
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 Ae = /* @__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))(Ae || {}), Fe = /* @__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))(Fe || {}), o = /* @__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))(o || {});
628
- const Ge = {
629
- [o.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
630
- [o.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
631
- [o.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
632
- [o.NO_INBOUND_ADDRESSES]: "No inbound addresses.",
633
- [o.CHAIN_HALTED_OR_UNSUPPORTED]: "Chain {0} halted or unsupported.",
634
- [o.MISSING_INPUT_PARAMETER]: "Missing input parameter: {0}.",
635
- [o.INVALID_TYPE_GENERIC]: "Invalid type",
636
- [o.INVALID_NUMBER_STRING]: "Invalid number string.",
637
- [o.INVALID_NUMBER]: "Invalid number.",
638
- [o.INVALID_BOOLEAN]: "Invalid boolean.",
639
- [o.INVALID_OBJECT]: "Invalid object.",
640
- [o.INVALID_ARRAY]: "Invalid array.",
641
- [o.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Sell amount must be a positive integer.",
642
- [o.SELL_BUY_ASSETS_ARE_THE_SAME]: "Sell and buy assets are the same.",
643
- [o.MISSING_SOURCE_ADDRESS_FOR_SYNTH]: "Source address is required for synth quote.",
644
- [o.AFF_ADDRESS_AND_BPS_OR_NEITHER]: "Must provide affiliateAddress and affiliateBasisPoints params, or neither.",
645
- [o.AFF_ADDRESS_TOO_LONG]: "affiliateAddress too long: 3 characters max.",
646
- [o.AFF_BPS_INTEGER_0_100]: "affiliateBasisPoints must be an integer between 0 and 100.",
647
- [o.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]: "Source address {0} invalid for sell chain.",
648
- [o.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]: "Destination address {0} invalid for buy chain.",
649
- [o.PREFERRED_PROFVIDER_NOT_SUPPORTED]: "Preferred provider not supported.",
650
- [o.DESTINATION_ADDRESS_SMART_CONTRACT]: "Destination address is a smart contract.",
651
- [o.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]: "Buy amount must be a positive integer.",
652
- [o.INVALID_PROVIDER]: "Invalid provider {0}.",
653
- [o.MISSING_CROSS_CHAIN_PROVIDER]: "Missing cross-chain provider.",
654
- [o.MISSING_AVAX_PROVIDER]: "Missing AVAX provider.",
655
- [o.MISSING_BSC_PROVIDER]: "Missing BSC provider.",
656
- [o.MISSING_ETH_PROVIDER]: "Missing ETH provider.",
657
- [o.MISSING_ARB_PROVIDER]: "Missing ARB provider.",
658
- [o.INVALID_PROVIDER_FOR_SWAP_OUT]: "Invalid provider for swap out.",
659
- [o.INVALID_CHAIN]: "Invalid chain {0}.",
660
- [o.INVALID_ASSET]: "Invalid asset {0}.",
661
- [o.UNSUPPORTED_CHAIN]: "Unsupported chain {0}.",
662
- [o.UNSUPPORTED_ASSET]: "Unsupported asset {0}.",
663
- [o.UNSUPPORTED_ASSET_FOR_SWAPOUT]: "Unsupported asset {0} for swap out.",
664
- [o.THORNODE_QUOTE_GENERIC_ERROR]: "ThorNode quote generic error.",
665
- [o.INVALID_SOURCE_ADDRESS]: "Invalid source address {0}",
666
- [o.INVALID_DESTINATION_ADDRESS]: "Invalid destination address {0}",
667
- [o.NOT_ENOUGH_SYNTH_BALANCE]: "Source address doesn't have enough synth balance for this quote.",
668
- [o.SYNTH_MINTING_CAP_REACHED]: "Synth minting cap reached.",
669
- [o.INVALID_QUOTE_MODE]: "Invalid quote mode.",
670
- [o.NO_QUOTES]: "No quotes to service this request.",
671
- [o.SERVICE_UNAVAILABLE_GENERIC]: "Service unavailable.",
672
- [o.MISSING_GAS_DATA_GENERIC]: "Missing gas data.",
673
- [o.MISSING_TOKEN_INFO_GENERIC]: "Missing token info.",
674
- [o.CANT_FIND_TOKEN_LIST]: "Can't find tokenlist {0}.",
675
- [o.NO_PRICE]: "No price for asset {0}.",
676
- [o.PRICE_IS_STALE]: "Price is stale for asset {0}.",
677
- [o.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
678
- [o.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
679
- }, ae = (e, t) => {
680
- let n = Ge[e];
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];
681
681
  for (let a = 0; a < t.length; a++)
682
682
  n = n.replace(`{${a}}`, t[a]);
683
683
  return t.length === 0 ? n.replace("{0}", "") : n;
684
684
  };
685
- let Ut = class we extends Error {
685
+ class Ae extends Error {
686
686
  constructor({
687
687
  status: t,
688
688
  revision: n,
@@ -690,22 +690,22 @@ let Ut = class we extends Error {
690
690
  code: i,
691
691
  message: r,
692
692
  type: p,
693
- options: { shouldLog: d, shouldThrow: l, shouldTrace: c } = {
693
+ options: { shouldLog: o, shouldThrow: y, shouldTrace: T } = {
694
694
  shouldLog: !0,
695
695
  shouldThrow: !0,
696
696
  shouldTrace: !0
697
697
  },
698
- displayMessageParams: y
698
+ displayMessageParams: u
699
699
  }) {
700
- const u = r || ae(i, y || []) || "";
701
- super(u), 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 = u, this.display = ae(i, y || []), this.code = i, this.type = p || Ae.UNHANDLED_ERROR, this.options = {
702
- shouldLog: d || !0,
703
- shouldTrace: c || !0,
704
- shouldThrow: l || !1
705
- }, this.displayMessageParams = y || [], this.options.shouldTrace && Error.captureStackTrace(this);
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
705
+ }, this.displayMessageParams = u || [], this.options.shouldTrace && Error.captureStackTrace(this);
706
706
  }
707
707
  static fromErrorInfo(t) {
708
- return new we(t);
708
+ return new Ae(t);
709
709
  }
710
710
  toErrorInfo() {
711
711
  return { ...this, identifier: this.identifier };
@@ -714,7 +714,7 @@ let Ut = class we extends Error {
714
714
  return `${this.revision}-${this.type || "NO_TYPE"}-${this.module}-${this.code}`;
715
715
  }
716
716
  get displayMessage() {
717
- return ae(this.code, this.displayMessageParams || []);
717
+ return te(this.code, this.displayMessageParams || []);
718
718
  }
719
719
  handle() {
720
720
  const t = `[${this.identifier}]: ${this.message}`;
@@ -723,9 +723,9 @@ let Ut = class we 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 || {}), We = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(We || {}), qe = /* @__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))(qe || {});
728
- const Ht = {
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 = {
729
729
  ARB: [44, 60, 0, 0, 0],
730
730
  AVAX: [44, 60, 0, 0, 0],
731
731
  BCH: [44, 145, 0, 0, 0],
@@ -743,7 +743,7 @@ const Ht = {
743
743
  THOR: [44, 931, 0, 0, 0]
744
744
  };
745
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 $t = [
746
+ const Ut = [
747
747
  "ETH",
748
748
  "AVAX",
749
749
  "BSC",
@@ -751,38 +751,38 @@ const $t = [
751
751
  "OP",
752
752
  "MATIC"
753
753
  /* Polygon */
754
- ], kt = [
754
+ ], Ht = [
755
755
  "BTC",
756
756
  "BCH",
757
757
  "DOGE",
758
758
  "LTC"
759
759
  /* Litecoin */
760
- ], Ft = [
760
+ ], $t = [
761
761
  "GAIA",
762
762
  "THOR",
763
763
  "BNB"
764
764
  /* Binance */
765
765
  ];
766
- var ce = /* @__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))(ce || {}), Ee = /* @__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))(Ee || {}), q = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(q || {});
767
- const te = Object.values(s), Ke = Object.keys(s), me = te.reduce(
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(
768
768
  (e, t) => {
769
- const n = Ke.find((a) => s[a] === t);
769
+ const n = qe.find((a) => s[a] === t);
770
770
  return n && (e[t] = n), e;
771
771
  },
772
772
  {}
773
- ), Ye = te.reduce(
774
- (e, t) => (e[t] = ce[me[t]], e),
773
+ ), Ke = Z.reduce(
774
+ (e, t) => (e[t] = le[ce[t]], e),
775
775
  {}
776
- ), Xe = te.reduce(
777
- (e, t) => (e[t] = Ee[me[t]], e),
776
+ ), Ye = Z.reduce(
777
+ (e, t) => (e[t] = we[ce[t]], e),
778
778
  {}
779
- ), Gt = te.reduce(
779
+ ), kt = Z.reduce(
780
780
  (e, t) => {
781
- const n = `${me[t]}Hex`;
782
- return e[t] = ce[n], e;
781
+ const n = `${ce[t]}Hex`;
782
+ return e[t] = le[n], e;
783
783
  },
784
784
  {}
785
- ), Wt = {
785
+ ), Ft = {
786
786
  "0xa4b1": "ARB",
787
787
  42161: "ARB",
788
788
  "0xa86a": "AVAX",
@@ -807,7 +807,7 @@ const te = Object.values(s), Ke = Object.keys(s), me = te.reduce(
807
807
  "thorchain-stagenet-v2": "THOR",
808
808
  "thorchain-mainnet-v1": "THOR"
809
809
  /* THORChain */
810
- }, Re = {
810
+ }, Ee = {
811
811
  ARB: "https://arbiscan.io",
812
812
  AVAX: "https://snowtrace.io",
813
813
  BSC: "https://bscscan.com",
@@ -824,47 +824,55 @@ const te = Object.values(s), Ke = Object.keys(s), me = te.reduce(
824
824
  MATIC: "https://polygonscan.com",
825
825
  THOR: "https://viewblock.io/thorchain"
826
826
  };
827
- var je = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(je || {}), 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 || {}), F = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(F || {}), 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, ze = (e, t, n) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, N = (e, t, n) => (ze(e, typeof t != "symbol" ? t + "" : t, n), n), Ze = (e, t, n) => {
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) => {
828
828
  if (!t.has(e))
829
829
  throw TypeError("Cannot " + n);
830
- }, B = (e, t, n) => {
830
+ }, V = (e, t, n) => {
831
831
  if (t.has(e))
832
832
  throw TypeError("Cannot add the same private member more than once");
833
833
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
834
- }, R = (e, t, n) => (Ze(e, t, "access private method"), n);
835
- const qt = (e) => {
834
+ }, g = (e, t, n) => (ze(e, t, "access private method"), n);
835
+ const Gt = (e) => {
836
836
  if (e < 0)
837
837
  throw new Error("Invalid number of year");
838
838
  return 10 + e;
839
- }, Kt = (e) => {
839
+ }, Wt = (e) => {
840
840
  if (e.length > 30)
841
841
  return !1;
842
842
  const t = /^[a-zA-Z0-9+_-]+$/g;
843
843
  return !!e.match(t);
844
- }, Yt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Oe = async (e, t) => {
845
- const n = Object.entries(t || {}).reduce(
846
- (a, [i, r]) => (r && (a[i] = r), a),
847
- {}
848
- );
849
- return (await fetch(
850
- `${e}${t ? `?${new URLSearchParams(n).toString()}` : ""}`,
851
- { method: "GET", mode: "cors", credentials: "omit", referrer: "https://sk.thorswap.net" }
852
- )).json();
853
- }, et = async (e, t, n, a = !1) => {
854
- const i = await fetch(`${e}`, {
855
- body: t,
856
- headers: n,
857
- method: "POST",
858
- referrer: "https://sk.thorswap.net"
859
- });
860
- return a ? i.text() : i.json();
861
- }, tt = "0x313ce567", Ie = async ({ chain: e, to: t }) => {
844
+ }, qt = ([e, t, n, a, i]) => `${e}'/${t}'/${n}'/${a}${typeof i != "number" ? "" : `/${i}`}`, Re = async (e, t) => {
862
845
  try {
863
- const n = await et(
864
- Xe[e],
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 }) => {
870
+ try {
871
+ const n = await Ze(
872
+ Ye[e],
865
873
  JSON.stringify({
866
874
  method: "eth_call",
867
- params: [{ to: t.toLowerCase(), data: tt }, "latest"],
875
+ params: [{ to: t.toLowerCase(), data: et }, "latest"],
868
876
  id: 44,
869
877
  jsonrpc: "2.0"
870
878
  }),
@@ -875,30 +883,30 @@ const qt = (e) => {
875
883
  } catch (n) {
876
884
  return console.error(n), E[e];
877
885
  }
878
- }, nt = async (e) => {
886
+ }, tt = async (e) => {
879
887
  if (e === s.Ethereum)
880
888
  return E.ETH;
881
889
  const [, t] = e.split("-");
882
- return t != null && t.startsWith("0x") ? Ie({ chain: s.Ethereum, to: t }) : E.ETH;
883
- }, at = async (e) => {
890
+ return t != null && t.startsWith("0x") ? Oe({ chain: s.Ethereum, to: t }) : E.ETH;
891
+ }, nt = async (e) => {
884
892
  const [, t] = e.split("-");
885
- return t != null && t.startsWith("0x") ? Ie({ chain: s.Avalanche, to: t.toLowerCase() }) : E.AVAX;
886
- }, st = async (e) => (e === s.BinanceSmartChain, E.BSC), Se = async ({ chain: e, symbol: t }) => {
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 }) => {
887
895
  switch (e) {
888
896
  case s.Ethereum:
889
- return nt(t);
897
+ return tt(t);
890
898
  case s.Avalanche:
891
- return at(t);
899
+ return nt(t);
892
900
  case s.BinanceSmartChain:
893
- return st(t);
901
+ return at(t);
894
902
  default:
895
903
  return E[e];
896
904
  }
897
- }, it = {
898
- [F.Average]: 1.2,
899
- [F.Fast]: 1.5,
900
- [F.Fastest]: 2
901
- }, rt = ({ chain: e, symbol: t }) => {
905
+ }, st = {
906
+ [k.Average]: 1.2,
907
+ [k.Fast]: 1.5,
908
+ [k.Fastest]: 2
909
+ }, it = ({ chain: e, symbol: t }) => {
902
910
  switch (e) {
903
911
  case s.Bitcoin:
904
912
  case s.BitcoinCash:
@@ -924,7 +932,7 @@ const qt = (e) => {
924
932
  case s.THORChain:
925
933
  return t === "RUNE";
926
934
  }
927
- }, pt = (e) => {
935
+ }, rt = (e) => {
928
936
  switch (e) {
929
937
  case "ETH.THOR":
930
938
  return { identifier: "ETH.THOR-0xa5f2211b9b8170f694421f2046281775e8468044", decimal: 18 };
@@ -953,7 +961,7 @@ const qt = (e) => {
953
961
  case s.Ethereum:
954
962
  return { identifier: `${e}.${e}`, decimal: E[e] };
955
963
  }
956
- }, ot = ({ chain: e, symbol: t }) => {
964
+ }, pt = ({ chain: e, symbol: t }) => {
957
965
  if (t.includes("/"))
958
966
  return "Synth";
959
967
  switch (e) {
@@ -983,35 +991,35 @@ const qt = (e) => {
983
991
  case s.Optimism:
984
992
  return [s.Ethereum, s.Optimism].includes(t) ? "Native" : "OPTIMISM";
985
993
  }
986
- }, Xt = (e) => {
994
+ }, Kt = (e) => {
987
995
  var t;
988
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];
989
997
  return { chain: n, symbol: r, ticker: p, synth: i };
990
- }, dt = ({
998
+ }, ot = ({
991
999
  liquidityUnits: e,
992
1000
  poolUnits: t,
993
1001
  runeDepth: n
994
1002
  }) => {
995
- const a = w(e), i = w(t), r = w(n), p = a.mul(r), d = i.mul(i).mul(2), l = i.mul(a).mul(2), c = a.mul(a), y = i.mul(i).mul(i);
996
- return p.mul(d.sub(l).add(c)).div(y);
997
- }, ut = ({
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 = ({
998
1006
  liquidityUnits: e,
999
1007
  poolUnits: t,
1000
1008
  assetDepth: n
1001
1009
  }) => {
1002
- const a = w(e), i = w(t), r = w(n), p = a.mul(r), d = i.mul(i).mul(2), l = i.mul(a).mul(2), c = a.mul(a), y = p.mul(d.sub(l).add(c)), u = i.mul(i).mul(i);
1003
- return y.div(u);
1004
- }, jt = ({
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 = ({
1005
1013
  percent: e,
1006
1014
  runeDepth: t,
1007
1015
  liquidityUnits: n,
1008
1016
  poolUnits: a
1009
- }) => dt({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), Jt = ({
1017
+ }) => ot({ runeDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), Xt = ({
1010
1018
  percent: e,
1011
1019
  assetDepth: t,
1012
1020
  liquidityUnits: n,
1013
1021
  poolUnits: a
1014
- }) => ut({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), w = (e) => new le({ value: e, decimal: E.THOR }), yt = ({
1022
+ }) => dt({ assetDepth: t, liquidityUnits: n, poolUnits: a }).mul(e), w = (e) => new ye({ value: e, decimal: E.THOR }), ut = ({
1015
1023
  liquidityUnits: e,
1016
1024
  poolUnits: t,
1017
1025
  runeDepth: n,
@@ -1019,17 +1027,17 @@ const qt = (e) => {
1019
1027
  }) => ({
1020
1028
  assetAmount: w(a).mul(e).div(t),
1021
1029
  runeAmount: w(n).mul(e).div(t)
1022
- }), Qt = ({
1030
+ }), jt = ({
1023
1031
  liquidityUnits: e,
1024
1032
  poolUnits: t,
1025
1033
  runeDepth: n,
1026
1034
  assetDepth: a,
1027
1035
  percent: i
1028
1036
  }) => Object.fromEntries(
1029
- Object.entries(yt({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
1037
+ Object.entries(ut({ liquidityUnits: e, poolUnits: t, runeDepth: n, assetDepth: a })).map(
1030
1038
  ([r, p]) => [r, p.mul(i)]
1031
1039
  )
1032
- ), zt = ({
1040
+ ), Qt = ({
1033
1041
  runeDepth: e,
1034
1042
  poolUnits: t,
1035
1043
  assetDepth: n,
@@ -1037,24 +1045,24 @@ const qt = (e) => {
1037
1045
  runeAmount: i,
1038
1046
  assetAmount: r
1039
1047
  }) => {
1040
- const p = w(e), d = w(n), l = w(t), c = w(i), y = w(r), u = c.mul(d), h = y.mul(p), _ = c.mul(y), O = p.mul(d), I = l.mul(u.add(h.add(_.mul(2)))), g = u.add(h.add(O.mul(2))), S = I.div(g), b = w(a).add(S);
1041
- if (S.baseValueNumber === 0)
1042
- return b.div(l).baseValueNumber;
1043
- const M = l.add(b);
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);
1044
1052
  return b.div(M).baseValueNumber;
1045
- }, Zt = ({
1053
+ }, Jt = ({
1046
1054
  runeAmount: e,
1047
1055
  assetAmount: t,
1048
1056
  runeDepth: n,
1049
1057
  assetDepth: a
1050
1058
  }) => {
1051
- const i = w(n), r = w(a), p = w(t), d = w(e), l = p.mul(i).sub(r.mul(d)), c = r.mul(d).add(i.mul(r));
1052
- return Math.abs(l.div(c).baseValueNumber);
1053
- }, lt = ({
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 = ({
1054
1062
  symbol: e,
1055
1063
  ticker: t,
1056
1064
  chain: n
1057
- }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, x = (e, t) => {
1065
+ }) => n === "ETH" && t !== "ETH" ? `${t}-${e.slice(-3)}` : e, D = (e, t) => {
1058
1066
  switch (e) {
1059
1067
  case f.LEAVE:
1060
1068
  case f.BOND: {
@@ -1074,8 +1082,8 @@ const qt = (e) => {
1074
1082
  return r ? `${e}:${n}/${a}::t:0` : `${e}:${n}.${a}:${i || ""}:t:0`;
1075
1083
  }
1076
1084
  case f.WITHDRAW: {
1077
- const { chain: n, ticker: a, symbol: i, basisPoints: r, targetAssetString: p, singleSide: d } = t, l = !d && p ? `:${p}` : "", c = lt({ chain: n, symbol: i, ticker: a });
1078
- return `${e}:${n}${d ? "/" : "."}${c}:${r}${l}`;
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}`;
1079
1087
  }
1080
1088
  case f.OPEN_LOAN:
1081
1089
  case f.CLOSE_LOAN: {
@@ -1085,43 +1093,44 @@ const qt = (e) => {
1085
1093
  default:
1086
1094
  return "";
1087
1095
  }
1088
- }, K = 8, ge = ({
1096
+ }, me = Object.values(s), lt = (e = "") => {
1097
+ const t = e.toUpperCase(), [n] = t.split(".");
1098
+ if (me.includes(n))
1099
+ return !0;
1100
+ const [a] = t.split("/");
1101
+ if (me.includes(a))
1102
+ return !0;
1103
+ throw new Error(
1104
+ `Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
1105
+ );
1106
+ }, q = 8, U = (e) => 10n ** BigInt(e), F = (e) => Math.log10(parseFloat(e.toString()));
1107
+ function ge({
1089
1108
  value: e,
1090
- bigIntDecimal: t = K,
1091
- decimal: n = K
1092
- }) => {
1109
+ bigIntDecimal: t = q,
1110
+ decimal: n = q
1111
+ }) {
1093
1112
  const a = e < 0n;
1094
1113
  let i = e.toString().substring(a ? 1 : 0);
1095
1114
  const r = n - (i.length - 1);
1096
1115
  r > 0 && (i = "0".repeat(r) + i);
1097
1116
  const p = i.length - n;
1098
- let d = i.slice(-n);
1099
- 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(
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(
1100
1119
  /\.?0*$/,
1101
1120
  ""
1102
1121
  );
1103
- }, Te = Object.values(s), ct = (e = "") => {
1104
- const t = e.toUpperCase(), [n] = t.split(".");
1105
- if (Te.includes(n))
1106
- return !0;
1107
- const [a] = t.split("/");
1108
- if (Te.includes(a))
1109
- return !0;
1110
- throw new Error(
1111
- `Invalid identifier: ${e}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`
1112
- );
1113
- }, U = (e) => 10n ** BigInt(e), G = (e) => Math.log10(parseFloat(e.toString()));
1114
- var L, $, ie, ve, re, _e, z, pe, H, W, Z, oe, k, J;
1115
- const mt = class Q {
1122
+ }
1123
+ var L, $, ae, Se, se, Te, Q, ie, H, G, J, re;
1124
+ const ct = class j {
1116
1125
  constructor(t) {
1117
- B(this, L), B(this, ie), B(this, re), B(this, z), B(this, H), B(this, Z), B(this, k), N(this, "decimalMultiplier", 10n ** 8n), N(this, "bigIntValue", 0n), N(this, "decimal");
1118
- const n = typeof t == "object", a = n ? t.value : t;
1119
- this.decimal = n ? t.decimal : void 0, this.decimalMultiplier = U(
1120
- Math.max(R(this, Z, oe).call(this, R(this, H, W).call(this, a)), this.decimal || 0)
1121
- ), R(this, ie, ve).call(this, a);
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);
1122
1131
  }
1123
1132
  static fromBigInt(t, n) {
1124
- return new Q({
1133
+ return new j({
1125
1134
  decimal: n,
1126
1135
  value: ge({ value: t, bigIntDecimal: n, decimal: n })
1127
1136
  });
@@ -1131,40 +1140,34 @@ const mt = class Q {
1131
1140
  from: n,
1132
1141
  to: a
1133
1142
  }) {
1134
- return Q.fromBigInt(
1135
- new Q(t).bigIntValue * U(a) / U(n),
1143
+ return j.fromBigInt(
1144
+ new j(t).bigIntValue * U(a) / U(n),
1136
1145
  a
1137
1146
  );
1138
1147
  }
1139
- get unsafeNumber() {
1140
- return parseFloat((this.bigIntValue / this.decimalMultiplier).toString());
1141
- }
1142
1148
  get baseValue() {
1143
- return R(this, k, J).call(this, "string");
1149
+ return this.getBaseValue("string");
1144
1150
  }
1145
1151
  get baseValueNumber() {
1146
- return R(this, k, J).call(this, "number");
1152
+ return this.getBaseValue("number");
1147
1153
  }
1148
1154
  get baseValueBigInt() {
1149
- return R(this, k, J).call(this, "number");
1155
+ return this.getBaseValue("bigint");
1150
1156
  }
1151
- get value() {
1152
- return this.formatBigIntToSafeValue(
1153
- this.bigIntValue,
1154
- this.decimal || G(this.decimalMultiplier)
1155
- );
1157
+ set(t) {
1158
+ return new this.constructor({ decimal: this.decimal, value: t, identifier: this.toString() });
1156
1159
  }
1157
1160
  add(...t) {
1158
- return R(this, L, $).call(this, "add", ...t);
1161
+ return g(this, L, $).call(this, "add", ...t);
1159
1162
  }
1160
1163
  sub(...t) {
1161
- return R(this, L, $).call(this, "sub", ...t);
1164
+ return g(this, L, $).call(this, "sub", ...t);
1162
1165
  }
1163
1166
  mul(...t) {
1164
- return R(this, L, $).call(this, "mul", ...t);
1167
+ return g(this, L, $).call(this, "mul", ...t);
1165
1168
  }
1166
1169
  div(...t) {
1167
- return R(this, L, $).call(this, "div", ...t);
1170
+ return g(this, L, $).call(this, "div", ...t);
1168
1171
  }
1169
1172
  gt(t) {
1170
1173
  return this.bigIntValue > this.getBigIntValue(t);
@@ -1181,124 +1184,170 @@ const mt = class Q {
1181
1184
  eqValue(t) {
1182
1185
  return this.bigIntValue === this.getBigIntValue(t);
1183
1186
  }
1187
+ getValue(t) {
1188
+ const n = this.formatBigIntToSafeValue(
1189
+ this.bigIntValue,
1190
+ this.decimal || F(this.decimalMultiplier)
1191
+ );
1192
+ switch (t) {
1193
+ case "number":
1194
+ return Number(n);
1195
+ case "string":
1196
+ return n;
1197
+ default:
1198
+ return this.bigIntValue;
1199
+ }
1200
+ }
1201
+ getBaseValue(t) {
1202
+ const n = this.decimalMultiplier / U(this.decimal || 0), a = this.bigIntValue / n;
1203
+ switch (t) {
1204
+ case "number":
1205
+ return Number(a);
1206
+ case "string":
1207
+ return a.toString();
1208
+ default:
1209
+ return this.bigIntValue;
1210
+ }
1211
+ }
1184
1212
  getBigIntValue(t, n) {
1185
- return !n && typeof t == "object" ? t.bigIntValue : (t = typeof t == "object" ? t.value : t, R(this, z, pe).call(this, R(this, H, W).call(this, 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);
1186
1214
  }
1187
1215
  formatBigIntToSafeValue(t, n) {
1188
- const a = n || this.decimal || K, i = Math.max(
1216
+ const a = n || this.decimal || q, i = Math.max(
1189
1217
  a,
1190
- G(this.decimalMultiplier)
1191
- ), r = t < 0n;
1192
- let p = t.toString().substring(r ? 1 : 0);
1193
- const d = i - (p.length - 1);
1194
- d > 0 && (p = "0".repeat(d) + p);
1195
- const l = p.length - i;
1196
- let c = p.slice(-i);
1197
- return parseInt(c[a]) >= 5 ? c = `${c.substring(0, a - 1)}${(parseInt(c[a - 1]) + 1).toString()}` : c = c.substring(0, a), `${r ? "-" : ""}${p.slice(0, l)}.${c}`.replace(
1198
- /\.?0*$/,
1199
- ""
1200
- );
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*$/, "");
1201
1225
  }
1202
- toSignificant(t) {
1203
- const n = this.value.split("."), a = n[0], i = n[1];
1204
- return i ? `${a}.${i.slice(0, t || this.decimal)}`.replace(
1205
- /\.?0*$/,
1206
- ""
1207
- ) : a;
1226
+ 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)
1229
+ 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,
1235
+ "0"
1236
+ );
1237
+ const o = parseInt(r), y = `${o}`.slice(0, t);
1238
+ return `0.${y.padStart(
1239
+ r.length - `${o}`.length + y.length,
1240
+ "0"
1241
+ )}`;
1208
1242
  }
1209
1243
  };
1210
1244
  L = /* @__PURE__ */ new WeakSet(), $ = function(e, ...t) {
1211
- const n = R(this, re, _e).call(this, this, ...t), a = U(n), i = t.reduce(
1212
- (p, d) => {
1213
- const l = this.getBigIntValue(d, n);
1214
- if (e === "div" && l === 0n)
1215
- throw new RangeError("Division by zero");
1216
- return e === "add" ? p + l : e === "sub" ? p - l : e === "mul" ? p * l / a : p * a / l;
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);
1248
+ switch (e) {
1249
+ case "add":
1250
+ return p + y;
1251
+ case "sub":
1252
+ return p - y;
1253
+ case "mul":
1254
+ return p * y / a;
1255
+ case "div": {
1256
+ if (y === 0n)
1257
+ throw new RangeError("Division by zero");
1258
+ return p * a / y;
1259
+ }
1260
+ default:
1261
+ return p;
1262
+ }
1217
1263
  },
1218
1264
  //normalize is to precision multiplier base
1219
1265
  this.bigIntValue * a / this.decimalMultiplier
1220
1266
  ), r = ge({
1221
1267
  bigIntDecimal: n,
1222
- decimal: Math.max(n, G(this.decimalMultiplier)),
1268
+ decimal: Math.max(n, F(this.decimalMultiplier)),
1223
1269
  value: i
1224
1270
  });
1225
1271
  return new this.constructor({ decimal: this.decimal, value: r, identifier: this.toString() });
1226
- }, ie = /* @__PURE__ */ new WeakSet(), ve = function(e, t) {
1227
- const n = R(this, H, W).call(this, e) || "0";
1228
- this.bigIntValue = t || R(this, z, pe).call(this, n);
1229
- }, re = /* @__PURE__ */ new WeakSet(), _e = function(...e) {
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) {
1230
1276
  const t = e.map(
1231
- (n) => typeof n == "object" ? n.decimal || G(n.decimalMultiplier) : R(this, Z, oe).call(this, R(this, H, W).call(this, n))
1277
+ (n) => typeof n == "object" ? n.decimal || F(n.decimalMultiplier) : g(this, J, re).call(this, g(this, H, G).call(this, n))
1232
1278
  ).filter(Boolean);
1233
- return Math.max(...t, K);
1234
- }, z = /* @__PURE__ */ new WeakSet(), pe = function(e, t) {
1235
- const n = t ? U(t) : this.decimalMultiplier, a = G(n), [i, r = ""] = e.split(".");
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(".");
1236
1282
  return BigInt(`${i}${r.padEnd(a, "0")}`);
1237
- }, H = /* @__PURE__ */ new WeakSet(), W = function(e) {
1283
+ }, H = /* @__PURE__ */ new WeakSet(), G = function(e) {
1238
1284
  const t = `${typeof e == "number" ? Number(e).toLocaleString("fullwide", {
1239
1285
  useGrouping: !1,
1240
1286
  maximumFractionDigits: 20
1241
- }) : e}`.replaceAll(",", ".").split(".");
1287
+ }) : oe(e)}`.replaceAll(",", ".").split(".");
1242
1288
  return t.length > 1 ? `${t.slice(0, -1).join("")}.${t.at(-1)}` : t[0];
1243
- }, Z = /* @__PURE__ */ new WeakSet(), oe = function(e) {
1289
+ }, J = /* @__PURE__ */ new WeakSet(), re = function(e) {
1244
1290
  var t;
1245
1291
  const n = ((t = e.split(".")[1]) == null ? void 0 : t.length) || 0;
1246
- return Math.max(n, K);
1247
- }, k = /* @__PURE__ */ new WeakSet(), J = function(e) {
1248
- const t = this.decimalMultiplier / U(this.decimal || 0), n = this.bigIntValue / t;
1249
- switch (e) {
1250
- case "number":
1251
- return Number(n);
1252
- case "string":
1253
- return n.toString();
1254
- default:
1255
- return n;
1256
- }
1292
+ return Math.max(n, q);
1257
1293
  };
1258
- let de = mt, ue;
1259
- const se = (e) => {
1260
- if (!ue)
1294
+ let pe = ct;
1295
+ function oe(e) {
1296
+ return typeof e == "object" ? "getValue" in e ? e.getValue("string") : e.value : e;
1297
+ }
1298
+ let de;
1299
+ const ne = (e) => {
1300
+ if (!de)
1261
1301
  throw new Error("Static assets not loaded, call await AssetValue.loadStaticAssets() first");
1262
- return ue.get(e.toUpperCase()) || { decimal: E.THOR, identifier: "" };
1263
- }, he = async (e, t = 0) => {
1264
- ct(e);
1265
- const n = await Se(ye(e));
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));
1266
1306
  return new v({ decimal: n, value: t, identifier: e });
1267
1307
  };
1268
- class v extends de {
1308
+ class v extends pe {
1269
1309
  constructor(t) {
1270
1310
  super(
1271
- t.value instanceof de ? t.value : { decimal: t.decimal, value: t.value }
1311
+ t.value instanceof pe ? t.value : { decimal: t.decimal, value: t.value }
1272
1312
  ), N(this, "address"), N(this, "chain"), N(this, "isSynthetic", !1), N(this, "isGasAsset", !1), N(this, "symbol"), N(this, "ticker"), N(this, "type");
1273
- const n = "identifier" in t ? t.identifier : `${t.chain}.${t.symbol}`, a = ye(n);
1274
- this.type = ot(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;
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}`;
1318
+ }
1319
+ toString() {
1320
+ return `${this.chain}.${this.symbol}`;
1321
+ }
1322
+ eq({ chain: t, symbol: n }) {
1323
+ return this.chain === t && this.symbol === n;
1275
1324
  }
1276
1325
  static async fromString(t, n = 0) {
1277
- return he(t, n);
1326
+ return _e(t, n);
1278
1327
  }
1279
1328
  static fromStringSync(t, n = 0) {
1280
- const { decimal: a, identifier: i } = se(
1329
+ const { decimal: a, identifier: i } = ne(
1281
1330
  t
1282
1331
  );
1283
1332
  return i ? new v({ decimal: a, identifier: i, value: n }) : void 0;
1284
1333
  }
1285
1334
  static async fromIdentifier(t, n = 0) {
1286
- return he(t, n);
1335
+ return _e(t, n);
1287
1336
  }
1288
1337
  static fromIdentifierSync(t, n = 0) {
1289
- const { decimal: a, identifier: i } = se(t);
1338
+ const { decimal: a, identifier: i } = ne(t);
1290
1339
  return new v({ decimal: a, identifier: i, value: n });
1291
1340
  }
1292
1341
  static fromChainOrSignature(t, n = 0) {
1293
- const { decimal: a, identifier: i } = pt(t);
1342
+ const { decimal: a, identifier: i } = rt(t);
1294
1343
  return new v({ value: n, decimal: a, identifier: i });
1295
1344
  }
1296
1345
  static async fromTCQuote(t, n = 0) {
1297
- const a = await Se(ye(t)), i = this.shiftDecimals({ value: n, from: E.THOR, to: a });
1346
+ const a = await Ie(ue(t)), i = this.shiftDecimals({ value: n, from: E.THOR, to: a });
1298
1347
  return new v({ value: i, identifier: t, decimal: a });
1299
1348
  }
1300
1349
  static fromTCQuoteStatic(t, n = 0) {
1301
- const a = se(t), i = this.shiftDecimals({
1350
+ const a = ne(t), i = this.shiftDecimals({
1302
1351
  value: n,
1303
1352
  from: E.THOR,
1304
1353
  to: a.decimal
@@ -1316,10 +1365,10 @@ class v extends de {
1316
1365
  NativeList: i,
1317
1366
  ...r
1318
1367
  } = await import("@swapkit/tokens");
1319
- ue = [i, ...Object.values(r)].reduce(
1320
- (p, { tokens: d }) => (d.forEach(({ identifier: l, chain: c, ...y }) => {
1321
- const u = "decimals" in y ? y.decimals : E[c];
1322
- p.set(l, { identifier: l, decimal: u });
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 });
1323
1372
  }), p),
1324
1373
  /* @__PURE__ */ new Map()
1325
1374
  ), t({ ok: !0 });
@@ -1333,17 +1382,8 @@ class v extends de {
1333
1382
  }
1334
1383
  );
1335
1384
  }
1336
- get assetValue() {
1337
- return `${this.value} ${this.ticker}`;
1338
- }
1339
- toString() {
1340
- return `${this.chain}.${this.symbol}`;
1341
- }
1342
- eq({ chain: t, symbol: n }) {
1343
- return this.chain === t && this.symbol === n;
1344
- }
1345
1385
  }
1346
- const fe = (e) => {
1386
+ const he = (e) => {
1347
1387
  const t = v.fromChainOrSignature(e);
1348
1388
  switch (e) {
1349
1389
  case s.Bitcoin:
@@ -1361,17 +1401,17 @@ const fe = (e) => {
1361
1401
  default:
1362
1402
  return t.add(1);
1363
1403
  }
1364
- }, ye = (e) => {
1404
+ }, ue = (e) => {
1365
1405
  const t = e.slice(0, 14).includes("/"), n = e.includes(".") ? e : `${s.THORChain}.${e}`, [a, i] = n.split("."), [r, p] = i.split("-");
1366
1406
  return {
1367
1407
  address: p == null ? void 0 : p.toLowerCase(),
1368
1408
  chain: a,
1369
- isGasAsset: rt({ chain: a, symbol: i }),
1409
+ isGasAsset: it({ chain: a, symbol: i }),
1370
1410
  isSynthetic: t,
1371
1411
  symbol: p ? `${r}-${(p == null ? void 0 : p.toLowerCase()) ?? ""}` : i,
1372
1412
  ticker: t ? i : r
1373
1413
  };
1374
- }, Tt = {
1414
+ }, mt = {
1375
1415
  /**
1376
1416
  * Core
1377
1417
  */
@@ -1428,20 +1468,17 @@ const fe = (e) => {
1428
1468
  */
1429
1469
  helpers_number_different_decimals: 99101
1430
1470
  };
1431
- class m extends Error {
1471
+ class c extends Error {
1432
1472
  constructor(t, n) {
1433
- console.error(n), super(t, { cause: { code: Tt[t], message: t } }), Object.setPrototypeOf(this, m.prototype);
1473
+ console.error(n), super(t, { cause: { code: mt[t], message: t } }), Object.setPrototypeOf(this, c.prototype);
1434
1474
  }
1435
1475
  }
1436
- class le extends de {
1476
+ class ye extends pe {
1437
1477
  eq(t) {
1438
1478
  return this.eqValue(t);
1439
1479
  }
1440
- toString() {
1441
- return this.value;
1442
- }
1443
1480
  }
1444
- const _t = [
1481
+ const Tt = [
1445
1482
  {
1446
1483
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1447
1484
  stateMutability: "nonpayable",
@@ -1532,7 +1569,7 @@ const _t = [
1532
1569
  type: "function"
1533
1570
  },
1534
1571
  { stateMutability: "payable", type: "receive" }
1535
- ], ht = [
1572
+ ], _t = [
1536
1573
  {
1537
1574
  inputs: [
1538
1575
  { internalType: "address", name: "_ttp", type: "address" },
@@ -1676,7 +1713,7 @@ const _t = [
1676
1713
  type: "function"
1677
1714
  },
1678
1715
  { stateMutability: "payable", type: "receive" }
1679
- ], ft = [
1716
+ ], ht = [
1680
1717
  {
1681
1718
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1682
1719
  stateMutability: "nonpayable",
@@ -1781,7 +1818,7 @@ const _t = [
1781
1818
  type: "function"
1782
1819
  },
1783
1820
  { stateMutability: "payable", type: "receive" }
1784
- ], bt = [
1821
+ ], ft = [
1785
1822
  {
1786
1823
  inputs: [{ internalType: "address", name: "_ttp", type: "address" }],
1787
1824
  stateMutability: "nonpayable",
@@ -1872,7 +1909,7 @@ const _t = [
1872
1909
  type: "function"
1873
1910
  },
1874
1911
  { stateMutability: "payable", type: "receive" }
1875
- ], At = [
1912
+ ], bt = [
1876
1913
  {
1877
1914
  inputs: [
1878
1915
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2016,7 +2053,7 @@ const _t = [
2016
2053
  type: "function"
2017
2054
  },
2018
2055
  { stateMutability: "payable", type: "receive" }
2019
- ], wt = [
2056
+ ], At = [
2020
2057
  {
2021
2058
  inputs: [
2022
2059
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2135,7 +2172,7 @@ const _t = [
2135
2172
  type: "function"
2136
2173
  },
2137
2174
  { stateMutability: "payable", type: "receive" }
2138
- ], Et = [
2175
+ ], wt = [
2139
2176
  {
2140
2177
  inputs: [
2141
2178
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2254,7 +2291,7 @@ const _t = [
2254
2291
  type: "function"
2255
2292
  },
2256
2293
  { stateMutability: "payable", type: "receive" }
2257
- ], Rt = [
2294
+ ], Et = [
2258
2295
  {
2259
2296
  inputs: [
2260
2297
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2373,7 +2410,7 @@ const _t = [
2373
2410
  type: "function"
2374
2411
  },
2375
2412
  { stateMutability: "payable", type: "receive" }
2376
- ], Ot = [
2413
+ ], Rt = [
2377
2414
  {
2378
2415
  inputs: [
2379
2416
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2492,7 +2529,7 @@ const _t = [
2492
2529
  type: "function"
2493
2530
  },
2494
2531
  { stateMutability: "payable", type: "receive" }
2495
- ], It = [
2532
+ ], Ot = [
2496
2533
  {
2497
2534
  inputs: [
2498
2535
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2619,7 +2656,7 @@ const _t = [
2619
2656
  type: "function"
2620
2657
  },
2621
2658
  { stateMutability: "payable", type: "receive" }
2622
- ], St = [
2659
+ ], It = [
2623
2660
  {
2624
2661
  inputs: [
2625
2662
  { internalType: "address", name: "_ttp", type: "address" },
@@ -2873,7 +2910,7 @@ const _t = [
2873
2910
  type: "function"
2874
2911
  },
2875
2912
  { stateMutability: "payable", type: "receive" }
2876
- ], vt = [
2913
+ ], St = [
2877
2914
  {
2878
2915
  inputs: [
2879
2916
  { internalType: "address", name: "_ttp", type: "address" },
@@ -3000,7 +3037,7 @@ const _t = [
3000
3037
  type: "function"
3001
3038
  },
3002
3039
  { stateMutability: "payable", type: "receive" }
3003
- ], Mt = [
3040
+ ], vt = [
3004
3041
  {
3005
3042
  inputs: [
3006
3043
  { internalType: "address", name: "_ttp", type: "address" },
@@ -3127,27 +3164,27 @@ const _t = [
3127
3164
  type: "function"
3128
3165
  },
3129
3166
  { stateMutability: "payable", type: "receive" }
3130
- ], Me = {
3131
- ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: _t,
3132
- ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: ft,
3133
- ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: bt
3134
- }, Ct = {
3135
- ...Me,
3167
+ ], ve = {
3168
+ ["0x7C38b8B2efF28511ECc14a621e263857Fb5771d3".toLowerCase()]: Tt,
3169
+ ["0xB6fA6f1DcD686F4A573Fd243a6FABb4ba36Ba98c".toLowerCase()]: ht,
3170
+ ["0xd31f7e39afECEc4855fecc51b693F9A0Cec49fd2".toLowerCase()]: ft
3171
+ }, Mt = {
3172
+ ...ve,
3136
3173
  // AVAX
3137
- ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: wt,
3138
- ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: ht,
3139
- ["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: Rt,
3174
+ ["0x942c6dA485FD6cEf255853ef83a149d43A73F18a".toLowerCase()]: At,
3175
+ ["0x5505BE604dFA8A1ad402A71f8A357fba47F9bf5a".toLowerCase()]: _t,
3176
+ ["0x3b7DbdD635B99cEa39D3d95Dbd0217F05e55B212".toLowerCase()]: Et,
3140
3177
  // BSC
3141
- ["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: At,
3178
+ ["0x30912B38618D3D37De3191A4FFE982C65a9aEC2E".toLowerCase()]: bt,
3142
3179
  // ETH
3143
- ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: Et,
3144
- ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Ot,
3145
- ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: It,
3146
- ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: St,
3180
+ ["0xbf365e79aA44A2164DA135100C57FDB6635ae870".toLowerCase()]: wt,
3181
+ ["0x86904Eb2b3c743400D03f929F2246EfA80B91215".toLowerCase()]: Rt,
3182
+ ["0x3660dE6C56cFD31998397652941ECe42118375DA".toLowerCase()]: Ot,
3183
+ ["0xBd68cBe6c247e2c3a0e36B8F0e24964914f26Ee8".toLowerCase()]: It,
3147
3184
  ["0xe4ddca21881bac219af7f217703db0475d2a9f02".toLowerCase()]: gt,
3148
- ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: vt,
3149
- ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: Mt
3150
- }, Nt = ({
3185
+ ["0x11733abf0cdb43298f7e949c930188451a9a9ef2".toLowerCase()]: St,
3186
+ ["0xb33874810e5395eb49d8bd7e912631db115d5a03".toLowerCase()]: vt
3187
+ }, Ct = ({
3151
3188
  streamSwap: e,
3152
3189
  contractAddress: t,
3153
3190
  recipient: n,
@@ -3156,40 +3193,40 @@ const _t = [
3156
3193
  amount: i,
3157
3194
  amountOutMin: r = "",
3158
3195
  data: p = "",
3159
- deadline: d,
3160
- memo: l,
3161
- router: c,
3162
- memoStreamingSwap: y,
3163
- tcMemo: u,
3196
+ deadline: o,
3197
+ memo: y,
3198
+ router: T,
3199
+ memoStreamingSwap: u,
3200
+ tcMemo: l,
3164
3201
  tcRouter: h,
3165
3202
  tcVault: _,
3166
- vault: O,
3167
- token: I
3203
+ vault: R,
3204
+ token: O
3168
3205
  }
3169
3206
  }) => {
3170
- const g = !!Me[t.toLowerCase()];
3171
- if (g && !c)
3207
+ const S = !!ve[t.toLowerCase()];
3208
+ if (S && !T)
3172
3209
  throw new Error("Router is required on calldata for swapIn with GenericContract");
3173
- const S = u || l, b = e && y || S;
3174
- if (!_ && !O)
3210
+ const I = l || y, b = e && u || I;
3211
+ if (!_ && !R)
3175
3212
  throw new Error("TC Vault is required on calldata");
3176
- if (!h && !c)
3213
+ if (!h && !T)
3177
3214
  throw new Error("TC Router is required on calldata");
3178
3215
  if (!b)
3179
3216
  throw new Error("TC Memo is required on calldata");
3180
- if (!I)
3217
+ if (!O)
3181
3218
  throw new Error("Token is required on calldata");
3182
3219
  const M = [
3183
3220
  // v2 contracts don't have tcVault, tcRouter, tcMemo but vault, router, memo
3184
- a(h || c),
3185
- a(_ || O),
3221
+ a(h || T),
3222
+ a(_ || R),
3186
3223
  b.replace("{recipientAddress}", n),
3187
- a(I),
3224
+ a(O),
3188
3225
  i
3189
- ], ne = g ? [a(c), p, d] : [r, d];
3190
- return [...M, ...ne];
3191
- }, Dt = ({ chain: e, txHash: t }) => {
3192
- const n = Re[e];
3226
+ ], ee = S ? [a(T), p, o] : [r, o];
3227
+ return [...M, ...ee];
3228
+ }, Nt = ({ chain: e, txHash: t }) => {
3229
+ const n = Ee[e];
3193
3230
  switch (e) {
3194
3231
  case s.Binance:
3195
3232
  case s.Bitcoin:
@@ -3215,7 +3252,7 @@ const _t = [
3215
3252
  throw new Error(`Unsupported chain: ${e}`);
3216
3253
  }
3217
3254
  }, xt = ({ chain: e, address: t }) => {
3218
- const n = Re[e];
3255
+ const n = Ee[e];
3219
3256
  switch (e) {
3220
3257
  case s.Arbitrum:
3221
3258
  case s.Avalanche:
@@ -3238,100 +3275,100 @@ const _t = [
3238
3275
  default:
3239
3276
  throw new Error(`Unsupported chain: ${e}`);
3240
3277
  }
3241
- }, Pt = (e) => {
3242
- const t = e ? q.ThornodeStagenet : q.ThornodeMainnet;
3243
- return Oe(`${t}/thorchain/inbound_addresses`);
3278
+ }, Dt = (e) => {
3279
+ const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3280
+ return Re(`${t}/thorchain/inbound_addresses`);
3244
3281
  }, Bt = (e) => {
3245
- const t = e ? q.ThornodeStagenet : q.ThornodeMainnet;
3246
- return Oe(`${t}/thorchain/mimir`);
3247
- }, be = () => Object.values(s).reduce(
3282
+ const t = e ? W.ThornodeStagenet : W.ThornodeMainnet;
3283
+ return Re(`${t}/thorchain/mimir`);
3284
+ }, fe = () => Object.values(s).reduce(
3248
3285
  (e, t) => (e[t] = null, e),
3249
3286
  {}
3250
3287
  );
3251
- var V, ee, Y, D, X, j;
3252
- class en {
3288
+ var P, z, K, x, Y, X;
3289
+ class zt {
3253
3290
  constructor({ stagenet: t } = {}) {
3254
- T(this, "connectedChains", be());
3255
- T(this, "connectedWallets", be());
3256
- T(this, "stagenet", !1);
3257
- T(this, "getAddress", (t) => {
3291
+ m(this, "connectedChains", fe());
3292
+ m(this, "connectedWallets", fe());
3293
+ m(this, "stagenet", !1);
3294
+ m(this, "getAddress", (t) => {
3258
3295
  var n;
3259
3296
  return ((n = this.connectedChains[t]) == null ? void 0 : n.address) || "";
3260
3297
  });
3261
- T(this, "getExplorerTxUrl", (t, n) => Dt({ chain: t, txHash: n }));
3262
- T(this, "getWallet", (t) => this.connectedWallets[t]);
3263
- T(this, "getExplorerAddressUrl", (t, n) => xt({ chain: t, address: n }));
3264
- T(this, "getBalance", async (t, n) => {
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) => {
3265
3302
  var i;
3266
3303
  if (!n)
3267
3304
  return ((i = this.connectedChains[t]) == null ? void 0 : i.balance) || [];
3268
3305
  const a = await this.getWalletByChain(t);
3269
3306
  return (a == null ? void 0 : a.balance) || [];
3270
3307
  });
3271
- T(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3272
- var d, l, c, y;
3308
+ m(this, "swap", async ({ streamSwap: t, recipient: n, route: a, feeOptionKey: i }) => {
3309
+ var o, y, T, u;
3273
3310
  const { quoteMode: r } = a.meta, p = r.startsWith("ERC20-") ? s.Ethereum : r.startsWith("ARC20-") ? s.Avalanche : s.BinanceSmartChain;
3274
3311
  if (!a.complete)
3275
- throw new m("core_swap_route_not_complete");
3312
+ throw new c("core_swap_route_not_complete");
3276
3313
  try {
3277
- if (He.includes(r)) {
3278
- const u = this.connectedWallets[p];
3279
- if (!(u != null && u.sendTransaction))
3280
- throw new m("core_wallet_connection_not_found");
3281
- if (!(t ? (d = a == null ? void 0 : a.streamingSwap) == null ? void 0 : d.transaction : a == null ? void 0 : a.transaction))
3282
- throw new m("core_swap_route_transaction_not_found");
3283
- const { isHexString: _, parseUnits: O } = await import("./index-cf1865cd.js"), { data: I, from: g, to: S, value: b } = a.transaction, M = {
3284
- data: I,
3285
- from: g,
3286
- to: S.toLowerCase(),
3287
- chainId: BigInt(Ye[p]),
3288
- value: b ? new le({
3289
- value: _(b) ? b : O(b, "wei").toString(16)
3314
+ if (Ue.includes(r)) {
3315
+ const l = this.connectedWallets[p];
3316
+ if (!(l != null && l.sendTransaction))
3317
+ 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))
3319
+ 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)
3290
3327
  }).baseValueBigInt : 0n
3291
3328
  };
3292
- return u.sendTransaction(M, i);
3329
+ return l.sendTransaction(M, i);
3293
3330
  }
3294
- if (ke.includes(r)) {
3331
+ if ($e.includes(r)) {
3295
3332
  if (!a.calldata.fromAsset)
3296
- throw new m("core_swap_asset_not_recognized");
3297
- const u = await v.fromString(a.calldata.fromAsset);
3298
- if (!u)
3299
- throw new m("core_swap_asset_not_recognized");
3300
- const { address: h } = await A(this, V).call(this, u.chain), {
3333
+ throw new c("core_swap_asset_not_recognized");
3334
+ const l = await v.fromString(a.calldata.fromAsset);
3335
+ if (!l)
3336
+ throw new c("core_swap_asset_not_recognized");
3337
+ const { address: h } = await A(this, P).call(this, l.chain), {
3301
3338
  contract: _,
3302
- calldata: { amountIn: O, memo: I, memoStreamingSwap: g }
3303
- } = a, S = u.add(le.fromBigInt(BigInt(O), u.decimal)), b = t && g || I;
3304
- return this.deposit({ assetValue: S, memo: b, feeOptionKey: i, router: _, recipient: h });
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 });
3305
3342
  }
3306
- if ($e.includes(r)) {
3307
- const { calldata: u, contract: h } = a;
3343
+ if (He.includes(r)) {
3344
+ const { calldata: l, contract: h } = a;
3308
3345
  if (!h)
3309
- throw new m("core_swap_contract_not_found");
3310
- const _ = this.connectedWallets[p], O = this.getAddress(p);
3311
- if (!(_ != null && _.sendTransaction) || !O)
3312
- throw new m("core_wallet_connection_not_found");
3313
- const { getProvider: I, toChecksumAddress: g } = await import("@swapkit/toolbox-evm"), S = I(p), b = Ct[h.toLowerCase()];
3346
+ throw new c("core_swap_contract_not_found");
3347
+ const _ = this.connectedWallets[p], R = this.getAddress(p);
3348
+ if (!(_ != null && _.sendTransaction) || !R)
3349
+ 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()];
3314
3351
  if (!b)
3315
- throw new m("core_swap_contract_not_supported", { contractAddress: h });
3316
- const ne = await ((y = (c = (await ((l = _.createContract) == null ? void 0 : l.call(_, h, b, S))).populateTransaction).swapIn) == null ? void 0 : y.call(
3317
- c,
3318
- ...Nt({
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({
3319
3356
  streamSwap: t,
3320
- toChecksumAddress: g,
3357
+ toChecksumAddress: S,
3321
3358
  contractAddress: h,
3322
3359
  recipient: n,
3323
- calldata: u
3360
+ calldata: l
3324
3361
  }),
3325
- { from: O }
3362
+ { from: R }
3326
3363
  ));
3327
- return _.sendTransaction(ne, i);
3364
+ return _.sendTransaction(ee, i);
3328
3365
  }
3329
- throw new m("core_swap_quote_mode_not_supported", { quoteMode: r });
3330
- } catch (u) {
3331
- throw new m("core_swap_transaction_error", u);
3366
+ throw new c("core_swap_quote_mode_not_supported", { quoteMode: r });
3367
+ } catch (l) {
3368
+ throw new c("core_swap_transaction_error", l);
3332
3369
  }
3333
3370
  });
3334
- T(this, "getWalletByChain", async (t) => {
3371
+ m(this, "getWalletByChain", async (t) => {
3335
3372
  var i, r;
3336
3373
  const n = this.getAddress(t);
3337
3374
  if (!n)
@@ -3345,136 +3382,136 @@ class en {
3345
3382
  walletType: (r = this.connectedChains[t]) == null ? void 0 : r.walletType
3346
3383
  }, { ...this.connectedChains[t] };
3347
3384
  });
3348
- T(this, "approveAssetValue", (t, n) => A(this, Y).call(this, { assetValue: t, type: "approve", contractAddress: n }));
3349
- T(this, "isAssetValueApproved", (t, n) => A(this, Y).call(this, { assetValue: t, contractAddress: n, type: "checkOnly" }));
3350
- T(this, "validateAddress", ({ address: t, chain: n }) => {
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 }) => {
3351
3388
  var a, i;
3352
3389
  return (i = (a = this.getWallet(n)) == null ? void 0 : a.validateAddress) == null ? void 0 : i.call(a, t);
3353
3390
  });
3354
- T(this, "transfer", async (t) => {
3391
+ m(this, "transfer", async (t) => {
3355
3392
  const n = this.connectedWallets[t.assetValue.chain];
3356
3393
  if (!n)
3357
- throw new m("core_wallet_connection_not_found");
3394
+ throw new c("core_wallet_connection_not_found");
3358
3395
  try {
3359
- return await n.transfer(A(this, j).call(this, t));
3396
+ return await n.transfer(A(this, X).call(this, t));
3360
3397
  } catch (a) {
3361
- throw new m("core_swap_transaction_error", a);
3398
+ throw new c("core_swap_transaction_error", a);
3362
3399
  }
3363
3400
  });
3364
- T(this, "deposit", async ({
3401
+ m(this, "deposit", async ({
3365
3402
  assetValue: t,
3366
3403
  recipient: n,
3367
3404
  router: a,
3368
3405
  ...i
3369
3406
  }) => {
3370
- const { chain: r, symbol: p, ticker: d } = t, l = this.connectedWallets[r];
3371
- if (!l)
3372
- throw new m("core_wallet_connection_not_found");
3373
- const c = A(this, j).call(this, { assetValue: t, recipient: n, router: a, ...i });
3407
+ const { chain: r, symbol: p, ticker: o } = t, y = this.connectedWallets[r];
3408
+ if (!y)
3409
+ throw new c("core_wallet_connection_not_found");
3410
+ const T = A(this, X).call(this, { assetValue: t, recipient: n, router: a, ...i });
3374
3411
  try {
3375
3412
  switch (r) {
3376
3413
  case s.THORChain: {
3377
- const y = l;
3378
- return await (n === "" ? y.deposit(c) : y.transfer(c));
3414
+ const u = y;
3415
+ return await (n === "" ? u.deposit(T) : u.transfer(T));
3379
3416
  }
3380
3417
  case s.Ethereum:
3381
3418
  case s.BinanceSmartChain:
3382
3419
  case s.Avalanche: {
3383
- const { getChecksumAddressFromAsset: y } = await import("@swapkit/toolbox-evm"), u = r === s.Avalanche ? Ve : r === s.BinanceSmartChain ? Le : Be;
3384
- return await l.call({
3385
- abi: u,
3386
- contractAddress: a || (await A(this, V).call(this, r)).router,
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,
3387
3424
  funcName: "depositWithExpiry",
3388
3425
  funcParams: [
3389
3426
  n,
3390
- y({ chain: r, symbol: p, ticker: d }, r),
3427
+ u({ chain: r, symbol: p, ticker: o }, r),
3391
3428
  // TODO: (@Towan) Re-Check on that conversion 🙏
3392
3429
  t.baseValueBigInt.toString(),
3393
- c.memo,
3430
+ T.memo,
3394
3431
  i.expiration
3395
3432
  ],
3396
- txOverrides: { from: c.from, value: t.baseValueBigInt }
3433
+ txOverrides: { from: T.from, value: t.baseValueBigInt }
3397
3434
  });
3398
3435
  }
3399
3436
  default:
3400
- return await l.transfer(c);
3437
+ return await y.transfer(T);
3401
3438
  }
3402
- } catch (y) {
3403
- const u = ((y == null ? void 0 : y.message) || (y == null ? void 0 : y.toString())).toLowerCase(), h = u == null ? void 0 : u.includes("insufficient funds"), _ = u == null ? void 0 : u.includes("gas"), O = u == null ? void 0 : u.includes("server"), I = h ? "core_transaction_deposit_insufficient_funds_error" : _ ? "core_transaction_deposit_gas_error" : O ? "core_transaction_deposit_server_error" : "core_transaction_deposit_error";
3404
- throw new m(I, y);
3439
+ } 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);
3405
3442
  }
3406
3443
  });
3407
3444
  /**
3408
3445
  * TC related Methods
3409
3446
  */
3410
- T(this, "createLiquidity", async ({
3447
+ m(this, "createLiquidity", async ({
3411
3448
  runeAssetValue: t,
3412
3449
  assetValue: n
3413
3450
  }) => {
3414
3451
  if (t.lte(0) || n.lte(0))
3415
- throw new m("core_transaction_create_liquidity_invalid_params");
3452
+ throw new c("core_transaction_create_liquidity_invalid_params");
3416
3453
  let a = "", i = "";
3417
3454
  try {
3418
- a = await A(this, D).call(this, {
3455
+ a = await A(this, x).call(this, {
3419
3456
  assetValue: t,
3420
- memo: x(f.DEPOSIT, {
3457
+ memo: D(f.DEPOSIT, {
3421
3458
  ...n,
3422
3459
  address: this.getAddress(n.chain)
3423
3460
  })
3424
3461
  });
3425
3462
  } catch (r) {
3426
- throw new m("core_transaction_create_liquidity_rune_error", r);
3463
+ throw new c("core_transaction_create_liquidity_rune_error", r);
3427
3464
  }
3428
3465
  try {
3429
- i = await A(this, D).call(this, {
3466
+ i = await A(this, x).call(this, {
3430
3467
  assetValue: n,
3431
- memo: x(f.DEPOSIT, {
3468
+ memo: D(f.DEPOSIT, {
3432
3469
  ...n,
3433
3470
  address: this.getAddress(s.THORChain)
3434
3471
  })
3435
3472
  });
3436
3473
  } catch (r) {
3437
- throw new m("core_transaction_create_liquidity_asset_error", r);
3474
+ throw new c("core_transaction_create_liquidity_asset_error", r);
3438
3475
  }
3439
3476
  return { runeTx: a, assetTx: i };
3440
3477
  });
3441
- T(this, "addLiquidity", async ({
3478
+ m(this, "addLiquidity", async ({
3442
3479
  poolIdentifier: t,
3443
3480
  runeAssetValue: n,
3444
3481
  assetValue: a,
3445
3482
  runeAddr: i,
3446
3483
  assetAddr: r,
3447
3484
  isPendingSymmAsset: p,
3448
- mode: d = "sym"
3485
+ mode: o = "sym"
3449
3486
  }) => {
3450
- const [l, ...c] = t.split("."), y = d === "sym", u = (n == null ? void 0 : n.gt(0)) && (y || d === "rune"), h = (a == null ? void 0 : a.gt(0)) && (y || d === "asset"), _ = p || u, O = _ ? i || this.getAddress(s.THORChain) : "", I = y || d === "asset" ? r || this.getAddress(l) : "";
3451
- if (!u && !h)
3452
- throw new m("core_transaction_add_liquidity_invalid_params");
3453
- if (_ && !O)
3454
- throw new m("core_transaction_add_liquidity_no_rune_address");
3455
- let g, S;
3456
- const b = { chain: l, symbol: c.join(".") };
3457
- if (u && n)
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)
3489
+ throw new c("core_transaction_add_liquidity_invalid_params");
3490
+ if (_ && !R)
3491
+ 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)
3458
3495
  try {
3459
- g = await A(this, D).call(this, {
3496
+ S = await A(this, x).call(this, {
3460
3497
  assetValue: n,
3461
- memo: x(f.DEPOSIT, { ...b, address: I })
3498
+ memo: D(f.DEPOSIT, { ...b, address: O })
3462
3499
  });
3463
3500
  } catch (M) {
3464
- throw new m("core_transaction_add_liquidity_rune_error", M);
3501
+ throw new c("core_transaction_add_liquidity_rune_error", M);
3465
3502
  }
3466
3503
  if (h && a)
3467
3504
  try {
3468
- S = await A(this, D).call(this, {
3505
+ I = await A(this, x).call(this, {
3469
3506
  assetValue: a,
3470
- memo: x(f.DEPOSIT, { ...b, address: O })
3507
+ memo: D(f.DEPOSIT, { ...b, address: R })
3471
3508
  });
3472
3509
  } catch (M) {
3473
- throw new m("core_transaction_add_liquidity_asset_error", M);
3510
+ throw new c("core_transaction_add_liquidity_asset_error", M);
3474
3511
  }
3475
- return { runeTx: g, assetTx: S };
3512
+ return { runeTx: S, assetTx: I };
3476
3513
  });
3477
- T(this, "withdraw", async ({
3514
+ m(this, "withdraw", async ({
3478
3515
  memo: t,
3479
3516
  assetValue: n,
3480
3517
  percent: a,
@@ -3483,9 +3520,9 @@ class en {
3483
3520
  }) => {
3484
3521
  const p = r === "rune" ? v.fromChainOrSignature(s.THORChain) : i === "sym" && r === "sym" || i === "rune" || i === "asset" ? void 0 : n;
3485
3522
  try {
3486
- return await A(this, D).call(this, {
3487
- assetValue: fe(i === "asset" ? n.chain : s.THORChain),
3488
- memo: t || x(f.WITHDRAW, {
3523
+ return await A(this, x).call(this, {
3524
+ assetValue: he(i === "asset" ? n.chain : s.THORChain),
3525
+ memo: t || D(f.WITHDRAW, {
3489
3526
  symbol: n.symbol,
3490
3527
  chain: n.chain,
3491
3528
  ticker: n.ticker,
@@ -3494,71 +3531,71 @@ class en {
3494
3531
  singleSide: !1
3495
3532
  })
3496
3533
  });
3497
- } catch (d) {
3498
- throw new m("core_transaction_withdraw_error", d);
3534
+ } catch (o) {
3535
+ throw new c("core_transaction_withdraw_error", o);
3499
3536
  }
3500
3537
  });
3501
- T(this, "savings", async ({
3538
+ m(this, "savings", async ({
3502
3539
  assetValue: t,
3503
3540
  memo: n,
3504
3541
  percent: a,
3505
3542
  type: i
3506
3543
  }) => {
3507
- const r = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || x(r, {
3544
+ const r = i === "add" ? f.DEPOSIT : f.WITHDRAW, p = n || D(r, {
3508
3545
  ticker: t.ticker,
3509
3546
  symbol: t.symbol,
3510
3547
  chain: t.chain,
3511
3548
  singleSide: !0,
3512
3549
  basisPoints: a ? Math.max(1e4, Math.round(a * 100)) : void 0
3513
3550
  });
3514
- return A(this, D).call(this, { assetValue: t, memo: p });
3551
+ return A(this, x).call(this, { assetValue: t, memo: p });
3515
3552
  });
3516
- T(this, "loan", ({
3553
+ m(this, "loan", ({
3517
3554
  assetValue: t,
3518
3555
  memo: n,
3519
3556
  minAmount: a,
3520
3557
  type: i
3521
- }) => A(this, D).call(this, {
3558
+ }) => A(this, x).call(this, {
3522
3559
  assetValue: t,
3523
- memo: n || x(i === "open" ? f.OPEN_LOAN : f.CLOSE_LOAN, {
3560
+ memo: n || D(i === "open" ? f.OPEN_LOAN : f.CLOSE_LOAN, {
3524
3561
  asset: t.toString(),
3525
3562
  minAmount: a.toString(),
3526
3563
  address: this.getAddress(t.chain)
3527
3564
  })
3528
3565
  }));
3529
- T(this, "nodeAction", ({
3566
+ m(this, "nodeAction", ({
3530
3567
  type: t,
3531
3568
  assetValue: n,
3532
3569
  address: a
3533
3570
  }) => {
3534
- const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, r = x(i, {
3571
+ const i = t === "bond" ? f.BOND : t === "unbond" ? f.UNBOND : f.LEAVE, r = D(i, {
3535
3572
  address: a,
3536
3573
  unbondAmount: t === "unbond" ? n.baseValueNumber : void 0
3537
3574
  });
3538
- return A(this, X).call(this, {
3575
+ return A(this, Y).call(this, {
3539
3576
  memo: r,
3540
- assetValue: t === "bond" ? n : fe(s.THORChain)
3577
+ assetValue: t === "bond" ? n : he(s.THORChain)
3541
3578
  });
3542
3579
  });
3543
- T(this, "registerThorname", ({
3580
+ m(this, "registerThorname", ({
3544
3581
  assetValue: t,
3545
3582
  ...n
3546
- }) => A(this, X).call(this, { assetValue: t, memo: x(f.THORNAME_REGISTER, n) }));
3547
- T(this, "extend", ({ wallets: t, config: n, apis: a = {}, rpcUrls: i = {} }) => {
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 = {} }) => {
3548
3585
  try {
3549
3586
  t.forEach((r) => {
3550
3587
  this[r.connectMethodName] = r.connect({
3551
- addChain: A(this, ee),
3588
+ addChain: A(this, z),
3552
3589
  config: n || {},
3553
3590
  apis: a,
3554
3591
  rpcUrls: i
3555
3592
  });
3556
3593
  });
3557
3594
  } catch (r) {
3558
- throw new m("core_extend_error", r);
3595
+ throw new c("core_extend_error", r);
3559
3596
  }
3560
3597
  });
3561
- T(this, "estimateMaxSendableAmount", async ({
3598
+ m(this, "estimateMaxSendableAmount", async ({
3562
3599
  chain: t,
3563
3600
  params: n
3564
3601
  }) => {
@@ -3591,40 +3628,40 @@ class en {
3591
3628
  });
3592
3629
  }
3593
3630
  default:
3594
- throw new m("core_estimated_max_spendable_chain_not_supported");
3631
+ throw new c("core_estimated_max_spendable_chain_not_supported");
3595
3632
  }
3596
3633
  });
3597
3634
  /**
3598
3635
  * Wallet connection methods
3599
3636
  */
3600
- T(this, "connectXDEFI", async (t) => {
3601
- throw new m("core_wallet_xdefi_not_installed");
3637
+ m(this, "connectXDEFI", async (t) => {
3638
+ throw new c("core_wallet_xdefi_not_installed");
3602
3639
  });
3603
- T(this, "connectEVMWallet", async (t, n) => {
3604
- throw new m("core_wallet_evmwallet_not_installed");
3640
+ m(this, "connectEVMWallet", async (t, n) => {
3641
+ throw new c("core_wallet_evmwallet_not_installed");
3605
3642
  });
3606
- T(this, "connectWalletconnect", async (t, n) => {
3607
- throw new m("core_wallet_walletconnect_not_installed");
3643
+ m(this, "connectWalletconnect", async (t, n) => {
3644
+ throw new c("core_wallet_walletconnect_not_installed");
3608
3645
  });
3609
- T(this, "connectKeystore", async (t, n) => {
3610
- throw new m("core_wallet_keystore_not_installed");
3646
+ m(this, "connectKeystore", async (t, n) => {
3647
+ throw new c("core_wallet_keystore_not_installed");
3611
3648
  });
3612
- T(this, "connectLedger", async (t, n) => {
3613
- throw new m("core_wallet_ledger_not_installed");
3649
+ m(this, "connectLedger", async (t, n) => {
3650
+ throw new c("core_wallet_ledger_not_installed");
3614
3651
  });
3615
- T(this, "connectTrezor", async (t, n) => {
3616
- throw new m("core_wallet_trezor_not_installed");
3652
+ m(this, "connectTrezor", async (t, n) => {
3653
+ throw new c("core_wallet_trezor_not_installed");
3617
3654
  });
3618
- T(this, "connectKeplr", async (t) => {
3619
- throw new m("core_wallet_keplr_not_installed");
3655
+ m(this, "connectKeplr", async (t) => {
3656
+ throw new c("core_wallet_keplr_not_installed");
3620
3657
  });
3621
- T(this, "connectOkx", async (t) => {
3622
- throw new m("core_wallet_okx_not_installed");
3658
+ m(this, "connectOkx", async (t) => {
3659
+ throw new c("core_wallet_okx_not_installed");
3623
3660
  });
3624
- T(this, "disconnectChain", (t) => {
3661
+ m(this, "disconnectChain", (t) => {
3625
3662
  this.connectedChains[t] = null, this.connectedWallets[t] = null;
3626
3663
  });
3627
- P(this, V, async (t) => {
3664
+ B(this, P, async (t) => {
3628
3665
  if (t === s.THORChain)
3629
3666
  return {
3630
3667
  gas_rate: "0",
@@ -3633,63 +3670,63 @@ class en {
3633
3670
  halted: !1,
3634
3671
  chain: s.THORChain
3635
3672
  };
3636
- const a = (await Pt(this.stagenet)).find((i) => i.chain === t);
3673
+ const a = (await Dt(this.stagenet)).find((i) => i.chain === t);
3637
3674
  if (!a)
3638
- throw new m("core_inbound_data_not_found");
3675
+ throw new c("core_inbound_data_not_found");
3639
3676
  if (a != null && a.halted)
3640
- throw new m("core_chain_halted");
3677
+ throw new c("core_chain_halted");
3641
3678
  return a;
3642
3679
  });
3643
- P(this, ee, ({ chain: t, wallet: n, walletMethods: a }) => {
3680
+ B(this, z, ({ chain: t, wallet: n, walletMethods: a }) => {
3644
3681
  this.connectedChains[t] = n, this.connectedWallets[t] = a;
3645
3682
  });
3646
- P(this, Y, async ({
3683
+ B(this, K, async ({
3647
3684
  assetValue: { baseValueBigInt: t, address: n, chain: a, isGasAsset: i, isSynthetic: r },
3648
3685
  type: p = "checkOnly",
3649
- contractAddress: d
3686
+ contractAddress: o
3650
3687
  }) => {
3651
- const l = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(a);
3652
- if (l && i || !l || r)
3688
+ const y = [s.Ethereum, s.Avalanche, s.BinanceSmartChain].includes(a);
3689
+ if (y && i || !y || r)
3653
3690
  return !0;
3654
- const y = this.connectedWallets[a], u = p === "checkOnly" ? y == null ? void 0 : y.isApproved : y == null ? void 0 : y.approve;
3655
- if (!u)
3656
- throw new m("core_wallet_connection_not_found");
3691
+ const u = this.connectedWallets[a], l = p === "checkOnly" ? u == null ? void 0 : u.isApproved : u == null ? void 0 : u.approve;
3692
+ if (!l)
3693
+ throw new c("core_wallet_connection_not_found");
3657
3694
  const h = this.getAddress(a);
3658
3695
  if (!n || !h)
3659
- throw new m("core_approve_asset_address_or_from_not_found");
3660
- const _ = d || (await A(this, V).call(this, a)).router;
3661
- return u({
3696
+ 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({
3662
3699
  amount: t,
3663
3700
  assetAddress: n,
3664
3701
  from: h,
3665
3702
  spenderAddress: _
3666
3703
  });
3667
3704
  });
3668
- P(this, D, async ({
3705
+ B(this, x, async ({
3669
3706
  assetValue: t,
3670
3707
  memo: n,
3671
- feeOptionKey: a = F.Fast
3708
+ feeOptionKey: a = k.Fast
3672
3709
  }) => {
3673
3710
  const {
3674
3711
  gas_rate: i,
3675
3712
  router: r,
3676
3713
  address: p
3677
- } = await A(this, V).call(this, t.chain), d = (parseInt(i) || 0) * it[a];
3714
+ } = await A(this, P).call(this, t.chain), o = (parseInt(i) || 0) * st[a];
3678
3715
  return this.deposit({
3679
3716
  assetValue: t,
3680
3717
  recipient: p,
3681
3718
  memo: n,
3682
3719
  router: r,
3683
- feeRate: d
3720
+ feeRate: o
3684
3721
  });
3685
3722
  });
3686
- P(this, X, async ({ memo: t, assetValue: n }) => {
3723
+ B(this, Y, async ({ memo: t, assetValue: n }) => {
3687
3724
  const a = await Bt(this.stagenet);
3688
3725
  if (a.HALTCHAINGLOBAL >= 1 || a.HALTTHORCHAIN >= 1)
3689
- throw new m("core_chain_halted");
3726
+ throw new c("core_chain_halted");
3690
3727
  return this.deposit({ assetValue: n, recipient: "", memo: t });
3691
3728
  });
3692
- P(this, j, ({ assetValue: t, ...n }) => ({
3729
+ B(this, X, ({ assetValue: t, ...n }) => ({
3693
3730
  ...n,
3694
3731
  memo: n.memo || "",
3695
3732
  from: this.getAddress(t.chain),
@@ -3698,65 +3735,65 @@ class en {
3698
3735
  this.stagenet = !!t;
3699
3736
  }
3700
3737
  }
3701
- V = new WeakMap(), ee = new WeakMap(), Y = new WeakMap(), D = new WeakMap(), X = new WeakMap(), j = new WeakMap();
3738
+ P = new WeakMap(), z = new WeakMap(), K = new WeakMap(), x = new WeakMap(), Y = new WeakMap(), X = new WeakMap();
3702
3739
  export {
3703
- He as AGG_SWAP,
3704
- Ut as ApiError,
3705
- q as ApiUrl,
3740
+ Ue as AGG_SWAP,
3741
+ Ae as ApiError,
3742
+ W as ApiUrl,
3706
3743
  v as AssetValue,
3707
3744
  E as BaseDecimal,
3745
+ pe as BigIntArithmetics,
3708
3746
  s as Chain,
3709
- ce as ChainId,
3710
- Wt as ChainIdToChain,
3711
- Ye as ChainToChainId,
3712
- Re as ChainToExplorerUrl,
3713
- Gt as ChainToHexChainId,
3714
- Xe as ChainToRPC,
3715
- We as ContractAddress,
3716
- Ft as CosmosChainList,
3717
- K as DEFAULT_DECIMAL,
3718
- qe as DerivationPath,
3719
- o as ERROR_CODE,
3720
- Fe as ERROR_MODULE,
3721
- Ae as ERROR_TYPE,
3722
- $t as EVMChainList,
3723
- je as ErrorCode,
3724
- F as FeeOption,
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,
3725
3762
  f as MemoType,
3726
- Ht as NetworkDerivationPath,
3727
- Ue as QuoteMode,
3728
- Ee as RPCUrl,
3729
- $e as SWAP_IN,
3730
- ke as SWAP_OUT,
3731
- en as SwapKitCore,
3732
- m as SwapKitError,
3733
- le as SwapKitNumber,
3734
- Ve as TCAvalancheDepositABI,
3735
- Le as TCBscDepositABI,
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,
3769
+ c as SwapKitError,
3770
+ ye as SwapKitNumber,
3771
+ Pe as TCAvalancheDepositABI,
3772
+ Ve as TCBscDepositABI,
3736
3773
  Be as TCEthereumVaultAbi,
3737
- kt as UTXOChainList,
3738
- Je as WalletOption,
3739
- Xt as assetFromString,
3740
- Yt as derivationPathToString,
3741
- Lt as erc20ABI,
3774
+ Ht as UTXOChainList,
3775
+ je as WalletOption,
3776
+ Kt as assetFromString,
3777
+ qt as derivationPathToString,
3778
+ Vt as erc20ABI,
3742
3779
  ge as formatBigIntToSafeValue,
3743
- it as gasFeeMultiplier,
3744
- ot as getAssetType,
3745
- ut as getAsymmetricAssetShare,
3746
- Jt as getAsymmetricAssetWithdrawAmount,
3747
- dt as getAsymmetricRuneShare,
3748
- jt as getAsymmetricRuneWithdrawAmount,
3749
- pt as getCommonAssetInfo,
3750
- Se as getDecimal,
3751
- zt as getEstimatedPoolShare,
3752
- Zt as getLiquiditySlippage,
3753
- x as getMemoFor,
3754
- fe as getMinAmountByChain,
3755
- Oe as getRequest,
3756
- yt as getSymmetricPoolShare,
3757
- Qt as getSymmetricWithdraw,
3758
- qt as getTHORNameCost,
3759
- rt as isGasAsset,
3760
- et as postRequest,
3761
- Kt as validateTHORName
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
3762
3799
  };