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.13.3 to 1.14.0

4

dist/index.js

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

var Gn=Object.create;var{getPrototypeOf:Ln,defineProperty:hn,getOwnPropertyNames:sn}=Object;var jn=Object.prototype.hasOwnProperty;var Hn=(n,h,H)=>{H=n!=null?Gn(Ln(n)):{};let x=h||!n||!n.__esModule?hn(H,"default",{value:n,enumerable:!0}):H;for(let R of sn(n))if(!jn.call(x,R))hn(x,R,{get:()=>n[R],enumerable:!0});return x};var xn=((n)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(n,{get:(h,H)=>(typeof require!=="undefined"?require:h)[H]}):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 p;((_)=>{_.Arbitrum="https://arb1.arbitrum.io/rpc";_.Avalanche="https://node-router.thorswap.net/avalanche-c";_.Base="https://base.llamarpc.com";_.BinanceSmartChain="https://bsc-dataseed.binance.org";_.Bitcoin="https://node-router.thorswap.net/bitcoin";_.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash";_.Chainflip="wss://mainnet-archive.chainflip.io";_.Cosmos="https://node-router.thorswap.net/cosmos/rpc";_.Dash="https://node-router.thorswap.net/dash";_.Dogecoin="https://node-router.thorswap.net/dogecoin";_.Ethereum="https://node-router.thorswap.net/ethereum";_.Kujira="https://rpc-kujira.synergynodes.com/";_.Litecoin="https://node-router.thorswap.net/litecoin";_.Maya="https://tendermint.mayachain.info";_.MayaStagenet="https://stagenet.tendermint.mayachain.info";_.Optimism="https://mainnet.optimism.io";_.Polkadot="wss://rpc.polkadot.io";_.Polygon="https://polygon-rpc.com";_.Radix="https://radix-mainnet.rpc.grove.city/v1/326002fc/core";_.THORChain="https://rpc.thorswap.net";_.THORChainStagenet="https://stagenet-rpc.ninerealms.com";_.Solana="https://solana-rpc.publicnode.com"})(p||={});var m;((C)=>{C.Arbitrum="https://arbiscan.io";C.Avalanche="https://snowtrace.io";C.Base="https://basescan.org";C.BinanceSmartChain="https://bscscan.com";C.Bitcoin="https://blockchair.com/bitcoin";C.BitcoinCash="https://www.blockchair.com/bitcoin-cash";C.Chainflip="https://explorer.polkascan.io/polkadot";C.Cosmos="https://www.mintscan.io/cosmos";C.Dash="https://blockchair.com/dash";C.Dogecoin="https://blockchair.com/dogecoin";C.Ethereum="https://etherscan.io";C.Kujira="https://finder.kujira.network/kaiyo-1";C.Litecoin="https://blockchair.com/litecoin";C.Maya="https://www.mayascan.org";C.Optimism="https://optimistic.etherscan.io";C.Polkadot="https://polkadot.subscan.io";C.Polygon="https://polygonscan.com";C.Radix="https://dashboard.radixdlt.com";C.THORChain="https://runescan.io";C.Solana="https://solscan.io"})(m||={});var X;((C)=>{C.Arbitrum="ARB";C.Avalanche="AVAX";C.Base="BASE";C.BinanceSmartChain="BSC";C.Bitcoin="BTC";C.BitcoinCash="BCH";C.Cosmos="GAIA";C.Dash="DASH";C.Dogecoin="DOGE";C.Ethereum="ETH";C.Kujira="KUJI";C.Litecoin="LTC";C.Maya="MAYA";C.Optimism="OP";C.Polkadot="DOT";C.Chainflip="FLIP";C.Polygon="MATIC";C.Radix="XRD";C.THORChain="THOR";C.Solana="SOL"})(X||={});var Q;((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"})(Q||={});var Oh={["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"},Xn=Object.keys(X),y=Object.values(X),k={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},$h=["DOT","FLIP"],K=["ARB","AVAX","BASE","BSC","ETH","OP","MATIC"],th=["BTC","BCH","DASH","DOGE","LTC"],_h=["GAIA","THOR","MAYA","KUJI"],Gh=["AVAX","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"],Lh=["ARB","DASH","ETH","KUJI","MAYA","THOR"],f=y.reduce((n,h)=>{let H=Xn.find((x)=>X[x]===h);if(H)n[h]=H;return n},{}),Rn=y.reduce((n,h)=>{return n[h]=Q[f[h]],n},{}),d=y.reduce((n,h)=>{return n[h]=p[f[h]],n},{}),sh=y.reduce((n,h)=>{let H=`${f[h]}Hex`;return n[h]=Q[H],n},{}),jh=y.reduce((n,h)=>{return n[h]=m[f[h]],n},{});var Jn;((t)=>{t.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC";t.TC_SUPPORTED_TO_ETH="TC-ERC20";t.TC_SUPPORTED_TO_AVAX="TC-ARC20";t.TC_SUPPORTED_TO_BSC="TC-BEP20";t.ETH_TO_TC_SUPPORTED="ERC20-TC";t.ETH_TO_ETH="ERC20-ERC20";t.ETH_TO_AVAX="ERC20-ARC20";t.ETH_TO_BSC="ERC20-BEP20";t.AVAX_TO_TC_SUPPORTED="ARC20-TC";t.AVAX_TO_ETH="ARC20-ERC20";t.AVAX_TO_AVAX="ARC20-ARC20";t.AVAX_TO_BSC="ARC20-BEP20";t.BSC_TO_TC_SUPPORTED="BEP20-TC";t.BSC_TO_ETH="BEP20-ERC20";t.BSC_TO_AVAX="BEP20-ARC20";t.BSC_TO_BSC="BEP20-BEP20"})(Jn||={});var Jh=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],Ih=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],Sh=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];var In;((o)=>{o.ARB="0x0000000000000000000000000000000000000000";o.AVAX="0x0000000000000000000000000000000000000000";o.BASE="0x0000000000000000000000000000000000000000";o.ETH="0x0000000000000000000000000000000000000000";o.BSC="0x0000000000000000000000000000000000000000";o.MATIC="0x0000000000000000000000000000000000001010";o.OP="0x4200000000000000000000000000000000000042"})(In||={});var Sn;((C)=>{C.ARB="m/44'/60'/0'/0";C.AVAX="m/44'/60'/0'/0";C.BASE="m/44'/60'/0'/0";C.BCH="m/44'/145'/0'/0";C.BSC="m/44'/60'/0'/0";C.BTC="m/84'/0'/0'/0";C.DASH="m/44'/5'/0'/0";C.DOGE="m/44'/3'/0'/0";C.DOT="////";C.ETH="m/44'/60'/0'/0";C.FLIP="////";C.GAIA="m/44'/118'/0'/0";C.KUJI="m/44'/118'/0'/0";C.LTC="m/84'/2'/0'/0";C.MATIC="m/44'/60'/0'/0";C.MAYA="m/44'/931'/0'/0";C.OP="m/44'/60'/0'/0";C.SOL="m/44'/501'/0'/0";C.THOR="m/44'/931'/0'/0";C.XRD="////"})(Sn||={});var b={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 Fn;(($)=>{$.BRAVE="BRAVE";$.COINBASE_MOBILE="COINBASE_MOBILE";$.COINBASE_WEB="COINBASE_WEB";$.EIP6963="EIP6963";$.EXODUS="EXODUS";$.KEEPKEY="KEEPKEY";$.KEEPKEY_BEX="KEEPKEY_BEX";$.KEPLR="KEPLR";$.KEYSTORE="KEYSTORE";$.LEAP="LEAP";$.LEDGER="LEDGER";$.LEDGER_LIVE="LEDGER_LIVE";$.METAMASK="METAMASK";$.OKX="OKX";$.OKX_MOBILE="OKX_MOBILE";$.PHANTOM="PHANTOM";$.POLKADOT_JS="POLKADOT_JS";$.RADIX_WALLET="RADIX_WALLET";$.TREZOR="TREZOR";$.TALISMAN="TALISMAN";$.TRUSTWALLET_WEB="TRUSTWALLET_WEB";$.WALLETCONNECT="WALLETCONNECT";$.XDEFI="XDEFI"})(Fn||={});var gn;((x)=>{x[x.NoError=36864]="NoError";x[x.LockedDevice=21781]="LockedDevice";x[x.TC_NotFound=65535]="TC_NotFound"})(gn||={});var zn;((x)=>{x.Average="average";x.Fast="fast";x.Fastest="fastest"})(zn||={});var Zn;((H)=>{H.Approve="approve";H.CheckOnly="checkOnly"})(Zn||={});var Bn;((T)=>{T.NAME_REGISTER="~";T.BOND="BOND";T.DEPOSIT="+";T.LEAVE="LEAVE";T.UNBOND="UNBOND";T.WITHDRAW="-";T.OPEN_LOAN="$+";T.CLOSE_LOAN="$-";T.RUNEPOOL_DEPOSIT="POOL+";T.RUNEPOOL_WITHDRAW="POOL-"})(Bn||={});var Yn;((F)=>{F.unknownError="unknownError";F.test_error="test_error";F.providerDetailsError="providerDetailsError";F.blockHeaderNotFound="blockHeaderNotFound";F.blockHashNotFoundAtHeight="blockHashNotFoundAtHeight";F.blockHashNotFoundAtHash="blockHashNotFoundAtHash";F.txHashMissing="txHashMissing";F.assetValueMissingInfo="assetValueMissingInfo";F.invalidAsset="invalidAsset";F.blockIsRequired="blockIsRequired";F.currentBlockHeaderNotFound="currentBlockHeaderNotFound";F.failedToRetrieveBalance="failedToRetrieveBalance";F.failedToRetrieveBlock="failedToRetrieveBlock";F.failedToRetrieveFees="failedToRetrieveFees";F.notImplementedBCH="notImplementedBCH";F.notImplementedDoge="notImplementedDoge";F.noPoolsFound="noPoolsFound";F.noVaultsFound="noVaultsFound";F.noTxFound="noTxFound";F.noInputCoinFound="noInputCoinFound";F.noBlockDataFound="noBlockDataFound";F.multipleCosmosMessages="multipleCosmosMessages";F.heightOrHashNotProvided="heightOrHashNotProvided";F.unknownDenom="unknownDenom";F.invalidBlockHeight="invalidBlockHeight";F.timestampExtrinsicNoArgumentsForBlock="timestampExtrinsicNoArgumentsForBlock";F.timestampExtrinsicNoTimestampForBlock="timestampExtrinsicNoTimestampForBlock";F.noTimestampExtrinsicForHash="noTimestampExtrinsicForHash";F.timestampExtrinsicNoArgumentsForHash="timestampExtrinsicNoArgumentsForHash";F.txMemoUndefined="txMemoUndefined";F.txMemoIncorrect="txMemoIncorrect";F.txTypeNotFound="txTypeNotFound";F.txNoMessage="txNoMessage";F.txNotFound="txNotFound";F.txReceiptNotFound="txReceiptNotFound";F.txParsingError="txParsingError";F.blockNotFound="blockNotFound";F.balanceNotFound="balanceNotFound";F.configError="configError";F.noQuoteResponse="noQuoteResponse";F.noPoolAssetsFound="noPoolAssetsFound";F.noThorchainPools="noThorchainPools";F.noMayachainPools="noMayachainPools";F.invalidAffiliateFee="invalidAffiliateFee";F.invalidBuyAssetAddress="invalidBuyAssetAddress";F.invalidSellAssetAddress="invalidSellAssetAddress";F.invalidSourceAddress="invalidSourceAddress";F.invalidDestinationAddress="invalidDestinationAddress";F.sourceAddressIsSmartContract="sourceAddressIsSmartContract";F.destinationAddressIsSmartContract="destinationAddressIsSmartContract";F.invalidChainId="invalidChainId";F.unsupportedChainId="unsupportedChainId";F.unsupportedEVMChainId="unsupportedEVMChainId";F.noWhitelistTokens="noWhitelistTokens";F.failedFetchGasPrice="failedFetchGasPrice";F.failedToCreateDepositChannel="failedToCreateDepositChannel";F.noProviderDetailsFound="noProviderDetailsFound";F.noTokenListsFound="noTokenListsFound";F.tokenNotFound="tokenNotFound";F.tokenPriceNotFound="tokenPriceNotFound";F.swapAmountTooSmall="swapAmountTooSmall";F.legsArrayIsEmpty="legsArrayIsEmpty";F.failedToFetchQuoteForLeg="failedToFetchQuoteForLeg";F.noBlockHeaderFound="noBlockHeaderFound";F.failedToSimulateSwap="failedToSimulateSwap";F.addressScreeningFailed="addressScreeningFailed";F.noLiquidtyProvidersFound="noLiquidtyProvidersFound";F.noSaversFound="noSaversFound";F.noInboundAddressesFound="noInboundAddressesFound";F.noInboundAddressFoundForChain="noInboundAddressFoundForChain";F.noLastBlocksFound="noLastBlocksFound";F.noVersionFound="noVersionFound";F.noConstantsFound="noConstantsFound";F.noMimirsFound="noMimirsFound";F.noRoutesFound="noRoutesFound";F.quoteNotFound="quoteNotFound";F.ledgerSignFailed="ledgerSignFailed";F.ledgerFetchSwapFailed="ledgerFetchSwapFailed";F.failedToFetchTx="failedToFetchTx";F.failedBuildTransactionDetails="failedBuildTransactionDetails";F.noLegsForRoute="noLegsForRoute";F.noRouterAddressFound="noRouterAddressFound";F.noAggregatorAddressFound="noAggregatorAddressFound";F.noContractInstanceFound="noContractInstanceFound";F.noContractAddressFound="noContractAddressFound";F.invalidAffiliate="invalidAffiliate";F.providerNotfound="No provider found";F.noRecordFound="No Record found";F.slippageTooLow="Slippage too low";F.tradingHalted="tradingHalted";F.noWrappedGasAsset="noWrappedGasAsset";F.aggregatorAddressNotFound="aggregatorAddressNotFound";F.routerAddressNotFound="routerAddressNotFound";F.dummyAddressNotFound="dummyAddressNotFound";F.trackerError="trackerError";F.noOhlcvDataFound="noOhlcvDataFound";F.noTradingPairs="noTradingPairs";F.noLoanPositionFound="noLoanPositionFound";F.noLendingAvailability="noLendingAvailability";F.lendingRepayTooSmall="lendingRepayTooSmall";F.missingState="missingState";F.ledgerSwapNotFound="ledgerSwapNotFound";F.ledgerSwapNotReadyForTracking="ledgerSwapNotReadyForTracking";F.errorEstimatingGas="errorEstimatingGas";F.apiKeyInvalid="apiKeyInvalid";F.apiKeyFailedToUpdate="apiKeyFailedToUpdate";F.apiKeyExpired="apiKeyExpired";F.unauthorized="unauthorized";F.failedToCreateMemo="failedToCreateMemo";F.radixIncorrectInstructions="radixIncorrectInstructions";F.invalidAddressForChain="invalidAddressForChain"})(Yn||={});var Pn;((H)=>{H.highSlippage="highSlippage";H.highPriceImpact="highPriceImpact"})(Pn||={});var wn;((G)=>{G.CHAINFLIP="CHAINFLIP";G.MAYACHAIN="MAYACHAIN";G.MAYACHAIN_STREAMING="MAYACHAIN_STREAMING";G.ONEINCH="ONEINCH";G.PANCAKESWAP="PANCAKESWAP";G.PANGOLIN_V1="PANGOLIN_V1";G.SUSHISWAP_V2="SUSHISWAP_V2";G.THORCHAIN="THORCHAIN";G.THORCHAIN_STREAMING="THORCHAIN_STREAMING";G.TRADERJOE_V2="TRADERJOE_V2";G.UNISWAP_V2="UNISWAP_V2";G.UNISWAP_V3="UNISWAP_V3";G.CAVIAR_V1="CAVIAR_V1"})(wn||={});var qn;((N)=>{N.LIQUIDITY="liquidity";N.NETWORK="network";N.INBOUND="inbound";N.OUTBOUND="outbound";N.AFFILIATE="affiliate";N.TAX="tax"})(qn||={});var a={},Qn=typeof window!=="undefined"?{}:{referrer:"https://sk.thorswap.net",referer:"https://sk.thorswap.net"};function fh({apiKey:n,...h}){a={...h,apiKey:n}}async function U(n,h){let{apiKey:H,...x}=a,{searchParams:R,json:B,body:N}=h,o={...Qn,...x.headers,...h.headers,...B?{"Content-Type":"application/json"}:{}},O=B?JSON.stringify(B):N,A=new URL(n);if(R)A.search=new URLSearchParams(R).toString();if(H)o["x-api-key"]=H;try{let j=await(await fetch(A.toString(),{...x,...h,body:O,headers:o})).json();if(h.responseHandler)return h.responseHandler(j);return j}catch(T){if(h.onError)return h.onError(T);console.error(T)}}var w={get:async(n,h)=>U(n,{...h,method:"GET"}),post:async(n,h)=>U(n,{...h,method:"POST"}),extend:(n)=>{let h={...a,...n};return{get:async(H,x)=>U(H,{...h,...x,method:"GET"}),post:async(H,x)=>U(H,{...h,...x,method:"POST"}),extend:(H)=>w.extend({...h,...H})}}};var yn={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,core_transaction_invalid_recipient_address:10317,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,wallet_radix_not_found:20801,wallet_radix_transaction_failed:20802,wallet_keepkey_not_found:20900,wallet_keepkey_asset_not_defined:20901,wallet_keepkey_contract_address_not_provided:20902,wallet_keepkey_send_transaction_no_address:20903,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,thorchain_preferred_asset_payout_required:40104,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,toolbox_radix_signer_not_defined:90301,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 s extends Error{static ErrorCode=yn;constructor(n,h){let H=typeof n==="string",x=H?n:n.errorKey;if(h)console.error(h,{stack:h?.stack,message:h?.message});super(x,{cause:{code:s.ErrorCode[x],message:`${x}${H?"":`: ${JSON.stringify(n.info)}`}`}});Object.setPrototypeOf(this,s.prototype)}}function mh(n){if(n<0)throw new s({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return 10+n}function dh(n){if(n<0)throw new s({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(H){if(h)throw new s(h,H);return console.error(H)}}function ih(n){switch(n){case"THOR":return`${n}.RUNE`;case"GAIA":return`${n}.ATOM`;case"BSC":return`${n}`;default:return`${n}.${n}`}}var Wn=["production","test"].includes("development"),Nn=new Set;function Cn(n,h){if(!Wn&&n){if(Nn.has(h))return;Nn.add(h),console.warn(h)}}async function lh(n="thorchain-1"){if(!["thorchain-stagenet-v2","thorchain-1","thorchain-mainnet-v1"].includes(n))return n;try{return(await w.get(`${n!=="thorchain-1"?"https://stagenet-rpc.ninerealms.com":"https://rpc.thorswap.net"}/status`)).result.node_info.network}catch(h){return n}}var on=[...Object.values(X),"TERRA"];function An(n=""){let h=n.toUpperCase(),[H]=h.split(".");if(on.includes(H))return!0;let[x]=h.split("/");if(on.includes(x))return!0;throw new s({errorKey:"helpers_invalid_identifier",info:{message:`Invalid identifier: ${n}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`,identifier:n}})}function hH(n){if(n.length>30)return!1;let h=/^[a-zA-Z0-9+_-]+$/g;return!!n.match(h)}var V=8,P=(n)=>10n**BigInt(n),W=(n)=>Math.log10(Number.parseFloat(n.toString()));function q({value:n,bigIntDecimal:h=V,decimal:H=V}){if(H===0)return n.toString();let x=n<0n,R=n.toString().substring(x?1:0),B=H-(R.length-1);if(B>0)R="0".repeat(B)+R;let N=R.length-H,o=R.slice(-H);if(Number.parseInt(o[h]||"0")>=5)o=`${o.substring(0,h-1)}${(Number.parseInt(o[h-1]||"0")+1).toString()}`;else o=o.substring(0,h);return`${x?"-":""}${R.slice(0,N)}.${o}`.replace(/\.?0*$/,"")}class z{decimalMultiplier=10n**8n;bigIntValue=0n;decimal;static fromBigInt(n,h){return new z({decimal:h,value:q({value:n,bigIntDecimal:h,decimal:h})})}static shiftDecimals({value:n,from:h,to:H}){return z.fromBigInt(n.getBaseValue("bigint")*P(H)/P(h),H)}constructor(n){let h=i(n),H=typeof n==="object";this.decimal=H?n.decimal:void 0,this.decimalMultiplier=H&&"decimalMultiplier"in n?n.decimalMultiplier:P(Math.max(cn(D(h)),this.decimal||0)),this.#R(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){let h=this.formatBigIntToSafeValue(this.bigIntValue,this.decimal||W(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){let h=this.decimalMultiplier/P(this.decimal||k.THOR),H=this.bigIntValue/h;switch(n){case"number":return Number(H);case"string":return H.toString();case"bigint":return H}}getBigIntValue(n,h){if(!h&&typeof n==="object")return n.bigIntValue;let H=i(n),x=D(H);if(x==="0"||x==="undefined")return 0n;return this.#x(x,h)}toSignificant(n=6){let[h,H]=this.getValue("string").split("."),x=h||"",R=H||"";if((Number.parseInt(x)?x.length+R.length:R.length)<=n)return this.getValue("string");if(x.length>=n)return x.slice(0,n).padEnd(x.length,"0");if(Number.parseInt(x))return`${x}.${R.slice(0,n-x.length)}`.padEnd(n-x.length,"0");let N=Number.parseInt(R),o=`${N}`.slice(0,n);return`0.${o.padStart(R.length-`${N}`.length+o.length,"0")}`}toFixed(n=6){let[h,H]=this.getValue("string").split("."),x=h||"",R=H||"";if(Number.parseInt(x))return`${x}.${R.slice(0,n)}`.padEnd(n,"0");let B=Number.parseInt(R),N=`${B}`.slice(0,n);return`0.${N.padStart(R.length-`${B}`.length+N.length,"0")}`}toAbbreviation(n=2){let h=this.getValue("number"),H=["","K","M","B","T","Q","Qi","S"],x=Math.floor(Math.log10(Math.abs(h))/3),R=H[x];if(!R)return this.getValue("string");let B=10**(x*3);return`${(h/B).toFixed(n)}${R}`}toCurrency(n="$",{currencyPosition:h="start",decimal:H=2,decimalSeparator:x=".",thousandSeparator:R=","}={}){let B=this.getValue("number"),[N="",o=""]=B.toFixed(6).split("."),O=N.replace(/\B(?=(\d{3})+(?!\d))/g,R),A=N||o?N==="0"?`${Number.parseFloat(`0.${o}`)}`.replace(".",x):`${O}${Number.parseInt(o)?`${x}${o.slice(0,H)}`:""}`:"0.00";return`${h==="start"?n:""}${A}${h==="end"?n:""}`}formatBigIntToSafeValue(n,h){let H=h||this.decimal||V,x=Math.max(H,W(this.decimalMultiplier)),R=n<0n,B=n.toString().substring(R?1:0),N=x-(B.length-1),o=N>0?"0".repeat(N)+B:B,O=o.length-x,A=o.slice(-x);if(Number.parseInt(A[H]||"0")>=5)A=`${A.substring(0,H-1)}${(Number.parseInt(A[H-1]||"0")+1).toString()}`;else A=A.substring(0,H);return`${R?"-":""}${o.slice(0,O)}.${A}`.replace(/\.?0*$/,"")}#h(n,...h){let H=this.#H(this,...h),x=Math.max(H,W(this.decimalMultiplier)),R=P(x),B=h.reduce((o,O)=>{let A=this.getBigIntValue(O,x);switch(n){case"add":return o+A;case"sub":return o-A;case"mul":return o*A/R;case"div":{if(A===0n)throw new RangeError("Division by zero");return o*R/A}default:return o}},this.bigIntValue*R/this.decimalMultiplier),N=q({bigIntDecimal:x,decimal:x,value:B});return new this.constructor({decimalMultiplier:P(x),decimal:this.decimal,value:N,identifier:this.toString()})}#n(n,...h){let H=this.#H(this,...h),x=this.getBigIntValue(h[0]||"0",H),R=this.getBigIntValue(this,H);switch(n){case"gt":return R>x;case"gte":return R>=x;case"lt":return R<x;case"lte":return R<=x;case"eqValue":return R===x}}#R(n){let h=D(n)||"0";this.bigIntValue=this.#x(h)}#H(...n){let h=n.map((H)=>{return typeof H==="object"?H.decimal||W(H.decimalMultiplier):cn(D(H))}).filter(Boolean);return Math.max(...h,V)}#x(n,h){let H=h?P(h):this.decimalMultiplier,x=W(H),[R="",B=""]=n.split(".");return BigInt(`${R}${B.padEnd(x,"0")}`)}}var Vn=Intl.NumberFormat("fullwide",{useGrouping:!1,maximumFractionDigits:20});function D(n){let H=`${typeof n==="number"?Vn.format(n):i(n)}`.replaceAll(",",".").split(".");return H.length>1?`${H.slice(0,-1).join("")}.${H.at(-1)}`:H[0]||"0"}function cn(n){let h=n.split(".")[1]?.length||0;return Math.max(h,V)}function i(n){return typeof n==="object"?"getValue"in n?n.getValue("string"):n.value:n}var E=new Map;class L extends z{address;chain;isGasAsset=!1;isSynthetic=!1;isTradeAsset=!1;symbol;tax;ticker;type;chainId;constructor({value:n,decimal:h,tax:H,chain:x,symbol:R,identifier:B}){super(typeof n==="object"?n:{decimal:h,value:n});let N=l(B||`${x}.${R}`);this.type=$n(N),this.tax=H,this.chain=N.chain,this.ticker=N.ticker,this.symbol=N.symbol,this.address=N.address,this.isSynthetic=N.isSynthetic,this.isTradeAsset=N.isTradeAsset,this.isGasAsset=N.isGasAsset,this.chainId=Rn[N.chain]}toString({includeSynthProtocol:n}={}){return(this.isSynthetic||this.isTradeAsset)&&!n?this.symbol:`${this.chain}.${this.symbol}`}toUrl(){return this.isSynthetic?`${this.chain}.${this.symbol.replace("/",".")}`:this.isTradeAsset?`${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){let[H,x,R]=n.split(".");if(!(H&&x))throw new s({errorKey:"helpers_invalid_asset_url",info:{urlAsset:n}});let B=H==="THOR"&&R?`${H}.${x}/${R}`:n;return L.from({asset:B,value:h})}static from({value:n=0,fromBaseDecimal:h,asyncTokenLookup:H,...x}){let R=n instanceof z?n.getValue("string"):n,B="chain"in x,N=B?x.chain:x.asset,o=B||Tn.includes(N),{identifier:O,decimal:A}=o?On(N):{identifier:N,decimal:void 0},{chain:T,isSynthetic:j,isTradeAsset:I}=l(O),G=E.get(T==="SOL"?O:O.toUpperCase()),Z=G?.decimal||A;Cn(!(H||Z),`Couldn't find static decimal for ${O} (Using default ${k[T]} decimal as fallback).
var Gn=Object.create;var{getPrototypeOf:Ln,defineProperty:hn,getOwnPropertyNames:sn}=Object;var jn=Object.prototype.hasOwnProperty;var Hn=(n,h,H)=>{H=n!=null?Gn(Ln(n)):{};let x=h||!n||!n.__esModule?hn(H,"default",{value:n,enumerable:!0}):H;for(let R of sn(n))if(!jn.call(x,R))hn(x,R,{get:()=>n[R],enumerable:!0});return x};var xn=((n)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(n,{get:(h,H)=>(typeof require!=="undefined"?require:h)[H]}):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 p;((_)=>{_.Arbitrum="https://arb1.arbitrum.io/rpc";_.Avalanche="https://node-router.thorswap.net/avalanche-c";_.Base="https://base.llamarpc.com";_.BinanceSmartChain="https://bsc-dataseed.binance.org";_.Bitcoin="https://node-router.thorswap.net/bitcoin";_.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash";_.Chainflip="wss://mainnet-archive.chainflip.io";_.Cosmos="https://node-router.thorswap.net/cosmos/rpc";_.Dash="https://node-router.thorswap.net/dash";_.Dogecoin="https://node-router.thorswap.net/dogecoin";_.Ethereum="https://node-router.thorswap.net/ethereum";_.Kujira="https://rpc-kujira.synergynodes.com/";_.Litecoin="https://node-router.thorswap.net/litecoin";_.Maya="https://tendermint.mayachain.info";_.MayaStagenet="https://stagenet.tendermint.mayachain.info";_.Optimism="https://mainnet.optimism.io";_.Polkadot="wss://rpc.polkadot.io";_.Polygon="https://polygon-rpc.com";_.Radix="https://radix-mainnet.rpc.grove.city/v1/326002fc/core";_.THORChain="https://rpc.thorswap.net";_.THORChainStagenet="https://stagenet-rpc.ninerealms.com";_.Solana="https://solana-rpc.publicnode.com"})(p||={});var m;((C)=>{C.Arbitrum="https://arbiscan.io";C.Avalanche="https://snowtrace.io";C.Base="https://basescan.org";C.BinanceSmartChain="https://bscscan.com";C.Bitcoin="https://blockchair.com/bitcoin";C.BitcoinCash="https://www.blockchair.com/bitcoin-cash";C.Chainflip="https://explorer.polkascan.io/polkadot";C.Cosmos="https://www.mintscan.io/cosmos";C.Dash="https://blockchair.com/dash";C.Dogecoin="https://blockchair.com/dogecoin";C.Ethereum="https://etherscan.io";C.Kujira="https://finder.kujira.network/kaiyo-1";C.Litecoin="https://blockchair.com/litecoin";C.Maya="https://www.mayascan.org";C.Optimism="https://optimistic.etherscan.io";C.Polkadot="https://polkadot.subscan.io";C.Polygon="https://polygonscan.com";C.Radix="https://dashboard.radixdlt.com";C.THORChain="https://runescan.io";C.Solana="https://solscan.io"})(m||={});var X;((C)=>{C.Arbitrum="ARB";C.Avalanche="AVAX";C.Base="BASE";C.BinanceSmartChain="BSC";C.Bitcoin="BTC";C.BitcoinCash="BCH";C.Cosmos="GAIA";C.Dash="DASH";C.Dogecoin="DOGE";C.Ethereum="ETH";C.Kujira="KUJI";C.Litecoin="LTC";C.Maya="MAYA";C.Optimism="OP";C.Polkadot="DOT";C.Chainflip="FLIP";C.Polygon="MATIC";C.Radix="XRD";C.THORChain="THOR";C.Solana="SOL"})(X||={});var Q;((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"})(Q||={});var Oh={["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"},Xn=Object.keys(X),y=Object.values(X),k={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},$h=["DOT","FLIP"],K=["ARB","AVAX","BASE","BSC","ETH","OP","MATIC"],th=["BTC","BCH","DASH","DOGE","LTC"],_h=["GAIA","THOR","MAYA","KUJI"],Gh=["AVAX","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"],Lh=["ARB","DASH","ETH","KUJI","MAYA","THOR"],f=y.reduce((n,h)=>{let H=Xn.find((x)=>X[x]===h);if(H)n[h]=H;return n},{}),Rn=y.reduce((n,h)=>{return n[h]=Q[f[h]],n},{}),d=y.reduce((n,h)=>{return n[h]=p[f[h]],n},{}),sh=y.reduce((n,h)=>{let H=`${f[h]}Hex`;return n[h]=Q[H],n},{}),jh=y.reduce((n,h)=>{return n[h]=m[f[h]],n},{});var Jn;((t)=>{t.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC";t.TC_SUPPORTED_TO_ETH="TC-ERC20";t.TC_SUPPORTED_TO_AVAX="TC-ARC20";t.TC_SUPPORTED_TO_BSC="TC-BEP20";t.ETH_TO_TC_SUPPORTED="ERC20-TC";t.ETH_TO_ETH="ERC20-ERC20";t.ETH_TO_AVAX="ERC20-ARC20";t.ETH_TO_BSC="ERC20-BEP20";t.AVAX_TO_TC_SUPPORTED="ARC20-TC";t.AVAX_TO_ETH="ARC20-ERC20";t.AVAX_TO_AVAX="ARC20-ARC20";t.AVAX_TO_BSC="ARC20-BEP20";t.BSC_TO_TC_SUPPORTED="BEP20-TC";t.BSC_TO_ETH="BEP20-ERC20";t.BSC_TO_AVAX="BEP20-ARC20";t.BSC_TO_BSC="BEP20-BEP20"})(Jn||={});var Jh=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],Ih=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],Sh=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];var In;((o)=>{o.ARB="0x0000000000000000000000000000000000000000";o.AVAX="0x0000000000000000000000000000000000000000";o.BASE="0x0000000000000000000000000000000000000000";o.ETH="0x0000000000000000000000000000000000000000";o.BSC="0x0000000000000000000000000000000000000000";o.MATIC="0x0000000000000000000000000000000000001010";o.OP="0x4200000000000000000000000000000000000042"})(In||={});var Sn;((C)=>{C.ARB="m/44'/60'/0'/0";C.AVAX="m/44'/60'/0'/0";C.BASE="m/44'/60'/0'/0";C.BCH="m/44'/145'/0'/0";C.BSC="m/44'/60'/0'/0";C.BTC="m/84'/0'/0'/0";C.DASH="m/44'/5'/0'/0";C.DOGE="m/44'/3'/0'/0";C.DOT="////";C.ETH="m/44'/60'/0'/0";C.FLIP="////";C.GAIA="m/44'/118'/0'/0";C.KUJI="m/44'/118'/0'/0";C.LTC="m/84'/2'/0'/0";C.MATIC="m/44'/60'/0'/0";C.MAYA="m/44'/931'/0'/0";C.OP="m/44'/60'/0'/0";C.SOL="m/44'/501'/0'/0";C.THOR="m/44'/931'/0'/0";C.XRD="////"})(Sn||={});var b={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 Fn;(($)=>{$.BRAVE="BRAVE";$.COINBASE_MOBILE="COINBASE_MOBILE";$.COINBASE_WEB="COINBASE_WEB";$.EIP6963="EIP6963";$.EXODUS="EXODUS";$.KEEPKEY="KEEPKEY";$.KEEPKEY_BEX="KEEPKEY_BEX";$.KEPLR="KEPLR";$.KEYSTORE="KEYSTORE";$.LEAP="LEAP";$.LEDGER="LEDGER";$.LEDGER_LIVE="LEDGER_LIVE";$.METAMASK="METAMASK";$.OKX="OKX";$.OKX_MOBILE="OKX_MOBILE";$.PHANTOM="PHANTOM";$.POLKADOT_JS="POLKADOT_JS";$.RADIX_WALLET="RADIX_WALLET";$.TREZOR="TREZOR";$.TALISMAN="TALISMAN";$.TRUSTWALLET_WEB="TRUSTWALLET_WEB";$.WALLETCONNECT="WALLETCONNECT";$.XDEFI="XDEFI"})(Fn||={});var gn;((x)=>{x[x.NoError=36864]="NoError";x[x.LockedDevice=21781]="LockedDevice";x[x.TC_NotFound=65535]="TC_NotFound"})(gn||={});var zn;((x)=>{x.Average="average";x.Fast="fast";x.Fastest="fastest"})(zn||={});var Zn;((H)=>{H.Approve="approve";H.CheckOnly="checkOnly"})(Zn||={});var Bn;((T)=>{T.NAME_REGISTER="~";T.BOND="BOND";T.DEPOSIT="+";T.LEAVE="LEAVE";T.UNBOND="UNBOND";T.WITHDRAW="-";T.OPEN_LOAN="$+";T.CLOSE_LOAN="$-";T.RUNEPOOL_DEPOSIT="POOL+";T.RUNEPOOL_WITHDRAW="POOL-"})(Bn||={});var Yn;((F)=>{F.unknownError="unknownError";F.test_error="test_error";F.providerDetailsError="providerDetailsError";F.blockHeaderNotFound="blockHeaderNotFound";F.blockHashNotFoundAtHeight="blockHashNotFoundAtHeight";F.blockHashNotFoundAtHash="blockHashNotFoundAtHash";F.txHashMissing="txHashMissing";F.assetValueMissingInfo="assetValueMissingInfo";F.invalidAsset="invalidAsset";F.blockIsRequired="blockIsRequired";F.currentBlockHeaderNotFound="currentBlockHeaderNotFound";F.failedToRetrieveBalance="failedToRetrieveBalance";F.failedToRetrieveBlock="failedToRetrieveBlock";F.failedToRetrieveFees="failedToRetrieveFees";F.notImplementedBCH="notImplementedBCH";F.notImplementedDoge="notImplementedDoge";F.noPoolsFound="noPoolsFound";F.noVaultsFound="noVaultsFound";F.noTxFound="noTxFound";F.noInputCoinFound="noInputCoinFound";F.noBlockDataFound="noBlockDataFound";F.multipleCosmosMessages="multipleCosmosMessages";F.heightOrHashNotProvided="heightOrHashNotProvided";F.unknownDenom="unknownDenom";F.invalidBlockHeight="invalidBlockHeight";F.timestampExtrinsicNoArgumentsForBlock="timestampExtrinsicNoArgumentsForBlock";F.timestampExtrinsicNoTimestampForBlock="timestampExtrinsicNoTimestampForBlock";F.noTimestampExtrinsicForHash="noTimestampExtrinsicForHash";F.timestampExtrinsicNoArgumentsForHash="timestampExtrinsicNoArgumentsForHash";F.txMemoUndefined="txMemoUndefined";F.txMemoIncorrect="txMemoIncorrect";F.txTypeNotFound="txTypeNotFound";F.txNoMessage="txNoMessage";F.txNotFound="txNotFound";F.txReceiptNotFound="txReceiptNotFound";F.txParsingError="txParsingError";F.blockNotFound="blockNotFound";F.balanceNotFound="balanceNotFound";F.configError="configError";F.noQuoteResponse="noQuoteResponse";F.noPoolAssetsFound="noPoolAssetsFound";F.noThorchainPools="noThorchainPools";F.noMayachainPools="noMayachainPools";F.invalidAffiliateFee="invalidAffiliateFee";F.invalidBuyAssetAddress="invalidBuyAssetAddress";F.invalidSellAssetAddress="invalidSellAssetAddress";F.invalidSourceAddress="invalidSourceAddress";F.invalidDestinationAddress="invalidDestinationAddress";F.sourceAddressIsSmartContract="sourceAddressIsSmartContract";F.destinationAddressIsSmartContract="destinationAddressIsSmartContract";F.invalidChainId="invalidChainId";F.unsupportedChainId="unsupportedChainId";F.unsupportedEVMChainId="unsupportedEVMChainId";F.noWhitelistTokens="noWhitelistTokens";F.failedFetchGasPrice="failedFetchGasPrice";F.failedToCreateDepositChannel="failedToCreateDepositChannel";F.noProviderDetailsFound="noProviderDetailsFound";F.noTokenListsFound="noTokenListsFound";F.tokenNotFound="tokenNotFound";F.tokenPriceNotFound="tokenPriceNotFound";F.swapAmountTooSmall="swapAmountTooSmall";F.legsArrayIsEmpty="legsArrayIsEmpty";F.failedToFetchQuoteForLeg="failedToFetchQuoteForLeg";F.noBlockHeaderFound="noBlockHeaderFound";F.failedToSimulateSwap="failedToSimulateSwap";F.addressScreeningFailed="addressScreeningFailed";F.noLiquidtyProvidersFound="noLiquidtyProvidersFound";F.noSaversFound="noSaversFound";F.noInboundAddressesFound="noInboundAddressesFound";F.noInboundAddressFoundForChain="noInboundAddressFoundForChain";F.noLastBlocksFound="noLastBlocksFound";F.noVersionFound="noVersionFound";F.noConstantsFound="noConstantsFound";F.noMimirsFound="noMimirsFound";F.noRoutesFound="noRoutesFound";F.quoteNotFound="quoteNotFound";F.ledgerSignFailed="ledgerSignFailed";F.ledgerFetchSwapFailed="ledgerFetchSwapFailed";F.failedToFetchTx="failedToFetchTx";F.failedBuildTransactionDetails="failedBuildTransactionDetails";F.noLegsForRoute="noLegsForRoute";F.noRouterAddressFound="noRouterAddressFound";F.noAggregatorAddressFound="noAggregatorAddressFound";F.noContractInstanceFound="noContractInstanceFound";F.noContractAddressFound="noContractAddressFound";F.invalidAffiliate="invalidAffiliate";F.providerNotfound="No provider found";F.noRecordFound="No Record found";F.slippageTooLow="Slippage too low";F.tradingHalted="tradingHalted";F.noWrappedGasAsset="noWrappedGasAsset";F.aggregatorAddressNotFound="aggregatorAddressNotFound";F.routerAddressNotFound="routerAddressNotFound";F.dummyAddressNotFound="dummyAddressNotFound";F.trackerError="trackerError";F.noOhlcvDataFound="noOhlcvDataFound";F.noTradingPairs="noTradingPairs";F.noLoanPositionFound="noLoanPositionFound";F.noLendingAvailability="noLendingAvailability";F.lendingRepayTooSmall="lendingRepayTooSmall";F.missingState="missingState";F.ledgerSwapNotFound="ledgerSwapNotFound";F.ledgerSwapNotReadyForTracking="ledgerSwapNotReadyForTracking";F.errorEstimatingGas="errorEstimatingGas";F.apiKeyInvalid="apiKeyInvalid";F.apiKeyFailedToUpdate="apiKeyFailedToUpdate";F.apiKeyExpired="apiKeyExpired";F.unauthorized="unauthorized";F.failedToCreateMemo="failedToCreateMemo";F.radixIncorrectInstructions="radixIncorrectInstructions";F.invalidAddressForChain="invalidAddressForChain"})(Yn||={});var Pn;((H)=>{H.highSlippage="highSlippage";H.highPriceImpact="highPriceImpact"})(Pn||={});var wn;((G)=>{G.CHAINFLIP="CHAINFLIP";G.MAYACHAIN="MAYACHAIN";G.MAYACHAIN_STREAMING="MAYACHAIN_STREAMING";G.ONEINCH="ONEINCH";G.PANCAKESWAP="PANCAKESWAP";G.PANGOLIN_V1="PANGOLIN_V1";G.SUSHISWAP_V2="SUSHISWAP_V2";G.THORCHAIN="THORCHAIN";G.THORCHAIN_STREAMING="THORCHAIN_STREAMING";G.TRADERJOE_V2="TRADERJOE_V2";G.UNISWAP_V2="UNISWAP_V2";G.UNISWAP_V3="UNISWAP_V3";G.CAVIAR_V1="CAVIAR_V1"})(wn||={});var qn;((N)=>{N.LIQUIDITY="liquidity";N.NETWORK="network";N.INBOUND="inbound";N.OUTBOUND="outbound";N.AFFILIATE="affiliate";N.TAX="tax"})(qn||={});var a={},Qn=typeof window!=="undefined"?{}:{referrer:"https://sk.thorswap.net",referer:"https://sk.thorswap.net"};function fh({apiKey:n,...h}){a={...h,apiKey:n}}async function U(n,h){let{apiKey:H,...x}=a,{searchParams:R,json:B,body:N}=h,o={...Qn,...x.headers,...h.headers,...B?{"Content-Type":"application/json"}:{}},O=B?JSON.stringify(B):N,A=new URL(n);if(R)A.search=new URLSearchParams(R).toString();if(H)o["x-api-key"]=H;try{let j=await(await fetch(A.toString(),{...x,...h,body:O,headers:o})).json();if(h.responseHandler)return h.responseHandler(j);return j}catch(T){if(h.onError)return h.onError(T);console.error(T)}}var w={get:async(n,h)=>U(n,{...h,method:"GET"}),post:async(n,h)=>U(n,{...h,method:"POST"}),extend:(n)=>{let h={...a,...n};return{get:async(H,x)=>U(H,{...h,...x,method:"GET"}),post:async(H,x)=>U(H,{...h,...x,method:"POST"}),extend:(H)=>w.extend({...h,...H})}}};var yn={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,core_transaction_invalid_recipient_address:10317,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,wallet_radix_not_found:20801,wallet_radix_transaction_failed:20802,wallet_keepkey_not_found:20900,wallet_keepkey_asset_not_defined:20901,wallet_keepkey_contract_address_not_provided:20902,wallet_keepkey_send_transaction_no_address:20903,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,thorchain_preferred_asset_payout_required:40104,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,toolbox_radix_signer_not_defined:90301,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 s extends Error{static ErrorCode=yn;constructor(n,h){let H=typeof n==="string",x=H?n:n.errorKey;if(h)console.error(h,{stack:h?.stack,message:h?.message});super(x,{cause:{code:s.ErrorCode[x],message:`${x}${H?"":`: ${JSON.stringify(n.info)}`}`}});Object.setPrototypeOf(this,s.prototype)}}function mh(n){if(n<0)throw new s({errorKey:"helpers_invalid_number_of_years",info:{numberOfYears:n}});return 10+n}function dh(n){if(n<0)throw new s({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(H){if(h)throw new s(h,H);return console.error(H)}}function ih(n){switch(n){case"THOR":return`${n}.RUNE`;case"GAIA":return`${n}.ATOM`;case"BSC":return`${n}`;default:return`${n}.${n}`}}var Wn=["production","test"].includes("development"),Nn=new Set;function Cn(n,h){if(!Wn&&n){if(Nn.has(h))return;Nn.add(h),console.warn(h)}}async function lh(n="thorchain-1"){if(!["thorchain-stagenet-v2","thorchain-1","thorchain-mainnet-v1"].includes(n))return n;try{return(await w.get(`${n!=="thorchain-1"?"https://stagenet-rpc.ninerealms.com":"https://rpc.thorswap.net"}/status`)).result.node_info.network}catch(h){return n}}var on=[...Object.values(X),"TERRA"];function An(n=""){let h=n.toUpperCase(),[H]=h.split(".");if(on.includes(H))return!0;let[x]=h.split("/");if(on.includes(x))return!0;throw new s({errorKey:"helpers_invalid_identifier",info:{message:`Invalid identifier: ${n}. Expected format: <Chain>.<Ticker> or <Chain>.<Ticker>-<ContractAddress>`,identifier:n}})}function hH(n){if(n.length>30)return!1;let h=/^[a-zA-Z0-9+_-]+$/g;return!!n.match(h)}var V=8,P=(n)=>10n**BigInt(n),W=(n)=>Math.log10(Number.parseFloat(n.toString()));function q({value:n,bigIntDecimal:h=V,decimal:H=V}){if(H===0)return n.toString();let x=n<0n,R=n.toString().substring(x?1:0),B=H-(R.length-1);if(B>0)R="0".repeat(B)+R;let N=R.length-H,o=R.slice(-H);if(Number.parseInt(o[h]||"0")>=5)o=`${o.substring(0,h-1)}${(Number.parseInt(o[h-1]||"0")+1).toString()}`;else o=o.substring(0,h);return`${x?"-":""}${R.slice(0,N)}.${o}`.replace(/\.?0*$/,"")}class z{decimalMultiplier=10n**8n;bigIntValue=0n;decimal;static fromBigInt(n,h){return new z({decimal:h,value:q({value:n,bigIntDecimal:h,decimal:h})})}static shiftDecimals({value:n,from:h,to:H}){return z.fromBigInt(n.getBaseValue("bigint")*P(H)/P(h),H)}constructor(n){let h=i(n),H=typeof n==="object";this.decimal=H?n.decimal:void 0,this.decimalMultiplier=H&&"decimalMultiplier"in n?n.decimalMultiplier:P(Math.max(cn(D(h)),this.decimal||0)),this.#R(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,h){let H=this.formatBigIntToSafeValue(this.bigIntValue,h||this.decimal||W(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,h){let H=this.decimalMultiplier/P(h||this.decimal||k.THOR),x=this.bigIntValue/H;switch(n){case"number":return Number(x);case"string":return x.toString();case"bigint":return x}}getBigIntValue(n,h){if(!h&&typeof n==="object")return n.bigIntValue;let H=i(n),x=D(H);if(x==="0"||x==="undefined")return 0n;return this.#x(x,h)}toSignificant(n=6){let[h,H]=this.getValue("string").split("."),x=h||"",R=H||"";if((Number.parseInt(x)?x.length+R.length:R.length)<=n)return this.getValue("string");if(x.length>=n)return x.slice(0,n).padEnd(x.length,"0");if(Number.parseInt(x))return`${x}.${R.slice(0,n-x.length)}`.padEnd(n-x.length,"0");let N=Number.parseInt(R),o=`${N}`.slice(0,n);return`0.${o.padStart(R.length-`${N}`.length+o.length,"0")}`}toFixed(n=6){let[h,H]=this.getValue("string").split("."),x=h||"",R=H||"";if(Number.parseInt(x))return`${x}.${R.slice(0,n)}`.padEnd(n,"0");let B=Number.parseInt(R),N=`${B}`.slice(0,n);return`0.${N.padStart(R.length-`${B}`.length+N.length,"0")}`}toAbbreviation(n=2){let h=this.getValue("number"),H=["","K","M","B","T","Q","Qi","S"],x=Math.floor(Math.log10(Math.abs(h))/3),R=H[x];if(!R)return this.getValue("string");let B=10**(x*3);return`${(h/B).toFixed(n)}${R}`}toCurrency(n="$",{currencyPosition:h="start",decimal:H=2,decimalSeparator:x=".",thousandSeparator:R=","}={}){let B=this.getValue("number"),[N="",o=""]=B.toFixed(6).split("."),O=N.replace(/\B(?=(\d{3})+(?!\d))/g,R),A=N||o?N==="0"?`${Number.parseFloat(`0.${o}`)}`.replace(".",x):`${O}${Number.parseInt(o)?`${x}${o.slice(0,H)}`:""}`:"0.00";return`${h==="start"?n:""}${A}${h==="end"?n:""}`}formatBigIntToSafeValue(n,h){let H=h||this.decimal||V,x=Math.max(H,W(this.decimalMultiplier)),R=n<0n,B=n.toString().substring(R?1:0),N=x-(B.length-1),o=N>0?"0".repeat(N)+B:B,O=o.length-x,A=o.slice(-x);if(Number.parseInt(A[H]||"0")>=5)A=`${A.substring(0,H-1)}${(Number.parseInt(A[H-1]||"0")+1).toString()}`;else A=A.substring(0,H);return`${R?"-":""}${o.slice(0,O)}.${A}`.replace(/\.?0*$/,"")}#h(n,...h){let H=this.#H(this,...h),x=Math.max(H,W(this.decimalMultiplier)),R=P(x),B=h.reduce((o,O)=>{let A=this.getBigIntValue(O,x);switch(n){case"add":return o+A;case"sub":return o-A;case"mul":return o*A/R;case"div":{if(A===0n)throw new RangeError("Division by zero");return o*R/A}default:return o}},this.bigIntValue*R/this.decimalMultiplier),N=q({bigIntDecimal:x,decimal:x,value:B});return new this.constructor({decimalMultiplier:P(x),decimal:this.decimal,value:N,identifier:this.toString()})}#n(n,...h){let H=this.#H(this,...h),x=this.getBigIntValue(h[0]||"0",H),R=this.getBigIntValue(this,H);switch(n){case"gt":return R>x;case"gte":return R>=x;case"lt":return R<x;case"lte":return R<=x;case"eqValue":return R===x}}#R(n){let h=D(n)||"0";this.bigIntValue=this.#x(h)}#H(...n){let h=n.map((H)=>{return typeof H==="object"?H.decimal||W(H.decimalMultiplier):cn(D(H))}).filter(Boolean);return Math.max(...h,V)}#x(n,h){let H=h?P(h):this.decimalMultiplier,x=W(H),[R="",B=""]=n.split(".");return BigInt(`${R}${B.padEnd(x,"0")}`)}}var Vn=Intl.NumberFormat("fullwide",{useGrouping:!1,maximumFractionDigits:20});function D(n){let H=`${typeof n==="number"?Vn.format(n):i(n)}`.replaceAll(",",".").split(".");return H.length>1?`${H.slice(0,-1).join("")}.${H.at(-1)}`:H[0]||"0"}function cn(n){let h=n.split(".")[1]?.length||0;return Math.max(h,V)}function i(n){return typeof n==="object"?"getValue"in n?n.getValue("string"):n.value:n}var E=new Map;class L extends z{address;chain;isGasAsset=!1;isSynthetic=!1;isTradeAsset=!1;symbol;tax;ticker;type;chainId;constructor({value:n,decimal:h,tax:H,chain:x,symbol:R,identifier:B}){super(typeof n==="object"?n:{decimal:h,value:n});let N=l(B||`${x}.${R}`);this.type=$n(N),this.tax=H,this.chain=N.chain,this.ticker=N.ticker,this.symbol=N.symbol,this.address=N.address,this.isSynthetic=N.isSynthetic,this.isTradeAsset=N.isTradeAsset,this.isGasAsset=N.isGasAsset,this.chainId=Rn[N.chain]}toString({includeSynthProtocol:n}={}){return(this.isSynthetic||this.isTradeAsset)&&!n?this.symbol:`${this.chain}.${this.symbol}`}toUrl(){return this.isSynthetic?`${this.chain}.${this.symbol.replace("/",".")}`:this.isTradeAsset?`${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){let[H,x,R]=n.split(".");if(!(H&&x))throw new s({errorKey:"helpers_invalid_asset_url",info:{urlAsset:n}});let B=H==="THOR"&&R?`${H}.${x}/${R}`:n;return L.from({asset:B,value:h})}static from({value:n=0,fromBaseDecimal:h,asyncTokenLookup:H,...x}){let R=n instanceof z?n.getValue("string"):n,B="chain"in x,N=B?x.chain:x.asset,o=B||Tn.includes(N),{identifier:O,decimal:A}=o?On(N):{identifier:N,decimal:void 0},{chain:T,isSynthetic:j,isTradeAsset:I}=l(O),G=E.get(T==="SOL"?O:O.toUpperCase()),Z=G?.decimal||A;Cn(!(H||Z),`Couldn't find static decimal for ${O} (Using default ${k[T]} 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=F8A84FF30F04106364756E2164756E21
//# debugId=8CA4B547D605105F64756E2164756E21

@@ -9,8 +9,8 @@ {

"devDependencies": {
"@swapkit/toolbox-cosmos": "1.3.17",
"@swapkit/toolbox-evm": "1.5.8",
"@swapkit/toolbox-radix": "1.2.12",
"@swapkit/toolbox-solana": "1.1.16",
"@swapkit/toolbox-substrate": "1.2.20",
"@swapkit/toolbox-utxo": "1.1.25"
"@swapkit/toolbox-cosmos": "1.4.1",
"@swapkit/toolbox-evm": "1.6.1",
"@swapkit/toolbox-radix": "1.2.13",
"@swapkit/toolbox-solana": "1.1.17",
"@swapkit/toolbox-substrate": "1.2.21",
"@swapkit/toolbox-utxo": "1.1.26"
},

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

"types": "./src/index.ts",
"version": "1.13.3"
"version": "1.14.0"
}

@@ -104,2 +104,13 @@ import { describe, expect, test } from "bun:test";

});
test("returns string value with adjusted decimals", () => {
const skNumber = new SwapKitNumber({ value: "1.234567890123456789", decimal: 18 });
expect(skNumber.getValue("string", 8)).toBe("1.23456789");
});
test("returns string base value with adjusted decimals", () => {
const skNumber = new SwapKitNumber({ value: "1.234567890123456789", decimal: 18 });
expect(skNumber.getBaseValue("string", 8)).toBe("123456789");
expect(skNumber.getBaseValue("string", 10)).toBe("12345678901");
});
});

@@ -117,2 +128,13 @@

});
test("returns number value with adjusted decimals", () => {
const skNumber = new SwapKitNumber({ value: "1.234567890123456789", decimal: 18 });
expect(skNumber.getValue("number", 8)).toBe(1.23456789);
});
test("returns number base value with adjusted decimals", () => {
const skNumber = new SwapKitNumber({ value: "1.234567890123456789", decimal: 18 });
expect(skNumber.getBaseValue("number", 8)).toBe(123456789);
expect(skNumber.getBaseValue("number", 10)).toBe(12345678901);
});
});

@@ -125,2 +147,8 @@

});
test("returns bigint value with adjusted decimals", () => {
const skNumber = new SwapKitNumber({ value: "1.234567890123456789", decimal: 18 });
expect(skNumber.getBaseValue("bigint", 8)).toBe(123456789n);
expect(skNumber.getBaseValue("bigint", 10)).toBe(12345678901n);
});
});

@@ -127,0 +155,0 @@ });

@@ -135,6 +135,6 @@ import { BaseDecimal } from "../types/chains";

// @ts-expect-error False positive
getValue<T extends AllowedNumberTypes>(type: T): NumberPrimitivesType[T] {
getValue<T extends AllowedNumberTypes>(type: T, decimal?: number): NumberPrimitivesType[T] {
const value = this.formatBigIntToSafeValue(
this.bigIntValue,
this.decimal || decimalFromMultiplier(this.decimalMultiplier),
decimal || this.decimal || decimalFromMultiplier(this.decimalMultiplier),
);

@@ -154,4 +154,5 @@

// @ts-expect-error
getBaseValue<T extends AllowedNumberTypes>(type: T): NumberPrimitivesType[T] {
const divisor = this.decimalMultiplier / toMultiplier(this.decimal || BaseDecimal.THOR);
getBaseValue<T extends AllowedNumberTypes>(type: T, decimal?: number): NumberPrimitivesType[T] {
const divisor =
this.decimalMultiplier / toMultiplier(decimal || this.decimal || BaseDecimal.THOR);
const baseValue = this.bigIntValue / divisor;

@@ -158,0 +159,0 @@

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