@thorswap-lib/evm-web3-wallets
Advanced tools
Comparing version 1.0.0-development.47 to 1.0.0-development.48
import { Web3Provider as d } from "@ethersproject/providers"; | ||
var E = /* @__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", _.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", _))(E || {}); | ||
E.INVALID_INPUT_PARAMETERS + "", E.UNKNOWN_PROVIDERS + "", E.CANNOT_FIND_INBOUND_ADDRESS + "", E.NO_INBOUND_ADDRESSES + "", E.CHAIN_HALTED_OR_UNSUPPORTED + "", E.MISSING_INPUT_PARAMETER + "", E.INVALID_TYPE_GENERIC + "", E.INVALID_NUMBER_STRING + "", E.INVALID_NUMBER + "", E.INVALID_BOOLEAN + "", E.INVALID_OBJECT + "", E.INVALID_ARRAY + "", E.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", E.SELL_BUY_ASSETS_ARE_THE_SAME + "", E.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", E.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", E.AFF_ADDRESS_TOO_LONG + "", E.AFF_BPS_INTEGER_0_100 + "", E.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", E.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", E.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", E.DESTINATION_ADDRESS_SMART_CONTRACT + "", E.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", E.INVALID_PROVIDER + "", E.MISSING_CROSS_CHAIN_PROVIDER + "", E.MISSING_AVAX_PROVIDER + "", E.MISSING_BSC_PROVIDER + "", E.MISSING_ETH_PROVIDER + "", E.MISSING_ARB_PROVIDER + "", E.INVALID_PROVIDER_FOR_SWAP_OUT + "", E.INVALID_CHAIN + "", E.INVALID_ASSET + "", E.UNSUPPORTED_CHAIN + "", E.UNSUPPORTED_ASSET + "", E.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", E.THORNODE_QUOTE_GENERIC_ERROR + "", E.NOT_ENOUGH_SYNTH_BALANCE + "", E.SYNTH_MINTING_CAP_REACHED + "", E.INVALID_QUOTE_MODE + "", E.NO_QUOTES + "", E.SERVICE_UNAVAILABLE_GENERIC + "", E.MISSING_GAS_DATA_GENERIC + "", E.MISSING_TOKEN_INFO_GENERIC + "", E.CANT_FIND_TOKEN_LIST + "", E.NO_PRICE + "", E.PRICE_IS_STALE + "", E.ADDRESS_NOT_WHITELISTED + "", E.ADDRESS_ALREADY_CLAIMED + ""; | ||
var i = /* @__PURE__ */ ((_) => (_.Arbitrum = "ARB", _.Avalanche = "AVAX", _.Binance = "BNB", _.BinanceSmartChain = "BSC", _.Bitcoin = "BTC", _.BitcoinCash = "BCH", _.Cosmos = "GAIA", _.Dogecoin = "DOGE", _.Ethereum = "ETH", _.Litecoin = "LTC", _.Optimism = "OP", _.Polygon = "MATIC", _.THORChain = "THOR", _))(i || {}), o = /* @__PURE__ */ ((_) => (_.Arbitrum = "42161", _.ArbitrumHex = "0xa4b1", _.Avalanche = "43114", _.AvalancheHex = "0xa86a", _.Binance = "Binance-Chain-Tigris", _.BinanceHex = "", _.BinanceSmartChain = "56", _.BinanceSmartChainHex = "0x38", _.Bitcoin = "bitcoin", _.BitcoinHex = "", _.BitcoinCash = "bitcoincash", _.BitcoinCashHex = "", _.Cosmos = "cosmoshub-4", _.CosmosHex = "", _.Dogecoin = "dogecoin", _.DogecoinHex = "", _.Ethereum = "1", _.EthereumHex = "0x1", _.Litecoin = "litecoin", _.LitecoinHex = "", _.Optimism = "10", _.OptimismHex = "0xa", _.Polygon = "137", _.PolygonHex = "0x89", _.THORChain = "thorchain-mainnet-v1", _.THORChainHex = "", _.THORChainStagenet = "thorchain-stagenet-v2", _))(o || {}), e = /* @__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", _.Optimism = "https://mainnet.optimism.io", _.Polygon = "https://polygon-rpc.com", _.THORChain = "https://rpc.thorswap.net", _.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", _))(e || {}); | ||
const S = Object.values(i), C = Object.keys(i), N = S.reduce( | ||
var E = /* @__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", _))(E || {}); | ||
E.INVALID_INPUT_PARAMETERS + "", E.UNKNOWN_PROVIDERS + "", E.CANNOT_FIND_INBOUND_ADDRESS + "", E.NO_INBOUND_ADDRESSES + "", E.CHAIN_HALTED_OR_UNSUPPORTED + "", E.MISSING_INPUT_PARAMETER + "", E.INVALID_TYPE_GENERIC + "", E.INVALID_NUMBER_STRING + "", E.INVALID_NUMBER + "", E.INVALID_BOOLEAN + "", E.INVALID_OBJECT + "", E.INVALID_ARRAY + "", E.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", E.SELL_BUY_ASSETS_ARE_THE_SAME + "", E.MISSING_SOURCE_ADDRESS_FOR_SYNTH + "", E.AFF_ADDRESS_AND_BPS_OR_NEITHER + "", E.AFF_ADDRESS_TOO_LONG + "", E.AFF_BPS_INTEGER_0_100 + "", E.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN + "", E.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN + "", E.PREFERRED_PROFVIDER_NOT_SUPPORTED + "", E.DESTINATION_ADDRESS_SMART_CONTRACT + "", E.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER + "", E.INVALID_PROVIDER + "", E.MISSING_CROSS_CHAIN_PROVIDER + "", E.MISSING_AVAX_PROVIDER + "", E.MISSING_BSC_PROVIDER + "", E.MISSING_ETH_PROVIDER + "", E.MISSING_ARB_PROVIDER + "", E.INVALID_PROVIDER_FOR_SWAP_OUT + "", E.INVALID_CHAIN + "", E.INVALID_ASSET + "", E.UNSUPPORTED_CHAIN + "", E.UNSUPPORTED_ASSET + "", E.UNSUPPORTED_ASSET_FOR_SWAPOUT + "", E.THORNODE_QUOTE_GENERIC_ERROR + "", E.INVALID_SOURCE_ADDRESS + "", E.INVALID_DESTINATION_ADDRESS + "", E.NOT_ENOUGH_SYNTH_BALANCE + "", E.SYNTH_MINTING_CAP_REACHED + "", E.INVALID_QUOTE_MODE + "", E.NO_QUOTES + "", E.SERVICE_UNAVAILABLE_GENERIC + "", E.MISSING_GAS_DATA_GENERIC + "", E.MISSING_TOKEN_INFO_GENERIC + "", E.CANT_FIND_TOKEN_LIST + "", E.NO_PRICE + "", E.PRICE_IS_STALE + "", E.ADDRESS_NOT_WHITELISTED + "", E.ADDRESS_ALREADY_CLAIMED + ""; | ||
var S = /* @__PURE__ */ ((_) => (_.Arbitrum = "ARB", _.Avalanche = "AVAX", _.Binance = "BNB", _.BinanceSmartChain = "BSC", _.Bitcoin = "BTC", _.BitcoinCash = "BCH", _.Cosmos = "GAIA", _.Dogecoin = "DOGE", _.Ethereum = "ETH", _.Litecoin = "LTC", _.Optimism = "OP", _.Polygon = "MATIC", _.THORChain = "THOR", _))(S || {}), N = /* @__PURE__ */ ((_) => (_.Arbitrum = "42161", _.ArbitrumHex = "0xa4b1", _.Avalanche = "43114", _.AvalancheHex = "0xa86a", _.Binance = "Binance-Chain-Tigris", _.BinanceHex = "", _.BinanceSmartChain = "56", _.BinanceSmartChainHex = "0x38", _.Bitcoin = "bitcoin", _.BitcoinHex = "", _.BitcoinCash = "bitcoincash", _.BitcoinCashHex = "", _.Cosmos = "cosmoshub-4", _.CosmosHex = "", _.Dogecoin = "dogecoin", _.DogecoinHex = "", _.Ethereum = "1", _.EthereumHex = "0x1", _.Litecoin = "litecoin", _.LitecoinHex = "", _.Optimism = "10", _.OptimismHex = "0xa", _.Polygon = "137", _.PolygonHex = "0x89", _.THORChain = "thorchain-mainnet-v1", _.THORChainHex = "", _.THORChainStagenet = "thorchain-stagenet-v2", _))(N || {}), e = /* @__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", _.Optimism = "https://mainnet.optimism.io", _.Polygon = "https://polygon-rpc.com", _.THORChain = "https://rpc.thorswap.net", _.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", _))(e || {}); | ||
const i = Object.values(S), C = Object.keys(S), o = i.reduce( | ||
(_, t) => { | ||
const n = C.find((A) => i[A] === t); | ||
const n = C.find((A) => S[A] === t); | ||
return n && (_[t] = n), _; | ||
@@ -12,12 +12,12 @@ }, | ||
); | ||
S.reduce( | ||
(_, t) => (_[t] = o[N[t]], _), | ||
i.reduce( | ||
(_, t) => (_[t] = N[o[t]], _), | ||
{} | ||
); | ||
S.reduce( | ||
(_, t) => (_[t] = e[N[t]], _), | ||
i.reduce( | ||
(_, t) => (_[t] = e[o[t]], _), | ||
{} | ||
); | ||
S.reduce( | ||
(_, t) => (_[t] = o[`${N[t]}Hex`], _), | ||
i.reduce( | ||
(_, t) => (_[t] = N[`${o[t]}Hex`], _), | ||
{} | ||
@@ -37,10 +37,10 @@ ); | ||
} | ||
}, P = ({ | ||
}, L = ({ | ||
addChain: _, | ||
config: { covalentApiKey: t, ethplorerApiKey: n } | ||
}) => async (A, a = I.METAMASK) => { | ||
const O = A.map(async (R) => { | ||
const { getWeb3WalletMethods: D } = await import("@thorswap-lib/toolbox-evm"), s = new d(T(a), "any"); | ||
const D = A.map(async (R) => { | ||
const { getWeb3WalletMethods: O } = await import("@thorswap-lib/toolbox-evm"), s = new d(T(a), "any"); | ||
await s.send("eth_requestAccounts", []); | ||
const r = await s.getSigner().getAddress(), c = await D({ | ||
const r = await s.getSigner().getAddress(), c = await O({ | ||
chain: R, | ||
@@ -57,9 +57,9 @@ ethplorerApiKey: n, | ||
}); | ||
return await Promise.all(O), !0; | ||
}, B = { | ||
return await Promise.all(D), !0; | ||
}, U = { | ||
connectMethodName: "connectEVMWallet", | ||
connect: P | ||
connect: L | ||
}; | ||
export { | ||
B as evmWallet | ||
U as evmWallet | ||
}; |
{ | ||
"author": "thorswap", | ||
"dependencies": { | ||
"@thorswap-lib/types": "1.0.0-development.107" | ||
"@thorswap-lib/types": "1.0.0-development.108" | ||
}, | ||
@@ -14,3 +14,3 @@ "description": "THORSwap Lib evm-web3-wallets", | ||
"@internal/config": "0.0.1-development.3", | ||
"@thorswap-lib/toolbox-evm": "1.0.0-development.169" | ||
"@thorswap-lib/toolbox-evm": "1.0.0-development.170" | ||
}, | ||
@@ -39,3 +39,3 @@ "eslintConfig": { | ||
"@ethersproject/providers": "^5.7.0", | ||
"@thorswap-lib/toolbox-evm": "1.0.0-development.169" | ||
"@thorswap-lib/toolbox-evm": "1.0.0-development.170" | ||
}, | ||
@@ -49,3 +49,3 @@ "publishConfig": { | ||
"types": "./dist/index.d.ts", | ||
"version": "1.0.0-development.47", | ||
"version": "1.0.0-development.48", | ||
"scripts": { | ||
@@ -52,0 +52,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
28596
+ Added@thorswap-lib/helpers@0.0.0-development.115(transitive)
+ Added@thorswap-lib/swapkit-entities@1.0.0-development.123(transitive)
+ Added@thorswap-lib/toolbox-evm@1.0.0-development.170(transitive)
- Removed@thorswap-lib/helpers@0.0.0-development.114(transitive)
- Removed@thorswap-lib/swapkit-entities@1.0.0-development.122(transitive)
- Removed@thorswap-lib/toolbox-evm@1.0.0-development.169(transitive)