@coinmasters/swapkit-entities
Advanced tools
Comparing version 3.7.56 to 3.7.57
var H = Object.defineProperty; | ||
var L = (t, s, i) => s in t ? H(t, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[s] = i; | ||
var c = (t, s, i) => (L(t, typeof s != "symbol" ? s + "" : s, i), i); | ||
var b = (t, s, i) => s in t ? H(t, s, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[s] = i; | ||
var c = (t, s, i) => (b(t, typeof s != "symbol" ? s + "" : s, i), i); | ||
import { BigNumber as E } from "bignumber.js"; | ||
var a = /* @__PURE__ */ ((t) => (t.INVALID_INPUT_PARAMETERS = "1000", t.UNKNOWN_PROVIDERS = "1001", t.CANNOT_FIND_INBOUND_ADDRESS = "1002", t.NO_INBOUND_ADDRESSES = "1003", t.CHAIN_HALTED_OR_UNSUPPORTED = "1004", t.MISSING_INPUT_PARAMETER = "1005", t.INVALID_TYPE_GENERIC = "1100", t.INVALID_NUMBER_STRING = "1101", t.INVALID_NUMBER = "1102", t.INVALID_BOOLEAN = "1103", t.INVALID_OBJECT = "1104", t.INVALID_ARRAY = "1105", t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", t.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", t.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", t.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", t.AFF_ADDRESS_TOO_LONG = "2004", t.AFF_BPS_INTEGER_0_100 = "2005", t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", t.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", t.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", t.SOURCE_ADDRESS_SMART_CONTRACT = "2011", t.INVALID_PROVIDER = "2100", t.MISSING_CROSS_CHAIN_PROVIDER = "2101", t.MISSING_AVAX_PROVIDER = "2102", t.MISSING_BSC_PROVIDER = "2103", t.MISSING_ETH_PROVIDER = "2104", t.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", t.MISSING_ARB_PROVIDER = "2106", t.INVALID_CHAIN = "2200", t.INVALID_ASSET = "2201", t.INVALID_ASSET_IDENTIFIER = "2202", t.UNSUPPORTED_CHAIN = "2204", t.UNSUPPORTED_ASSET = "2203", t.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", t.INVALID_SOURCE_ADDRESS = "2300", t.INVALID_DESTINATION_ADDRESS = "2301", t.THORNODE_QUOTE_GENERIC_ERROR = "3000", t.NOT_ENOUGH_SYNTH_BALANCE = "3001", t.SYNTH_MINTING_CAP_REACHED = "3002", t.INVALID_QUOTE_MODE = "4000", t.NO_QUOTES = "4001", t.SERVICE_UNAVAILABLE_GENERIC = "5000", t.MISSING_GAS_DATA_GENERIC = "5100", t.MISSING_TOKEN_INFO_GENERIC = "5200", t.CANT_FIND_TOKEN_LIST = "5201", t.NO_PRICE = "5202", t.PRICE_IS_STALE = "5203", t.ADDRESS_NOT_WHITELISTED = "6000", t.ADDRESS_ALREADY_CLAIMED = "6001", t.TEMPORARY_ERROR = "9999", t))(a || {}); | ||
a.INVALID_INPUT_PARAMETERS + "", a.UNKNOWN_PROVIDERS + "", a.CANNOT_FIND_INBOUND_ADDRESS + "", a.NO_INBOUND_ADDRESSES + "", a.CHAIN_HALTED_OR_UNSUPPORTED + "", a.MISSING_INPUT_PARAMETER + "", a.INVALID_TYPE_GENERIC + "", a.INVALID_NUMBER_STRING + "", a.INVALID_NUMBER + "", a.INVALID_BOOLEAN + "", a.INVALID_OBJECT + "", a.INVALID_ARRAY + "", a.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", a.SELL_BUY_ASSETS_ARE_THE_SAME + "", a.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", a.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", a.AFF_ADDRESS_TOO_LONG + "", a.AFF_BPS_INTEGER_0_100 + "", a.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", a.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", a.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", a.DESTINATION_ADDRESS_SMART_CONTRACT + "", a.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", a.INVALID_PROVIDER + "", a.MISSING_CROSS_CHAIN_PROVIDER + "", a.MISSING_AVAX_PROVIDER + "", a.MISSING_BSC_PROVIDER + "", a.MISSING_ETH_PROVIDER + "", a.MISSING_ARB_PROVIDER + "", a.INVALID_PROVIDER_FOR_SWAP_OUT + "", a.INVALID_CHAIN + "", a.INVALID_ASSET + "", a.UNSUPPORTED_CHAIN + "", a.UNSUPPORTED_ASSET + "", a.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", a.THORNODE_QUOTE_GENERIC_ERROR + "", a.INVALID_SOURCE_ADDRESS + "", a.INVALID_DESTINATION_ADDRESS + "", a.NOT_ENOUGH_SYNTH_BALANCE + "", a.SYNTH_MINTING_CAP_REACHED + "", a.INVALID_QUOTE_MODE + "", a.NO_QUOTES + "", a.SERVICE_UNAVAILABLE_GENERIC + "", a.MISSING_GAS_DATA_GENERIC + "", a.MISSING_TOKEN_INFO_GENERIC + "", a.CANT_FIND_TOKEN_LIST + "", a.NO_PRICE + "", a.PRICE_IS_STALE + "", a.ADDRESS_NOT_WHITELISTED + "", a.ADDRESS_ALREADY_CLAIMED + ""; | ||
var e = /* @__PURE__ */ ((t) => (t.Arbitrum = "ARB", t.Avalanche = "AVAX", t.Base = "BASE", t.Binance = "BNB", t.BinanceSmartChain = "BSC", t.Bitcoin = "BTC", t.BitcoinCash = "BCH", t.Cosmos = "GAIA", t.Dash = "DASH", t.Digibyte = "DGB", t.Dogecoin = "DOGE", t.EOS = "EOS", t.Ethereum = "ETH", t.Kujira = "KUJI", t.Litecoin = "LTC", t.Mayachain = "MAYA", t.Optimism = "OP", t.Osmosis = "OSMO", t.Polygon = "MATIC", t.Ripple = "XRP", t.THORChain = "THOR", t.Zcash = "ZEC", t))(e || {}); | ||
var r = /* @__PURE__ */ ((t) => (t.INVALID_INPUT_PARAMETERS = "1000", t.UNKNOWN_PROVIDERS = "1001", t.CANNOT_FIND_INBOUND_ADDRESS = "1002", t.NO_INBOUND_ADDRESSES = "1003", t.CHAIN_HALTED_OR_UNSUPPORTED = "1004", t.MISSING_INPUT_PARAMETER = "1005", t.INVALID_TYPE_GENERIC = "1100", t.INVALID_NUMBER_STRING = "1101", t.INVALID_NUMBER = "1102", t.INVALID_BOOLEAN = "1103", t.INVALID_OBJECT = "1104", t.INVALID_ARRAY = "1105", t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", t.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", t.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", t.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", t.AFF_ADDRESS_TOO_LONG = "2004", t.AFF_BPS_INTEGER_0_100 = "2005", t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", t.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", t.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", t.SOURCE_ADDRESS_SMART_CONTRACT = "2011", t.INVALID_PROVIDER = "2100", t.MISSING_CROSS_CHAIN_PROVIDER = "2101", t.MISSING_AVAX_PROVIDER = "2102", t.MISSING_BSC_PROVIDER = "2103", t.MISSING_ETH_PROVIDER = "2104", t.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", t.MISSING_ARB_PROVIDER = "2106", t.INVALID_CHAIN = "2200", t.INVALID_ASSET = "2201", t.INVALID_ASSET_IDENTIFIER = "2202", t.UNSUPPORTED_CHAIN = "2204", t.UNSUPPORTED_ASSET = "2203", t.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", t.INVALID_SOURCE_ADDRESS = "2300", t.INVALID_DESTINATION_ADDRESS = "2301", t.THORNODE_QUOTE_GENERIC_ERROR = "3000", t.NOT_ENOUGH_SYNTH_BALANCE = "3001", t.SYNTH_MINTING_CAP_REACHED = "3002", t.INVALID_QUOTE_MODE = "4000", t.NO_QUOTES = "4001", t.SERVICE_UNAVAILABLE_GENERIC = "5000", t.MISSING_GAS_DATA_GENERIC = "5100", t.MISSING_TOKEN_INFO_GENERIC = "5200", t.CANT_FIND_TOKEN_LIST = "5201", t.NO_PRICE = "5202", t.PRICE_IS_STALE = "5203", t.ADDRESS_NOT_WHITELISTED = "6000", t.ADDRESS_ALREADY_CLAIMED = "6001", t.TEMPORARY_ERROR = "9999", t))(r || {}); | ||
r.INVALID_INPUT_PARAMETERS + "", r.UNKNOWN_PROVIDERS + "", r.CANNOT_FIND_INBOUND_ADDRESS + "", r.NO_INBOUND_ADDRESSES + "", r.CHAIN_HALTED_OR_UNSUPPORTED + "", r.MISSING_INPUT_PARAMETER + "", r.INVALID_TYPE_GENERIC + "", r.INVALID_NUMBER_STRING + "", r.INVALID_NUMBER + "", r.INVALID_BOOLEAN + "", r.INVALID_OBJECT + "", r.INVALID_ARRAY + "", r.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", r.SELL_BUY_ASSETS_ARE_THE_SAME + "", r.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", r.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", r.AFF_ADDRESS_TOO_LONG + "", r.AFF_BPS_INTEGER_0_100 + "", r.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", r.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", r.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", r.DESTINATION_ADDRESS_SMART_CONTRACT + "", r.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", r.INVALID_PROVIDER + "", r.MISSING_CROSS_CHAIN_PROVIDER + "", r.MISSING_AVAX_PROVIDER + "", r.MISSING_BSC_PROVIDER + "", r.MISSING_ETH_PROVIDER + "", r.MISSING_ARB_PROVIDER + "", r.INVALID_PROVIDER_FOR_SWAP_OUT + "", r.INVALID_CHAIN + "", r.INVALID_ASSET + "", r.UNSUPPORTED_CHAIN + "", r.UNSUPPORTED_ASSET + "", r.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", r.THORNODE_QUOTE_GENERIC_ERROR + "", r.INVALID_SOURCE_ADDRESS + "", r.INVALID_DESTINATION_ADDRESS + "", r.NOT_ENOUGH_SYNTH_BALANCE + "", r.SYNTH_MINTING_CAP_REACHED + "", r.INVALID_QUOTE_MODE + "", r.NO_QUOTES + "", r.SERVICE_UNAVAILABLE_GENERIC + "", r.MISSING_GAS_DATA_GENERIC + "", r.MISSING_TOKEN_INFO_GENERIC + "", r.CANT_FIND_TOKEN_LIST + "", r.NO_PRICE + "", r.PRICE_IS_STALE + "", r.ADDRESS_NOT_WHITELISTED + "", r.ADDRESS_ALREADY_CLAIMED + ""; | ||
var e = /* @__PURE__ */ ((t) => (t.Arbitrum = "ARB", t.Avalanche = "AVAX", t.Base = "BASE", t.BinanceSmartChain = "BSC", t.Bitcoin = "BTC", t.BitcoinCash = "BCH", t.Cosmos = "GAIA", t.Dash = "DASH", t.Digibyte = "DGB", t.Dogecoin = "DOGE", t.EOS = "EOS", t.Ethereum = "ETH", t.Kujira = "KUJI", t.Litecoin = "LTC", t.Mayachain = "MAYA", t.Optimism = "OP", t.Osmosis = "OSMO", t.Polygon = "MATIC", t.Ripple = "XRP", t.THORChain = "THOR", t.Zcash = "ZEC", t))(e || {}); | ||
const w = { | ||
@@ -12,3 +12,2 @@ ARB: "eip155:42161", | ||
BSC: "eip155:56", | ||
BNB: "binance:bnb-beacon-chain", | ||
BCH: "bip122:000000000000000000651ef99cb9fcbe", | ||
@@ -35,3 +34,3 @@ BTC: "bip122:000000000019d6689c085ae165831e93", | ||
w[e[t]], e[t]; | ||
var u = /* @__PURE__ */ ((t) => (t[t.ARB = 18] = "ARB", t[t.AVAX = 18] = "AVAX", t[t.BCH = 8] = "BCH", t[t.BNB = 8] = "BNB", t[t.BSC = 18] = "BSC", t[t.BTC = 8] = "BTC", t[t.DASH = 8] = "DASH", t[t.DGB = 8] = "DGB", t[t.DOGE = 8] = "DOGE", t[t.ETH = 18] = "ETH", t[t.BASE = 18] = "BASE", t[t.EOS = 6] = "EOS", t[t.GAIA = 6] = "GAIA", t[t.KUJI = 6] = "KUJI", t[t.LTC = 8] = "LTC", t[t.MATIC = 18] = "MATIC", t[t.MAYA = 10] = "MAYA", t[t.OP = 18] = "OP", t[t.OSMO = 6] = "OSMO", t[t.XRP = 6] = "XRP", t[t.THOR = 8] = "THOR", t[t.ZEC = 8] = "ZEC", t))(u || {}); | ||
var u = /* @__PURE__ */ ((t) => (t[t.ARB = 18] = "ARB", t[t.AVAX = 18] = "AVAX", t[t.BCH = 8] = "BCH", t[t.BSC = 18] = "BSC", t[t.BTC = 8] = "BTC", t[t.DASH = 8] = "DASH", t[t.DGB = 8] = "DGB", t[t.DOGE = 8] = "DOGE", t[t.ETH = 18] = "ETH", t[t.BASE = 18] = "BASE", t[t.EOS = 6] = "EOS", t[t.GAIA = 6] = "GAIA", t[t.KUJI = 6] = "KUJI", t[t.LTC = 8] = "LTC", t[t.MATIC = 18] = "MATIC", t[t.MAYA = 10] = "MAYA", t[t.OP = 18] = "OP", t[t.OSMO = 6] = "OSMO", t[t.XRP = 6] = "XRP", t[t.THOR = 8] = "THOR", t[t.ZEC = 8] = "ZEC", t))(u || {}); | ||
const d = [ | ||
@@ -47,3 +46,3 @@ "ETH" | ||
]; | ||
var B = /* @__PURE__ */ ((t) => (t.Arbitrum = "42161", t.ArbitrumHex = "0xa4b1", t.Avalanche = "43114", t.AvalancheHex = "0xa86a", t.Base = "8453", t.Binance = "Binance-Chain-Tigris", t.BinanceSmartChain = "56", t.BinanceSmartChainHex = "0x38", t.Bitcoin = "bitcoin", t.BitcoinCash = "bitcoincash", t.Cosmos = "cosmoshub-4", t.Dash = "dash", t.Dogecoin = "dogecoin", t.Kujira = "kaiyo-1", t.Ethereum = "1", t.EthereumHex = "0x1", t.Litecoin = "litecoin", t.Mayachain = "mayachain-mainnet-v1", t.MayaStagenet = "mayachain-stagenet-v1", t.Optimism = "10", t.OptimismHex = "0xa", t.Osmosis = "osmosis-1", t.Polygon = "137", t.PolygonHex = "0x89", t.THORChain = "thorchain-mainnet-v1", t.THORChainStagenet = "thorchain-stagenet-v2", t))(B || {}), b = /* @__PURE__ */ ((t) => (t.Arbitrum = "https://arb1.arbitrum.io/rpc", t.Avalanche = "https://avalanche-c-chain-rpc.publicnode.com", t.Binance = "https://binance.llamarpc.com", t.BinanceSmartChain = "https://binance.llamarpc.com", t.Base = "https://developer-access-mainnet.base.org", t.Bitcoin = "https://node-router.thorswap.net/bitcoin", t.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", t.Cosmos = "https://api.cosmos.shapeshift.com", t.Kujira = "https://rpc-kujira.synergynodes.com/", t.Dash = "https://dash.nownodes.io", t.Dogecoin = "https://node-router.thorswap.net/dogecoin", t.Ethereum = "https://daemon.ethereum.shapeshift.com", t.Litecoin = "https://node-router.thorswap.net/litecoin", t.Mayachain = "https://mayanode.mayachain.info", t.MayaStagenet = "https://stagenet.tendermint.mayachain.info", t.Optimism = "https://mainnet.optimism.io", t.Osmosis = "https://lcd-osmosis.keplr.app", t.Polygon = "https://polygon-rpc.com", t.Ripple = "https://xrplcluster.com", t.THORChain = "https://thornode.ninerealms.com", t.THORChainStagenet = "https://thornode.ninerealms.com", t))(b || {}); | ||
var B = /* @__PURE__ */ ((t) => (t.Arbitrum = "42161", t.ArbitrumHex = "0xa4b1", t.Avalanche = "43114", t.AvalancheHex = "0xa86a", t.Base = "8453", t.BinanceSmartChain = "56", t.BinanceSmartChainHex = "0x38", t.Bitcoin = "bitcoin", t.BitcoinCash = "bitcoincash", t.Cosmos = "cosmoshub-4", t.Dash = "dash", t.Dogecoin = "dogecoin", t.Kujira = "kaiyo-1", t.Ethereum = "1", t.EthereumHex = "0x1", t.Litecoin = "litecoin", t.Mayachain = "mayachain-mainnet-v1", t.MayaStagenet = "mayachain-stagenet-v1", t.Optimism = "10", t.OptimismHex = "0xa", t.Osmosis = "osmosis-1", t.Polygon = "137", t.PolygonHex = "0x89", t.THORChain = "thorchain-mainnet-v1", t.THORChainStagenet = "thorchain-stagenet-v2", t))(B || {}), M = /* @__PURE__ */ ((t) => (t.Arbitrum = "https://arb1.arbitrum.io/rpc", t.Avalanche = "https://avalanche-c-chain-rpc.publicnode.com", t.BinanceSmartChain = "https://binance.llamarpc.com", t.Base = "https://developer-access-mainnet.base.org", t.Bitcoin = "https://node-router.thorswap.net/bitcoin", t.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", t.Cosmos = "https://api.cosmos.shapeshift.com", t.Kujira = "https://rpc-kujira.synergynodes.com/", t.Dash = "https://dash.nownodes.io", t.Dogecoin = "https://node-router.thorswap.net/dogecoin", t.Ethereum = "https://daemon.ethereum.shapeshift.com", t.Litecoin = "https://node-router.thorswap.net/litecoin", t.Mayachain = "https://mayanode.mayachain.info", t.MayaStagenet = "https://stagenet.tendermint.mayachain.info", t.Optimism = "https://mainnet.optimism.io", t.Osmosis = "https://lcd-osmosis.keplr.app", t.Polygon = "https://polygon-rpc.com", t.Ripple = "https://xrplcluster.com", t.THORChain = "https://thornode.ninerealms.com", t.THORChainStagenet = "https://thornode.ninerealms.com", t))(M || {}); | ||
const p = Object.values(e), v = Object.keys(e), U = p.reduce( | ||
@@ -61,3 +60,3 @@ (t, s) => { | ||
p.reduce( | ||
(t, s) => (t[s] = b[U[s]], t), | ||
(t, s) => (t[s] = M[U[s]], t), | ||
{} | ||
@@ -109,3 +108,3 @@ ); | ||
}; | ||
class r { | ||
class a { | ||
constructor(s, i = 0, n) { | ||
@@ -120,12 +119,12 @@ c(this, "assetAmount"); | ||
static fromMidgard(s) { | ||
return new r(s || 0, 0, u.THOR); | ||
return new a(s || 0, 0, u.THOR); | ||
} | ||
static fromBaseAmount(s, i) { | ||
return new r(s, 0, i); | ||
return new a(s, 0, i); | ||
} | ||
static fromAssetAmount(s, i) { | ||
return new r(s, 1, i); | ||
return new a(s, 1, i); | ||
} | ||
static fromNormalAmount(s) { | ||
return new r(s || 0, 1, 1); | ||
return new a(s || 0, 1, 1); | ||
} | ||
@@ -138,3 +137,3 @@ static sorter(s, i) { | ||
add(s) { | ||
return new r( | ||
return new a( | ||
this.assetAmount.plus(s.assetAmount), | ||
@@ -146,3 +145,3 @@ 1, | ||
sub(s) { | ||
return new r( | ||
return new a( | ||
this.assetAmount.minus(s.assetAmount), | ||
@@ -154,29 +153,29 @@ 1, | ||
mul(s) { | ||
return s instanceof r ? new r( | ||
return s instanceof a ? new a( | ||
this.assetAmount.multipliedBy(s.assetAmount), | ||
1, | ||
this.decimal | ||
) : new r(this.assetAmount.multipliedBy(s), 1, this.decimal); | ||
) : new a(this.assetAmount.multipliedBy(s), 1, this.decimal); | ||
} | ||
div(s) { | ||
return s instanceof r ? new r( | ||
return s instanceof a ? new a( | ||
this.assetAmount.dividedBy(s.assetAmount), | ||
1, | ||
this.decimal | ||
) : new r(this.assetAmount.dividedBy(s), 1, this.decimal); | ||
) : new a(this.assetAmount.dividedBy(s), 1, this.decimal); | ||
} | ||
gte(s) { | ||
return s instanceof r ? this.assetAmount.isGreaterThanOrEqualTo(s.assetAmount) : this.assetAmount.isGreaterThanOrEqualTo(s); | ||
return s instanceof a ? this.assetAmount.isGreaterThanOrEqualTo(s.assetAmount) : this.assetAmount.isGreaterThanOrEqualTo(s); | ||
} | ||
gt(s) { | ||
return s instanceof r ? this.assetAmount.isGreaterThan(s.assetAmount) : this.assetAmount.isGreaterThan(s); | ||
return s instanceof a ? this.assetAmount.isGreaterThan(s.assetAmount) : this.assetAmount.isGreaterThan(s); | ||
} | ||
lte(s) { | ||
return s instanceof r ? this.assetAmount.isLessThanOrEqualTo(s.assetAmount) : this.assetAmount.isLessThanOrEqualTo(s); | ||
return s instanceof a ? this.assetAmount.isLessThanOrEqualTo(s.assetAmount) : this.assetAmount.isLessThanOrEqualTo(s); | ||
} | ||
lt(s) { | ||
return s instanceof r ? this.assetAmount.isLessThan(s.assetAmount) : this.assetAmount.isLessThan(s); | ||
return s instanceof a ? this.assetAmount.isLessThan(s.assetAmount) : this.assetAmount.isLessThan(s); | ||
} | ||
eq(s) { | ||
return s instanceof r ? this.assetAmount.isEqualTo(s.assetAmount) : this.assetAmount.isEqualTo(s); | ||
return s instanceof a ? this.assetAmount.isEqualTo(s.assetAmount) : this.assetAmount.isEqualTo(s); | ||
} | ||
@@ -205,3 +204,3 @@ toSignificant(s = 8, i = 8, n = I, o = 0) { | ||
toMidgard() { | ||
return new r( | ||
return new a( | ||
new E( | ||
@@ -346,3 +345,3 @@ this.baseAmount.dividedBy(10 ** this.decimal).multipliedBy(10 ** u.THOR).toFixed() | ||
}, k = (t) => t.eq(f(t.chain)), D = (t, s) => s.find((i) => t.shallowEq(i.asset)); | ||
class g extends r { | ||
class g extends a { | ||
constructor({ | ||
@@ -355,3 +354,3 @@ baseAsset: i, | ||
}) { | ||
const O = r.fromAssetAmount( | ||
const O = a.fromAssetAmount( | ||
m ? m.assetAmount : 1, | ||
@@ -407,12 +406,12 @@ i.decimal | ||
toAbbreviateRaw(i = 2) { | ||
return r.fromAssetAmount(this.price, 8).toAbbreviate(i); | ||
return a.fromAssetAmount(this.price, 8).toAbbreviate(i); | ||
} | ||
toFixedRaw(i = 8, n = I, o = l.ROUND_DOWN) { | ||
return r.fromAssetAmount(this.price, 8).toFixed(i, n, o); | ||
return a.fromAssetAmount(this.price, 8).toFixed(i, n, o); | ||
} | ||
toFixedInverted(i = 8, n = I, o = l.ROUND_DOWN) { | ||
return r.fromAssetAmount(this.invert(), 8).toFixed(i, n, o); | ||
return a.fromAssetAmount(this.invert(), 8).toFixed(i, n, o); | ||
} | ||
} | ||
class N extends r { | ||
class N extends a { | ||
constructor(i, n) { | ||
@@ -422,3 +421,3 @@ super(n.assetAmount, _.ASSET_AMOUNT, n.decimal); | ||
c(this, "amount"); | ||
this.asset = i, this.amount = new r(n.assetAmount, _.ASSET_AMOUNT, n.decimal); | ||
this.asset = i, this.amount = new a(n.assetAmount, _.ASSET_AMOUNT, n.decimal); | ||
} | ||
@@ -437,7 +436,7 @@ add(i) { | ||
let n; | ||
return i instanceof r ? n = new r( | ||
return i instanceof a ? n = new a( | ||
this.assetAmount.multipliedBy(i.assetAmount), | ||
_.ASSET_AMOUNT, | ||
this.decimal | ||
) : n = new r( | ||
) : n = new a( | ||
this.assetAmount.multipliedBy(i), | ||
@@ -450,7 +449,7 @@ _.ASSET_AMOUNT, | ||
let n; | ||
return i instanceof r ? n = new r( | ||
return i instanceof a ? n = new a( | ||
this.assetAmount.dividedBy(i.assetAmount), | ||
_.ASSET_AMOUNT, | ||
this.decimal | ||
) : n = new r(this.assetAmount.dividedBy(i), _.ASSET_AMOUNT, this.decimal), new N(this.asset, n); | ||
) : n = new a(this.assetAmount.dividedBy(i), _.ASSET_AMOUNT, this.decimal), new N(this.asset, n); | ||
} | ||
@@ -474,3 +473,3 @@ toCurrencyFormat({ | ||
pools: n, | ||
priceAmount: r.fromAssetAmount(this.assetAmount, this.decimal) | ||
priceAmount: a.fromAssetAmount(this.assetAmount, this.decimal) | ||
}); | ||
@@ -493,5 +492,5 @@ } | ||
) : 1; | ||
return new N(s, r.fromBaseAmount(i, s.decimal)); | ||
return new N(s, a.fromBaseAmount(i, s.decimal)); | ||
}; | ||
class M { | ||
class L { | ||
constructor(s, i, n, o) { | ||
@@ -503,3 +502,3 @@ c(this, "asset"); | ||
c(this, "detail"); | ||
this.asset = s, this.runeDepth = i, this.assetDepth = n, this.detail = o, this.assetUSDPrice = r.fromAssetAmount(o.assetPriceUSD, u.THOR); | ||
this.asset = s, this.runeDepth = i, this.assetDepth = n, this.detail = o, this.assetUSDPrice = a.fromAssetAmount(o.assetPriceUSD, u.THOR); | ||
} | ||
@@ -509,4 +508,4 @@ static fromPoolData(s) { | ||
if (A && n && o) { | ||
const m = r.fromBaseAmount(n, u.THOR), O = r.fromBaseAmount(o, u.THOR); | ||
return new M(A, m, O, s); | ||
const m = a.fromBaseAmount(n, u.THOR), O = a.fromBaseAmount(o, u.THOR); | ||
return new L(A, m, O, s); | ||
} | ||
@@ -523,3 +522,3 @@ return null; | ||
export { | ||
r as Amount, | ||
a as Amount, | ||
_ as AmountType, | ||
@@ -530,3 +529,3 @@ N as AssetAmount, | ||
y as EMPTY_FORMAT, | ||
M as Pool, | ||
L as Pool, | ||
g as Price, | ||
@@ -533,0 +532,0 @@ l as Rounding, |
@@ -5,3 +5,3 @@ { | ||
"tiny-invariant": "1.3.1", | ||
"@coinmasters/types": "4.7.56" | ||
"@coinmasters/types": "4.7.57" | ||
}, | ||
@@ -14,3 +14,3 @@ "description": "SwapKit Lib swapkit-entities", | ||
"vitest": "0.34.6", | ||
"@internal/config": "2.7.56" | ||
"@internal/config": "2.7.57" | ||
}, | ||
@@ -46,3 +46,3 @@ "eslintConfig": { | ||
"types": "./dist/index.d.ts", | ||
"version": "3.7.56", | ||
"version": "3.7.57", | ||
"scripts": { | ||
@@ -49,0 +49,0 @@ "build": "vite build", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
122845
1481
+ Added@coinmasters/types@4.7.57(transitive)
- Removed@coinmasters/types@4.7.56(transitive)
Updated@coinmasters/types@4.7.57