Socket
Socket
Sign inDemoInstall

@thorswap-lib/types

Package Overview
Dependencies
Maintainers
3
Versions
192
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thorswap-lib/types - npm Package Compare versions

Comparing version 1.0.0-development.102 to 1.0.0

44

dist/index.d.ts
/// <reference types="node" />
import { BigNumber } from '@ethersproject/bignumber';
import { BigNumberish } from '@ethersproject/bignumber';
import { FixedNumber } from '@ethersproject/bignumber';
import type { BigNumber } from '@ethersproject/bignumber';
import type { BigNumberish } from '@ethersproject/bignumber';
import type { FixedNumber } from '@ethersproject/bignumber';

@@ -13,20 +13,17 @@ export declare type AddChainWalletParams = {

export declare type AmountWithAssetDenom = AmountWithDenom<Denomination.Asset, FixedNumber>;
export declare type AmountWithBaseDenom = AmountWithDenom<BigNumber>;
export declare type AmountWithBaseDenom = AmountWithDenom<Denomination.Base, BigNumber>;
declare type AmountWithDenom<T, U = BigNumber | FixedNumber> = T extends Denomination ? {
type: T;
declare type AmountWithDenom<U = BigNumber | FixedNumber> = {
amount: () => U;
plus: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
minus: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
times: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
div: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
gt: (value: U | AmountWithDenom<T, U>) => boolean;
gte: (value: U | AmountWithDenom<T, U>) => boolean;
lt: (value: U | AmountWithDenom<T, U>) => boolean;
lte: (value: U | AmountWithDenom<T, U>) => boolean;
eq: (value: U | AmountWithDenom<T, U>) => boolean;
plus: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
minus: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
times: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
div: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
gt: (value: U | AmountWithDenom<U>) => boolean;
gte: (value: U | AmountWithDenom<U>) => boolean;
lt: (value: U | AmountWithDenom<U>) => boolean;
lte: (value: U | AmountWithDenom<U>) => boolean;
eq: (value: U | AmountWithDenom<U>) => boolean;
decimal: number;
} : never;
};

@@ -277,13 +274,2 @@ export declare class ApiError extends Error {

export declare enum Denomination {
/**
* values for asset amounts in base units (no decimal)
*/
Base = "BASE",
/**
* values of asset amounts (w/ decimal)
*/
Asset = "ASSET"
}
export declare type DepositParams = TxParams & {

@@ -290,0 +276,0 @@ router?: string;

var h = Object.defineProperty;
var O = (e, n, a) => n in e ? h(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a;
var s = (e, n, a) => (O(e, typeof n != "symbol" ? n + "" : n, a), a);
const X = [
const F = [
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },

@@ -102,3 +102,3 @@ {

}
], K = [
], X = [
{

@@ -278,3 +278,3 @@ inputs: [{ internalType: "address", name: "rune", type: "address" }],

}
], W = [
], K = [
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },

@@ -444,4 +444,4 @@ {

];
var V = /* @__PURE__ */ ((e) => (e.Base = "BASE", e.Asset = "ASSET", e))(V || {}), P = /* @__PURE__ */ ((e) => (e.THOR = "THOR", e.RUNE = "RUNE", e.ATOM = "ATOM", e.MUON = "MUON", e.USDC = "USDC", e))(P || {}), g = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.ETH_TO_ETH = "ERC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.AVAX_TO_ETH = "ARC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e))(g || {}), A = /* @__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))(A || {}), H = /* @__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))(H || {}), 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.SOURCE_ADDRESS_SMART_CONTRACT = "2011", 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 = {
var V = /* @__PURE__ */ ((e) => (e.THOR = "THOR", e.RUNE = "RUNE", e.ATOM = "ATOM", e.MUON = "MUON", e.USDC = "USDC", e))(V || {}), P = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.ETH_TO_ETH = "ERC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.AVAX_TO_ETH = "ARC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e))(P || {}), A = /* @__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))(A || {}), g = /* @__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))(g || {}), 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.SOURCE_ADDRESS_SMART_CONTRACT = "2011", 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 = {
[t.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",

@@ -495,4 +495,4 @@ [t.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",

[t.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
}, o = (e, n) => {
let a = B[e];
}, T = (e, n) => {
let a = H[e];
for (let r = 0; r < n.length; r++)

@@ -515,5 +515,5 @@ a = a.replace(`{${r}}`, n[r]);

},
displayMessageParams: T
displayMessageParams: o
}) {
const l = _ || o(d, T || []) || "";
const l = _ || T(d, o || []) || "";
super(l);

@@ -530,7 +530,7 @@ s(this, "status");

s(this, "displayMessageParams");
this.status = a, this.revision = r || "NO_REVISION", this.module = N, this.message = l, this.display = o(d, T || []), this.code = d, this.type = S || A.UNHANDLED_ERROR, this.options = {
this.status = a, this.revision = r || "NO_REVISION", this.module = N, this.message = l, this.display = T(d, o || []), this.code = d, this.type = S || A.UNHANDLED_ERROR, this.options = {
shouldLog: E || !0,
shouldTrace: f || !0,
shouldThrow: c || !1
}, this.displayMessageParams = T || [], this.options.shouldTrace && Error.captureStackTrace(this);
}, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
}

@@ -547,3 +547,3 @@ static fromErrorInfo(a) {

get displayMessage() {
return o(this.code, this.displayMessageParams || []);
return T(this.code, this.displayMessageParams || []);
}

@@ -558,4 +558,4 @@ handle() {

}
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 || {}), C = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(C || {}), 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 = {
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 || {}), B = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(B || {}), C = /* @__PURE__ */ ((e) => (e[e.Ethereum = 60] = "Ethereum", e[e.Binance = 714] = "Binance", e[e.THORChain = 931] = "THORChain", e))(C || {}), b = /* @__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))(b || {});
const W = {
ARB: [44, 60, 0, 0, 0],

@@ -575,4 +575,4 @@ AVAX: [44, 60, 0, 0, 0],

};
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 || {});
const k = [
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.MATIC = 18] = "MATIC", e[e.OP = 18] = "OP", e[e.THOR = 8] = "THOR", e))(L || {});
const Y = [
"ETH",

@@ -585,3 +585,3 @@ "AVAX",

/* Polygon */
], $ = [
], k = [
"BTC",

@@ -592,3 +592,3 @@ "BCH",

/* Litecoin */
], q = [
], $ = [
"GAIA",

@@ -599,3 +599,3 @@ "THOR",

];
var u = /* @__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))(u || {}), 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.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(I || {}), v = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet.thornode.thorswap.net", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(v || {});
var u = /* @__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))(u || {}), 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.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(I || {}), x = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet.thornode.thorswap.net", e.ThorswapApi = "https://api.thorswap.finance", e.ThorswapStatic = "https://static.thorswap.net", e))(x || {});
const p = Object.values(i), D = Object.keys(i), y = p.reduce(

@@ -607,12 +607,12 @@ (e, n) => {

{}
), Q = p.reduce(
), q = p.reduce(
(e, n) => (e[n] = u[y[n]], e),
{}
), j = p.reduce(
), Q = p.reduce(
(e, n) => (e[n] = I[y[n]], e),
{}
), J = p.reduce(
), j = p.reduce(
(e, n) => (e[n] = u[`${y[n]}Hex`], e),
{}
), Z = {
), J = {
42161: "ARB",

@@ -640,3 +640,3 @@ "0xa4b1": "ARB",

/* Polygon */
}, z = {
}, Z = {
ARB: "https://arbiscan.io",

@@ -656,40 +656,38 @@ AVAX: "https://snowtrace.io",

};
var R = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(R || {}), M = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(M || {});
const ee = "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 || {}), U = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", 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.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(w || {});
var v = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(v || {}), R = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(R || {});
const z = "image rally need wedding health address purse army antenna leopard sea gain";
var M = /* @__PURE__ */ ((e) => (e[e.NotInstalled = 0] = "NotInstalled", e[e.Detected = 1] = "Detected", e))(M || {}), G = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(G || {}), U = /* @__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.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(U || {});
export {
m as ApiError,
v as ApiUrl,
P as AssetSymbol,
x as BaseDecimal,
x as ApiUrl,
V as AssetSymbol,
L as BaseDecimal,
i as Chain,
u as ChainId,
Z as ChainIdToChain,
Q as ChainToChainId,
z as ChainToExplorerUrl,
J as ChainToHexChainId,
j as ChainToRPC,
C as ContractAddress,
q as CosmosChainList,
V as Denomination,
L as DerivationPath,
J as ChainIdToChain,
q as ChainToChainId,
Z as ChainToExplorerUrl,
j as ChainToHexChainId,
Q as ChainToRPC,
B as ContractAddress,
$ as CosmosChainList,
b as DerivationPath,
t as ERROR_CODE,
H as ERROR_MODULE,
g as ERROR_MODULE,
A as ERROR_TYPE,
k as EVMChainList,
R as ErrorCode,
U as FeeOption,
ee as MOCK_PHRASE,
M as MemoType,
Y as NetworkDerivationPath,
b as NetworkId,
g as QuoteMode,
Y as EVMChainList,
v as ErrorCode,
G as FeeOption,
z as MOCK_PHRASE,
R as MemoType,
W as NetworkDerivationPath,
C as NetworkId,
P as QuoteMode,
I as RPCUrl,
W as TCAvalancheDepositABI,
K as TCEthereumVaultAbi,
$ as UTXOChainList,
w as WalletOption,
G as WalletStatus,
X as erc20ABI
K as TCAvalancheDepositABI,
X as TCEthereumVaultAbi,
k as UTXOChainList,
U as WalletOption,
M as WalletStatus,
F as erc20ABI
};
//# sourceMappingURL=index.es.js.map

@@ -6,5 +6,5 @@ {

"@ethersproject/bignumber": "5.7.0",
"@types/node": "20.4.2",
"vite": "4.4.4",
"@internal/config": "0.0.1-development.2"
"@types/node": "20.5.9",
"vite": "4.4.9",
"@internal/config": "0.0.1"
},

@@ -37,5 +37,5 @@ "eslintConfig": {

"types": "./dist/index.d.ts",
"version": "1.0.0-development.102",
"version": "1.0.0",
"scripts": {
"build": "echo 'Build types 🛠'; vite build && echo 'Build succeeded types ✅'",
"build": "vite build",
"clean": "rm -rf dist .turbo node_modules",

@@ -42,0 +42,0 @@ "lint": "eslint ./ --ext .ts,.tsx --fix; tsc --noEmit",

@@ -1,32 +0,17 @@

import { BigNumber, FixedNumber } from '@ethersproject/bignumber';
import type { BigNumber, FixedNumber } from '@ethersproject/bignumber';
export enum Denomination {
/**
* values for asset amounts in base units (no decimal)
*/
Base = 'BASE',
/**
* values of asset amounts (w/ decimal)
*/
Asset = 'ASSET',
}
type AmountWithDenom<U = BigNumber | FixedNumber> = {
amount: () => U;
plus: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
minus: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
times: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
div: (value: U | AmountWithDenom<U>, decimal?: number) => AmountWithDenom<U>;
gt: (value: U | AmountWithDenom<U>) => boolean;
gte: (value: U | AmountWithDenom<U>) => boolean;
lt: (value: U | AmountWithDenom<U>) => boolean;
lte: (value: U | AmountWithDenom<U>) => boolean;
eq: (value: U | AmountWithDenom<U>) => boolean;
decimal: number;
};
type AmountWithDenom<T, U = BigNumber | FixedNumber> = T extends Denomination
? {
type: T;
amount: () => U;
plus: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
minus: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
times: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
div: (value: U | AmountWithDenom<T, U>, decimal?: number) => AmountWithDenom<T, U>;
gt: (value: U | AmountWithDenom<T, U>) => boolean;
gte: (value: U | AmountWithDenom<T, U>) => boolean;
lt: (value: U | AmountWithDenom<T, U>) => boolean;
lte: (value: U | AmountWithDenom<T, U>) => boolean;
eq: (value: U | AmountWithDenom<T, U>) => boolean;
decimal: number;
}
: never;
export type AmountWithBaseDenom = AmountWithDenom<Denomination.Base, BigNumber>;
export type AmountWithAssetDenom = AmountWithDenom<Denomination.Asset, FixedNumber>;
export type AmountWithBaseDenom = AmountWithDenom<BigNumber>;

@@ -1,2 +0,2 @@

import { Chain } from './network.js';
import type { Chain } from './network.ts';

@@ -3,0 +3,0 @@ export enum AssetSymbol {

@@ -1,5 +0,5 @@

import { FixedNumber } from '@ethersproject/bignumber';
import type { FixedNumber } from '@ethersproject/bignumber';
import { Chain, CosmosChain, EVMChain, UTXOChain } from './network.js';
import { WalletOption } from './wallet.js';
import type { Chain, CosmosChain, EVMChain, UTXOChain } from './network.ts';
import type { WalletOption } from './wallet.ts';

@@ -6,0 +6,0 @@ type ConnectMethodNames =

@@ -1,3 +0,4 @@

import { getDisplayMessage } from './displayMessages.js';
import { ApiErrorOptions, ERROR_CODE, ERROR_MODULE, ERROR_TYPE, ErrorInfo } from './types.js';
import { getDisplayMessage } from './displayMessages.ts';
import type { ApiErrorOptions, ERROR_CODE, ERROR_MODULE, ErrorInfo } from './types.ts';
import { ERROR_TYPE } from './types.ts';

@@ -4,0 +5,0 @@ export class ApiError extends Error {

@@ -1,2 +0,2 @@

import { ERROR_CODE } from './types.js';
import { ERROR_CODE } from './types.ts';

@@ -3,0 +3,0 @@ export const ERROR_DISPLAY_MESSAGES: Record<string, string> = {

@@ -1,2 +0,2 @@

export * from './apiError.js';
export * from './types.js';
export * from './apiError.ts';
export * from './types.ts';

@@ -1,10 +0,10 @@

export { erc20ABI } from './abis/erc20.js';
export { TCAvalancheDepositABI, TCEthereumVaultAbi } from './abis/tcEthVault.js';
export * from './amount.js';
export * from './asset.js';
export * from './commonTypes.js';
export * from './errors/index.js';
export * from './network.js';
export * from './thorchain.js';
export * from './transactions.js';
export * from './wallet.js';
export { erc20ABI } from './abis/erc20.ts';
export { TCAvalancheDepositABI, TCEthereumVaultAbi } from './abis/tcEthVault.ts';
export * from './amount.ts';
export * from './asset.ts';
export * from './commonTypes.ts';
export * from './errors/index.ts';
export * from './network.ts';
export * from './thorchain.ts';
export * from './transactions.ts';
export * from './wallet.ts';

@@ -1,6 +0,6 @@

import { BigNumberish } from '@ethersproject/bignumber';
import type { BigNumberish } from '@ethersproject/bignumber';
import { AmountWithBaseDenom } from './amount.js';
import { Asset } from './asset.js';
import { FeeOption } from './wallet.js';
import type { AmountWithBaseDenom } from './amount.ts';
import type { Asset } from './asset.ts';
import type { FeeOption } from './wallet.ts';

@@ -7,0 +7,0 @@ enum TxType {

@@ -1,3 +0,3 @@

import { AmountWithBaseDenom } from './amount.js';
import { Asset } from './asset.js';
import type { AmountWithBaseDenom } from './amount.ts';
import type { Asset } from './asset.ts';

@@ -4,0 +4,0 @@ export const MOCK_PHRASE =

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