@coinmasters/api
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -1,4 +0,4 @@ | ||
var o = /* @__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))(o || {}); | ||
o.INVALID_INPUT_PARAMETERS + "", o.UNKNOWN_PROVIDERS + "", o.CANNOT_FIND_INBOUND_ADDRESS + "", o.NO_INBOUND_ADDRESSES + "", o.CHAIN_HALTED_OR_UNSUPPORTED + "", o.MISSING_INPUT_PARAMETER + "", o.INVALID_TYPE_GENERIC + "", o.INVALID_NUMBER_STRING + "", o.INVALID_NUMBER + "", o.INVALID_BOOLEAN + "", o.INVALID_OBJECT + "", o.INVALID_ARRAY + "", o.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", o.SELL_BUY_ASSETS_ARE_THE_SAME + "", o.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", o.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", o.AFF_ADDRESS_TOO_LONG + "", o.AFF_BPS_INTEGER_0_100 + "", o.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", o.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", o.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", o.DESTINATION_ADDRESS_SMART_CONTRACT + "", o.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", o.INVALID_PROVIDER + "", o.MISSING_CROSS_CHAIN_PROVIDER + "", o.MISSING_AVAX_PROVIDER + "", o.MISSING_BSC_PROVIDER + "", o.MISSING_ETH_PROVIDER + "", o.MISSING_ARB_PROVIDER + "", o.INVALID_PROVIDER_FOR_SWAP_OUT + "", o.INVALID_CHAIN + "", o.INVALID_ASSET + "", o.UNSUPPORTED_CHAIN + "", o.UNSUPPORTED_ASSET + "", o.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", o.THORNODE_QUOTE_GENERIC_ERROR + "", o.INVALID_SOURCE_ADDRESS + "", o.INVALID_DESTINATION_ADDRESS + "", o.NOT_ENOUGH_SYNTH_BALANCE + "", o.SYNTH_MINTING_CAP_REACHED + "", o.INVALID_QUOTE_MODE + "", o.NO_QUOTES + "", o.SERVICE_UNAVAILABLE_GENERIC + "", o.MISSING_GAS_DATA_GENERIC + "", o.MISSING_TOKEN_INFO_GENERIC + "", o.CANT_FIND_TOKEN_LIST + "", o.NO_PRICE + "", o.PRICE_IS_STALE + "", o.ADDRESS_NOT_WHITELISTED + "", o.ADDRESS_ALREADY_CLAIMED + ""; | ||
var i = /* @__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.Maya = "MAYA", t.Optimism = "OP", t.Osmosis = "OSMO", t.Polygon = "MATIC", t.Ripple = "XRP", t.THORChain = "THOR", t.Zcash = "ZEC", t))(i || {}); | ||
var i = /* @__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))(i || {}); | ||
i.INVALID_INPUT_PARAMETERS + "", i.UNKNOWN_PROVIDERS + "", i.CANNOT_FIND_INBOUND_ADDRESS + "", i.NO_INBOUND_ADDRESSES + "", i.CHAIN_HALTED_OR_UNSUPPORTED + "", i.MISSING_INPUT_PARAMETER + "", i.INVALID_TYPE_GENERIC + "", i.INVALID_NUMBER_STRING + "", i.INVALID_NUMBER + "", i.INVALID_BOOLEAN + "", i.INVALID_OBJECT + "", i.INVALID_ARRAY + "", i.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", i.SELL_BUY_ASSETS_ARE_THE_SAME + "", i.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", i.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", i.AFF_ADDRESS_TOO_LONG + "", i.AFF_BPS_INTEGER_0_100 + "", i.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", i.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", i.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", i.DESTINATION_ADDRESS_SMART_CONTRACT + "", i.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", i.INVALID_PROVIDER + "", i.MISSING_CROSS_CHAIN_PROVIDER + "", i.MISSING_AVAX_PROVIDER + "", i.MISSING_BSC_PROVIDER + "", i.MISSING_ETH_PROVIDER + "", i.MISSING_ARB_PROVIDER + "", i.INVALID_PROVIDER_FOR_SWAP_OUT + "", i.INVALID_CHAIN + "", i.INVALID_ASSET + "", i.UNSUPPORTED_CHAIN + "", i.UNSUPPORTED_ASSET + "", i.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", i.THORNODE_QUOTE_GENERIC_ERROR + "", i.INVALID_SOURCE_ADDRESS + "", i.INVALID_DESTINATION_ADDRESS + "", i.NOT_ENOUGH_SYNTH_BALANCE + "", i.SYNTH_MINTING_CAP_REACHED + "", i.INVALID_QUOTE_MODE + "", i.NO_QUOTES + "", i.SERVICE_UNAVAILABLE_GENERIC + "", i.MISSING_GAS_DATA_GENERIC + "", i.MISSING_TOKEN_INFO_GENERIC + "", i.CANT_FIND_TOKEN_LIST + "", i.NO_PRICE + "", i.PRICE_IS_STALE + "", i.ADDRESS_NOT_WHITELISTED + "", i.ADDRESS_ALREADY_CLAIMED + ""; | ||
var o = /* @__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.Maya = "MAYA", t.Optimism = "OP", t.Osmosis = "OSMO", t.Polygon = "MATIC", t.Ripple = "XRP", t.THORChain = "THOR", t.Zcash = "ZEC", t))(o || {}); | ||
const H = { | ||
@@ -28,5 +28,5 @@ ARB: "eip155:42161", | ||
}; | ||
for (const t in i) | ||
H[i[t]], i[t]; | ||
const N = [ | ||
for (const t in o) | ||
H[o[t]], o[t]; | ||
const I = [ | ||
"ETH", | ||
@@ -41,6 +41,6 @@ "AVAX", | ||
]; | ||
var f = /* @__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.Maya = "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))(f || {}), y = /* @__PURE__ */ ((t) => (t.Arbitrum = "https://arb1.arbitrum.io/rpc", t.Avalanche = "https://node-router.thorswap.net/avalanche-c", t.Binance = "https://base.llamarpc.com", t.BinanceSmartChain = "https://bsc-dataseed.binance.org", t.Base = "https://base.llamarpc.com", t.Bitcoin = "https://node-router.thorswap.net/bitcoin", t.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", t.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", t.Kujira = "https://rpc-kujira.synergynodes.com/", t.Dash = "https://dash.nownodes.io", t.Dogecoin = "https://node-router.thorswap.net/dogecoin", t.Ethereum = "https://node-router.thorswap.net/ethereum", t.Litecoin = "https://node-router.thorswap.net/litecoin", t.Maya = "https://tendermint.mayachain.info", t.MayaStagenet = "https://stagenet.tendermint.mayachain.info", t.Optimism = "https://mainnet.optimism.io", t.Osmosis = "https://rpc-osmosis.keplr.app", t.Polygon = "https://polygon-rpc.com", t.THORChain = "https://rpc.thorswap.net", t.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", t))(y || {}), c = /* @__PURE__ */ ((t) => (t.Cosmos = "https://node-router.thorswap.net/cosmos/rest", t.Kujira = "https://lcd-kujira.synergynodes.com/", t.MayanodeMainnet = "https://mayanode.mayachain.info", t.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", t.ThornodeMainnet = "https://thornode.thorswap.net", t.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", t.ThorswapApi = "https://api.thorswap.net", t.ThorswapStatic = "https://static.thorswap.net", t))(c || {}); | ||
const p = Object.values(i), v = Object.keys(i), m = p.reduce( | ||
var f = /* @__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.Maya = "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))(f || {}), B = /* @__PURE__ */ ((t) => (t.Arbitrum = "https://arb1.arbitrum.io/rpc", t.Avalanche = "https://node-router.thorswap.net/avalanche-c", t.Binance = "https://base.llamarpc.com", t.BinanceSmartChain = "https://bsc-dataseed.binance.org", t.Base = "https://base.llamarpc.com", t.Bitcoin = "https://node-router.thorswap.net/bitcoin", t.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", t.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", t.Kujira = "https://rpc-kujira.synergynodes.com/", t.Dash = "https://dash.nownodes.io", t.Dogecoin = "https://node-router.thorswap.net/dogecoin", t.Ethereum = "https://node-router.thorswap.net/ethereum", t.Litecoin = "https://node-router.thorswap.net/litecoin", t.Maya = "https://tendermint.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://rpc.thorswap.net", t.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", t))(B || {}), c = /* @__PURE__ */ ((t) => (t.Cosmos = "https://node-router.thorswap.net/cosmos/rest", t.Kujira = "https://lcd-kujira.synergynodes.com/", t.MayanodeMainnet = "https://mayanode.mayachain.info", t.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", t.ThornodeMainnet = "https://thornode.thorswap.net", t.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", t.ThorswapApi = "https://api.thorswap.net", t.ThorswapStatic = "https://static.thorswap.net", t))(c || {}); | ||
const p = Object.values(o), v = Object.keys(o), m = p.reduce( | ||
(t, e) => { | ||
const r = v.find((s) => i[s] === e); | ||
const r = v.find((s) => o[s] === e); | ||
return r && (t[e] = r), t; | ||
@@ -55,3 +55,3 @@ }, | ||
p.reduce( | ||
(t, e) => (t[e] = y[m[e]], t), | ||
(t, e) => (t[e] = B[m[e]], t), | ||
{} | ||
@@ -66,18 +66,21 @@ ); | ||
); | ||
const T = [ | ||
i.Arbitrum, | ||
i.Avalanche, | ||
i.Binance, | ||
i.BinanceSmartChain, | ||
i.Bitcoin, | ||
i.BitcoinCash, | ||
i.Cosmos, | ||
i.Dogecoin, | ||
i.Ethereum, | ||
i.Litecoin, | ||
i.Optimism, | ||
i.Polygon, | ||
i.THORChain | ||
const N = [ | ||
o.Arbitrum, | ||
o.Avalanche, | ||
o.Binance, | ||
o.BinanceSmartChain, | ||
o.Bitcoin, | ||
o.BitcoinCash, | ||
o.Cosmos, | ||
o.Osmosis, | ||
o.Ripple, | ||
o.Dogecoin, | ||
o.Dash, | ||
o.Ethereum, | ||
o.Litecoin, | ||
o.Optimism, | ||
o.Polygon, | ||
o.THORChain | ||
]; | ||
i.Cosmos, i.Bitcoin, i.BitcoinCash, i.Litecoin, i.Dogecoin, i.Ethereum, i.Arbitrum, i.Avalanche, i.BinanceSmartChain, i.Bitcoin, i.BitcoinCash, i.Cosmos, i.Dogecoin, i.Ethereum, i.Litecoin, i.Optimism, i.Polygon, i.THORChain, i.Ethereum, i.Binance, i.BinanceSmartChain, i.Avalanche, i.THORChain, i.Ethereum, i.Avalanche, i.BinanceSmartChain, i.Bitcoin, i.Cosmos; | ||
o.Cosmos, o.Arbitrum, o.Avalanche, o.Binance, o.BinanceSmartChain, o.Bitcoin, o.BitcoinCash, o.Cosmos, o.Dogecoin, o.Ethereum, o.Litecoin, o.Optimism, o.Polygon, o.THORChain, o.Bitcoin, o.BitcoinCash, o.Litecoin, o.Dogecoin, o.Ethereum, o.Arbitrum, o.Avalanche, o.BinanceSmartChain, o.Bitcoin, o.BitcoinCash, o.Cosmos, o.Dogecoin, o.Ethereum, o.Litecoin, o.Optimism, o.Polygon, o.THORChain, o.Ethereum, o.Binance, o.BinanceSmartChain, o.Avalanche, o.THORChain, o.Ethereum, o.Avalanche, o.BinanceSmartChain, o.Bitcoin, o.Cosmos; | ||
class P extends Error { | ||
@@ -104,3 +107,3 @@ constructor(e, r, s) { | ||
} | ||
class L extends Error { | ||
class y extends Error { | ||
constructor(e) { | ||
@@ -115,8 +118,8 @@ super("Request timed out"), Object.defineProperty(this, "request", { | ||
} | ||
const l = (t) => t !== null && typeof t == "object", d = (...t) => { | ||
const d = (t) => t !== null && typeof t == "object", T = (...t) => { | ||
for (const e of t) | ||
if ((!l(e) || Array.isArray(e)) && e !== void 0) | ||
if ((!d(e) || Array.isArray(e)) && e !== void 0) | ||
throw new TypeError("The `options` argument must be an object"); | ||
return D({}, ...t); | ||
}, B = (t = {}, e = {}) => { | ||
}, L = (t = {}, e = {}) => { | ||
const r = new globalThis.Headers(t), s = e instanceof globalThis.Headers, n = new globalThis.Headers(e); | ||
@@ -131,6 +134,6 @@ for (const [a, _] of n.entries()) | ||
Array.isArray(e) || (e = []), e = [...e, ...s]; | ||
else if (l(s)) { | ||
else if (d(s)) { | ||
for (let [n, a] of Object.entries(s)) | ||
l(a) && n in e && (a = D(e[n], a)), e = { ...e, [n]: a }; | ||
l(s.headers) && (r = B(r, s.headers), e.headers = r); | ||
d(a) && n in e && (a = D(e[n], a)), e = { ...e, [n]: a }; | ||
d(s.headers) && (r = L(r, s.headers), e.headers = r); | ||
} | ||
@@ -209,3 +212,3 @@ return e; | ||
const _ = setTimeout(() => { | ||
r && r.abort(), a(new L(t)); | ||
r && r.abort(), a(new y(t)); | ||
}, s.timeout); | ||
@@ -234,5 +237,5 @@ s.fetch(t, e).then(n).catch(a).then(() => { | ||
}; | ||
class I { | ||
class l { | ||
static create(e, r) { | ||
const s = new I(e, r), n = async () => { | ||
const s = new l(e, r), n = async () => { | ||
if (typeof s._options.timeout == "number" && s._options.timeout > C) | ||
@@ -306,3 +309,3 @@ throw new RangeError(`The \`timeout\` option cannot be greater than ${C}`); | ||
...r, | ||
headers: B(this._input.headers, r.headers), | ||
headers: L(this._input.headers, r.headers), | ||
hooks: D({ | ||
@@ -344,3 +347,3 @@ beforeRequest: [], | ||
_calculateRetryDelay(e) { | ||
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(e instanceof L)) { | ||
if (this._retryCount++, this._retryCount < this._options.retry.limit && !(e instanceof y)) { | ||
if (e instanceof P) { | ||
@@ -434,6 +437,6 @@ if (!this._options.retry.statusCodes.includes(e.response.status)) | ||
const O = (t) => { | ||
const e = (r, s) => I.create(r, d(t, s)); | ||
const e = (r, s) => l.create(r, T(t, s)); | ||
for (const r of U) | ||
e[r] = (s, n) => I.create(s, d(t, n, { method: r })); | ||
return e.create = (r) => O(d(r)), e.extend = (r) => O(d(t, r)), e.stop = w, e; | ||
e[r] = (s, n) => l.create(s, T(t, n, { method: r })); | ||
return e.create = (r) => O(T(r)), e.extend = (r) => O(T(t, r)), e.stop = w, e; | ||
}, z = O(), Z = z, E = { | ||
@@ -440,0 +443,0 @@ CachedPrices: `${c.ThorswapApi}/tokenlist/cached-price`, |
@@ -5,3 +5,3 @@ { | ||
"ky": "1.1.3", | ||
"@coinmasters/types": "4.1.0" | ||
"@coinmasters/types": "4.2.0" | ||
}, | ||
@@ -13,3 +13,3 @@ "description": "SwapKit Lib swapkit-api", | ||
"vitest": "0.34.6", | ||
"@internal/config": "2.1.0" | ||
"@internal/config": "2.2.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "eslintConfig": { | ||
"types": "./dist/index.d.ts", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"scripts": { | ||
@@ -45,0 +45,0 @@ "build": "vite build", |
@@ -18,7 +18,18 @@ import { ApiUrl } from '@coinmasters/types'; | ||
const headers = | ||
typeof window !== 'undefined' | ||
? {} | ||
: { referrer: 'https://sk.thorswap.net', referer: 'https://sk.thorswap.net' }; | ||
// Determine API key: use environment variable if available, otherwise use hardcoded value | ||
const apiKey = typeof process !== 'undefined' && process.env['THORSWAP_API_KEY'] | ||
? process.env['THORSWAP_API_KEY'] | ||
: '8813f69e-13e8-42c3-b90a-9c1c059bdad5'; | ||
// Determine referrer: use environment variable if available, otherwise use default value | ||
const referrer = typeof process !== 'undefined' && process.env['THORSWAP_API_REFERER'] | ||
? process.env['THORSWAP_API_REFERER'] | ||
: 'https://pioneers.dev'; | ||
// Define headers with 'x-api-key' and 'referrer' | ||
const headers = { | ||
'x-api-key': apiKey, | ||
'referrer': referrer | ||
}; | ||
const kyClient = ky.create({ headers }); | ||
@@ -25,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
101095
1389
+ Added@coinmasters/types@4.2.0(transitive)
- Removed@coinmasters/types@4.1.0(transitive)
Updated@coinmasters/types@4.2.0