Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@swapkit/helpers

Package Overview
Dependencies
Maintainers
0
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swapkit/helpers - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

4

dist/index.js

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

var l=((n)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(n,{get:(h,t)=>(typeof require!=="undefined"?require:h)[t]}):n)(function(n){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});export*from"@swapkit/contracts";var M;((k)=>{k.Arbitrum="https://arb1.arbitrum.io/rpc";k.Avalanche="https://node-router.thorswap.net/avalanche-c";k.Base="https://base.llamarpc.com";k.BinanceSmartChain="https://bsc-dataseed.binance.org";k.Bitcoin="https://node-router.thorswap.net/bitcoin";k.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash";k.Chainflip="wss://mainnet-archive.chainflip.io";k.Cosmos="https://node-router.thorswap.net/cosmos/rpc";k.Dash="https://node-router.thorswap.net/dash";k.Dogecoin="https://node-router.thorswap.net/dogecoin";k.Ethereum="https://node-router.thorswap.net/ethereum";k.Kujira="https://rpc-kujira.synergynodes.com/";k.Litecoin="https://node-router.thorswap.net/litecoin";k.Maya="https://tendermint.mayachain.info";k.MayaStagenet="https://stagenet.tendermint.mayachain.info";k.Optimism="https://mainnet.optimism.io";k.Polkadot="wss://rpc.polkadot.io";k.Polygon="https://polygon-rpc.com";k.Radix="https://radix-mainnet.rpc.grove.city/v1/326002fc/core";k.THORChain="https://rpc.thorswap.net";k.THORChainStagenet="https://stagenet-rpc.ninerealms.com";k.Solana="https://mainnet.helius-rpc.com/?api-key=2cbe3ae6-cfc5-4141-a093-0055d0fa3d80"})(M||={});var d;((F)=>{F.Arbitrum="https://arbiscan.io";F.Avalanche="https://snowtrace.io";F.Base="https://basescan.org";F.BinanceSmartChain="https://bscscan.com";F.Bitcoin="https://blockchair.com/bitcoin";F.BitcoinCash="https://www.blockchair.com/bitcoin-cash";F.Chainflip="https://explorer.polkascan.io/polkadot";F.Cosmos="https://www.mintscan.io/cosmos";F.Dash="https://blockchair.com/dash";F.Dogecoin="https://blockchair.com/dogecoin";F.Ethereum="https://etherscan.io";F.Kujira="https://finder.kujira.network/kaiyo-1";F.Litecoin="https://blockchair.com/litecoin";F.Maya="https://www.mayascan.org";F.Optimism="https://optimistic.etherscan.io";F.Polkadot="https://polkadot.subscan.io";F.Polygon="https://polygonscan.com";F.Radix="https://dashboard.radixdlt.com";F.THORChain="https://runescan.io";F.Solana="https://solscan.io"})(d||={});var g;((F)=>{F.Arbitrum="ARB";F.Avalanche="AVAX";F.Base="BASE";F.BinanceSmartChain="BSC";F.Bitcoin="BTC";F.BitcoinCash="BCH";F.Cosmos="GAIA";F.Dash="DASH";F.Dogecoin="DOGE";F.Ethereum="ETH";F.Kujira="KUJI";F.Litecoin="LTC";F.Maya="MAYA";F.Optimism="OP";F.Polkadot="DOT";F.Chainflip="FLIP";F.Polygon="MATIC";F.Radix="XRD";F.THORChain="THOR";F.Solana="SOL"})(g||={});var y;((C)=>{C.Arbitrum="42161";C.ArbitrumHex="0xa4b1";C.Avalanche="43114";C.AvalancheHex="0xa86a";C.Base="8453";C.BaseHex="0x2105";C.BinanceSmartChain="56";C.BinanceSmartChainHex="0x38";C.Bitcoin="bitcoin";C.BitcoinCash="bitcoincash";C.Chainflip="chainflip";C.Cosmos="cosmoshub-4";C.Dash="dash";C.Dogecoin="dogecoin";C.Kujira="kaiyo-1";C.Ethereum="1";C.EthereumHex="0x1";C.Litecoin="litecoin";C.Maya="mayachain-mainnet-v1";C.MayaStagenet="mayachain-stagenet-v1";C.Optimism="10";C.OptimismHex="0xa";C.Polkadot="polkadot";C.Polygon="137";C.PolygonHex="0x89";C.Radix="radix-mainnet";C.THORChain="thorchain-mainnet-v1";C.THORChainStagenet="thorchain-stagenet-v2";C.Solana="solana"})(y||={});var Nh={["0xa4b1"]:"ARB",["42161"]:"ARB",["0xa86a"]:"AVAX",["43114"]:"AVAX",["0x2105"]:"BASE",["8453"]:"BASE",["0x38"]:"BSC",["56"]:"BSC",["bitcoincash"]:"BCH",["bitcoin"]:"BTC",["chainflip"]:"FLIP",["cosmoshub-4"]:"GAIA",["dash"]:"DASH",["dogecoin"]:"DOGE",["0x1"]:"ETH",["kaiyo-1"]:"KUJI",["1"]:"ETH",["litecoin"]:"LTC",["mayachain-stagenet-v1"]:"MAYA",["mayachain-mainnet-v1"]:"MAYA",["0xa"]:"OP",["10"]:"OP",["polkadot"]:"DOT",["0x89"]:"MATIC",["137"]:"MATIC",["radix-mainnet"]:"XRD",["thorchain-stagenet-v2"]:"THOR",["thorchain-mainnet-v1"]:"THOR",["solana"]:"SOL"},$n=Object.keys(g),Z=Object.values(g),B={ARB:18,AVAX:18,BASE:18,BCH:8,BSC:18,BTC:8,DASH:8,DOGE:8,DOT:10,ETH:18,FLIP:18,GAIA:6,KUJI:6,LTC:8,MATIC:18,MAYA:8,OP:18,SOL:9,THOR:8,XRD:18},Ah=["DOT","FLIP"],V=["ARB","AVAX","BASE","BSC","ETH","OP","MATIC"],Ch=["BTC","BCH","DASH","DOGE","LTC"],Bh=["GAIA","THOR","MAYA","KUJI"],Th=["AVAX","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"],kh=["ARB","DASH","ETH","KUJI","MAYA","THOR"],b=Z.reduce((n,h)=>{const t=$n.find((o)=>g[o]===h);if(t)n[h]=t;return n},{}),nn=Z.reduce((n,h)=>{return n[h]=y[b[h]],n},{}),E=Z.reduce((n,h)=>{return n[h]=M[b[h]],n},{}),Oh=Z.reduce((n,h)=>{const t=`${b[h]}Hex`;return n[h]=y[t],n},{}),$h=Z.reduce((n,h)=>{return n[h]=d[b[h]],n},{});var In;((I)=>{I.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC";I.TC_SUPPORTED_TO_ETH="TC-ERC20";I.TC_SUPPORTED_TO_AVAX="TC-ARC20";I.TC_SUPPORTED_TO_BSC="TC-BEP20";I.ETH_TO_TC_SUPPORTED="ERC20-TC";I.ETH_TO_ETH="ERC20-ERC20";I.ETH_TO_AVAX="ERC20-ARC20";I.ETH_TO_BSC="ERC20-BEP20";I.AVAX_TO_TC_SUPPORTED="ARC20-TC";I.AVAX_TO_ETH="ARC20-ERC20";I.AVAX_TO_AVAX="ARC20-ARC20";I.AVAX_TO_BSC="ARC20-BEP20";I.BSC_TO_TC_SUPPORTED="BEP20-TC";I.BSC_TO_ETH="BEP20-ERC20";I.BSC_TO_AVAX="BEP20-ARC20";I.BSC_TO_BSC="BEP20-BEP20"})(In||={});var Lh=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],_h=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],Gh=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];var Ln;((R)=>{R.ARB="0x0000000000000000000000000000000000000000";R.AVAX="0x0000000000000000000000000000000000000000";R.BASE="0x0000000000000000000000000000000000000000";R.ETH="0x0000000000000000000000000000000000000000";R.BSC="0x0000000000000000000000000000000000000000";R.MATIC="0x0000000000000000000000000000000000001010";R.OP="0x4200000000000000000000000000000000000042"})(Ln||={});var _n;((F)=>{F.ARB="m/44'/60'/0'/0";F.AVAX="m/44'/60'/0'/0";F.BASE="m/44'/60'/0'/0";F.BCH="m/44'/145'/0'/0";F.BSC="m/44'/60'/0'/0";F.BTC="m/84'/0'/0'/0";F.DASH="m/44'/5'/0'/0";F.DOGE="m/44'/3'/0'/0";F.DOT="////";F.ETH="m/44'/60'/0'/0";F.FLIP="////";F.GAIA="m/44'/118'/0'/0";F.KUJI="m/44'/118'/0'/0";F.LTC="m/84'/2'/0'/0";F.MATIC="m/44'/60'/0'/0";F.MAYA="m/44'/931'/0'/0";F.OP="m/44'/60'/0'/0";F.SOL="m/44'/501'/0'/0";F.THOR="m/44'/931'/0'/0";F.XRD="////"})(_n||={});var v={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DOGE:[44,3,0,0,0],ETH:[44,60,0,0,0],GAIA:[44,118,0,0,0],KUJI:[44,118,0,0,0],LTC:[84,2,0,0,0],MATIC:[44,60,0,0,0],MAYA:[44,931,0,0,0],OP:[44,60,0,0,0],SOL:[44,501,0,0,0],THOR:[44,931,0,0,0],XRD:[0,0,0,0,0],DOT:[0,0,0,0,0],FLIP:[0,0,0,0,0]};var hn;((O)=>{O.BRAVE="BRAVE";O.COINBASE_MOBILE="COINBASE_MOBILE";O.COINBASE_WEB="COINBASE_WEB";O.EIP6963="EIP6963";O.EXODUS="EXODUS";O.KEEPKEY="KEEPKEY";O.KEPLR="KEPLR";O.KEYSTORE="KEYSTORE";O.LEDGER="LEDGER";O.LEDGER_LIVE="LEDGER_LIVE";O.METAMASK="METAMASK";O.OKX="OKX";O.OKX_MOBILE="OKX_MOBILE";O.PHANTOM="PHANTOM";O.POLKADOT_JS="POLKADOT_JS";O.RADIX_WALLET="RADIX_WALLET";O.TREZOR="TREZOR";O.TALISMAN="TALISMAN";O.TRUSTWALLET_WEB="TRUSTWALLET_WEB";O.WALLETCONNECT="WALLETCONNECT";O.XDEFI="XDEFI"})(hn||={});var Gn;((o)=>{o[o.NoError=36864]="NoError";o[o.LockedDevice=21781]="LockedDevice";o[o.TC_NotFound=65535]="TC_NotFound"})(Gn||={});var gn;((o)=>{o.Average="average";o.Fast="fast";o.Fastest="fastest"})(gn||={});var Pn;((t)=>{t.Approve="approve";t.CheckOnly="checkOnly"})(Pn||={});var tn;((A)=>{A.NAME_REGISTER="~";A.BOND="BOND";A.DEPOSIT="+";A.LEAVE="LEAVE";A.UNBOND="UNBOND";A.WITHDRAW="-";A.OPEN_LOAN="$+";A.CLOSE_LOAN="$-";A.RUNEPOOL_DEPOSIT="POOL+";A.RUNEPOOL_WITHDRAW="POOL-"})(tn||={});var Sn;((c)=>{c.unknownError="unknownError";c.test_error="test_error";c.providerDetailsError="providerDetailsError";c.blockHeaderNotFound="blockHeaderNotFound";c.blockHashNotFoundAtHeight="blockHashNotFoundAtHeight";c.blockHashNotFoundAtHash="blockHashNotFoundAtHash";c.txHashMissing="txHashMissing";c.assetValueMissingInfo="assetValueMissingInfo";c.invalidAsset="invalidAsset";c.blockIsRequired="blockIsRequired";c.currentBlockHeaderNotFound="currentBlockHeaderNotFound";c.failedToRetrieveBalance="failedToRetrieveBalance";c.failedToRetrieveBlock="failedToRetrieveBlock";c.failedToRetrieveFees="failedToRetrieveFees";c.notImplementedBCH="notImplementedBCH";c.notImplementedDoge="notImplementedDoge";c.noPoolsFound="noPoolsFound";c.noVaultsFound="noVaultsFound";c.noTxFound="noTxFound";c.noInputCoinFound="noInputCoinFound";c.noBlockDataFound="noBlockDataFound";c.multipleCosmosMessages="multipleCosmosMessages";c.heightOrHashNotProvided="heightOrHashNotProvided";c.unknownDenom="unknownDenom";c.invalidBlockHeight="invalidBlockHeight";c.timestampExtrinsicNoArgumentsForBlock="timestampExtrinsicNoArgumentsForBlock";c.timestampExtrinsicNoTimestampForBlock="timestampExtrinsicNoTimestampForBlock";c.noTimestampExtrinsicForHash="noTimestampExtrinsicForHash";c.timestampExtrinsicNoArgumentsForHash="timestampExtrinsicNoArgumentsForHash";c.txMemoUndefined="txMemoUndefined";c.txMemoIncorrect="txMemoIncorrect";c.txTypeNotFound="txTypeNotFound";c.txNoMessage="txNoMessage";c.txNotFound="txNotFound";c.txReceiptNotFound="txReceiptNotFound";c.txParsingError="txParsingError";c.blockNotFound="blockNotFound";c.balanceNotFound="balanceNotFound";c.configError="configError";c.noQuoteResponse="noQuoteResponse";c.noPoolAssetsFound="noPoolAssetsFound";c.noThorchainPools="noThorchainPools";c.noMayachainPools="noMayachainPools";c.invalidAffiliateFee="invalidAffiliateFee";c.invalidBuyAssetAddress="invalidBuyAssetAddress";c.invalidSellAssetAddress="invalidSellAssetAddress";c.invalidSourceAddress="invalidSourceAddress";c.invalidDestinationAddress="invalidDestinationAddress";c.sourceAddressIsSmartContract="sourceAddressIsSmartContract";c.destinationAddressIsSmartContract="destinationAddressIsSmartContract";c.invalidChainId="invalidChainId";c.unsupportedChainId="unsupportedChainId";c.unsupportedEVMChainId="unsupportedEVMChainId";c.noWhitelistTokens="noWhitelistTokens";c.failedFetchGasPrice="failedFetchGasPrice";c.failedToCreateDepositChannel="failedToCreateDepositChannel";c.noProviderDetailsFound="noProviderDetailsFound";c.noTokenListsFound="noTokenListsFound";c.tokenNotFound="tokenNotFound";c.tokenPriceNotFound="tokenPriceNotFound";c.swapAmountTooSmall="swapAmountTooSmall";c.legsArrayIsEmpty="legsArrayIsEmpty";c.failedToFetchQuoteForLeg="failedToFetchQuoteForLeg";c.noBlockHeaderFound="noBlockHeaderFound";c.failedToSimulateSwap="failedToSimulateSwap";c.addressScreeningFailed="addressScreeningFailed";c.noLiquidtyProvidersFound="noLiquidtyProvidersFound";c.noSaversFound="noSaversFound";c.noInboundAddressesFound="noInboundAddressesFound";c.noInboundAddressFoundForChain="noInboundAddressFoundForChain";c.noLastBlocksFound="noLastBlocksFound";c.noVersionFound="noVersionFound";c.noConstantsFound="noConstantsFound";c.noMimirsFound="noMimirsFound";c.noRoutesFound="noRoutesFound";c.quoteNotFound="quoteNotFound";c.ledgerSignFailed="ledgerSignFailed";c.ledgerFetchSwapFailed="ledgerFetchSwapFailed";c.failedToFetchTx="failedToFetchTx";c.failedBuildTransactionDetails="failedBuildTransactionDetails";c.noLegsForRoute="noLegsForRoute";c.noRouterAddressFound="noRouterAddressFound";c.noAggregatorAddressFound="noAggregatorAddressFound";c.noContractInstanceFound="noContractInstanceFound";c.noContractAddressFound="noContractAddressFound";c.invalidAffiliate="invalidAffiliate";c.providerNotfound="No provider found";c.noRecordFound="No Record found";c.slippageTooLow="Slippage too low";c.tradingHalted="tradingHalted";c.noWrappedGasAsset="noWrappedGasAsset";c.aggregatorAddressNotFound="aggregatorAddressNotFound";c.routerAddressNotFound="routerAddressNotFound";c.dummyAddressNotFound="dummyAddressNotFound";c.trackerError="trackerError";c.noOhlcvDataFound="noOhlcvDataFound";c.noTradingPairs="noTradingPairs";c.noLoanPositionFound="noLoanPositionFound";c.noLendingAvailability="noLendingAvailability";c.lendingRepayTooSmall="lendingRepayTooSmall";c.missingState="missingState";c.ledgerSwapNotFound="ledgerSwapNotFound";c.ledgerSwapNotReadyForTracking="ledgerSwapNotReadyForTracking";c.errorEstimatingGas="errorEstimatingGas";c.apiKeyInvalid="apiKeyInvalid";c.apiKeyFailedToUpdate="apiKeyFailedToUpdate";c.apiKeyExpired="apiKeyExpired";c.unauthorized="unauthorized";c.failedToCreateMemo="failedToCreateMemo";c.radixIncorrectInstructions="radixIncorrectInstructions";c.invalidAddressForChain="invalidAddressForChain"})(Sn||={});var jn;((t)=>{t.highSlippage="highSlippage";t.highPriceImpact="highPriceImpact"})(jn||={});var pn;((_)=>{_.CHAINFLIP="CHAINFLIP";_.MAYACHAIN="MAYACHAIN";_.MAYACHAIN_STREAMING="MAYACHAIN_STREAMING";_.ONEINCH="ONEINCH";_.PANCAKESWAP="PANCAKESWAP";_.PANGOLIN_V1="PANGOLIN_V1";_.SUSHISWAP_V2="SUSHISWAP_V2";_.THORCHAIN="THORCHAIN";_.THORCHAIN_STREAMING="THORCHAIN_STREAMING";_.TRADERJOE_V2="TRADERJOE_V2";_.UNISWAP_V2="UNISWAP_V2";_.UNISWAP_V3="UNISWAP_V3";_.CAVIAR_V1="CAVIAR_V1"})(pn||={});var un;((s)=>{s.LIQUIDITY="liquidity";s.NETWORK="network";s.INBOUND="inbound";s.OUTBOUND="outbound";s.AFFILIATE="affiliate";s.TAX="tax"})(un||={});import{red as Fn,yellow as yn}from"picocolors";function Qh({apiKey:n,...h}){i={...h,apiKey:n}}async function K(n,h){const{apiKey:t,...o}=i,{searchParams:x,json:H,body:s}=h,R={...Xn,...o.headers,...h.headers,...H?{"Content-Type":"application/json"}:{}},T=H?JSON.stringify(H):s,N=new URL(n);if(x)N.search=new URLSearchParams(x).toString();if(t)R["x-api-key"]=t;try{const G=await(await fetch(N.toString(),{...o,...h,body:T,headers:R})).json();if(h.responseHandler)return h.responseHandler(G);return G}catch(A){if(h.onError)return h.onError(A);console.error(A)}}var i={},Xn=typeof window!=="undefined"?{}:{referrer:"https://sk.thorswap.net",referer:"https://sk.thorswap.net"},J={get:async(n,h)=>K(n,{...h,method:"GET"}),post:async(n,h)=>K(n,{...h,method:"POST"}),extend:(n)=>{const h={...i,...n};return{get:async(t,o)=>K(t,{...h,...o,method:"GET"}),post:async(t,o)=>K(t,{...h,...o,method:"POST"}),extend:(t)=>J.extend({...h,...t})}}};var Jn={core_estimated_max_spendable_chain_not_supported:10002,core_extend_error:10003,core_inbound_data_not_found:10004,core_approve_asset_address_or_from_not_found:10005,core_plugin_not_found:10006,core_plugin_swap_not_found:10007,core_approve_asset_target_invalid:10008,core_explorer_unsupported_chain:10009,core_verify_message_not_supported:10010,core_chain_halted:10099,core_wallet_connection_not_found:10100,core_wallet_xdefi_not_installed:10101,core_wallet_evmwallet_not_installed:10102,core_wallet_walletconnect_not_installed:10103,core_wallet_keystore_not_installed:10104,core_wallet_ledger_not_installed:10105,core_wallet_trezor_not_installed:10106,core_wallet_keplr_not_installed:10107,core_wallet_okx_not_installed:10108,core_wallet_keepkey_not_installed:10109,core_wallet_talisman_not_installed:10110,core_wallet_not_keypair_wallet:10111,core_wallet_sign_message_not_supported:10110,core_swap_invalid_params:10200,core_swap_route_not_complete:10201,core_swap_asset_not_recognized:10202,core_swap_contract_not_found:10203,core_swap_route_transaction_not_found:10204,core_swap_contract_not_supported:10205,core_swap_transaction_error:10206,core_swap_quote_mode_not_supported:10207,core_transaction_deposit_error:10301,core_transaction_create_liquidity_base_error:10302,core_transaction_create_liquidity_asset_error:10303,core_transaction_create_liquidity_invalid_params:10304,core_transaction_add_liquidity_invalid_params:10305,core_transaction_add_liquidity_base_address:10306,core_transaction_add_liquidity_base_error:10307,core_transaction_add_liquidity_asset_error:10308,core_transaction_withdraw_error:10309,core_transaction_deposit_to_pool_error:10310,core_transaction_deposit_insufficient_funds_error:10311,core_transaction_deposit_gas_error:10312,core_transaction_invalid_sender_address:10313,core_transaction_deposit_server_error:10314,core_transaction_user_rejected:10315,core_transaction_failed:10316,wallet_connection_rejected_by_user:20000,wallet_missing_api_key:20001,wallet_chain_not_supported:20002,wallet_missing_params:20003,wallet_provider_not_found:20004,wallet_failed_to_add_or_switch_network:20005,wallet_ledger_connection_error:20101,wallet_ledger_connection_claimed:20102,wallet_ledger_get_address_error:20103,wallet_ledger_device_not_found:20104,wallet_ledger_device_locked:20105,wallet_phantom_not_found:20201,wallet_xdefi_not_found:20301,wallet_xdefi_send_transaction_no_address:20302,wallet_xdefi_contract_address_not_provided:20303,wallet_xdefi_asset_not_defined:20304,wallet_walletconnect_project_id_not_specified:20401,wallet_walletconnect_connection_not_established:20402,wallet_walletconnect_namespace_not_supported:20403,wallet_trezor_failed_to_sign_transaction:20501,wallet_trezor_derivation_path_not_supported:20502,wallet_trezor_failed_to_get_address:20503,wallet_talisman_not_enabled:20601,wallet_talisman_not_found:20602,wallet_polkadot_not_found:20701,chainflip_channel_error:30001,chainflip_unknown_asset:30002,chainflip_broker_invalid_params:30100,chainflip_broker_recipient_error:30101,chainflip_broker_register:30102,chainflip_broker_tx_error:30103,chainflip_broker_withdraw:30104,chainflip_broker_fund_only_flip_supported:30105,chainflip_broker_fund_invalid_address:30106,thorchain_chain_halted:40001,thorchain_trading_halted:40002,thorchain_swapin_router_required:40100,thorchain_swapin_vault_required:40101,thorchain_swapin_memo_required:40102,thorchain_swapin_token_required:40103,api_v2_invalid_response:50001,api_v2_server_error:50002,toolbox_cosmos_signer_not_defined:90101,toolbox_cosmos_no_accounts_found:90102,toolbox_cosmos_verify_signature_no_pubkey:90103,toolbox_evm_no_abi_fragment:90201,toolbox_evm_no_signer:90202,toolbox_evm_no_signer_address:90203,toolbox_evm_no_from_address:90204,toolbox_evm_no_contract_address:90205,toolbox_evm_no_fee_data:90206,toolbox_evm_no_gas_price:90207,toolbox_evm_no_to_address:90208,toolbox_evm_invalid_gas_asset_address:90209,toolbox_evm_provider_not_eip1193_compatible:90210,toolbox_evm_error_estimating_gas_limit:90211,toolbox_evm_error_sending_transaction:90212,helpers_invalid_number_different_decimals:99000,helpers_invalid_number_of_years:99001,helpers_invalid_identifier:99002,helpers_invalid_asset_url:99003,helpers_invalid_asset_identifier:99004,helpers_invalid_memo_type:99005,helpers_failed_to_switch_network:99103,helpers_not_found_provider:99200,not_implemented:99999};class L extends Error{static ErrorCode=Jn;constructor(n,h){const t=typeof n==="string",o=t?n:n.errorKey;if(h)console.error(h,{stack:h?.stack,message:h?.message});super(o,{cause:{code:L.ErrorCode[o],message:`${o}${t?"":`: ${JSON.stringify(n.info)}`}`}});Object.setPrototypeOf(this,L.prototype)}}function Dh(n){if(n<0)throw new L({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return 10+n}function Uh(n){if(n<0)throw new L({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return Math.round((10+n*1.0512)*10000000000)/10000000000}function ah(n,h){try{return n()}catch(t){if(h)throw new L(h,t);return console.error(t)}}function dh(n){switch(n){case"THOR":return`${n}.RUNE`;case"GAIA":return`${n}.ATOM`;case"BSC":return`${n}`;default:return`${n}.${n}`}}function xn(n,h){if(!wn&&n){if(on.has(h))return;on.add(h),console.warn(h)}}async function Eh(n="thorchain-mainnet-v1"){if(!["thorchain-stagenet-v2","thorchain-mainnet-v1","thorchain-mainnet-v1"].includes(n))return n;try{return(await J.get(`${n!=="thorchain-mainnet-v1"?"https://stagenet-rpc.ninerealms.com":"https://rpc.thorswap.net"}/status`)).result.node_info.network}catch(h){return n}}var wn=["production","test"].includes("development"),on=new Set;function Hn(n=""){const h=n.toUpperCase(),[t]=h.split(".");if(cn.includes(t))return!0;const[o]=h.split("/");if(cn.includes(o))return!0;throw new L({errorKey:"helpers_invalid_identifier",info:{message:`Invalid identifier: ${n}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`,identifier:n}})}function rh(n){if(n.length>30)return!1;const h=/^[a-zA-Z0-9+_-]+$/g;return!!n.match(h)}var cn=[...Object.values(g),"TERRA"];function w({value:n,bigIntDecimal:h=Y,decimal:t=Y}){if(t===0)return n.toString();const o=n<0n;let x=n.toString().substring(o?1:0);const H=t-(x.length-1);if(H>0)x="0".repeat(H)+x;const s=x.length-t;let R=x.slice(-t);if(Number.parseInt(R[h]||"0")>=5)R=`${R.substring(0,h-1)}${(Number.parseInt(R[h-1]||"0")+1).toString()}`;else R=R.substring(0,h);return`${o?"-":""}${x.slice(0,s)}.${R}`.replace(/\.?0*$/,"")}function D(n){const t=`${typeof n==="number"?zn.format(n):m(n)}`.replaceAll(",",".").split(".");return t.length>1?`${t.slice(0,-1).join("")}.${t.at(-1)}`:t[0]||"0"}function sn(n){const h=n.split(".")[1]?.length||0;return Math.max(h,Y)}function m(n){return typeof n==="object"?"getValue"in n?n.getValue("string"):n.value:n}var Y=8,u=(n)=>10n**BigInt(n),f=(n)=>Math.log10(Number.parseFloat(n.toString()));class p{decimalMultiplier=10n**8n;bigIntValue=0n;decimal;static fromBigInt(n,h){return new p({decimal:h,value:w({value:n,bigIntDecimal:h,decimal:h})})}static shiftDecimals({value:n,from:h,to:t}){return p.fromBigInt(n.getBaseValue("bigint")*u(t)/u(h),t)}constructor(n){const h=m(n),t=typeof n==="object";this.decimal=t?n.decimal:void 0,this.decimalMultiplier=t&&"decimalMultiplier"in n?n.decimalMultiplier:u(Math.max(sn(D(h)),this.decimal||0)),this.#x(h)}set(n){return new this.constructor({decimal:this.decimal,value:n,identifier:this.toString({includeSynthProtocol:!0})})}add(...n){return this.#h("add",...n)}sub(...n){return this.#h("sub",...n)}mul(...n){return this.#h("mul",...n)}div(...n){return this.#h("div",...n)}gt(n){return this.#n("gt",n)}gte(n){return this.#n("gte",n)}lt(n){return this.#n("lt",n)}lte(n){return this.#n("lte",n)}eqValue(n){return this.#n("eqValue",n)}getValue(n){const h=this.formatBigIntToSafeValue(this.bigIntValue,this.decimal||f(this.decimalMultiplier));switch(n){case"number":return Number(h);case"string":return h;case"bigint":return this.bigIntValue*10n**BigInt(this.decimal||8n)/this.decimalMultiplier}}getBaseValue(n){const h=this.decimalMultiplier/u(this.decimal||B.THOR),t=this.bigIntValue/h;switch(n){case"number":return Number(t);case"string":return t.toString();case"bigint":return t}}getBigIntValue(n,h){if(!h&&typeof n==="object")return n.bigIntValue;const t=m(n),o=D(t);if(o==="0"||o==="undefined")return 0n;return this.#o(o,h)}toSignificant(n=6){const[h,t]=this.getValue("string").split("."),o=h||"",x=t||"";if((Number.parseInt(o)?o.length+x.length:x.length)<=n)return this.getValue("string");if(o.length>=n)return o.slice(0,n).padEnd(o.length,"0");if(Number.parseInt(o))return`${o}.${x.slice(0,n-o.length)}`.padEnd(n-o.length,"0");const s=Number.parseInt(x),R=`${s}`.slice(0,n);return`0.${R.padStart(x.length-`${s}`.length+R.length,"0")}`}toFixed(n=6){const[h,t]=this.getValue("string").split("."),o=h||"",x=t||"";if(Number.parseInt(o))return`${o}.${x.slice(0,n)}`.padEnd(n,"0");const H=Number.parseInt(x),s=`${H}`.slice(0,n);return`0.${s.padStart(x.length-`${H}`.length+s.length,"0")}`}toAbbreviation(n=2){const h=this.getValue("number"),t=["","K","M","B","T","Q","Qi","S"],o=Math.floor(Math.log10(Math.abs(h))/3),x=t[o];if(!x)return this.getValue("string");const H=10**(o*3);return`${(h/H).toFixed(n)}${x}`}toCurrency(n="$",{currencyPosition:h="start",decimal:t=2,decimalSeparator:o=".",thousandSeparator:x=","}={}){const H=this.getValue("number"),[s="",R=""]=H.toFixed(6).split("."),T=s.replace(/\B(?=(\d{3})+(?!\d))/g,x),N=s||R?s==="0"?`${Number.parseFloat(`0.${R}`)}`.replace(".",o):`${T}${Number.parseInt(R)?`${o}${R.slice(0,t)}`:""}`:"0.00";return`${h==="start"?n:""}${N}${h==="end"?n:""}`}formatBigIntToSafeValue(n,h){const t=h||this.decimal||Y,o=Math.max(t,f(this.decimalMultiplier)),x=n<0n,H=n.toString().substring(x?1:0),s=o-(H.length-1),R=s>0?"0".repeat(s)+H:H,T=R.length-o;let N=R.slice(-o);if(Number.parseInt(N[t]||"0")>=5)N=`${N.substring(0,t-1)}${(Number.parseInt(N[t-1]||"0")+1).toString()}`;else N=N.substring(0,t);return`${x?"-":""}${R.slice(0,T)}.${N}`.replace(/\.?0*$/,"")}#h(n,...h){const t=this.#t(this,...h),o=Math.max(t,f(this.decimalMultiplier)),x=u(o),H=h.reduce((R,T)=>{const N=this.getBigIntValue(T,o);switch(n){case"add":return R+N;case"sub":return R-N;case"mul":return R*N/x;case"div":{if(N===0n)throw new RangeError("Division by zero");return R*x/N}default:return R}},this.bigIntValue*x/this.decimalMultiplier),s=w({bigIntDecimal:o,decimal:o,value:H});return new this.constructor({decimalMultiplier:u(o),decimal:this.decimal,value:s,identifier:this.toString()})}#n(n,...h){const t=this.#t(this,...h),o=this.getBigIntValue(h[0]||"0",t),x=this.getBigIntValue(this,t);switch(n){case"gt":return x>o;case"gte":return x>=o;case"lt":return x<o;case"lte":return x<=o;case"eqValue":return x===o}}#x(n){const h=D(n)||"0";this.bigIntValue=this.#o(h)}#t(...n){const h=n.map((t)=>{return typeof t==="object"?t.decimal||f(t.decimalMultiplier):sn(D(t))}).filter(Boolean);return Math.max(...h,Y)}#o(n,h){const t=h?u(h):this.decimalMultiplier,o=f(t),[x="",H=""]=n.split(".");return BigInt(`${x}${H.padEnd(o,"0")}`)}}var zn=Intl.NumberFormat("fullwide",{useGrouping:!1,maximumFractionDigits:20});function Ft(n){const h=$.from({chain:n});switch(n){case"BTC":case"LTC":case"BCH":case"DASH":return h.set(0.00010001);case"DOGE":return h.set(1.00000001);case"AVAX":case"ETH":case"ARB":case"BSC":return h.set(0.00000001);case"THOR":case"MAYA":return h.set(0);case"GAIA":case"KUJI":return h.set(0.000001);default:return h.set(0.00000001)}}async function Zn(n,h=0){Hn(n);const t=U.get(n.toUpperCase()),o=t?.decimal||await Nn(r(n));if(!t)U.set(n.toUpperCase(),{identifier:n,decimal:o});return new $({decimal:o,value:a(h,o),identifier:n})}function fn(n,h=0){const t=n.split(".")?.[0]?.toUpperCase(),o=t?["MAYA","THOR"].includes(t):!1,[x,H]=o?n.split(".").slice(1).join().split("/"):n.split("/");if(!(x&&H))throw new L({errorKey:"helpers_invalid_asset_identifier",info:{identifier:n}});return new $({decimal:8,value:a(h,8),identifier:`${t||"THOR"}.${x}/${H}`})}function a(n,h){return typeof n==="bigint"?w({value:n,bigIntDecimal:h,decimal:h}):n}function r(n){const h=n.slice(0,14).includes("/"),t=n.split(".")?.[0]?.toUpperCase()==="THOR",o=n.split(".")?.[0]?.toUpperCase()==="MAYA",[x,H=""]=t||o?n.split(".").slice(1).join().split("/"):n.split("/");if(h&&!(x&&H))throw new L({errorKey:"helpers_invalid_asset_identifier",info:{identifier:n}});const s=n.includes(".")&&!h?n:`${o?"MAYA":"THOR"}.${H}`,[R,...T]=s.split("."),N=h?H:T.join("."),A=N.split("-"),G=A.length===1?A[0]:A.slice(0,-1).join("-"),S=A.length===1?void 0:A[A.length-1];return{address:S?.toLowerCase(),chain:R,isGasAsset:e({chain:R,symbol:N}),isSynthetic:h,ticker:G,symbol:(h?`${x}/`:"")+(S?`${G}-${S?.toLowerCase()??""}`:N)}}var U=new Map;class $ extends p{address;chain;isGasAsset=!1;isSynthetic=!1;symbol;tax;ticker;type;chainId;constructor({value:n,decimal:h,tax:t,chain:o,symbol:x,identifier:H}){super(typeof n==="object"?n:{decimal:h,value:n});const s=r(H||`${o}.${x}`);this.type=Cn(s),this.tax=t,this.chain=s.chain,this.ticker=s.ticker,this.symbol=s.symbol,this.address=s.address,this.isSynthetic=s.isSynthetic,this.isGasAsset=s.isGasAsset,this.chainId=nn[s.chain]}toString({includeSynthProtocol:n}={}){return this.isSynthetic&&!n?this.symbol:`${this.chain}.${this.symbol}`}toUrl(){return this.isSynthetic?`${this.chain}.${this.symbol.replace("/",".")}`:this.toString()}eqAsset({chain:n,symbol:h}){return this.chain===n&&this.symbol===h}eq(n){return this.eqAsset(n)&&this.eqValue(n)}static fromUrl(n,h=0){const[t,o,x]=n.split(".");if(!(t&&o))throw new L({errorKey:"helpers_invalid_asset_url",info:{urlAsset:n}});const H=t==="THOR"&&x?`${t}.${o}/${x}`:n;return $.from({asset:H,value:h})}static from({value:n=0,fromBaseDecimal:h,asyncTokenLookup:t,...o}){const x=n instanceof p?n.getValue("string"):n,H="chain"in o,s=H?o.chain:o.asset,R=H||Rn.includes(s),{identifier:T,decimal:N}=R?An(s):{identifier:s,decimal:void 0},{chain:A,isSynthetic:G}=r(T),S=U.get(T.toUpperCase()),_=S?.decimal||N;xn(!(t||_),yn(`Couldn't find static decimal for ${Fn(T)} (Using default ${Fn(B[A])} decimal as fallback).
var l=((n)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(n,{get:(h,t)=>(typeof require!=="undefined"?require:h)[t]}):n)(function(n){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});export*from"@swapkit/contracts";var M;((k)=>{k.Arbitrum="https://arb1.arbitrum.io/rpc";k.Avalanche="https://node-router.thorswap.net/avalanche-c";k.Base="https://base.llamarpc.com";k.BinanceSmartChain="https://bsc-dataseed.binance.org";k.Bitcoin="https://node-router.thorswap.net/bitcoin";k.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash";k.Chainflip="wss://mainnet-archive.chainflip.io";k.Cosmos="https://node-router.thorswap.net/cosmos/rpc";k.Dash="https://node-router.thorswap.net/dash";k.Dogecoin="https://node-router.thorswap.net/dogecoin";k.Ethereum="https://node-router.thorswap.net/ethereum";k.Kujira="https://rpc-kujira.synergynodes.com/";k.Litecoin="https://node-router.thorswap.net/litecoin";k.Maya="https://tendermint.mayachain.info";k.MayaStagenet="https://stagenet.tendermint.mayachain.info";k.Optimism="https://mainnet.optimism.io";k.Polkadot="wss://rpc.polkadot.io";k.Polygon="https://polygon-rpc.com";k.Radix="https://radix-mainnet.rpc.grove.city/v1/326002fc/core";k.THORChain="https://rpc.thorswap.net";k.THORChainStagenet="https://stagenet-rpc.ninerealms.com";k.Solana="https://mainnet.helius-rpc.com/?api-key=2cbe3ae6-cfc5-4141-a093-0055d0fa3d80"})(M||={});var d;((F)=>{F.Arbitrum="https://arbiscan.io";F.Avalanche="https://snowtrace.io";F.Base="https://basescan.org";F.BinanceSmartChain="https://bscscan.com";F.Bitcoin="https://blockchair.com/bitcoin";F.BitcoinCash="https://www.blockchair.com/bitcoin-cash";F.Chainflip="https://explorer.polkascan.io/polkadot";F.Cosmos="https://www.mintscan.io/cosmos";F.Dash="https://blockchair.com/dash";F.Dogecoin="https://blockchair.com/dogecoin";F.Ethereum="https://etherscan.io";F.Kujira="https://finder.kujira.network/kaiyo-1";F.Litecoin="https://blockchair.com/litecoin";F.Maya="https://www.mayascan.org";F.Optimism="https://optimistic.etherscan.io";F.Polkadot="https://polkadot.subscan.io";F.Polygon="https://polygonscan.com";F.Radix="https://dashboard.radixdlt.com";F.THORChain="https://runescan.io";F.Solana="https://solscan.io"})(d||={});var g;((F)=>{F.Arbitrum="ARB";F.Avalanche="AVAX";F.Base="BASE";F.BinanceSmartChain="BSC";F.Bitcoin="BTC";F.BitcoinCash="BCH";F.Cosmos="GAIA";F.Dash="DASH";F.Dogecoin="DOGE";F.Ethereum="ETH";F.Kujira="KUJI";F.Litecoin="LTC";F.Maya="MAYA";F.Optimism="OP";F.Polkadot="DOT";F.Chainflip="FLIP";F.Polygon="MATIC";F.Radix="XRD";F.THORChain="THOR";F.Solana="SOL"})(g||={});var y;((C)=>{C.Arbitrum="42161";C.ArbitrumHex="0xa4b1";C.Avalanche="43114";C.AvalancheHex="0xa86a";C.Base="8453";C.BaseHex="0x2105";C.BinanceSmartChain="56";C.BinanceSmartChainHex="0x38";C.Bitcoin="bitcoin";C.BitcoinCash="bitcoincash";C.Chainflip="chainflip";C.Cosmos="cosmoshub-4";C.Dash="dash";C.Dogecoin="dogecoin";C.Kujira="kaiyo-1";C.Ethereum="1";C.EthereumHex="0x1";C.Litecoin="litecoin";C.Maya="mayachain-mainnet-v1";C.MayaStagenet="mayachain-stagenet-v1";C.Optimism="10";C.OptimismHex="0xa";C.Polkadot="polkadot";C.Polygon="137";C.PolygonHex="0x89";C.Radix="radix-mainnet";C.THORChain="thorchain-1";C.THORChainStagenet="thorchain-stagenet-v2";C.Solana="solana"})(y||={});var Nh={["0xa4b1"]:"ARB",["42161"]:"ARB",["0xa86a"]:"AVAX",["43114"]:"AVAX",["0x2105"]:"BASE",["8453"]:"BASE",["0x38"]:"BSC",["56"]:"BSC",["bitcoincash"]:"BCH",["bitcoin"]:"BTC",["chainflip"]:"FLIP",["cosmoshub-4"]:"GAIA",["dash"]:"DASH",["dogecoin"]:"DOGE",["0x1"]:"ETH",["kaiyo-1"]:"KUJI",["1"]:"ETH",["litecoin"]:"LTC",["mayachain-stagenet-v1"]:"MAYA",["mayachain-mainnet-v1"]:"MAYA",["0xa"]:"OP",["10"]:"OP",["polkadot"]:"DOT",["0x89"]:"MATIC",["137"]:"MATIC",["radix-mainnet"]:"XRD",["thorchain-stagenet-v2"]:"THOR",["thorchain-1"]:"THOR",["solana"]:"SOL"},$n=Object.keys(g),Z=Object.values(g),B={ARB:18,AVAX:18,BASE:18,BCH:8,BSC:18,BTC:8,DASH:8,DOGE:8,DOT:10,ETH:18,FLIP:18,GAIA:6,KUJI:6,LTC:8,MATIC:18,MAYA:8,OP:18,SOL:9,THOR:8,XRD:18},Ah=["DOT","FLIP"],V=["ARB","AVAX","BASE","BSC","ETH","OP","MATIC"],Ch=["BTC","BCH","DASH","DOGE","LTC"],Bh=["GAIA","THOR","MAYA","KUJI"],Th=["AVAX","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"],kh=["ARB","DASH","ETH","KUJI","MAYA","THOR"],b=Z.reduce((n,h)=>{const t=$n.find((o)=>g[o]===h);if(t)n[h]=t;return n},{}),nn=Z.reduce((n,h)=>{return n[h]=y[b[h]],n},{}),E=Z.reduce((n,h)=>{return n[h]=M[b[h]],n},{}),Oh=Z.reduce((n,h)=>{const t=`${b[h]}Hex`;return n[h]=y[t],n},{}),$h=Z.reduce((n,h)=>{return n[h]=d[b[h]],n},{});var In;((I)=>{I.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC";I.TC_SUPPORTED_TO_ETH="TC-ERC20";I.TC_SUPPORTED_TO_AVAX="TC-ARC20";I.TC_SUPPORTED_TO_BSC="TC-BEP20";I.ETH_TO_TC_SUPPORTED="ERC20-TC";I.ETH_TO_ETH="ERC20-ERC20";I.ETH_TO_AVAX="ERC20-ARC20";I.ETH_TO_BSC="ERC20-BEP20";I.AVAX_TO_TC_SUPPORTED="ARC20-TC";I.AVAX_TO_ETH="ARC20-ERC20";I.AVAX_TO_AVAX="ARC20-ARC20";I.AVAX_TO_BSC="ARC20-BEP20";I.BSC_TO_TC_SUPPORTED="BEP20-TC";I.BSC_TO_ETH="BEP20-ERC20";I.BSC_TO_AVAX="BEP20-ARC20";I.BSC_TO_BSC="BEP20-BEP20"})(In||={});var Lh=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],_h=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],Gh=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];var Ln;((R)=>{R.ARB="0x0000000000000000000000000000000000000000";R.AVAX="0x0000000000000000000000000000000000000000";R.BASE="0x0000000000000000000000000000000000000000";R.ETH="0x0000000000000000000000000000000000000000";R.BSC="0x0000000000000000000000000000000000000000";R.MATIC="0x0000000000000000000000000000000000001010";R.OP="0x4200000000000000000000000000000000000042"})(Ln||={});var _n;((F)=>{F.ARB="m/44'/60'/0'/0";F.AVAX="m/44'/60'/0'/0";F.BASE="m/44'/60'/0'/0";F.BCH="m/44'/145'/0'/0";F.BSC="m/44'/60'/0'/0";F.BTC="m/84'/0'/0'/0";F.DASH="m/44'/5'/0'/0";F.DOGE="m/44'/3'/0'/0";F.DOT="////";F.ETH="m/44'/60'/0'/0";F.FLIP="////";F.GAIA="m/44'/118'/0'/0";F.KUJI="m/44'/118'/0'/0";F.LTC="m/84'/2'/0'/0";F.MATIC="m/44'/60'/0'/0";F.MAYA="m/44'/931'/0'/0";F.OP="m/44'/60'/0'/0";F.SOL="m/44'/501'/0'/0";F.THOR="m/44'/931'/0'/0";F.XRD="////"})(_n||={});var v={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DOGE:[44,3,0,0,0],ETH:[44,60,0,0,0],GAIA:[44,118,0,0,0],KUJI:[44,118,0,0,0],LTC:[84,2,0,0,0],MATIC:[44,60,0,0,0],MAYA:[44,931,0,0,0],OP:[44,60,0,0,0],SOL:[44,501,0,0,0],THOR:[44,931,0,0,0],XRD:[0,0,0,0,0],DOT:[0,0,0,0,0],FLIP:[0,0,0,0,0]};var hn;((O)=>{O.BRAVE="BRAVE";O.COINBASE_MOBILE="COINBASE_MOBILE";O.COINBASE_WEB="COINBASE_WEB";O.EIP6963="EIP6963";O.EXODUS="EXODUS";O.KEEPKEY="KEEPKEY";O.KEPLR="KEPLR";O.KEYSTORE="KEYSTORE";O.LEDGER="LEDGER";O.LEDGER_LIVE="LEDGER_LIVE";O.METAMASK="METAMASK";O.OKX="OKX";O.OKX_MOBILE="OKX_MOBILE";O.PHANTOM="PHANTOM";O.POLKADOT_JS="POLKADOT_JS";O.RADIX_WALLET="RADIX_WALLET";O.TREZOR="TREZOR";O.TALISMAN="TALISMAN";O.TRUSTWALLET_WEB="TRUSTWALLET_WEB";O.WALLETCONNECT="WALLETCONNECT";O.XDEFI="XDEFI"})(hn||={});var Gn;((o)=>{o[o.NoError=36864]="NoError";o[o.LockedDevice=21781]="LockedDevice";o[o.TC_NotFound=65535]="TC_NotFound"})(Gn||={});var gn;((o)=>{o.Average="average";o.Fast="fast";o.Fastest="fastest"})(gn||={});var Pn;((t)=>{t.Approve="approve";t.CheckOnly="checkOnly"})(Pn||={});var tn;((A)=>{A.NAME_REGISTER="~";A.BOND="BOND";A.DEPOSIT="+";A.LEAVE="LEAVE";A.UNBOND="UNBOND";A.WITHDRAW="-";A.OPEN_LOAN="$+";A.CLOSE_LOAN="$-";A.RUNEPOOL_DEPOSIT="POOL+";A.RUNEPOOL_WITHDRAW="POOL-"})(tn||={});var Sn;((c)=>{c.unknownError="unknownError";c.test_error="test_error";c.providerDetailsError="providerDetailsError";c.blockHeaderNotFound="blockHeaderNotFound";c.blockHashNotFoundAtHeight="blockHashNotFoundAtHeight";c.blockHashNotFoundAtHash="blockHashNotFoundAtHash";c.txHashMissing="txHashMissing";c.assetValueMissingInfo="assetValueMissingInfo";c.invalidAsset="invalidAsset";c.blockIsRequired="blockIsRequired";c.currentBlockHeaderNotFound="currentBlockHeaderNotFound";c.failedToRetrieveBalance="failedToRetrieveBalance";c.failedToRetrieveBlock="failedToRetrieveBlock";c.failedToRetrieveFees="failedToRetrieveFees";c.notImplementedBCH="notImplementedBCH";c.notImplementedDoge="notImplementedDoge";c.noPoolsFound="noPoolsFound";c.noVaultsFound="noVaultsFound";c.noTxFound="noTxFound";c.noInputCoinFound="noInputCoinFound";c.noBlockDataFound="noBlockDataFound";c.multipleCosmosMessages="multipleCosmosMessages";c.heightOrHashNotProvided="heightOrHashNotProvided";c.unknownDenom="unknownDenom";c.invalidBlockHeight="invalidBlockHeight";c.timestampExtrinsicNoArgumentsForBlock="timestampExtrinsicNoArgumentsForBlock";c.timestampExtrinsicNoTimestampForBlock="timestampExtrinsicNoTimestampForBlock";c.noTimestampExtrinsicForHash="noTimestampExtrinsicForHash";c.timestampExtrinsicNoArgumentsForHash="timestampExtrinsicNoArgumentsForHash";c.txMemoUndefined="txMemoUndefined";c.txMemoIncorrect="txMemoIncorrect";c.txTypeNotFound="txTypeNotFound";c.txNoMessage="txNoMessage";c.txNotFound="txNotFound";c.txReceiptNotFound="txReceiptNotFound";c.txParsingError="txParsingError";c.blockNotFound="blockNotFound";c.balanceNotFound="balanceNotFound";c.configError="configError";c.noQuoteResponse="noQuoteResponse";c.noPoolAssetsFound="noPoolAssetsFound";c.noThorchainPools="noThorchainPools";c.noMayachainPools="noMayachainPools";c.invalidAffiliateFee="invalidAffiliateFee";c.invalidBuyAssetAddress="invalidBuyAssetAddress";c.invalidSellAssetAddress="invalidSellAssetAddress";c.invalidSourceAddress="invalidSourceAddress";c.invalidDestinationAddress="invalidDestinationAddress";c.sourceAddressIsSmartContract="sourceAddressIsSmartContract";c.destinationAddressIsSmartContract="destinationAddressIsSmartContract";c.invalidChainId="invalidChainId";c.unsupportedChainId="unsupportedChainId";c.unsupportedEVMChainId="unsupportedEVMChainId";c.noWhitelistTokens="noWhitelistTokens";c.failedFetchGasPrice="failedFetchGasPrice";c.failedToCreateDepositChannel="failedToCreateDepositChannel";c.noProviderDetailsFound="noProviderDetailsFound";c.noTokenListsFound="noTokenListsFound";c.tokenNotFound="tokenNotFound";c.tokenPriceNotFound="tokenPriceNotFound";c.swapAmountTooSmall="swapAmountTooSmall";c.legsArrayIsEmpty="legsArrayIsEmpty";c.failedToFetchQuoteForLeg="failedToFetchQuoteForLeg";c.noBlockHeaderFound="noBlockHeaderFound";c.failedToSimulateSwap="failedToSimulateSwap";c.addressScreeningFailed="addressScreeningFailed";c.noLiquidtyProvidersFound="noLiquidtyProvidersFound";c.noSaversFound="noSaversFound";c.noInboundAddressesFound="noInboundAddressesFound";c.noInboundAddressFoundForChain="noInboundAddressFoundForChain";c.noLastBlocksFound="noLastBlocksFound";c.noVersionFound="noVersionFound";c.noConstantsFound="noConstantsFound";c.noMimirsFound="noMimirsFound";c.noRoutesFound="noRoutesFound";c.quoteNotFound="quoteNotFound";c.ledgerSignFailed="ledgerSignFailed";c.ledgerFetchSwapFailed="ledgerFetchSwapFailed";c.failedToFetchTx="failedToFetchTx";c.failedBuildTransactionDetails="failedBuildTransactionDetails";c.noLegsForRoute="noLegsForRoute";c.noRouterAddressFound="noRouterAddressFound";c.noAggregatorAddressFound="noAggregatorAddressFound";c.noContractInstanceFound="noContractInstanceFound";c.noContractAddressFound="noContractAddressFound";c.invalidAffiliate="invalidAffiliate";c.providerNotfound="No provider found";c.noRecordFound="No Record found";c.slippageTooLow="Slippage too low";c.tradingHalted="tradingHalted";c.noWrappedGasAsset="noWrappedGasAsset";c.aggregatorAddressNotFound="aggregatorAddressNotFound";c.routerAddressNotFound="routerAddressNotFound";c.dummyAddressNotFound="dummyAddressNotFound";c.trackerError="trackerError";c.noOhlcvDataFound="noOhlcvDataFound";c.noTradingPairs="noTradingPairs";c.noLoanPositionFound="noLoanPositionFound";c.noLendingAvailability="noLendingAvailability";c.lendingRepayTooSmall="lendingRepayTooSmall";c.missingState="missingState";c.ledgerSwapNotFound="ledgerSwapNotFound";c.ledgerSwapNotReadyForTracking="ledgerSwapNotReadyForTracking";c.errorEstimatingGas="errorEstimatingGas";c.apiKeyInvalid="apiKeyInvalid";c.apiKeyFailedToUpdate="apiKeyFailedToUpdate";c.apiKeyExpired="apiKeyExpired";c.unauthorized="unauthorized";c.failedToCreateMemo="failedToCreateMemo";c.radixIncorrectInstructions="radixIncorrectInstructions";c.invalidAddressForChain="invalidAddressForChain"})(Sn||={});var jn;((t)=>{t.highSlippage="highSlippage";t.highPriceImpact="highPriceImpact"})(jn||={});var pn;((_)=>{_.CHAINFLIP="CHAINFLIP";_.MAYACHAIN="MAYACHAIN";_.MAYACHAIN_STREAMING="MAYACHAIN_STREAMING";_.ONEINCH="ONEINCH";_.PANCAKESWAP="PANCAKESWAP";_.PANGOLIN_V1="PANGOLIN_V1";_.SUSHISWAP_V2="SUSHISWAP_V2";_.THORCHAIN="THORCHAIN";_.THORCHAIN_STREAMING="THORCHAIN_STREAMING";_.TRADERJOE_V2="TRADERJOE_V2";_.UNISWAP_V2="UNISWAP_V2";_.UNISWAP_V3="UNISWAP_V3";_.CAVIAR_V1="CAVIAR_V1"})(pn||={});var un;((s)=>{s.LIQUIDITY="liquidity";s.NETWORK="network";s.INBOUND="inbound";s.OUTBOUND="outbound";s.AFFILIATE="affiliate";s.TAX="tax"})(un||={});import{red as Fn,yellow as yn}from"picocolors";function Qh({apiKey:n,...h}){i={...h,apiKey:n}}async function K(n,h){const{apiKey:t,...o}=i,{searchParams:x,json:H,body:s}=h,R={...Xn,...o.headers,...h.headers,...H?{"Content-Type":"application/json"}:{}},T=H?JSON.stringify(H):s,N=new URL(n);if(x)N.search=new URLSearchParams(x).toString();if(t)R["x-api-key"]=t;try{const G=await(await fetch(N.toString(),{...o,...h,body:T,headers:R})).json();if(h.responseHandler)return h.responseHandler(G);return G}catch(A){if(h.onError)return h.onError(A);console.error(A)}}var i={},Xn=typeof window!=="undefined"?{}:{referrer:"https://sk.thorswap.net",referer:"https://sk.thorswap.net"},J={get:async(n,h)=>K(n,{...h,method:"GET"}),post:async(n,h)=>K(n,{...h,method:"POST"}),extend:(n)=>{const h={...i,...n};return{get:async(t,o)=>K(t,{...h,...o,method:"GET"}),post:async(t,o)=>K(t,{...h,...o,method:"POST"}),extend:(t)=>J.extend({...h,...t})}}};var Jn={core_estimated_max_spendable_chain_not_supported:10002,core_extend_error:10003,core_inbound_data_not_found:10004,core_approve_asset_address_or_from_not_found:10005,core_plugin_not_found:10006,core_plugin_swap_not_found:10007,core_approve_asset_target_invalid:10008,core_explorer_unsupported_chain:10009,core_verify_message_not_supported:10010,core_chain_halted:10099,core_wallet_connection_not_found:10100,core_wallet_xdefi_not_installed:10101,core_wallet_evmwallet_not_installed:10102,core_wallet_walletconnect_not_installed:10103,core_wallet_keystore_not_installed:10104,core_wallet_ledger_not_installed:10105,core_wallet_trezor_not_installed:10106,core_wallet_keplr_not_installed:10107,core_wallet_okx_not_installed:10108,core_wallet_keepkey_not_installed:10109,core_wallet_talisman_not_installed:10110,core_wallet_not_keypair_wallet:10111,core_wallet_sign_message_not_supported:10110,core_swap_invalid_params:10200,core_swap_route_not_complete:10201,core_swap_asset_not_recognized:10202,core_swap_contract_not_found:10203,core_swap_route_transaction_not_found:10204,core_swap_contract_not_supported:10205,core_swap_transaction_error:10206,core_swap_quote_mode_not_supported:10207,core_transaction_deposit_error:10301,core_transaction_create_liquidity_base_error:10302,core_transaction_create_liquidity_asset_error:10303,core_transaction_create_liquidity_invalid_params:10304,core_transaction_add_liquidity_invalid_params:10305,core_transaction_add_liquidity_base_address:10306,core_transaction_add_liquidity_base_error:10307,core_transaction_add_liquidity_asset_error:10308,core_transaction_withdraw_error:10309,core_transaction_deposit_to_pool_error:10310,core_transaction_deposit_insufficient_funds_error:10311,core_transaction_deposit_gas_error:10312,core_transaction_invalid_sender_address:10313,core_transaction_deposit_server_error:10314,core_transaction_user_rejected:10315,core_transaction_failed:10316,wallet_connection_rejected_by_user:20000,wallet_missing_api_key:20001,wallet_chain_not_supported:20002,wallet_missing_params:20003,wallet_provider_not_found:20004,wallet_failed_to_add_or_switch_network:20005,wallet_ledger_connection_error:20101,wallet_ledger_connection_claimed:20102,wallet_ledger_get_address_error:20103,wallet_ledger_device_not_found:20104,wallet_ledger_device_locked:20105,wallet_phantom_not_found:20201,wallet_xdefi_not_found:20301,wallet_xdefi_send_transaction_no_address:20302,wallet_xdefi_contract_address_not_provided:20303,wallet_xdefi_asset_not_defined:20304,wallet_walletconnect_project_id_not_specified:20401,wallet_walletconnect_connection_not_established:20402,wallet_walletconnect_namespace_not_supported:20403,wallet_trezor_failed_to_sign_transaction:20501,wallet_trezor_derivation_path_not_supported:20502,wallet_trezor_failed_to_get_address:20503,wallet_talisman_not_enabled:20601,wallet_talisman_not_found:20602,wallet_polkadot_not_found:20701,chainflip_channel_error:30001,chainflip_unknown_asset:30002,chainflip_broker_invalid_params:30100,chainflip_broker_recipient_error:30101,chainflip_broker_register:30102,chainflip_broker_tx_error:30103,chainflip_broker_withdraw:30104,chainflip_broker_fund_only_flip_supported:30105,chainflip_broker_fund_invalid_address:30106,thorchain_chain_halted:40001,thorchain_trading_halted:40002,thorchain_swapin_router_required:40100,thorchain_swapin_vault_required:40101,thorchain_swapin_memo_required:40102,thorchain_swapin_token_required:40103,api_v2_invalid_response:50001,api_v2_server_error:50002,toolbox_cosmos_signer_not_defined:90101,toolbox_cosmos_no_accounts_found:90102,toolbox_cosmos_verify_signature_no_pubkey:90103,toolbox_evm_no_abi_fragment:90201,toolbox_evm_no_signer:90202,toolbox_evm_no_signer_address:90203,toolbox_evm_no_from_address:90204,toolbox_evm_no_contract_address:90205,toolbox_evm_no_fee_data:90206,toolbox_evm_no_gas_price:90207,toolbox_evm_no_to_address:90208,toolbox_evm_invalid_gas_asset_address:90209,toolbox_evm_provider_not_eip1193_compatible:90210,toolbox_evm_error_estimating_gas_limit:90211,toolbox_evm_error_sending_transaction:90212,helpers_invalid_number_different_decimals:99000,helpers_invalid_number_of_years:99001,helpers_invalid_identifier:99002,helpers_invalid_asset_url:99003,helpers_invalid_asset_identifier:99004,helpers_invalid_memo_type:99005,helpers_failed_to_switch_network:99103,helpers_not_found_provider:99200,not_implemented:99999};class L extends Error{static ErrorCode=Jn;constructor(n,h){const t=typeof n==="string",o=t?n:n.errorKey;if(h)console.error(h,{stack:h?.stack,message:h?.message});super(o,{cause:{code:L.ErrorCode[o],message:`${o}${t?"":`: ${JSON.stringify(n.info)}`}`}});Object.setPrototypeOf(this,L.prototype)}}function Dh(n){if(n<0)throw new L({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return 10+n}function Uh(n){if(n<0)throw new L({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return Math.round((10+n*1.0512)*10000000000)/10000000000}function ah(n,h){try{return n()}catch(t){if(h)throw new L(h,t);return console.error(t)}}function dh(n){switch(n){case"THOR":return`${n}.RUNE`;case"GAIA":return`${n}.ATOM`;case"BSC":return`${n}`;default:return`${n}.${n}`}}function xn(n,h){if(!wn&&n){if(on.has(h))return;on.add(h),console.warn(h)}}async function Eh(n="thorchain-1"){if(!["thorchain-stagenet-v2","thorchain-1","thorchain-mainnet-v1"].includes(n))return n;try{return(await J.get(`${n!=="thorchain-1"?"https://stagenet-rpc.ninerealms.com":"https://rpc.thorswap.net"}/status`)).result.node_info.network}catch(h){return n}}var wn=["production","test"].includes("development"),on=new Set;function Hn(n=""){const h=n.toUpperCase(),[t]=h.split(".");if(cn.includes(t))return!0;const[o]=h.split("/");if(cn.includes(o))return!0;throw new L({errorKey:"helpers_invalid_identifier",info:{message:`Invalid identifier: ${n}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`,identifier:n}})}function rh(n){if(n.length>30)return!1;const h=/^[a-zA-Z0-9+_-]+$/g;return!!n.match(h)}var cn=[...Object.values(g),"TERRA"];function w({value:n,bigIntDecimal:h=Y,decimal:t=Y}){if(t===0)return n.toString();const o=n<0n;let x=n.toString().substring(o?1:0);const H=t-(x.length-1);if(H>0)x="0".repeat(H)+x;const s=x.length-t;let R=x.slice(-t);if(Number.parseInt(R[h]||"0")>=5)R=`${R.substring(0,h-1)}${(Number.parseInt(R[h-1]||"0")+1).toString()}`;else R=R.substring(0,h);return`${o?"-":""}${x.slice(0,s)}.${R}`.replace(/\.?0*$/,"")}function D(n){const t=`${typeof n==="number"?zn.format(n):m(n)}`.replaceAll(",",".").split(".");return t.length>1?`${t.slice(0,-1).join("")}.${t.at(-1)}`:t[0]||"0"}function sn(n){const h=n.split(".")[1]?.length||0;return Math.max(h,Y)}function m(n){return typeof n==="object"?"getValue"in n?n.getValue("string"):n.value:n}var Y=8,u=(n)=>10n**BigInt(n),f=(n)=>Math.log10(Number.parseFloat(n.toString()));class p{decimalMultiplier=10n**8n;bigIntValue=0n;decimal;static fromBigInt(n,h){return new p({decimal:h,value:w({value:n,bigIntDecimal:h,decimal:h})})}static shiftDecimals({value:n,from:h,to:t}){return p.fromBigInt(n.getBaseValue("bigint")*u(t)/u(h),t)}constructor(n){const h=m(n),t=typeof n==="object";this.decimal=t?n.decimal:void 0,this.decimalMultiplier=t&&"decimalMultiplier"in n?n.decimalMultiplier:u(Math.max(sn(D(h)),this.decimal||0)),this.#x(h)}set(n){return new this.constructor({decimal:this.decimal,value:n,identifier:this.toString({includeSynthProtocol:!0})})}add(...n){return this.#h("add",...n)}sub(...n){return this.#h("sub",...n)}mul(...n){return this.#h("mul",...n)}div(...n){return this.#h("div",...n)}gt(n){return this.#n("gt",n)}gte(n){return this.#n("gte",n)}lt(n){return this.#n("lt",n)}lte(n){return this.#n("lte",n)}eqValue(n){return this.#n("eqValue",n)}getValue(n){const h=this.formatBigIntToSafeValue(this.bigIntValue,this.decimal||f(this.decimalMultiplier));switch(n){case"number":return Number(h);case"string":return h;case"bigint":return this.bigIntValue*10n**BigInt(this.decimal||8n)/this.decimalMultiplier}}getBaseValue(n){const h=this.decimalMultiplier/u(this.decimal||B.THOR),t=this.bigIntValue/h;switch(n){case"number":return Number(t);case"string":return t.toString();case"bigint":return t}}getBigIntValue(n,h){if(!h&&typeof n==="object")return n.bigIntValue;const t=m(n),o=D(t);if(o==="0"||o==="undefined")return 0n;return this.#o(o,h)}toSignificant(n=6){const[h,t]=this.getValue("string").split("."),o=h||"",x=t||"";if((Number.parseInt(o)?o.length+x.length:x.length)<=n)return this.getValue("string");if(o.length>=n)return o.slice(0,n).padEnd(o.length,"0");if(Number.parseInt(o))return`${o}.${x.slice(0,n-o.length)}`.padEnd(n-o.length,"0");const s=Number.parseInt(x),R=`${s}`.slice(0,n);return`0.${R.padStart(x.length-`${s}`.length+R.length,"0")}`}toFixed(n=6){const[h,t]=this.getValue("string").split("."),o=h||"",x=t||"";if(Number.parseInt(o))return`${o}.${x.slice(0,n)}`.padEnd(n,"0");const H=Number.parseInt(x),s=`${H}`.slice(0,n);return`0.${s.padStart(x.length-`${H}`.length+s.length,"0")}`}toAbbreviation(n=2){const h=this.getValue("number"),t=["","K","M","B","T","Q","Qi","S"],o=Math.floor(Math.log10(Math.abs(h))/3),x=t[o];if(!x)return this.getValue("string");const H=10**(o*3);return`${(h/H).toFixed(n)}${x}`}toCurrency(n="$",{currencyPosition:h="start",decimal:t=2,decimalSeparator:o=".",thousandSeparator:x=","}={}){const H=this.getValue("number"),[s="",R=""]=H.toFixed(6).split("."),T=s.replace(/\B(?=(\d{3})+(?!\d))/g,x),N=s||R?s==="0"?`${Number.parseFloat(`0.${R}`)}`.replace(".",o):`${T}${Number.parseInt(R)?`${o}${R.slice(0,t)}`:""}`:"0.00";return`${h==="start"?n:""}${N}${h==="end"?n:""}`}formatBigIntToSafeValue(n,h){const t=h||this.decimal||Y,o=Math.max(t,f(this.decimalMultiplier)),x=n<0n,H=n.toString().substring(x?1:0),s=o-(H.length-1),R=s>0?"0".repeat(s)+H:H,T=R.length-o;let N=R.slice(-o);if(Number.parseInt(N[t]||"0")>=5)N=`${N.substring(0,t-1)}${(Number.parseInt(N[t-1]||"0")+1).toString()}`;else N=N.substring(0,t);return`${x?"-":""}${R.slice(0,T)}.${N}`.replace(/\.?0*$/,"")}#h(n,...h){const t=this.#t(this,...h),o=Math.max(t,f(this.decimalMultiplier)),x=u(o),H=h.reduce((R,T)=>{const N=this.getBigIntValue(T,o);switch(n){case"add":return R+N;case"sub":return R-N;case"mul":return R*N/x;case"div":{if(N===0n)throw new RangeError("Division by zero");return R*x/N}default:return R}},this.bigIntValue*x/this.decimalMultiplier),s=w({bigIntDecimal:o,decimal:o,value:H});return new this.constructor({decimalMultiplier:u(o),decimal:this.decimal,value:s,identifier:this.toString()})}#n(n,...h){const t=this.#t(this,...h),o=this.getBigIntValue(h[0]||"0",t),x=this.getBigIntValue(this,t);switch(n){case"gt":return x>o;case"gte":return x>=o;case"lt":return x<o;case"lte":return x<=o;case"eqValue":return x===o}}#x(n){const h=D(n)||"0";this.bigIntValue=this.#o(h)}#t(...n){const h=n.map((t)=>{return typeof t==="object"?t.decimal||f(t.decimalMultiplier):sn(D(t))}).filter(Boolean);return Math.max(...h,Y)}#o(n,h){const t=h?u(h):this.decimalMultiplier,o=f(t),[x="",H=""]=n.split(".");return BigInt(`${x}${H.padEnd(o,"0")}`)}}var zn=Intl.NumberFormat("fullwide",{useGrouping:!1,maximumFractionDigits:20});function Ft(n){const h=$.from({chain:n});switch(n){case"BTC":case"LTC":case"BCH":case"DASH":return h.set(0.00010001);case"DOGE":return h.set(1.00000001);case"AVAX":case"ETH":case"ARB":case"BSC":return h.set(0.00000001);case"THOR":case"MAYA":return h.set(0);case"GAIA":case"KUJI":return h.set(0.000001);default:return h.set(0.00000001)}}async function Zn(n,h=0){Hn(n);const t=U.get(n.toUpperCase()),o=t?.decimal||await Nn(r(n));if(!t)U.set(n.toUpperCase(),{identifier:n,decimal:o});return new $({decimal:o,value:a(h,o),identifier:n})}function fn(n,h=0){const t=n.split(".")?.[0]?.toUpperCase(),o=t?["MAYA","THOR"].includes(t):!1,[x,H]=o?n.split(".").slice(1).join().split("/"):n.split("/");if(!(x&&H))throw new L({errorKey:"helpers_invalid_asset_identifier",info:{identifier:n}});return new $({decimal:8,value:a(h,8),identifier:`${t||"THOR"}.${x}/${H}`})}function a(n,h){return typeof n==="bigint"?w({value:n,bigIntDecimal:h,decimal:h}):n}function r(n){const h=n.slice(0,14).includes("/"),t=n.split(".")?.[0]?.toUpperCase()==="THOR",o=n.split(".")?.[0]?.toUpperCase()==="MAYA",[x,H=""]=t||o?n.split(".").slice(1).join().split("/"):n.split("/");if(h&&!(x&&H))throw new L({errorKey:"helpers_invalid_asset_identifier",info:{identifier:n}});const s=n.includes(".")&&!h?n:`${o?"MAYA":"THOR"}.${H}`,[R,...T]=s.split("."),N=h?H:T.join("."),A=N.split("-"),G=A.length===1?A[0]:A.slice(0,-1).join("-"),S=A.length===1?void 0:A[A.length-1];return{address:S?.toLowerCase(),chain:R,isGasAsset:e({chain:R,symbol:N}),isSynthetic:h,ticker:G,symbol:(h?`${x}/`:"")+(S?`${G}-${S?.toLowerCase()??""}`:N)}}var U=new Map;class $ extends p{address;chain;isGasAsset=!1;isSynthetic=!1;symbol;tax;ticker;type;chainId;constructor({value:n,decimal:h,tax:t,chain:o,symbol:x,identifier:H}){super(typeof n==="object"?n:{decimal:h,value:n});const s=r(H||`${o}.${x}`);this.type=Cn(s),this.tax=t,this.chain=s.chain,this.ticker=s.ticker,this.symbol=s.symbol,this.address=s.address,this.isSynthetic=s.isSynthetic,this.isGasAsset=s.isGasAsset,this.chainId=nn[s.chain]}toString({includeSynthProtocol:n}={}){return this.isSynthetic&&!n?this.symbol:`${this.chain}.${this.symbol}`}toUrl(){return this.isSynthetic?`${this.chain}.${this.symbol.replace("/",".")}`:this.toString()}eqAsset({chain:n,symbol:h}){return this.chain===n&&this.symbol===h}eq(n){return this.eqAsset(n)&&this.eqValue(n)}static fromUrl(n,h=0){const[t,o,x]=n.split(".");if(!(t&&o))throw new L({errorKey:"helpers_invalid_asset_url",info:{urlAsset:n}});const H=t==="THOR"&&x?`${t}.${o}/${x}`:n;return $.from({asset:H,value:h})}static from({value:n=0,fromBaseDecimal:h,asyncTokenLookup:t,...o}){const x=n instanceof p?n.getValue("string"):n,H="chain"in o,s=H?o.chain:o.asset,R=H||Rn.includes(s),{identifier:T,decimal:N}=R?An(s):{identifier:s,decimal:void 0},{chain:A,isSynthetic:G}=r(T),S=U.get(T.toUpperCase()),_=S?.decimal||N;xn(!(t||_),yn(`Couldn't find static decimal for ${Fn(T)} (Using default ${Fn(B[A])} decimal as fallback).
This can result in incorrect calculations and mess with amount sent on transactions.

@@ -6,2 +6,2 @@ You can load static assets by installing @swapkit/tokens package and calling AssetValue.loadStaticAssets()

//# debugId=3DFEC3B5857F7B8264756E2164756E21
//# debugId=AFA2D2DD73A4427E64756E2164756E21

@@ -6,12 +6,12 @@ {

"@swapkit/contracts": "1.0.4",
"@swapkit/tokens": "1.4.0",
"@swapkit/tokens": "1.5.0",
"picocolors": "1.0.1"
},
"devDependencies": {
"@swapkit/toolbox-cosmos": "1.2.1",
"@swapkit/toolbox-evm": "1.3.5",
"@swapkit/toolbox-radix": "1.0.27",
"@swapkit/toolbox-solana": "1.0.27",
"@swapkit/toolbox-substrate": "1.2.5",
"@swapkit/toolbox-utxo": "1.1.10"
"@swapkit/toolbox-cosmos": "1.3.0",
"@swapkit/toolbox-evm": "1.3.6",
"@swapkit/toolbox-radix": "1.0.28",
"@swapkit/toolbox-solana": "1.0.28",
"@swapkit/toolbox-substrate": "1.2.6",
"@swapkit/toolbox-utxo": "1.1.11"
},

@@ -41,3 +41,3 @@ "files": [

"types": "./src/index.ts",
"version": "1.7.1"
"version": "1.8.0"
}

@@ -55,3 +55,3 @@ import { ExplorerUrl, RPCUrl } from "./network";

Radix = "radix-mainnet",
THORChain = "thorchain-mainnet-v1",
THORChain = "thorchain-1",
THORChainStagenet = "thorchain-stagenet-v2",

@@ -58,0 +58,0 @@ Solana = "solana",

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