New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coinmasters/api

Package Overview
Dependencies
Maintainers
2
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinmasters/api - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

44

dist/index.es.js
var A = /* @__PURE__ */ ((_) => (_.INVALID_INPUT_PARAMETERS = "1000", _.UNKNOWN_PROVIDERS = "1001", _.CANNOT_FIND_INBOUND_ADDRESS = "1002", _.NO_INBOUND_ADDRESSES = "1003", _.CHAIN_HALTED_OR_UNSUPPORTED = "1004", _.MISSING_INPUT_PARAMETER = "1005", _.INVALID_TYPE_GENERIC = "1100", _.INVALID_NUMBER_STRING = "1101", _.INVALID_NUMBER = "1102", _.INVALID_BOOLEAN = "1103", _.INVALID_OBJECT = "1104", _.INVALID_ARRAY = "1105", _.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", _.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", _.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", _.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", _.AFF_ADDRESS_TOO_LONG = "2004", _.AFF_BPS_INTEGER_0_100 = "2005", _.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", _.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", _.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", _.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", _.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", _.SOURCE_ADDRESS_SMART_CONTRACT = "2011", _.INVALID_PROVIDER = "2100", _.MISSING_CROSS_CHAIN_PROVIDER = "2101", _.MISSING_AVAX_PROVIDER = "2102", _.MISSING_BSC_PROVIDER = "2103", _.MISSING_ETH_PROVIDER = "2104", _.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", _.MISSING_ARB_PROVIDER = "2106", _.INVALID_CHAIN = "2200", _.INVALID_ASSET = "2201", _.INVALID_ASSET_IDENTIFIER = "2202", _.UNSUPPORTED_CHAIN = "2204", _.UNSUPPORTED_ASSET = "2203", _.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", _.INVALID_SOURCE_ADDRESS = "2300", _.INVALID_DESTINATION_ADDRESS = "2301", _.THORNODE_QUOTE_GENERIC_ERROR = "3000", _.NOT_ENOUGH_SYNTH_BALANCE = "3001", _.SYNTH_MINTING_CAP_REACHED = "3002", _.INVALID_QUOTE_MODE = "4000", _.NO_QUOTES = "4001", _.SERVICE_UNAVAILABLE_GENERIC = "5000", _.MISSING_GAS_DATA_GENERIC = "5100", _.MISSING_TOKEN_INFO_GENERIC = "5200", _.CANT_FIND_TOKEN_LIST = "5201", _.NO_PRICE = "5202", _.PRICE_IS_STALE = "5203", _.ADDRESS_NOT_WHITELISTED = "6000", _.ADDRESS_ALREADY_CLAIMED = "6001", _.TEMPORARY_ERROR = "9999", _))(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__ */ ((_) => (_.Arbitrum = "ARB", _.Avalanche = "AVAX", _.Binance = "BNB", _.BinanceSmartChain = "BSC", _.Bitcoin = "BTC", _.BitcoinCash = "BCH", _.Cosmos = "GAIA", _.Dogecoin = "DOGE", _.Ethereum = "ETH", _.Litecoin = "LTC", _.Maya = "MAYA", _.Optimism = "OP", _.Polygon = "MATIC", _.THORChain = "THOR", _))(e || {}), C = /* @__PURE__ */ ((_) => (_.Arbitrum = "42161", _.ArbitrumHex = "0xa4b1", _.Avalanche = "43114", _.AvalancheHex = "0xa86a", _.Binance = "Binance-Chain-Tigris", _.BinanceSmartChain = "56", _.BinanceSmartChainHex = "0x38", _.Bitcoin = "bitcoin", _.BitcoinCash = "bitcoincash", _.Cosmos = "cosmoshub-4", _.Dogecoin = "dogecoin", _.Ethereum = "1", _.EthereumHex = "0x1", _.Litecoin = "litecoin", _.Maya = "mayachain-mainnet-v1", _.MayaStagenet = "mayachain-stagenet-v1", _.Optimism = "10", _.OptimismHex = "0xa", _.Polygon = "137", _.PolygonHex = "0x89", _.THORChain = "thorchain-mainnet-v1", _.THORChainStagenet = "thorchain-stagenet-v2", _))(C || {}), D = /* @__PURE__ */ ((_) => (_.Arbitrum = "https://arb1.arbitrum.io/rpc", _.Avalanche = "https://node-router.thorswap.net/avalanche-c", _.Binance = "", _.BinanceSmartChain = "https://bsc-dataseed.binance.org", _.Bitcoin = "https://node-router.thorswap.net/bitcoin", _.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", _.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", _.Dogecoin = "https://node-router.thorswap.net/dogecoin", _.Ethereum = "https://node-router.thorswap.net/ethereum", _.Litecoin = "https://node-router.thorswap.net/litecoin", _.Maya = "https://tendermint.mayachain.info", _.MayaStagenet = "https://stagenet.tendermint.mayachain.info", _.Optimism = "https://mainnet.optimism.io", _.Polygon = "https://polygon-rpc.com", _.THORChain = "https://rpc.thorswap.net", _.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", _))(D || {}), T = /* @__PURE__ */ ((_) => (_.Cosmos = "https://node-router.thorswap.net/cosmos/rest", _.MayanodeMainnet = "https://mayanode.mayachain.info", _.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", _.ThornodeMainnet = "https://thornode.thorswap.net", _.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", _.ThorswapApi = "https://api.thorswap.finance", _.ThorswapStatic = "https://static.thorswap.net", _))(T || {});
const r = Object.values(e), s = Object.keys(e), O = r.reduce(
var e = /* @__PURE__ */ ((_) => (_.Arbitrum = "ARB", _.Avalanche = "AVAX", _.Binance = "BNB", _.BinanceSmartChain = "BSC", _.Bitcoin = "BTC", _.BitcoinCash = "BCH", _.Cosmos = "GAIA", _.Dogecoin = "DOGE", _.Ethereum = "ETH", _.Kujira = "KUJI", _.Litecoin = "LTC", _.Maya = "MAYA", _.Optimism = "OP", _.Polygon = "MATIC", _.THORChain = "THOR", _))(e || {}), i = /* @__PURE__ */ ((_) => (_.Arbitrum = "42161", _.ArbitrumHex = "0xa4b1", _.Avalanche = "43114", _.AvalancheHex = "0xa86a", _.Binance = "Binance-Chain-Tigris", _.BinanceSmartChain = "56", _.BinanceSmartChainHex = "0x38", _.Bitcoin = "bitcoin", _.BitcoinCash = "bitcoincash", _.Cosmos = "cosmoshub-4", _.Dogecoin = "dogecoin", _.Kujira = "kaiyo-1", _.Ethereum = "1", _.EthereumHex = "0x1", _.Litecoin = "litecoin", _.Maya = "mayachain-mainnet-v1", _.MayaStagenet = "mayachain-stagenet-v1", _.Optimism = "10", _.OptimismHex = "0xa", _.Polygon = "137", _.PolygonHex = "0x89", _.THORChain = "thorchain-mainnet-v1", _.THORChainStagenet = "thorchain-stagenet-v2", _))(i || {}), D = /* @__PURE__ */ ((_) => (_.Arbitrum = "https://arb1.arbitrum.io/rpc", _.Avalanche = "https://node-router.thorswap.net/avalanche-c", _.Binance = "", _.BinanceSmartChain = "https://bsc-dataseed.binance.org", _.Bitcoin = "https://node-router.thorswap.net/bitcoin", _.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", _.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", _.Kujira = "https://rpc-kujira.synergynodes.com/", _.Dogecoin = "https://node-router.thorswap.net/dogecoin", _.Ethereum = "https://node-router.thorswap.net/ethereum", _.Litecoin = "https://node-router.thorswap.net/litecoin", _.Maya = "https://tendermint.mayachain.info", _.MayaStagenet = "https://stagenet.tendermint.mayachain.info", _.Optimism = "https://mainnet.optimism.io", _.Polygon = "https://polygon-rpc.com", _.THORChain = "https://rpc.thorswap.net", _.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", _))(D || {}), T = /* @__PURE__ */ ((_) => (_.Cosmos = "https://node-router.thorswap.net/cosmos/rest", _.Kujira = "https://lcd-kujira.synergynodes.com/", _.MayanodeMainnet = "https://mayanode.mayachain.info", _.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", _.ThornodeMainnet = "https://thornode.thorswap.net", _.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", _.ThorswapApi = "https://api.thorswap.finance", _.ThorswapStatic = "https://static.thorswap.net", _))(T || {});
const r = Object.values(e), n = Object.keys(e), C = r.reduce(
(_, S) => {
const E = s.find((t) => e[t] === S);
const E = n.find((t) => e[t] === S);
return E && (_[S] = E), _;

@@ -12,7 +12,7 @@ },

r.reduce(
(_, S) => (_[S] = C[O[S]], _),
(_, S) => (_[S] = i[C[S]], _),
{}
);
r.reduce(
(_, S) => (_[S] = D[O[S]], _),
(_, S) => (_[S] = D[C[S]], _),
{}

@@ -22,8 +22,8 @@ );

(_, S) => {
const E = `${O[S]}Hex`;
return _[S] = C[E], _;
const E = `${C[S]}Hex`;
return _[S] = i[E], _;
},
{}
);
const i = (_) => ("recipientAddress" in _ && _.recipientAddress && (_.recipientAddress = _.recipientAddress.replace(/(bchtest:|bitcoincash:)/, "")), new URLSearchParams(_).toString()), N = {
const O = (_) => ("recipientAddress" in _ && _.recipientAddress && (_.recipientAddress = _.recipientAddress.replace(/(bchtest:|bitcoincash:)/, "")), new URLSearchParams(_).toString()), I = {
CachedPrices: `${T.ThorswapApi}/tokenlist/cached-price`,

@@ -36,4 +36,4 @@ GasRates: `${T.ThorswapApi}/resource-worker/gasPrice/getAll`,

Thorname: `${T.ThorswapApi}/thorname`
}, I = {
get: (_, S, E) => fetch(`${_}${S ? `?${i(S)}` : ""}`, {
}, N = {
get: (_, S, E) => fetch(`${_}${S ? `?${O(S)}` : ""}`, {
referrer: "https://sk.thorswap.net"

@@ -48,19 +48,19 @@ }).then((t) => t.json()).catch((t) => {

headers: { "Content-Type": "application/json", ...(E == null ? void 0 : E.headers) || {} },
body: typeof S == "string" ? S : i(S)
body: typeof S == "string" ? S : O(S)
}).then((t) => t.json())
}, a = ({ tokens: _, ...S }) => {
const E = new URLSearchParams();
return _.filter((t, R, o) => o.findIndex((n) => n === t) === R).forEach((t) => E.append("tokens", JSON.stringify(t))), S.metadata && E.append("metadata", "true"), S.lookup && E.append("lookup", "true"), S.sparkline && E.append("sparkline", "true"), I.post(N.CachedPrices, E.toString(), {
return _.filter((t, R, o) => o.findIndex((s) => s === t) === R).forEach((t) => E.append("tokens", JSON.stringify(t))), S.metadata && E.append("metadata", "true"), S.lookup && E.append("lookup", "true"), S.sparkline && E.append("sparkline", "true"), N.post(I.CachedPrices, E.toString(), {
headers: { "Content-Type": "application/x-www-form-urlencoded" }
});
}, L = {
}, U = {
getCachedPrices: a,
getQuote: (_) => I.get(N.Quote, _),
getGasRates: () => I.get(N.GasRates),
getTxnDetails: (_) => I.get(N.Txn, { txHash: _ }),
getTokenlistProviders: () => I.get(N.TokenlistProviders),
getTokenList: (_) => I.get(`${N.TokenList}/${_}.json`),
getThornameAddresses: (_) => I.get(`${N.Thorname}/${_}`),
getThornameRegisteredChains: (_) => I.get(`${N.Thorname}/chains/${_}`),
getThornameRlookup: (_, S) => I.get(`${N.Thorname}/rlookup`, { address: _, chain: S })
getQuote: (_) => N.get(I.Quote, _),
getGasRates: () => N.get(I.GasRates),
getTxnDetails: (_) => N.get(I.Txn, { txHash: _ }),
getTokenlistProviders: () => N.get(I.TokenlistProviders),
getTokenList: (_) => N.get(`${I.TokenList}/${_}.json`),
getThornameAddresses: (_) => N.get(`${I.Thorname}/${_}`),
getThornameRegisteredChains: (_) => N.get(`${I.Thorname}/chains/${_}`),
getThornameRlookup: (_, S) => N.get(`${I.Thorname}/rlookup`, { address: _, chain: S })
};

@@ -70,5 +70,5 @@ var P = /* @__PURE__ */ ((_) => (_.SWAP_TC_TO_TC = "SWAP:TC-TC", _.SWAP_ETH_TO_TC = "SWAP:ERC20-TC", _.SWAP_TC_TO_ETH = "SWAP:TC-ERC20", _.SWAP_ETH_TO_ETH = "SWAP:ERC20-ERC20", _.SWAP_AVAX_TO_TC = "SWAP:AVAX-TC", _.SWAP_TC_TO_AVAX = "SWAP:TC-AVAX", _.SWAP_AVAX_TO_AVAX = "SWAP:AVAX-AVAX", _.SWAP_ETH_TO_AVAX = "SWAP:ETH-AVAX", _.SWAP_AVAX_TO_ETH = "SWAP:AVAX-ETH", _.SWAP_TC_TO_GAIA = "SWAP:TC-GAIA", _.SWAP_GAIA_TO_TC = "SWAP:GAIA-TC", _.SWAP_TC_TO_BNB = "SWAP:TC-BNB", _.SWAP_BNB_TO_TC = "SWAP:BNB-TC", _.SWAP_TC_TO_BTC = "SWAP:TC-BTC", _.SWAP_BTC_TO_TC = "SWAP:BTC-TC", _.SWAP_TC_TO_BCH = "SWAP:TC-BCH", _.SWAP_BCH_TO_TC = "SWAP:BCH-TC", _.SWAP_TC_TO_LTC = "SWAP:TC-LTC", _.SWAP_LTC_TO_TC = "SWAP:LTC-TC", _.SWAP_TC_TO_DOGE = "SWAP:TC-DOGE", _.SWAP_DOGE_TO_TC = "SWAP:DOGE-TC", _.TC_STATUS = "TC:STATUS", _.TC_TRANSFER = "TC:TRANSFER", _.TC_DEPOSIT = "TC:DEPOSIT", _.TC_SEND = "TC:SEND", _.TC_SWITCH = "TC:SWITCH", _.TC_LP_ADD = "TC:ADDLIQUIDITY", _.TC_LP_WITHDRAW = "TC:WITHDRAW", _.TC_TNS_CREATE = "TC:TNS-CREATE", _.TC_TNS_EXTEND = "TC:TNS-EXTEND", _.TC_TNS_UPDATE = "TC:TNS-UPDATE", _.TC_SAVINGS_ADD = "TC:ADDSAVINGS", _.TC_SAVINGS_WITHDRAW = "TC:WITHDRAWSAVINGS", _.TC_LENDING_OPEN = "TC:LENDINGOPEN", _.TC_LENDING_CLOSE = "TC:LENDINGCLOSE", _.ETH_APPROVAL = "ETH:APPROVAL", _.ETH_STATUS = "ETH:STATUS", _.ETH_TRANSFER_TO_TC = "ETH:TRANSFER:IN", _.ETH_TRANSFER_FROM_TC = "ETH:TRANSFER:OUT", _.AVAX_APPROVAL = "AVAX:APPROVAL", _.AVAX_STATUS = "AVAX:STATUS", _.AVAX_TRANSFER_TO_TC = "AVAX:TRANSFER:IN", _.AVAX_TRANSFER_FROM_TC = "AVAX:TRANSFER:OUT", _.BSC_APPROVAL = "BSC:APPROVAL", _.BSC_STATUS = "BSC:STATUS", _.BSC_TRANSFER_TO_TC = "BSC:TRANSFER:IN", _.BSC_TRANSFER_FROM_TC = "BSC:TRANSFER:OUT", _.APPROVAL = "APPROVAL", _.STATUS = "STATUS", _.TRANSFER_TO_TC = "TRANSFER:IN", _.TRANSFER_FROM_TC = "TRANSFER:OUT", _.UNSUPPORTED = "UNSUPPORTED", _.TC_LENDING = "TC:LENDING", _))(P || {}), d = /* @__PURE__ */ ((_) => (_.PENDING = "pending", _.SUCCESS = "success", _.CANCELLED = "cancelled", _.REFUNDED = "refunded", _.REPLACED = "replaced", _.ERROR = "error", _.UNKNOWN = "unknown", _.NOT_STARTED = "not_started", _.NOT_FOUND = "not_found", _.RETRIES_EXCEEDED = "retries_exceeded", _.STREAMING = "streaming", _))(d || {}), h = /* @__PURE__ */ ((_) => (_[_.NOT_STARTED = 0] = "NOT_STARTED", _[_.SUCCESS = 1] = "SUCCESS", _[_.REFUNDED = 2] = "REFUNDED", _))(h || {});

h as StreamingSwapProgressStatus,
L as SwapKitApi,
U as SwapKitApi,
P as TransactionType,
d as TxStatus
};
{
"author": "swapkit-oss-team",
"dependencies": {
"@coinmasters/types": "1.0.0"
"@coinmasters/types": "2.0.0"
},

@@ -11,3 +11,3 @@ "description": "SwapKit Lib swapkit-api",

"vitest": "0.34.4",
"@internal/config": "0.0.0"
"@internal/config": "1.0.0"
},

@@ -40,3 +40,3 @@ "eslintConfig": {

"types": "./dist/index.d.ts",
"version": "1.0.0",
"version": "2.0.0",
"scripts": {

@@ -43,0 +43,0 @@ "build": "vite build",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc