@thorswap-lib/types
Advanced tools
Comparing version 1.0.0-development.93 to 1.0.0-development.94
@@ -101,2 +101,4 @@ import { BigNumber } from '@ethersproject/bignumber'; | ||
LTC = 8, | ||
MATIC = 18, | ||
OP = 18, | ||
THOR = 8 | ||
@@ -125,5 +127,7 @@ } | ||
Cosmos = "GAIA", | ||
Doge = "DOGE", | ||
Dogecoin = "DOGE", | ||
Ethereum = "ETH", | ||
Litecoin = "LTC", | ||
Optimism = "OP", | ||
Polygon = "MATIC", | ||
THORChain = "THOR" | ||
@@ -138,13 +142,24 @@ } | ||
Binance = "Binance-Chain-Tigris", | ||
BinanceHex = "", | ||
BinanceSmartChain = "56", | ||
BinanceSmartChainHex = "0x38", | ||
Bitcoin = "bitcoin", | ||
Bitcoincash = "bitcoincash", | ||
BitcoinHex = "", | ||
BitcoinCash = "bitcoincash", | ||
BitcoinCashHex = "", | ||
Cosmos = "cosmoshub-4", | ||
CosmosHex = "", | ||
Dogecoin = "dogecoin", | ||
DogecoinHex = "", | ||
Ethereum = "1", | ||
EthereumHex = "0x1", | ||
Litecoin = "litecoin", | ||
Thorchain = "thorchain-mainnet-v1", | ||
ThorchainStagenet = "thorchain-stagenet-v2" | ||
LitecoinHex = "", | ||
Optimism = "10", | ||
OptimismHex = "0xa", | ||
Polygon = "137", | ||
PolygonHex = "0x89", | ||
THORChain = "thorchain-mainnet-v1", | ||
THORChainHex = "", | ||
THORChainStagenet = "thorchain-stagenet-v2" | ||
} | ||
@@ -154,16 +169,50 @@ | ||
export declare const ChainToChainId: Record<Chain, ChainId>; | ||
export declare const ChainToChainId: { | ||
ARB: ChainId; | ||
AVAX: ChainId; | ||
BNB: ChainId; | ||
BSC: ChainId; | ||
BTC: ChainId; | ||
BCH: ChainId; | ||
GAIA: ChainId; | ||
DOGE: ChainId; | ||
ETH: ChainId; | ||
LTC: ChainId; | ||
OP: ChainId; | ||
MATIC: ChainId; | ||
THOR: ChainId; | ||
}; | ||
export declare const ChainToHexChainId: Record<Chain, ChainId>; | ||
export declare const ChainToExplorerUrl: Record<Chain, string>; | ||
export declare const ChainToHexChainId: { | ||
ARB: ChainId; | ||
AVAX: ChainId; | ||
BNB: ChainId; | ||
BSC: ChainId; | ||
BTC: ChainId; | ||
BCH: ChainId; | ||
GAIA: ChainId; | ||
DOGE: ChainId; | ||
ETH: ChainId; | ||
LTC: ChainId; | ||
OP: ChainId; | ||
MATIC: ChainId; | ||
THOR: ChainId; | ||
}; | ||
export declare const ChainToRPC: { | ||
ARB: RPCUrl; | ||
AVAX: RPCUrl; | ||
BNB: RPCUrl; | ||
BSC: RPCUrl; | ||
BTC: RPCUrl; | ||
BCH: RPCUrl; | ||
GAIA: RPCUrl; | ||
DOGE: RPCUrl; | ||
ETH: RPCUrl; | ||
GAIA: RPCUrl; | ||
LTC: RPCUrl; | ||
BTC: RPCUrl; | ||
DOGE: RPCUrl; | ||
BCH: RPCUrl; | ||
OP: RPCUrl; | ||
MATIC: RPCUrl; | ||
THOR: RPCUrl; | ||
}; | ||
@@ -204,3 +253,3 @@ | ||
declare type ConnectMethodNames = 'connectXDEFI' | 'connectKeplr' | 'connectTrustwallet' | 'connectWalletconnect' | 'connectKeystore' | 'connectLedger' | 'connectTrezor' | 'connectEVMWallet'; | ||
declare type ConnectMethodNames = 'connectXDEFI' | 'connectKeplr' | 'connectWalletconnect' | 'connectKeystore' | 'connectLedger' | 'connectTrezor' | 'connectEVMWallet'; | ||
@@ -221,2 +270,4 @@ export declare type ConnectWalletParams = { | ||
BSC = "0x0000000000000000000000000000000000000000", | ||
MATIC = "0x0000000000000000000000000000000000001010", | ||
OP = "0x4200000000000000000000000000000000000042", | ||
USDC_SPL_MINT_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", | ||
@@ -253,2 +304,4 @@ USDC_SPL_TESTNET_MINT_ADDRESS = "6TEqT62wq5mbKQPubX9eFeNJRYXRJd79Hk51pZk7nZrB" | ||
LTC = "m/84'/2'/0'/0", | ||
MATIC = "m/44'/60'/0'/0", | ||
OP = "m/44'/60'/0'/0", | ||
THOR = "m/44'/931'/0'/0" | ||
@@ -421,3 +474,3 @@ } | ||
export declare type EVMChain = Chain.Ethereum | Chain.BinanceSmartChain | Chain.Avalanche | Chain.Arbitrum; | ||
export declare type EVMChain = Chain.Ethereum | Chain.BinanceSmartChain | Chain.Avalanche | Chain.Arbitrum | Chain.Optimism | Chain.Polygon; | ||
@@ -506,9 +559,16 @@ declare type EVMChains = Chain.Ethereum | Chain.BinanceSmartChain | Chain.Avalanche | Chain.Arbitrum; | ||
export declare enum MemoType { | ||
BOND = "BOND", | ||
DEPOSIT = "+", | ||
LEAVE = "LEAVE", | ||
THORNAME_REGISTER = "~", | ||
UNBOND = "UNBOND", | ||
UPGRADE = "SWITCH", | ||
WITHDRAW = "-", | ||
OPEN_LOAN = "$+", | ||
CLOSE_LOAN = "$-" | ||
} | ||
export declare const MOCK_PHRASE = "image rally need wedding health address purse army antenna leopard sea gain"; | ||
export declare enum Network { | ||
Mainnet = "mainnet", | ||
Testnet = "testnet" | ||
} | ||
export declare const NetworkDerivationPath: Record<Chain, DerivationPathArray>; | ||
@@ -529,9 +589,13 @@ | ||
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", | ||
Bitcoin = "https://node-router.thorswap.net/bitcoin", | ||
Dogecoin = "https://node-router.thorswap.net/dogecoin", | ||
BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash" | ||
Optimism = "https://mainnet.optimism.io", | ||
Polygon = "https://polygon-rpc.com", | ||
THORChain = "https://rpc.thorswap.net" | ||
} | ||
@@ -548,4 +612,2 @@ | ||
export declare const SUPPORTED_CHAINS: readonly [Chain.THORChain, Chain.Arbitrum, Chain.Avalanche, Chain.Bitcoin, Chain.Ethereum, Chain.Binance, Chain.BinanceSmartChain, Chain.Cosmos, Chain.Doge, Chain.BitcoinCash, Chain.Litecoin]; | ||
export declare const TCAvalancheDepositABI: ({ | ||
@@ -735,3 +797,3 @@ inputs: never[]; | ||
declare type UTXOChains = Chain.Bitcoin | Chain.Litecoin | Chain.Doge | Chain.BitcoinCash; | ||
declare type UTXOChains = Chain.Bitcoin | Chain.Litecoin | Chain.Dogecoin | Chain.BitcoinCash; | ||
@@ -744,3 +806,2 @@ export declare enum WalletOption { | ||
'TREZOR' = "TREZOR", | ||
'TRUSTWALLET' = "TRUSTWALLET", | ||
'TRUSTWALLET_WEB' = "TRUSTWALLET_WEB", | ||
@@ -747,0 +808,0 @@ 'LEDGER' = "LEDGER", |
@@ -1,5 +0,5 @@ | ||
var S = Object.defineProperty; | ||
var _ = (e, a, n) => a in e ? S(e, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[a] = n; | ||
var s = (e, a, n) => (_(e, typeof a != "symbol" ? a + "" : a, n), n); | ||
const U = [ | ||
var V = Object.defineProperty; | ||
var h = (e, n, a) => n in e ? V(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a; | ||
var s = (e, n, a) => (h(e, typeof n != "symbol" ? n + "" : n, a), a); | ||
const X = [ | ||
{ inputs: [], stateMutability: "nonpayable", type: "constructor" }, | ||
@@ -102,3 +102,3 @@ { | ||
} | ||
], w = [ | ||
], W = [ | ||
{ | ||
@@ -278,3 +278,3 @@ inputs: [{ internalType: "address", name: "rune", type: "address" }], | ||
} | ||
], F = [ | ||
], K = [ | ||
{ inputs: [], stateMutability: "nonpayable", type: "constructor" }, | ||
@@ -444,4 +444,4 @@ { | ||
]; | ||
var E = /* @__PURE__ */ ((e) => (e.Base = "BASE", e.Asset = "ASSET", e))(E || {}), c = /* @__PURE__ */ ((e) => (e.THOR = "THOR", e.RUNE = "RUNE", e["RUNE-67C"] = "RUNE-67C", e["RUNE-B1A"] = "RUNE-B1A", e.ATOM = "ATOM", e.MUON = "MUON", e.USDC = "USDC", e))(c || {}), o = /* @__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))(o || {}), f = /* @__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))(f || {}), t = /* @__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.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.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))(t || {}); | ||
const h = { | ||
var g = /* @__PURE__ */ ((e) => (e.Base = "BASE", e.Asset = "ASSET", e))(g || {}), P = /* @__PURE__ */ ((e) => (e.THOR = "THOR", e.RUNE = "RUNE", e["RUNE-67C"] = "RUNE-67C", e["RUNE-B1A"] = "RUNE-B1A", e.ATOM = "ATOM", e.MUON = "MUON", e.USDC = "USDC", e))(P || {}), m = /* @__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))(m || {}), O = /* @__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))(O || {}), t = /* @__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.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.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))(t || {}); | ||
const B = { | ||
[t.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.", | ||
@@ -495,17 +495,17 @@ [t.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.", | ||
[t.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop." | ||
}, p = (e, a) => { | ||
let n = h[e]; | ||
for (let r = 0; r < a.length; r++) | ||
n = n.replace(`{${r}}`, a[r]); | ||
return a.length === 0 ? n.replace("{0}", "") : n; | ||
}, o = (e, n) => { | ||
let a = B[e]; | ||
for (let r = 0; r < n.length; r++) | ||
a = a.replace(`{${r}}`, n[r]); | ||
return n.length === 0 ? a.replace("{0}", "") : a; | ||
}; | ||
class T extends Error { | ||
class A extends Error { | ||
constructor({ | ||
status: n, | ||
status: a, | ||
revision: r, | ||
module: y, | ||
code: i, | ||
message: l, | ||
type: A, | ||
options: { shouldLog: m, shouldThrow: I, shouldTrace: N } = { | ||
module: N, | ||
code: d, | ||
message: S, | ||
type: _, | ||
options: { shouldLog: E, shouldThrow: c, shouldTrace: f } = { | ||
shouldLog: !0, | ||
@@ -515,6 +515,6 @@ shouldThrow: !0, | ||
}, | ||
displayMessageParams: d | ||
displayMessageParams: u | ||
}) { | ||
const u = l || p(i, d || []) || ""; | ||
super(u); | ||
const l = S || o(d, u || []) || ""; | ||
super(l); | ||
s(this, "status"); | ||
@@ -530,10 +530,10 @@ s(this, "revision"); | ||
s(this, "displayMessageParams"); | ||
this.status = n, this.revision = r || "NO_REVISION", this.module = y, this.message = u, this.display = p(i, d || []), this.code = i, this.type = A || o.UNHANDLED_ERROR, this.options = { | ||
shouldLog: m || !0, | ||
shouldTrace: N || !0, | ||
shouldThrow: I || !1 | ||
}, this.displayMessageParams = d || [], this.options.shouldTrace && Error.captureStackTrace(this); | ||
this.status = a, this.revision = r || "NO_REVISION", this.module = N, this.message = l, this.display = o(d, u || []), this.code = d, this.type = _ || m.UNHANDLED_ERROR, this.options = { | ||
shouldLog: E || !0, | ||
shouldTrace: f || !0, | ||
shouldThrow: c || !1 | ||
}, this.displayMessageParams = u || [], this.options.shouldTrace && Error.captureStackTrace(this); | ||
} | ||
static fromErrorInfo(n) { | ||
return new T(n); | ||
static fromErrorInfo(a) { | ||
return new A(a); | ||
} | ||
@@ -547,29 +547,14 @@ toErrorInfo() { | ||
get displayMessage() { | ||
return p(this.code, this.displayMessageParams || []); | ||
return o(this.code, this.displayMessageParams || []); | ||
} | ||
handle() { | ||
const n = `[${this.identifier}]: ${this.message}`; | ||
if (this.options.shouldLog && console.error(n, ` | ||
const a = `[${this.identifier}]: ${this.message}`; | ||
if (this.options.shouldLog && console.error(a, ` | ||
`, this.stack || ""), this.options.shouldThrow) | ||
throw Error(n, { cause: this.stack }); | ||
throw Error(a, { cause: this.stack }); | ||
return this.toErrorInfo(); | ||
} | ||
} | ||
var B = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Doge = "DOGE", e.Ethereum = "ETH", e.Litecoin = "LTC", e.THORChain = "THOR", e))(B || {}); | ||
const X = [ | ||
"THOR", | ||
"ARB", | ||
"AVAX", | ||
"BTC", | ||
"ETH", | ||
"BNB", | ||
"BSC", | ||
"GAIA", | ||
"DOGE", | ||
"BCH", | ||
"LTC" | ||
/* Litecoin */ | ||
]; | ||
var V = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.USDC_SPL_MINT_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", e.USDC_SPL_TESTNET_MINT_ADDRESS = "6TEqT62wq5mbKQPubX9eFeNJRYXRJd79Hk51pZk7nZrB", e))(V || {}), g = /* @__PURE__ */ ((e) => (e.Mainnet = "mainnet", e.Testnet = "testnet", e))(g || {}), b = /* @__PURE__ */ ((e) => (e[e.Ethereum = 60] = "Ethereum", e[e.Binance = 714] = "Binance", e[e.THORChain = 931] = "THORChain", e))(b || {}), P = /* @__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.LTC = "m/84'/2'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(P || {}); | ||
const K = { | ||
var i = /* @__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.Litecoin = "LTC", e.Optimism = "OP", e.Polygon = "MATIC", e.THORChain = "THOR", e))(i || {}), H = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e.USDC_SPL_MINT_ADDRESS = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", e.USDC_SPL_TESTNET_MINT_ADDRESS = "6TEqT62wq5mbKQPubX9eFeNJRYXRJd79Hk51pZk7nZrB", e))(H || {}), b = /* @__PURE__ */ ((e) => (e[e.Ethereum = 60] = "Ethereum", e[e.Binance = 714] = "Binance", e[e.THORChain = 931] = "THORChain", e))(b || {}), L = /* @__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.LTC = "m/84'/2'/0'/0", e.MATIC = "m/44'/60'/0'/0", e.OP = "m/44'/60'/0'/0", e.THOR = "m/44'/931'/0'/0", e))(L || {}); | ||
const Y = { | ||
ARB: [44, 60, 0, 0, 0], | ||
@@ -585,43 +570,11 @@ AVAX: [44, 60, 0, 0, 0], | ||
LTC: [84, 2, 0, 0, 0], | ||
MATIC: [44, 60, 0, 0, 0], | ||
OP: [44, 60, 0, 0, 0], | ||
THOR: [44, 931, 0, 0, 0] | ||
}; | ||
var L = /* @__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.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.GAIA = 6] = "GAIA", e[e.LTC = 8] = "LTC", e[e.THOR = 8] = "THOR", e))(L || {}), H = /* @__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.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Thorchain = "thorchain-mainnet-v1", e.ThorchainStagenet = "thorchain-stagenet-v2", e))(H || {}), v = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e))(v || {}), D = /* @__PURE__ */ ((e) => (e.Thorswap = "https://api.thorswap.finance", e))(D || {}); | ||
const W = { | ||
ARB: "https://arb1.arbitrum.io/rpc", | ||
AVAX: "https://node-router.thorswap.net/avalanche-c", | ||
BSC: "https://bsc-dataseed.binance.org", | ||
ETH: "https://node-router.thorswap.net/ethereum", | ||
GAIA: "https://node-router.thorswap.net/cosmos/rpc", | ||
LTC: "https://node-router.thorswap.net/litecoin", | ||
BTC: "https://node-router.thorswap.net/bitcoin", | ||
DOGE: "https://node-router.thorswap.net/dogecoin", | ||
BCH: "https://node-router.thorswap.net/bitcoin-cash" | ||
/* BitcoinCash */ | ||
}, Y = { | ||
ARB: "42161", | ||
AVAX: "43114", | ||
BNB: "Binance-Chain-Tigris", | ||
BSC: "56", | ||
BTC: "bitcoin", | ||
BCH: "bitcoincash", | ||
GAIA: "cosmoshub-4", | ||
DOGE: "dogecoin", | ||
ETH: "1", | ||
LTC: "litecoin", | ||
THOR: "thorchain-mainnet-v1" | ||
/* Thorchain */ | ||
}, Q = { | ||
ARB: "0xa4b1", | ||
AVAX: "0xa86a", | ||
BNB: "Binance-Chain-Tigris", | ||
BSC: "0x38", | ||
BTC: "bitcoin", | ||
BCH: "bitcoincash", | ||
GAIA: "cosmoshub-4", | ||
DOGE: "dogecoin", | ||
ETH: "0x1", | ||
LTC: "litecoin", | ||
THOR: "thorchain-mainnet-v1" | ||
/* Thorchain */ | ||
}, q = { | ||
var x = /* @__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.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.GAIA = 6] = "GAIA", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.OP = 18] = "OP", e[e.THOR = 8] = "THOR", e))(x || {}), T = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Binance = "Binance-Chain-Tigris", e.BinanceHex = "", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinHex = "", e.BitcoinCash = "bitcoincash", e.BitcoinCashHex = "", e.Cosmos = "cosmoshub-4", e.CosmosHex = "", e.Dogecoin = "dogecoin", e.DogecoinHex = "", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.LitecoinHex = "", e.Optimism = "10", e.OptimismHex = "0xa", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainHex = "", e.THORChainStagenet = "thorchain-stagenet-v2", e))(T || {}), I = /* @__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.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Optimism = "https://mainnet.optimism.io", e.Polygon = "https://polygon-rpc.com", e.THORChain = "https://rpc.thorswap.net", e))(I || {}), v = /* @__PURE__ */ ((e) => (e.Thorswap = "https://api.thorswap.finance", e))(v || {}); | ||
const D = Object.keys(i), p = Object.values(i), y = p.reduce((e, n) => { | ||
const a = D.find((r) => i[r] === n); | ||
return a && (e[n] = a), e; | ||
}, {}), k = p.reduce((e, n) => (e[n] = T[y[n]], e), {}), Q = p.reduce((e, n) => (e[n] = I[y[n]], e), {}), q = p.reduce((e, n) => (e[n] = T[`${y[n]}Hex`], e), {}), $ = { | ||
[ | ||
@@ -673,45 +626,79 @@ 42161 | ||
"thorchain-mainnet-v1" | ||
/* Thorchain */ | ||
/* THORChain */ | ||
]: "THOR", | ||
[ | ||
"" | ||
/* THORChainHex */ | ||
]: "THOR", | ||
[ | ||
"thorchain-stagenet-v2" | ||
/* ThorchainStagenet */ | ||
]: "THOR" | ||
/* THORChain */ | ||
/* THORChainStagenet */ | ||
]: "THOR", | ||
[ | ||
10 | ||
/* Optimism */ | ||
]: "OP", | ||
[ | ||
"0xa" | ||
/* OptimismHex */ | ||
]: "OP", | ||
[ | ||
137 | ||
/* Polygon */ | ||
]: "MATIC", | ||
[ | ||
"0x89" | ||
/* PolygonHex */ | ||
]: "MATIC" | ||
/* Polygon */ | ||
}, Z = { | ||
ARB: "https://arbiscan.io", | ||
AVAX: "https://snowtrace.io", | ||
BSC: "https://bscscan.com", | ||
BNB: "https://explorer.binance.org", | ||
BCH: "https://www.blockchain.com/bch", | ||
BTC: "https://blockstream.info", | ||
GAIA: "https://cosmos.bigdipper.live", | ||
DOGE: "https://blockchair.com/dogecoin", | ||
ETH: "https://etherscan.io", | ||
LTC: "https://ltc.bitaps.com", | ||
OP: "https://optimistic.etherscan.io", | ||
MATIC: "https://polygonscan.com", | ||
THOR: "https://viewblock.io/thorchain" | ||
}; | ||
var x = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(x || {}); | ||
const k = "image rally need wedding health address purse army antenna leopard sea gain"; | ||
var C = /* @__PURE__ */ ((e) => (e[e.NotInstalled = 0] = "NotInstalled", e[e.Detected = 1] = "Detected", e))(C || {}), O = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(O || {}), M = /* @__PURE__ */ ((e) => (e.FlatFee = "base", e.PerByte = "byte", e))(M || {}), G = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET = "TRUSTWALLET", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(G || {}); | ||
var M = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(M || {}), C = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.UPGRADE = "SWITCH", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(C || {}); | ||
const J = "image rally need wedding health address purse army antenna leopard sea gain"; | ||
var G = /* @__PURE__ */ ((e) => (e[e.NotInstalled = 0] = "NotInstalled", e[e.Detected = 1] = "Detected", e))(G || {}), R = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(R || {}), U = /* @__PURE__ */ ((e) => (e.FlatFee = "base", e.PerByte = "byte", e))(U || {}), w = /* @__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.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(w || {}); | ||
export { | ||
T as ApiError, | ||
D as ApiUrl, | ||
c as AssetSymbol, | ||
L as BaseDecimal, | ||
B as Chain, | ||
H as ChainId, | ||
q as ChainIdToChain, | ||
Y as ChainToChainId, | ||
Q as ChainToHexChainId, | ||
W as ChainToRPC, | ||
V as ContractAddress, | ||
E as Denomination, | ||
P as DerivationPath, | ||
A as ApiError, | ||
v as ApiUrl, | ||
P as AssetSymbol, | ||
x as BaseDecimal, | ||
i as Chain, | ||
T as ChainId, | ||
$ as ChainIdToChain, | ||
k as ChainToChainId, | ||
Z as ChainToExplorerUrl, | ||
q as ChainToHexChainId, | ||
Q as ChainToRPC, | ||
H as ContractAddress, | ||
g as Denomination, | ||
L as DerivationPath, | ||
t as ERROR_CODE, | ||
f as ERROR_MODULE, | ||
o as ERROR_TYPE, | ||
x as ErrorCode, | ||
O as FeeOption, | ||
M as FeeType, | ||
k as MOCK_PHRASE, | ||
g as Network, | ||
K as NetworkDerivationPath, | ||
O as ERROR_MODULE, | ||
m as ERROR_TYPE, | ||
M as ErrorCode, | ||
R as FeeOption, | ||
U as FeeType, | ||
J as MOCK_PHRASE, | ||
C as MemoType, | ||
Y as NetworkDerivationPath, | ||
b as NetworkId, | ||
v as RPCUrl, | ||
X as SUPPORTED_CHAINS, | ||
F as TCAvalancheDepositABI, | ||
w as TCEthereumVaultAbi, | ||
G as WalletOption, | ||
C as WalletStatus, | ||
U as erc20ABI | ||
I as RPCUrl, | ||
K as TCAvalancheDepositABI, | ||
W as TCEthereumVaultAbi, | ||
w as WalletOption, | ||
G as WalletStatus, | ||
X as erc20ABI | ||
}; | ||
//# sourceMappingURL=index.es.js.map |
@@ -36,6 +36,6 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "1.0.0-development.93", | ||
"version": "1.0.0-development.94", | ||
"scripts": { | ||
"build": "echo 'Build types 🛠'; vite build && echo 'Build succeeded types ✅'", | ||
"clean": "rm -rf dist .turbo", | ||
"clean": "rm -rf dist .turbo node_modules", | ||
"lint": "eslint ./ --ext .ts,.tsx --fix; tsc --noEmit", | ||
@@ -42,0 +42,0 @@ "test": "echo 'No tests yet'" |
@@ -6,3 +6,3 @@ import { FixedNumber } from '@ethersproject/bignumber'; | ||
type UTXOChains = Chain.Bitcoin | Chain.Litecoin | Chain.Doge | Chain.BitcoinCash; | ||
type UTXOChains = Chain.Bitcoin | Chain.Litecoin | Chain.Dogecoin | Chain.BitcoinCash; | ||
type EVMChains = Chain.Ethereum | Chain.BinanceSmartChain | Chain.Avalanche | Chain.Arbitrum; | ||
@@ -13,3 +13,2 @@ | ||
| 'connectKeplr' | ||
| 'connectTrustwallet' | ||
| 'connectWalletconnect' | ||
@@ -16,0 +15,0 @@ | 'connectKeystore' |
@@ -9,22 +9,10 @@ export enum Chain { | ||
Cosmos = 'GAIA', | ||
Doge = 'DOGE', | ||
Dogecoin = 'DOGE', | ||
Ethereum = 'ETH', | ||
Litecoin = 'LTC', | ||
Optimism = 'OP', | ||
Polygon = 'MATIC', | ||
THORChain = 'THOR', | ||
} | ||
export const SUPPORTED_CHAINS = [ | ||
Chain.THORChain, | ||
Chain.Arbitrum, | ||
Chain.Avalanche, | ||
Chain.Bitcoin, | ||
Chain.Ethereum, | ||
Chain.Binance, | ||
Chain.BinanceSmartChain, | ||
Chain.Cosmos, | ||
Chain.Doge, | ||
Chain.BitcoinCash, | ||
Chain.Litecoin, | ||
] as const; | ||
export enum ContractAddress { | ||
@@ -35,2 +23,4 @@ ARB = '0x0000000000000000000000000000000000000000', | ||
BSC = '0x0000000000000000000000000000000000000000', | ||
MATIC = '0x0000000000000000000000000000000000001010', | ||
OP = '0x4200000000000000000000000000000000000042', | ||
USDC_SPL_MINT_ADDRESS = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', | ||
@@ -40,7 +30,2 @@ USDC_SPL_TESTNET_MINT_ADDRESS = '6TEqT62wq5mbKQPubX9eFeNJRYXRJd79Hk51pZk7nZrB', | ||
export enum Network { | ||
Mainnet = 'mainnet', | ||
Testnet = 'testnet', | ||
} | ||
export enum NetworkId { | ||
@@ -63,2 +48,4 @@ Ethereum = 60, | ||
LTC = "m/84'/2'/0'/0", | ||
MATIC = "m/44'/60'/0'/0", | ||
OP = "m/44'/60'/0'/0", | ||
THOR = "m/44'/931'/0'/0", | ||
@@ -80,2 +67,4 @@ } | ||
LTC: [84, 2, 0, 0, 0], | ||
MATIC: [44, 60, 0, 0, 0], | ||
OP: [44, 60, 0, 0, 0], | ||
THOR: [44, 931, 0, 0, 0], | ||
@@ -95,6 +84,14 @@ }; | ||
LTC = 8, | ||
MATIC = 18, | ||
OP = 18, | ||
THOR = 8, | ||
} | ||
export type EVMChain = Chain.Ethereum | Chain.BinanceSmartChain | Chain.Avalanche | Chain.Arbitrum; | ||
export type EVMChain = | ||
| Chain.Ethereum | ||
| Chain.BinanceSmartChain | ||
| Chain.Avalanche | ||
| Chain.Arbitrum | ||
| Chain.Optimism | ||
| Chain.Polygon; | ||
@@ -107,13 +104,24 @@ export enum ChainId { | ||
Binance = 'Binance-Chain-Tigris', | ||
BinanceHex = '', | ||
BinanceSmartChain = '56', | ||
BinanceSmartChainHex = '0x38', | ||
Bitcoin = 'bitcoin', | ||
Bitcoincash = 'bitcoincash', | ||
BitcoinHex = '', | ||
BitcoinCash = 'bitcoincash', | ||
BitcoinCashHex = '', | ||
Cosmos = 'cosmoshub-4', | ||
CosmosHex = '', | ||
Dogecoin = 'dogecoin', | ||
DogecoinHex = '', | ||
Ethereum = '1', | ||
EthereumHex = '0x1', | ||
Litecoin = 'litecoin', | ||
Thorchain = 'thorchain-mainnet-v1', | ||
ThorchainStagenet = 'thorchain-stagenet-v2', | ||
LitecoinHex = '', | ||
Optimism = '10', | ||
OptimismHex = '0xa', | ||
Polygon = '137', | ||
PolygonHex = '0x89', | ||
THORChain = 'thorchain-mainnet-v1', | ||
THORChainHex = '', | ||
THORChainStagenet = 'thorchain-stagenet-v2', | ||
} | ||
@@ -124,9 +132,13 @@ | ||
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', | ||
Bitcoin = 'https://node-router.thorswap.net/bitcoin', | ||
Dogecoin = 'https://node-router.thorswap.net/dogecoin', | ||
BitcoinCash = 'https://node-router.thorswap.net/bitcoin-cash', | ||
Optimism = 'https://mainnet.optimism.io', | ||
Polygon = 'https://polygon-rpc.com', | ||
THORChain = 'https://rpc.thorswap.net', | ||
} | ||
@@ -138,42 +150,30 @@ | ||
export const ChainToRPC = { | ||
[Chain.Arbitrum]: RPCUrl.Arbitrum, | ||
[Chain.Avalanche]: RPCUrl.Avalanche, | ||
[Chain.BinanceSmartChain]: RPCUrl.BinanceSmartChain, | ||
[Chain.Ethereum]: RPCUrl.Ethereum, | ||
[Chain.Cosmos]: RPCUrl.Cosmos, | ||
[Chain.Litecoin]: RPCUrl.Litecoin, | ||
[Chain.Bitcoin]: RPCUrl.Bitcoin, | ||
[Chain.Doge]: RPCUrl.Dogecoin, | ||
[Chain.BitcoinCash]: RPCUrl.BitcoinCash, | ||
}; | ||
type ChainNameType = keyof typeof Chain; | ||
export const ChainToChainId: Record<Chain, ChainId> = { | ||
[Chain.Arbitrum]: ChainId.Arbitrum, | ||
[Chain.Avalanche]: ChainId.Avalanche, | ||
[Chain.Binance]: ChainId.Binance, | ||
[Chain.BinanceSmartChain]: ChainId.BinanceSmartChain, | ||
[Chain.Bitcoin]: ChainId.Bitcoin, | ||
[Chain.BitcoinCash]: ChainId.Bitcoincash, | ||
[Chain.Cosmos]: ChainId.Cosmos, | ||
[Chain.Doge]: ChainId.Dogecoin, | ||
[Chain.Ethereum]: ChainId.Ethereum, | ||
[Chain.Litecoin]: ChainId.Litecoin, | ||
[Chain.THORChain]: ChainId.Thorchain, | ||
}; | ||
const chainNames = Object.keys(Chain) as ChainNameType[]; | ||
const chains = Object.values(Chain) as Chain[]; | ||
export const ChainToHexChainId: Record<Chain, ChainId> = { | ||
[Chain.Arbitrum]: ChainId.ArbitrumHex, | ||
[Chain.Avalanche]: ChainId.AvalancheHex, | ||
[Chain.Binance]: ChainId.Binance, | ||
[Chain.BinanceSmartChain]: ChainId.BinanceSmartChainHex, | ||
[Chain.Bitcoin]: ChainId.Bitcoin, | ||
[Chain.BitcoinCash]: ChainId.Bitcoincash, | ||
[Chain.Cosmos]: ChainId.Cosmos, | ||
[Chain.Doge]: ChainId.Dogecoin, | ||
[Chain.Ethereum]: ChainId.EthereumHex, | ||
[Chain.Litecoin]: ChainId.Litecoin, | ||
[Chain.THORChain]: ChainId.Thorchain, | ||
}; | ||
const ChainToChainName = chains.reduce((acc, chain) => { | ||
const chainName = chainNames.find((key) => Chain[key as ChainNameType] === chain); | ||
if (chainName) acc[chain] = chainName; | ||
return acc; | ||
}, {} as { [key in Chain]: ChainNameType }); | ||
export const ChainToChainId = chains.reduce((acc, chain) => { | ||
acc[chain] = ChainId[ChainToChainName[chain]]; | ||
return acc; | ||
}, {} as { [key in Chain]: ChainId }); | ||
export const ChainToRPC = chains.reduce((acc, chain) => { | ||
acc[chain] = RPCUrl[ChainToChainName[chain]]; | ||
return acc; | ||
}, {} as { [key in Chain]: RPCUrl }); | ||
export const ChainToHexChainId = chains.reduce((acc, chain) => { | ||
acc[chain] = ChainId[`${ChainToChainName[chain]}Hex`]; | ||
return acc; | ||
}, {} as { [key in Chain]: ChainId }); | ||
export const ChainIdToChain: Record<ChainId, Chain> = { | ||
@@ -188,10 +188,31 @@ [ChainId.Arbitrum]: Chain.Arbitrum, | ||
[ChainId.Bitcoin]: Chain.Bitcoin, | ||
[ChainId.Bitcoincash]: Chain.BitcoinCash, | ||
[ChainId.BitcoinCash]: Chain.BitcoinCash, | ||
[ChainId.Cosmos]: Chain.Cosmos, | ||
[ChainId.Dogecoin]: Chain.Doge, | ||
[ChainId.Dogecoin]: Chain.Dogecoin, | ||
[ChainId.EthereumHex]: Chain.Ethereum, | ||
[ChainId.Ethereum]: Chain.Ethereum, | ||
[ChainId.Litecoin]: Chain.Litecoin, | ||
[ChainId.Thorchain]: Chain.THORChain, | ||
[ChainId.ThorchainStagenet]: Chain.THORChain, | ||
[ChainId.THORChain]: Chain.THORChain, | ||
[ChainId.THORChainHex]: Chain.THORChain, | ||
[ChainId.THORChainStagenet]: Chain.THORChain, | ||
[ChainId.Optimism]: Chain.Optimism, | ||
[ChainId.OptimismHex]: Chain.Optimism, | ||
[ChainId.Polygon]: Chain.Polygon, | ||
[ChainId.PolygonHex]: Chain.Polygon, | ||
}; | ||
export const ChainToExplorerUrl: Record<Chain, string> = { | ||
[Chain.Arbitrum]: 'https://arbiscan.io', | ||
[Chain.Avalanche]: 'https://snowtrace.io', | ||
[Chain.BinanceSmartChain]: 'https://bscscan.com', | ||
[Chain.Binance]: 'https://explorer.binance.org', | ||
[Chain.BitcoinCash]: 'https://www.blockchain.com/bch', | ||
[Chain.Bitcoin]: 'https://blockstream.info', | ||
[Chain.Cosmos]: 'https://cosmos.bigdipper.live', | ||
[Chain.Dogecoin]: 'https://blockchair.com/dogecoin', | ||
[Chain.Ethereum]: 'https://etherscan.io', | ||
[Chain.Litecoin]: 'https://ltc.bitaps.com', | ||
[Chain.Optimism]: 'https://optimistic.etherscan.io', | ||
[Chain.Polygon]: 'https://polygonscan.com', | ||
[Chain.THORChain]: 'https://viewblock.io/thorchain', | ||
}; |
@@ -20,1 +20,13 @@ export type GetAddressAndPubKeyResponse = { | ||
} | ||
export enum MemoType { | ||
BOND = 'BOND', | ||
DEPOSIT = '+', | ||
LEAVE = 'LEAVE', | ||
THORNAME_REGISTER = '~', | ||
UNBOND = 'UNBOND', | ||
UPGRADE = 'SWITCH', | ||
WITHDRAW = '-', | ||
OPEN_LOAN = '$+', | ||
CLOSE_LOAN = '$-', | ||
} |
@@ -39,3 +39,2 @@ import { AmountWithBaseDenom } from './amount.js'; | ||
'TREZOR' = 'TREZOR', | ||
'TRUSTWALLET' = 'TRUSTWALLET', | ||
'TRUSTWALLET_WEB' = 'TRUSTWALLET_WEB', | ||
@@ -42,0 +41,0 @@ 'LEDGER' = 'LEDGER', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
259191
2844