@coinmasters/types 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var M=Object.defineProperty;var G=(e,a,s)=>a in e?M(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s;var r=(e,a,s)=>(G(e,typeof a!="symbol"?a+"":a,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"}],U=[{inputs:[{internalType:"address",name:"rune",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[],name:"RUNE",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"aggregator",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}],F=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct AvaxRouter.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct AvaxRouter.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"target",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}],X=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"target",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}];var _=(e=>(e.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC",e.TC_SUPPORTED_TO_ETH="TC-ERC20",e.TC_SUPPORTED_TO_AVAX="TC-ARC20",e.TC_SUPPORTED_TO_BSC="TC-BEP20",e.ETH_TO_TC_SUPPORTED="ERC20-TC",e.ETH_TO_ETH="ERC20-ERC20",e.ETH_TO_AVAX="ERC20-ARC20",e.ETH_TO_BSC="ERC20-BEP20",e.AVAX_TO_TC_SUPPORTED="ARC20-TC",e.AVAX_TO_ETH="ARC20-ERC20",e.AVAX_TO_AVAX="ARC20-ARC20",e.AVAX_TO_BSC="ARC20-BEP20",e.BSC_TO_TC_SUPPORTED="BEP20-TC",e.BSC_TO_ETH="BEP20-ERC20",e.BSC_TO_AVAX="BEP20-ARC20",e.BSC_TO_BSC="BEP20-BEP20",e))(_||{});const K=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],k=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],W=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];var l=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.REQUEST_PARAMETER_ERROR="REQUEST_PARAMETER_ERROR",e.RESPONSE_PARSING_ERROR="RESPONSE_PARSING_ERROR",e.UNSUPPORTED="UNSUPPORTED",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.INCOMPATIBLE_ASSETS_OPERATIONS="INCOMPATIBLE_ASSETS_OPERATIONS",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.DOWN_FOR_MAINTENANCE="DOWN_FOR_MAINTENANCE",e.MISSING_INBOUND_INFO="MISSING_INBOUND_INFO",e.QUOTE_FETCHING_ERROR="QUOTE_FETCHING_ERROR",e.AIRDROP_ERROR="AIRDROP_ERROR",e.UNHANDLED_ERROR="UNHANDLED_ERROR",e))(l||{}),c=(e=>(e.HEALTH_CONTROLLER="1000",e.LIQUIDITY_CONTROLLER="1001",e.PROVIDER_CONTROLLER="1002",e.QUOTE_CONTROLLER="1003",e.SWAP_CONTROLLER="1004",e.UTIL_CONTROLLER="1005",e.AIRDROP_CONTROLLER="1006",e.PROVIDER="2000",e.ASSET="2001",e.TOKEN_LIST="2002",e.QUOTE="2100",e.QUOTE_TXN_DETAILS="2101",e.THORCHAIN_PROVIDER="3000",e.UNISWAPV2_ETH_PROVIDER="3001",e.UNISWAPV3_ETH_PROVIDER="3002",e.SUSHISWAP_ETH_PROVIDER="3003",e.PANCAKESWAP_BSC_PROVIDER="3004",e.PANCAKESWAP_ETH_PROVIDER="3005",e.ONEINCH_ETH_PROVIDER="3006",e.ONEINCH_BSC_PROVIDER="3007",e.ONEINCH_AVAX_PROVIDER="3008",e.ZEROX_ETH_PROVIDER="3009",e.WOOFI_AVAX_PROVIDER="3010",e.PANGOLIN_AVAX_PROVIDER="3011",e.TRADERJOE_AVAX_PROVIDER="3012",e.KYBER_ETH_PROVIDER="3013",e.KYBER_AVAX_PROVIDER="3014",e.WOOFI_BSC_PROVIDER="3015",e.STARGATE_PROVIDER="3016",e.PROVIDER_UTIL="4000",e.TXN_DETAILS="5000",e.AIRDROP_UTIL="6000",e))(c||{}),n=(e=>(e.INVALID_INPUT_PARAMETERS="1000",e.UNKNOWN_PROVIDERS="1001",e.CANNOT_FIND_INBOUND_ADDRESS="1002",e.NO_INBOUND_ADDRESSES="1003",e.CHAIN_HALTED_OR_UNSUPPORTED="1004",e.MISSING_INPUT_PARAMETER="1005",e.INVALID_TYPE_GENERIC="1100",e.INVALID_NUMBER_STRING="1101",e.INVALID_NUMBER="1102",e.INVALID_BOOLEAN="1103",e.INVALID_OBJECT="1104",e.INVALID_ARRAY="1105",e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER="2000",e.SELL_BUY_ASSETS_ARE_THE_SAME="2001",e.MISSING_SOURCE_ADDRESS_FOR_SYNTH="2002",e.AFF_ADDRESS_AND_BPS_OR_NEITHER="2003",e.AFF_ADDRESS_TOO_LONG="2004",e.AFF_BPS_INTEGER_0_100="2005",e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN="2006",e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN="2007",e.PREFERRED_PROFVIDER_NOT_SUPPORTED="2008",e.DESTINATION_ADDRESS_SMART_CONTRACT="2009",e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER="2010",e.SOURCE_ADDRESS_SMART_CONTRACT="2011",e.INVALID_PROVIDER="2100",e.MISSING_CROSS_CHAIN_PROVIDER="2101",e.MISSING_AVAX_PROVIDER="2102",e.MISSING_BSC_PROVIDER="2103",e.MISSING_ETH_PROVIDER="2104",e.INVALID_PROVIDER_FOR_SWAP_OUT="2105",e.MISSING_ARB_PROVIDER="2106",e.INVALID_CHAIN="2200",e.INVALID_ASSET="2201",e.INVALID_ASSET_IDENTIFIER="2202",e.UNSUPPORTED_CHAIN="2204",e.UNSUPPORTED_ASSET="2203",e.UNSUPPORTED_ASSET_FOR_SWAPOUT="2205",e.INVALID_SOURCE_ADDRESS="2300",e.INVALID_DESTINATION_ADDRESS="2301",e.THORNODE_QUOTE_GENERIC_ERROR="3000",e.NOT_ENOUGH_SYNTH_BALANCE="3001",e.SYNTH_MINTING_CAP_REACHED="3002",e.INVALID_QUOTE_MODE="4000",e.NO_QUOTES="4001",e.SERVICE_UNAVAILABLE_GENERIC="5000",e.MISSING_GAS_DATA_GENERIC="5100",e.MISSING_TOKEN_INFO_GENERIC="5200",e.CANT_FIND_TOKEN_LIST="5201",e.NO_PRICE="5202",e.PRICE_IS_STALE="5203",e.ADDRESS_NOT_WHITELISTED="6000",e.ADDRESS_ALREADY_CLAIMED="6001",e.TEMPORARY_ERROR="9999",e))(n||{});const Y={[n.INVALID_INPUT_PARAMETERS]:"Invalid input parameters: {0}.",[n.UNKNOWN_PROVIDERS]:"Unknown providers: {0}.",[n.CANNOT_FIND_INBOUND_ADDRESS]:"Cannot find inbound address.",[n.NO_INBOUND_ADDRESSES]:"No inbound addresses.",[n.CHAIN_HALTED_OR_UNSUPPORTED]:"Chain {0} halted or unsupported.",[n.MISSING_INPUT_PARAMETER]:"Missing input parameter: {0}.",[n.INVALID_TYPE_GENERIC]:"Invalid type",[n.INVALID_NUMBER_STRING]:"Invalid number string.",[n.INVALID_NUMBER]:"Invalid number.",[n.INVALID_BOOLEAN]:"Invalid boolean.",[n.INVALID_OBJECT]:"Invalid object.",[n.INVALID_ARRAY]:"Invalid array.",[n.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Sell amount must be a positive integer.",[n.SELL_BUY_ASSETS_ARE_THE_SAME]:"Sell and buy assets are the same.",[n.MISSING_SOURCE_ADDRESS_FOR_SYNTH]:"Source address is required for synth quote.",[n.AFF_ADDRESS_AND_BPS_OR_NEITHER]:"Must provide affiliateAddress and affiliateBasisPoints params, or neither.",[n.AFF_ADDRESS_TOO_LONG]:"affiliateAddress too long: 3 characters max.",[n.AFF_BPS_INTEGER_0_100]:"affiliateBasisPoints must be an integer between 0 and 100.",[n.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]:"Source address {0} invalid for sell chain.",[n.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]:"Destination address {0} invalid for buy chain.",[n.PREFERRED_PROFVIDER_NOT_SUPPORTED]:"Preferred provider not supported.",[n.DESTINATION_ADDRESS_SMART_CONTRACT]:"Destination address is a smart contract.",[n.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Buy amount must be a positive integer.",[n.INVALID_PROVIDER]:"Invalid provider {0}.",[n.MISSING_CROSS_CHAIN_PROVIDER]:"Missing cross-chain provider.",[n.MISSING_AVAX_PROVIDER]:"Missing AVAX provider.",[n.MISSING_BSC_PROVIDER]:"Missing BSC provider.",[n.MISSING_ETH_PROVIDER]:"Missing ETH provider.",[n.MISSING_ARB_PROVIDER]:"Missing ARB provider.",[n.INVALID_PROVIDER_FOR_SWAP_OUT]:"Invalid provider for swap out.",[n.INVALID_CHAIN]:"Invalid chain {0}.",[n.INVALID_ASSET]:"Invalid asset {0}.",[n.UNSUPPORTED_CHAIN]:"Unsupported chain {0}.",[n.UNSUPPORTED_ASSET]:"Unsupported asset {0}.",[n.UNSUPPORTED_ASSET_FOR_SWAPOUT]:"Unsupported asset {0} for swap out.",[n.THORNODE_QUOTE_GENERIC_ERROR]:"ThorNode quote generic error.",[n.INVALID_SOURCE_ADDRESS]:"Invalid source address {0}",[n.INVALID_DESTINATION_ADDRESS]:"Invalid destination address {0}",[n.NOT_ENOUGH_SYNTH_BALANCE]:"Source address doesn't have enough synth balance for this quote.",[n.SYNTH_MINTING_CAP_REACHED]:"Synth minting cap reached.",[n.INVALID_QUOTE_MODE]:"Invalid quote mode.",[n.NO_QUOTES]:"No quotes to service this request.",[n.SERVICE_UNAVAILABLE_GENERIC]:"Service unavailable.",[n.MISSING_GAS_DATA_GENERIC]:"Missing gas data.",[n.MISSING_TOKEN_INFO_GENERIC]:"Missing token info.",[n.CANT_FIND_TOKEN_LIST]:"Can't find tokenlist {0}.",[n.NO_PRICE]:"No price for asset {0}.",[n.PRICE_IS_STALE]:"Price is stale for asset {0}.",[n.ADDRESS_NOT_WHITELISTED]:"Address {0} not whitelisted for airdrop.",[n.ADDRESS_ALREADY_CLAIMED]:"Address {0} already claimed the airdrop."},T=(e,a)=>{let s=Y[e];for(let i=0;i<a.length;i++)s=s.replace(`{${i}}`,a[i]);return a.length===0?s.replace("{0}",""):s};class A extends Error{constructor({status:s,revision:i,module:H,code:u,message:R,type:D,options:{shouldLog:L,shouldThrow:x,shouldTrace:v}={shouldLog:!0,shouldThrow:!0,shouldTrace:!0},displayMessageParams:y}){const E=R||T(u,y||[])||"";super(E);r(this,"status");r(this,"revision");r(this,"type");r(this,"module");r(this,"code");r(this,"message");r(this,"display");r(this,"stack");r(this,"options");r(this,"displayMessageParams");this.status=s,this.revision=i||"NO_REVISION",this.module=H,this.message=E,this.display=T(u,y||[]),this.code=u,this.type=D||l.UNHANDLED_ERROR,this.options={shouldLog:L||!0,shouldTrace:v||!0,shouldThrow:x||!1},this.displayMessageParams=y||[],this.options.shouldTrace&&Error.captureStackTrace(this)}static fromErrorInfo(s){return new A(s)}toErrorInfo(){return{...this,identifier:this.identifier}}get identifier(){return`${this.revision}-${this.type||"NO_TYPE"}-${this.module}-${this.code}`}get displayMessage(){return T(this.code,this.displayMessageParams||[])}handle(){const s=`[${this.identifier}]: ${this.message}`;if(this.options.shouldLog&&console.error(s,`
2
- `,this.stack||""),this.options.shouldThrow)throw Error(s,{cause:this.stack});return this.toErrorInfo()}}var t=(e=>(e.Arbitrum="ARB",e.Avalanche="AVAX",e.Base="BASE",e.Binance="BNB",e.BinanceSmartChain="BSC",e.Bitcoin="BTC",e.BitcoinCash="BCH",e.Cosmos="GAIA",e.Dash="DASH",e.Digibyte="DGB",e.Dogecoin="DOGE",e.EOS="EOS",e.Ethereum="ETH",e.Kujira="KUJI",e.Litecoin="LTC",e.Maya="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(t||{});function Z(e){switch(e){case"ARB":return"ARB";case"AVAX":return"AVAX";case"BASE":return"BASE";case"BNB":return"BNB";case"BSC":return"BSC";case"BTC":return"BTC";case"BCH":return"BCH";case"GAIA":return"GAIA";case"DASH":return"DASH";case"DGB":return"DGB";case"DOGE":return"DOGE";case"EOS":return"EOS";case"ETH":return"ETH";case"KUJI":return"KUJI";case"LTC":return"LTC";case"MAYA":return"MAYA";case"OP":return"OP";case"OSMO":return"OSMO";case"MATIC":return"MATIC";case"XRP":return"XRP";case"THOR":return"THOR";case"ZEC":return"ZEC";default:return}}const N={ARB:"eip155:42161",AVAX:"eip155:43114",BSC:"eip155:56",BNB:"binance:bnb-beacon-chain",BCH:"bip122:000000000000000000651ef99cb9fcbe",BTC:"bip122:000000000019d6689c085ae165831e93",BASE:"eip155:8453",GAIA:"cosmos:cosmoshub-4",DASH:"bip122:000007d91d1254d60e2dd1ae58038307",DGB:"bip122:digibytes-hash",DOGE:"bip122:00000000001a91e3dace36e2be3bf030",KUJI:"cosmos:kaiyo-1",EOS:"eos:cf057bbfb72640471fd910bcb67639c2",ETH:"eip155:1",LTC:"bip122:12a765e31ffd4059bada1e25190f6e98",MAYA:"cosmos:maya-mainnet-v1",OP:"eip155:10",OSMO:"cosmos:osmosis-1",MATIC:"eip155:137",XRP:"ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",THOR:"cosmos:thorchain-mainnet-v1",ZEC:"bip122:0000000000196a45"},C={};for(const e in t){const a=N[t[e]];C[a]=t[e]}var h=(e=>(e.ARB="0x0000000000000000000000000000000000000000",e.AVAX="0x0000000000000000000000000000000000000000",e.ETH="0x0000000000000000000000000000000000000000",e.BSC="0x0000000000000000000000000000000000000000",e.MATIC="0x0000000000000000000000000000000000001010",e.OP="0x4200000000000000000000000000000000000042",e))(h||{}),O=(e=>(e.ARB="m/44'/60'/0'/0/0",e.AVAX="m/44'/60'/0'/0/0",e.BASE="m/44'/60'/0'/0/0",e.BCH="m/44'/145'/0'/0/0",e.BNB="m/44'/714'/0'/0/0",e.BSC="m/44'/60'/0'/0/0",e.BTC="m/84'/0'/0'/0/0",e.DOGE="m/44'/3'/0'/0/0",e.DASH="m/44'/5'/0'/0/0",e.DGB="m/44'/20'/0'/0/0",e.ETH="m/44'/60'/0'/0/0",e.EOS="m/44'/194'/0'/0/0",e.GAIA="m/44'/118'/0'/0/0",e.KUJI="m/44'/118'/0'/0/0",e.LTC="m/84'/2'/0'/0/0",e.MATIC="m/44'/60'/0'/0/0",e.MAYA="m/44'/931'/0'/0/0",e.OP="m/44'/60'/0'/0/0",e.OSMO="m/44'/118'/0'/0/0",e.XRP="m/44'/144'/0'/0/0",e.THOR="m/44'/931'/0'/0/0",e.ZEC="m/44'/133'/0'/0/0",e))(O||{});const J={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BNB:[44,714,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DGB:[44,20,0,0,0],DOGE:[44,3,0,0,0],EOS:[44,194,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],OSMO:[44,118,0,0,0],XRP:[44,144,0,0,0],THOR:[44,931,0,0,0],ZEC:[44,133,0,0,0]};var f=(e=>(e[e.ARB=18]="ARB",e[e.AVAX=18]="AVAX",e[e.BCH=8]="BCH",e[e.BNB=8]="BNB",e[e.BSC=18]="BSC",e[e.BTC=8]="BTC",e[e.DASH=8]="DASH",e[e.DGB=8]="DGB",e[e.DOGE=8]="DOGE",e[e.ETH=18]="ETH",e[e.EOS=6]="EOS",e[e.GAIA=6]="GAIA",e[e.KUJI=6]="KUJI",e[e.LTC=8]="LTC",e[e.MATIC=18]="MATIC",e[e.MAYA=10]="MAYA",e[e.OP=18]="OP",e[e.OSMO=6]="OSMO",e[e.XRP=6]="XRP",e[e.THOR=8]="THOR",e[e.ZEC=8]="ZEC",e))(f||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],j=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],$=["GAIA","THOR","BNB","OSMO"],q=["AVAX","BNB","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"];var d=(e=>(e.Arbitrum="42161",e.ArbitrumHex="0xa4b1",e.Avalanche="43114",e.AvalancheHex="0xa86a",e.Base="8453",e.Binance="Binance-Chain-Tigris",e.BinanceSmartChain="56",e.BinanceSmartChainHex="0x38",e.Bitcoin="bitcoin",e.BitcoinCash="bitcoincash",e.Cosmos="cosmoshub-4",e.Dash="dash",e.Dogecoin="dogecoin",e.Kujira="kaiyo-1",e.Ethereum="1",e.EthereumHex="0x1",e.Litecoin="litecoin",e.Maya="mayachain-mainnet-v1",e.MayaStagenet="mayachain-stagenet-v1",e.Optimism="10",e.OptimismHex="0xa",e.Osmosis="osmosis-1",e.Polygon="137",e.PolygonHex="0x89",e.THORChain="thorchain-mainnet-v1",e.THORChainStagenet="thorchain-stagenet-v2",e))(d||{}),S=(e=>(e.Arbitrum="https://arb1.arbitrum.io/rpc",e.Avalanche="https://node-router.thorswap.net/avalanche-c",e.Binance="https://base.llamarpc.com",e.BinanceSmartChain="https://bsc-dataseed.binance.org",e.Base="https://base.llamarpc.com",e.Bitcoin="https://node-router.thorswap.net/bitcoin",e.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash",e.Cosmos="https://node-router.thorswap.net/cosmos/rpc",e.Kujira="https://rpc-kujira.synergynodes.com/",e.Dash="https://dash.nownodes.io",e.Dogecoin="https://node-router.thorswap.net/dogecoin",e.Ethereum="https://node-router.thorswap.net/ethereum",e.Litecoin="https://node-router.thorswap.net/litecoin",e.Maya="https://tendermint.mayachain.info",e.MayaStagenet="https://stagenet.tendermint.mayachain.info",e.Optimism="https://mainnet.optimism.io",e.Osmosis="https://lcd-osmosis.keplr.app",e.Polygon="https://polygon-rpc.com",e.Ripple="https://xrplcluster.com",e.THORChain="https://rpc.thorswap.net",e.THORChainStagenet="https://stagenet-rpc.ninerealms.com",e))(S||{}),B=(e=>(e.Cosmos="https://node-router.thorswap.net/cosmos/rest",e.Kujira="https://lcd-kujira.synergynodes.com/",e.MayanodeMainnet="https://mayanode.mayachain.info",e.MayanodeStagenet="https://stagenet.mayanode.mayachain.info",e.ThornodeMainnet="https://thornode.thorswap.net",e.ThornodeStagenet="https://stagenet-thornode.ninerealms.com",e.ThorswapApi="https://api.thorswap.net",e.ThorswapStatic="https://static.thorswap.net",e))(B||{});const o=Object.values(t),z=Object.keys(t),I=o.reduce((e,a)=>{const s=z.find(i=>t[i]===a);return s&&(e[a]=s),e},{}),Q=o.reduce((e,a)=>(e[a]=d[I[a]],e),{}),ee=o.reduce((e,a)=>(e[a]=S[I[a]],e),{}),te=o.reduce((e,a)=>{const s=`${I[a]}Hex`;return e[a]=d[s],e},{}),ne={"0xa4b1":"ARB",42161:"ARB","0xa86a":"AVAX",43114:"AVAX","0x38":"BSC",56:"BSC","Binance-Chain-Tigris":"BNB",bitcoincash:"BCH",bitcoin:"BTC","cosmoshub-4":"GAIA",8453:"BASE",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","osmosis-1":"OSMO","0x89":"MATIC",137:"MATIC","thorchain-stagenet-v2":"THOR","thorchain-mainnet-v1":"THOR"},ae={ARB:"https://arbiscan.io",AVAX:"https://snowtrace.io",BSC:"https://bscscan.com",BNB:"https://explorer.binance.org",BCH:"https://www.blockchain.com/bch",BTC:"https://blockstream.info",BASE:"https://basescan.org",GAIA:"https://cosmos.bigdipper.live",DASH:"https://blockchair.com/dash",DGB:"https://chainz.cryptoid.info/dgb",DOGE:"https://blockchair.com/dogecoin",KUJI:"https://finder.kujira.network/kaiyo-1",EOS:"https://eosauthority.com/",ETH:"https://etherscan.io",LTC:"https://ltc.bitaps.com",MAYA:"https://www.mayascan.org",OP:"https://optimistic.etherscan.io",OSMO:"https://www.mintscan.io/osmosis",MATIC:"https://polygonscan.com",XRP:"https://xrpscan.com",THOR:"https://runescan.io",ZEC:"https://z.cash/ecosystem/zcash-explorer"};var g=(e=>(e[e.NoError=36864]="NoError",e))(g||{}),b=(e=>(e.BOND="BOND",e.DEPOSIT="+",e.LEAVE="LEAVE",e.THORNAME_REGISTER="~",e.UNBOND="UNBOND",e.WITHDRAW="-",e.OPEN_LOAN="$+",e.CLOSE_LOAN="$-",e))(b||{}),P=(e=>(e.Average="average",e.Fast="fast",e.Fastest="fastest",e))(P||{}),V=(e=>(e.KEYSTORE="KEYSTORE",e.KEEPKEY="KEEPKEY",e.XDEFI="XDEFI",e.METAMASK="METAMASK",e.COINBASE_WEB="COINBASE_WEB",e.TREZOR="TREZOR",e.TRUSTWALLET_WEB="TRUSTWALLET_WEB",e.LEDGER="LEDGER",e.KEPLR="KEPLR",e.OKX="OKX",e.BRAVE="BRAVE",e.WALLETCONNECT="WALLETCONNECT",e))(V||{});const m=[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Osmosis,t.Ripple,t.Dogecoin,t.Dash,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],se={BRAVE:p,COINBASE_WEB:p,KEPLR:[t.Cosmos],KEYSTORE:[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],LEDGER:m,TREZOR:[t.Bitcoin,t.BitcoinCash,t.Litecoin,t.Dogecoin,t.Ethereum],KEEPKEY:m,METAMASK:[t.Arbitrum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],TRUSTWALLET_WEB:p,XDEFI:m,WALLETCONNECT:[t.Ethereum,t.Binance,t.BinanceSmartChain,t.Avalanche,t.THORChain],OKX:[t.Ethereum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.Cosmos]};exports.AGG_SWAP=K;exports.ApiError=A;exports.ApiUrl=B;exports.BaseDecimal=f;exports.Chain=t;exports.ChainId=d;exports.ChainIdToChain=ne;exports.ChainToChainId=Q;exports.ChainToExplorerUrl=ae;exports.ChainToHexChainId=te;exports.ChainToNetworkId=N;exports.ChainToRPC=ee;exports.ContractAddress=h;exports.CosmosChainList=$;exports.DerivationPath=O;exports.ERROR_CODE=n;exports.ERROR_MODULE=c;exports.ERROR_TYPE=l;exports.EVMChainList=p;exports.ErrorCode=g;exports.FeeOption=P;exports.MemoType=b;exports.NetworkDerivationPath=J;exports.NetworkIdToChain=C;exports.QuoteMode=_;exports.RPCUrl=S;exports.SWAP_IN=k;exports.SWAP_OUT=W;exports.TCAvalancheDepositABI=F;exports.TCBscDepositABI=X;exports.TCEthereumVaultAbi=U;exports.TCSupportedChainList=q;exports.UTXOChainList=j;exports.WalletOption=V;exports.availableChainsByWallet=se;exports.erc20ABI=w;exports.getChainEnumValue=Z;
1
+ "use strict";var X=Object.defineProperty;var K=(e,a,s)=>a in e?X(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s;var r=(e,a,s)=>(K(e,typeof a!="symbol"?a+"":a,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"success",type:"bool"}],stateMutability:"nonpayable",type:"function"}],k=[{inputs:[{internalType:"address",name:"rune",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[],name:"RUNE",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"aggregator",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}],Y=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct AvaxRouter.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct AvaxRouter.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"target",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}],Z=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferAllowance",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"address",name:"asset",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOut",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"vault",type:"address"},{indexed:!1,internalType:"address",name:"target",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"finalAsset",type:"address"},{indexed:!1,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amountOutMin",type:"uint256"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"TransferOutAndCall",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldVault",type:"address"},{indexed:!0,internalType:"address",name:"newVault",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{indexed:!1,internalType:"string",name:"memo",type:"string"}],name:"VaultTransfer",type:"event"},{inputs:[{internalType:"address payable",name:"vault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"},{internalType:"uint256",name:"expiration",type:"uint256"}],name:"depositWithExpiry",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address payable",name:"asgard",type:"address"},{components:[{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct THORChain_Router.Coin[]",name:"coins",type:"tuple[]"},{internalType:"string",name:"memo",type:"string"}],name:"returnVaultAssets",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"router",type:"address"},{internalType:"address",name:"newVault",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferAllowance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"to",type:"address"},{internalType:"address",name:"asset",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOut",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address payable",name:"target",type:"address"},{internalType:"address",name:"finalToken",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amountOutMin",type:"uint256"},{internalType:"string",name:"memo",type:"string"}],name:"transferOutAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"vault",type:"address"},{internalType:"address",name:"token",type:"address"}],name:"vaultAllowance",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}];var _=(e=>(e.TC_SUPPORTED_TO_TC_SUPPORTED="TC-TC",e.TC_SUPPORTED_TO_ETH="TC-ERC20",e.TC_SUPPORTED_TO_AVAX="TC-ARC20",e.TC_SUPPORTED_TO_BSC="TC-BEP20",e.ETH_TO_TC_SUPPORTED="ERC20-TC",e.ETH_TO_ETH="ERC20-ERC20",e.ETH_TO_AVAX="ERC20-ARC20",e.ETH_TO_BSC="ERC20-BEP20",e.AVAX_TO_TC_SUPPORTED="ARC20-TC",e.AVAX_TO_ETH="ARC20-ERC20",e.AVAX_TO_AVAX="ARC20-ARC20",e.AVAX_TO_BSC="ARC20-BEP20",e.BSC_TO_TC_SUPPORTED="BEP20-TC",e.BSC_TO_ETH="BEP20-ERC20",e.BSC_TO_AVAX="BEP20-ARC20",e.BSC_TO_BSC="BEP20-BEP20",e.GAIA_TO_OSMO="OSMOSIS-IBC",e.CHANGELLY="CHANGELLY",e))(_||{});const c=["OSMOSIS-IBC"],N=["CHANGELLY"],C=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],O=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],h=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"];function J(e){return C.includes(e)?"AGG_SWAP":O.includes(e)?"SWAP_IN":h.includes(e)?"SWAP_OUT":c.includes(e)?"OSMOSIS_SWAP":N.includes(e)?"CENTRALIZED_SWAPPER":null}var l=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.REQUEST_PARAMETER_ERROR="REQUEST_PARAMETER_ERROR",e.RESPONSE_PARSING_ERROR="RESPONSE_PARSING_ERROR",e.UNSUPPORTED="UNSUPPORTED",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.INCOMPATIBLE_ASSETS_OPERATIONS="INCOMPATIBLE_ASSETS_OPERATIONS",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.DOWN_FOR_MAINTENANCE="DOWN_FOR_MAINTENANCE",e.MISSING_INBOUND_INFO="MISSING_INBOUND_INFO",e.QUOTE_FETCHING_ERROR="QUOTE_FETCHING_ERROR",e.AIRDROP_ERROR="AIRDROP_ERROR",e.UNHANDLED_ERROR="UNHANDLED_ERROR",e))(l||{}),f=(e=>(e.HEALTH_CONTROLLER="1000",e.LIQUIDITY_CONTROLLER="1001",e.PROVIDER_CONTROLLER="1002",e.QUOTE_CONTROLLER="1003",e.SWAP_CONTROLLER="1004",e.UTIL_CONTROLLER="1005",e.AIRDROP_CONTROLLER="1006",e.PROVIDER="2000",e.ASSET="2001",e.TOKEN_LIST="2002",e.QUOTE="2100",e.QUOTE_TXN_DETAILS="2101",e.THORCHAIN_PROVIDER="3000",e.UNISWAPV2_ETH_PROVIDER="3001",e.UNISWAPV3_ETH_PROVIDER="3002",e.SUSHISWAP_ETH_PROVIDER="3003",e.PANCAKESWAP_BSC_PROVIDER="3004",e.PANCAKESWAP_ETH_PROVIDER="3005",e.ONEINCH_ETH_PROVIDER="3006",e.ONEINCH_BSC_PROVIDER="3007",e.ONEINCH_AVAX_PROVIDER="3008",e.ZEROX_ETH_PROVIDER="3009",e.WOOFI_AVAX_PROVIDER="3010",e.PANGOLIN_AVAX_PROVIDER="3011",e.TRADERJOE_AVAX_PROVIDER="3012",e.KYBER_ETH_PROVIDER="3013",e.KYBER_AVAX_PROVIDER="3014",e.WOOFI_BSC_PROVIDER="3015",e.STARGATE_PROVIDER="3016",e.PROVIDER_UTIL="4000",e.TXN_DETAILS="5000",e.AIRDROP_UTIL="6000",e))(f||{}),n=(e=>(e.INVALID_INPUT_PARAMETERS="1000",e.UNKNOWN_PROVIDERS="1001",e.CANNOT_FIND_INBOUND_ADDRESS="1002",e.NO_INBOUND_ADDRESSES="1003",e.CHAIN_HALTED_OR_UNSUPPORTED="1004",e.MISSING_INPUT_PARAMETER="1005",e.INVALID_TYPE_GENERIC="1100",e.INVALID_NUMBER_STRING="1101",e.INVALID_NUMBER="1102",e.INVALID_BOOLEAN="1103",e.INVALID_OBJECT="1104",e.INVALID_ARRAY="1105",e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER="2000",e.SELL_BUY_ASSETS_ARE_THE_SAME="2001",e.MISSING_SOURCE_ADDRESS_FOR_SYNTH="2002",e.AFF_ADDRESS_AND_BPS_OR_NEITHER="2003",e.AFF_ADDRESS_TOO_LONG="2004",e.AFF_BPS_INTEGER_0_100="2005",e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN="2006",e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN="2007",e.PREFERRED_PROFVIDER_NOT_SUPPORTED="2008",e.DESTINATION_ADDRESS_SMART_CONTRACT="2009",e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER="2010",e.SOURCE_ADDRESS_SMART_CONTRACT="2011",e.INVALID_PROVIDER="2100",e.MISSING_CROSS_CHAIN_PROVIDER="2101",e.MISSING_AVAX_PROVIDER="2102",e.MISSING_BSC_PROVIDER="2103",e.MISSING_ETH_PROVIDER="2104",e.INVALID_PROVIDER_FOR_SWAP_OUT="2105",e.MISSING_ARB_PROVIDER="2106",e.INVALID_CHAIN="2200",e.INVALID_ASSET="2201",e.INVALID_ASSET_IDENTIFIER="2202",e.UNSUPPORTED_CHAIN="2204",e.UNSUPPORTED_ASSET="2203",e.UNSUPPORTED_ASSET_FOR_SWAPOUT="2205",e.INVALID_SOURCE_ADDRESS="2300",e.INVALID_DESTINATION_ADDRESS="2301",e.THORNODE_QUOTE_GENERIC_ERROR="3000",e.NOT_ENOUGH_SYNTH_BALANCE="3001",e.SYNTH_MINTING_CAP_REACHED="3002",e.INVALID_QUOTE_MODE="4000",e.NO_QUOTES="4001",e.SERVICE_UNAVAILABLE_GENERIC="5000",e.MISSING_GAS_DATA_GENERIC="5100",e.MISSING_TOKEN_INFO_GENERIC="5200",e.CANT_FIND_TOKEN_LIST="5201",e.NO_PRICE="5202",e.PRICE_IS_STALE="5203",e.ADDRESS_NOT_WHITELISTED="6000",e.ADDRESS_ALREADY_CLAIMED="6001",e.TEMPORARY_ERROR="9999",e))(n||{});const j={[n.INVALID_INPUT_PARAMETERS]:"Invalid input parameters: {0}.",[n.UNKNOWN_PROVIDERS]:"Unknown providers: {0}.",[n.CANNOT_FIND_INBOUND_ADDRESS]:"Cannot find inbound address.",[n.NO_INBOUND_ADDRESSES]:"No inbound addresses.",[n.CHAIN_HALTED_OR_UNSUPPORTED]:"Chain {0} halted or unsupported.",[n.MISSING_INPUT_PARAMETER]:"Missing input parameter: {0}.",[n.INVALID_TYPE_GENERIC]:"Invalid type",[n.INVALID_NUMBER_STRING]:"Invalid number string.",[n.INVALID_NUMBER]:"Invalid number.",[n.INVALID_BOOLEAN]:"Invalid boolean.",[n.INVALID_OBJECT]:"Invalid object.",[n.INVALID_ARRAY]:"Invalid array.",[n.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Sell amount must be a positive integer.",[n.SELL_BUY_ASSETS_ARE_THE_SAME]:"Sell and buy assets are the same.",[n.MISSING_SOURCE_ADDRESS_FOR_SYNTH]:"Source address is required for synth quote.",[n.AFF_ADDRESS_AND_BPS_OR_NEITHER]:"Must provide affiliateAddress and affiliateBasisPoints params, or neither.",[n.AFF_ADDRESS_TOO_LONG]:"affiliateAddress too long: 3 characters max.",[n.AFF_BPS_INTEGER_0_100]:"affiliateBasisPoints must be an integer between 0 and 100.",[n.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]:"Source address {0} invalid for sell chain.",[n.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]:"Destination address {0} invalid for buy chain.",[n.PREFERRED_PROFVIDER_NOT_SUPPORTED]:"Preferred provider not supported.",[n.DESTINATION_ADDRESS_SMART_CONTRACT]:"Destination address is a smart contract.",[n.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Buy amount must be a positive integer.",[n.INVALID_PROVIDER]:"Invalid provider {0}.",[n.MISSING_CROSS_CHAIN_PROVIDER]:"Missing cross-chain provider.",[n.MISSING_AVAX_PROVIDER]:"Missing AVAX provider.",[n.MISSING_BSC_PROVIDER]:"Missing BSC provider.",[n.MISSING_ETH_PROVIDER]:"Missing ETH provider.",[n.MISSING_ARB_PROVIDER]:"Missing ARB provider.",[n.INVALID_PROVIDER_FOR_SWAP_OUT]:"Invalid provider for swap out.",[n.INVALID_CHAIN]:"Invalid chain {0}.",[n.INVALID_ASSET]:"Invalid asset {0}.",[n.UNSUPPORTED_CHAIN]:"Unsupported chain {0}.",[n.UNSUPPORTED_ASSET]:"Unsupported asset {0}.",[n.UNSUPPORTED_ASSET_FOR_SWAPOUT]:"Unsupported asset {0} for swap out.",[n.THORNODE_QUOTE_GENERIC_ERROR]:"ThorNode quote generic error.",[n.INVALID_SOURCE_ADDRESS]:"Invalid source address {0}",[n.INVALID_DESTINATION_ADDRESS]:"Invalid destination address {0}",[n.NOT_ENOUGH_SYNTH_BALANCE]:"Source address doesn't have enough synth balance for this quote.",[n.SYNTH_MINTING_CAP_REACHED]:"Synth minting cap reached.",[n.INVALID_QUOTE_MODE]:"Invalid quote mode.",[n.NO_QUOTES]:"No quotes to service this request.",[n.SERVICE_UNAVAILABLE_GENERIC]:"Service unavailable.",[n.MISSING_GAS_DATA_GENERIC]:"Missing gas data.",[n.MISSING_TOKEN_INFO_GENERIC]:"Missing token info.",[n.CANT_FIND_TOKEN_LIST]:"Can't find tokenlist {0}.",[n.NO_PRICE]:"No price for asset {0}.",[n.PRICE_IS_STALE]:"Price is stale for asset {0}.",[n.ADDRESS_NOT_WHITELISTED]:"Address {0} not whitelisted for airdrop.",[n.ADDRESS_ALREADY_CLAIMED]:"Address {0} already claimed the airdrop."},T=(e,a)=>{let s=j[e];for(let i=0;i<a.length;i++)s=s.replace(`{${i}}`,a[i]);return a.length===0?s.replace("{0}",""):s};class A extends Error{constructor({status:s,revision:i,module:v,code:u,message:M,type:G,options:{shouldLog:w,shouldThrow:U,shouldTrace:F}={shouldLog:!0,shouldThrow:!0,shouldTrace:!0},displayMessageParams:y}){const E=M||T(u,y||[])||"";super(E);r(this,"status");r(this,"revision");r(this,"type");r(this,"module");r(this,"code");r(this,"message");r(this,"display");r(this,"stack");r(this,"options");r(this,"displayMessageParams");this.status=s,this.revision=i||"NO_REVISION",this.module=v,this.message=E,this.display=T(u,y||[]),this.code=u,this.type=G||l.UNHANDLED_ERROR,this.options={shouldLog:w||!0,shouldTrace:F||!0,shouldThrow:U||!1},this.displayMessageParams=y||[],this.options.shouldTrace&&Error.captureStackTrace(this)}static fromErrorInfo(s){return new A(s)}toErrorInfo(){return{...this,identifier:this.identifier}}get identifier(){return`${this.revision}-${this.type||"NO_TYPE"}-${this.module}-${this.code}`}get displayMessage(){return T(this.code,this.displayMessageParams||[])}handle(){const s=`[${this.identifier}]: ${this.message}`;if(this.options.shouldLog&&console.error(s,`
2
+ `,this.stack||""),this.options.shouldThrow)throw Error(s,{cause:this.stack});return this.toErrorInfo()}}var t=(e=>(e.Arbitrum="ARB",e.Avalanche="AVAX",e.Base="BASE",e.Binance="BNB",e.BinanceSmartChain="BSC",e.Bitcoin="BTC",e.BitcoinCash="BCH",e.Cosmos="GAIA",e.Dash="DASH",e.Digibyte="DGB",e.Dogecoin="DOGE",e.EOS="EOS",e.Ethereum="ETH",e.Kujira="KUJI",e.Litecoin="LTC",e.Maya="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(t||{});function $(e){switch(e){case"ARB":return"ARB";case"AVAX":return"AVAX";case"BASE":return"BASE";case"BNB":return"BNB";case"BSC":return"BSC";case"BTC":return"BTC";case"BCH":return"BCH";case"GAIA":return"GAIA";case"DASH":return"DASH";case"DGB":return"DGB";case"DOGE":return"DOGE";case"EOS":return"EOS";case"ETH":return"ETH";case"KUJI":return"KUJI";case"LTC":return"LTC";case"MAYA":return"MAYA";case"OP":return"OP";case"OSMO":return"OSMO";case"MATIC":return"MATIC";case"XRP":return"XRP";case"THOR":return"THOR";case"ZEC":return"ZEC";default:return}}const B={ARB:"eip155:42161",AVAX:"eip155:43114",BSC:"eip155:56",BNB:"binance:bnb-beacon-chain",BCH:"bip122:000000000000000000651ef99cb9fcbe",BTC:"bip122:000000000019d6689c085ae165831e93",BASE:"eip155:8453",GAIA:"cosmos:cosmoshub-4",DASH:"bip122:000007d91d1254d60e2dd1ae58038307",DGB:"bip122:digibytes-hash",DOGE:"bip122:00000000001a91e3dace36e2be3bf030",KUJI:"cosmos:kaiyo-1",EOS:"eos:cf057bbfb72640471fd910bcb67639c2",ETH:"eip155:1",LTC:"bip122:12a765e31ffd4059bada1e25190f6e98",MAYA:"cosmos:maya-mainnet-v1",OP:"eip155:10",OSMO:"cosmos:osmosis-1",MATIC:"eip155:137",XRP:"ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",THOR:"cosmos:thorchain-mainnet-v1",ZEC:"bip122:0000000000196a45"},P={};for(const e in t){const a=B[t[e]];P[a]=t[e]}var g=(e=>(e.ARB="0x0000000000000000000000000000000000000000",e.AVAX="0x0000000000000000000000000000000000000000",e.ETH="0x0000000000000000000000000000000000000000",e.BSC="0x0000000000000000000000000000000000000000",e.MATIC="0x0000000000000000000000000000000000001010",e.OP="0x4200000000000000000000000000000000000042",e))(g||{}),b=(e=>(e.ARB="m/44'/60'/0'/0/0",e.AVAX="m/44'/60'/0'/0/0",e.BASE="m/44'/60'/0'/0/0",e.BCH="m/44'/145'/0'/0/0",e.BNB="m/44'/714'/0'/0/0",e.BSC="m/44'/60'/0'/0/0",e.BTC="m/84'/0'/0'/0/0",e.DOGE="m/44'/3'/0'/0/0",e.DASH="m/44'/5'/0'/0/0",e.DGB="m/44'/20'/0'/0/0",e.ETH="m/44'/60'/0'/0/0",e.EOS="m/44'/194'/0'/0/0",e.GAIA="m/44'/118'/0'/0/0",e.KUJI="m/44'/118'/0'/0/0",e.LTC="m/84'/2'/0'/0/0",e.MATIC="m/44'/60'/0'/0/0",e.MAYA="m/44'/931'/0'/0/0",e.OP="m/44'/60'/0'/0/0",e.OSMO="m/44'/118'/0'/0/0",e.XRP="m/44'/144'/0'/0/0",e.THOR="m/44'/931'/0'/0/0",e.ZEC="m/44'/133'/0'/0/0",e))(b||{});const q={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BNB:[44,714,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DGB:[44,20,0,0,0],DOGE:[44,3,0,0,0],EOS:[44,194,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],OSMO:[44,118,0,0,0],XRP:[44,144,0,0,0],THOR:[44,931,0,0,0],ZEC:[44,133,0,0,0]};var V=(e=>(e[e.ARB=18]="ARB",e[e.AVAX=18]="AVAX",e[e.BCH=8]="BCH",e[e.BNB=8]="BNB",e[e.BSC=18]="BSC",e[e.BTC=8]="BTC",e[e.DASH=8]="DASH",e[e.DGB=8]="DGB",e[e.DOGE=8]="DOGE",e[e.ETH=18]="ETH",e[e.EOS=6]="EOS",e[e.GAIA=6]="GAIA",e[e.KUJI=6]="KUJI",e[e.LTC=8]="LTC",e[e.MATIC=18]="MATIC",e[e.MAYA=10]="MAYA",e[e.OP=18]="OP",e[e.OSMO=6]="OSMO",e[e.XRP=6]="XRP",e[e.THOR=8]="THOR",e[e.ZEC=8]="ZEC",e))(V||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],z=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],Q=["GAIA","THOR","BNB","OSMO"],ee=["AVAX","BNB","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"];var d=(e=>(e.Arbitrum="42161",e.ArbitrumHex="0xa4b1",e.Avalanche="43114",e.AvalancheHex="0xa86a",e.Base="8453",e.Binance="Binance-Chain-Tigris",e.BinanceSmartChain="56",e.BinanceSmartChainHex="0x38",e.Bitcoin="bitcoin",e.BitcoinCash="bitcoincash",e.Cosmos="cosmoshub-4",e.Dash="dash",e.Dogecoin="dogecoin",e.Kujira="kaiyo-1",e.Ethereum="1",e.EthereumHex="0x1",e.Litecoin="litecoin",e.Maya="mayachain-mainnet-v1",e.MayaStagenet="mayachain-stagenet-v1",e.Optimism="10",e.OptimismHex="0xa",e.Osmosis="osmosis-1",e.Polygon="137",e.PolygonHex="0x89",e.THORChain="thorchain-mainnet-v1",e.THORChainStagenet="thorchain-stagenet-v2",e))(d||{}),S=(e=>(e.Arbitrum="https://arb1.arbitrum.io/rpc",e.Avalanche="https://node-router.thorswap.net/avalanche-c",e.Binance="https://base.llamarpc.com",e.BinanceSmartChain="https://bsc-dataseed.binance.org",e.Base="https://base.llamarpc.com",e.Bitcoin="https://node-router.thorswap.net/bitcoin",e.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash",e.Cosmos="https://node-router.thorswap.net/cosmos/rpc",e.Kujira="https://rpc-kujira.synergynodes.com/",e.Dash="https://dash.nownodes.io",e.Dogecoin="https://node-router.thorswap.net/dogecoin",e.Ethereum="https://node-router.thorswap.net/ethereum",e.Litecoin="https://node-router.thorswap.net/litecoin",e.Maya="https://tendermint.mayachain.info",e.MayaStagenet="https://stagenet.tendermint.mayachain.info",e.Optimism="https://mainnet.optimism.io",e.Osmosis="https://lcd-osmosis.keplr.app",e.Polygon="https://polygon-rpc.com",e.Ripple="https://xrplcluster.com",e.THORChain="https://rpc.thorswap.net",e.THORChainStagenet="https://stagenet-rpc.ninerealms.com",e))(S||{}),H=(e=>(e.Cosmos="https://node-router.thorswap.net/cosmos/rest",e.Kujira="https://lcd-kujira.synergynodes.com/",e.MayanodeMainnet="https://mayanode.mayachain.info",e.MayanodeStagenet="https://stagenet.mayanode.mayachain.info",e.ThornodeMainnet="https://thornode.thorswap.net",e.ThornodeStagenet="https://stagenet-thornode.ninerealms.com",e.ThorswapApi="https://api.thorswap.net",e.ThorswapStatic="https://static.thorswap.net",e))(H||{});const o=Object.values(t),te=Object.keys(t),I=o.reduce((e,a)=>{const s=te.find(i=>t[i]===a);return s&&(e[a]=s),e},{}),ne=o.reduce((e,a)=>(e[a]=d[I[a]],e),{}),ae=o.reduce((e,a)=>(e[a]=S[I[a]],e),{}),se=o.reduce((e,a)=>{const s=`${I[a]}Hex`;return e[a]=d[s],e},{}),re={"0xa4b1":"ARB",42161:"ARB","0xa86a":"AVAX",43114:"AVAX","0x38":"BSC",56:"BSC","Binance-Chain-Tigris":"BNB",bitcoincash:"BCH",bitcoin:"BTC","cosmoshub-4":"GAIA",8453:"BASE",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","osmosis-1":"OSMO","0x89":"MATIC",137:"MATIC","thorchain-stagenet-v2":"THOR","thorchain-mainnet-v1":"THOR"},ie={ARB:"https://arbiscan.io",AVAX:"https://snowtrace.io",BSC:"https://bscscan.com",BNB:"https://explorer.binance.org",BCH:"https://www.blockchain.com/bch",BTC:"https://blockstream.info",BASE:"https://basescan.org",GAIA:"https://cosmos.bigdipper.live",DASH:"https://blockchair.com/dash",DGB:"https://chainz.cryptoid.info/dgb",DOGE:"https://blockchair.com/dogecoin",KUJI:"https://finder.kujira.network/kaiyo-1",EOS:"https://eosauthority.com/",ETH:"https://etherscan.io",LTC:"https://ltc.bitaps.com",MAYA:"https://www.mayascan.org",OP:"https://optimistic.etherscan.io",OSMO:"https://www.mintscan.io/osmosis",MATIC:"https://polygonscan.com",XRP:"https://xrpscan.com",THOR:"https://runescan.io",ZEC:"https://z.cash/ecosystem/zcash-explorer"};var R=(e=>(e[e.NoError=36864]="NoError",e))(R||{}),L=(e=>(e.BOND="BOND",e.DEPOSIT="+",e.LEAVE="LEAVE",e.THORNAME_REGISTER="~",e.UNBOND="UNBOND",e.WITHDRAW="-",e.OPEN_LOAN="$+",e.CLOSE_LOAN="$-",e))(L||{}),D=(e=>(e.Average="average",e.Fast="fast",e.Fastest="fastest",e))(D||{}),x=(e=>(e.KEYSTORE="KEYSTORE",e.KEEPKEY="KEEPKEY",e.XDEFI="XDEFI",e.METAMASK="METAMASK",e.COINBASE_WEB="COINBASE_WEB",e.TREZOR="TREZOR",e.TRUSTWALLET_WEB="TRUSTWALLET_WEB",e.LEDGER="LEDGER",e.KEPLR="KEPLR",e.OKX="OKX",e.BRAVE="BRAVE",e.WALLETCONNECT="WALLETCONNECT",e))(x||{});const m=[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Osmosis,t.Ripple,t.Dogecoin,t.Dash,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],pe={BRAVE:p,COINBASE_WEB:p,KEPLR:[t.Cosmos],KEYSTORE:[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],LEDGER:m,TREZOR:[t.Bitcoin,t.BitcoinCash,t.Litecoin,t.Dogecoin,t.Ethereum],KEEPKEY:m,METAMASK:[t.Arbitrum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],TRUSTWALLET_WEB:p,XDEFI:m,WALLETCONNECT:[t.Ethereum,t.Binance,t.BinanceSmartChain,t.Avalanche,t.THORChain],OKX:[t.Ethereum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.Cosmos]};exports.AGG_SWAP=C;exports.ApiError=A;exports.ApiUrl=H;exports.BaseDecimal=V;exports.CENTRALIZED_SWAPPER=N;exports.Chain=t;exports.ChainId=d;exports.ChainIdToChain=re;exports.ChainToChainId=ne;exports.ChainToExplorerUrl=ie;exports.ChainToHexChainId=se;exports.ChainToNetworkId=B;exports.ChainToRPC=ae;exports.ContractAddress=g;exports.CosmosChainList=Q;exports.DerivationPath=b;exports.ERROR_CODE=n;exports.ERROR_MODULE=f;exports.ERROR_TYPE=l;exports.EVMChainList=p;exports.ErrorCode=R;exports.FeeOption=D;exports.MemoType=L;exports.NetworkDerivationPath=q;exports.NetworkIdToChain=P;exports.OSMOSIS_SWAP=c;exports.QuoteMode=_;exports.RPCUrl=S;exports.SWAP_IN=O;exports.SWAP_OUT=h;exports.TCAvalancheDepositABI=Y;exports.TCBscDepositABI=Z;exports.TCEthereumVaultAbi=k;exports.TCSupportedChainList=ee;exports.UTXOChainList=z;exports.WalletOption=x;exports.availableChainsByWallet=pe;exports.classifySwap=J;exports.erc20ABI=W;exports.getChainEnumValue=$;
package/dist/index.d.ts CHANGED
@@ -87,6 +87,8 @@ export declare enum BaseDecimal {
87
87
  ZEC = 8
88
88
  }
89
89
 
90
+ export declare const CENTRALIZED_SWAPPER: QuoteMode[];
91
+
90
92
  export declare enum Chain {
91
93
  Arbitrum = "ARB",
92
94
  Avalanche = "AVAX",
@@ -228,6 +230,8 @@ declare type ChainWallet = {
228
230
  walletType: WalletOption;
229
231
  };
230
232
 
233
+ export declare function classifySwap(quoteMode: QuoteMode): "AGG_SWAP" | "SWAP_IN" | "SWAP_OUT" | "OSMOSIS_SWAP" | "CENTRALIZED_SWAPPER" | null;
234
+
231
235
  export declare type ConnectConfig = {
232
236
  stagenet?: boolean;
233
237
  /**
@@ -542,6 +546,8 @@ export declare const NetworkDerivationPath: Record<Chain, DerivationPathArray>;
542
546
 
543
547
  export declare const NetworkIdToChain: Record<string, Chain>;
544
548
 
549
+ export declare const OSMOSIS_SWAP: QuoteMode[];
550
+
545
551
  export declare enum QuoteMode {
546
552
  TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
547
553
  TC_SUPPORTED_TO_ETH = "TC-ERC20",
@@ -558,7 +564,9 @@ export declare enum QuoteMode {
558
564
  BSC_TO_TC_SUPPORTED = "BEP20-TC",
559
565
  BSC_TO_ETH = "BEP20-ERC20",
560
566
  BSC_TO_AVAX = "BEP20-ARC20",
561
- BSC_TO_BSC = "BEP20-BEP20"
567
+ BSC_TO_BSC = "BEP20-BEP20",
568
+ GAIA_TO_OSMO = "OSMOSIS-IBC",
569
+ CHANGELLY = "CHANGELLY"
562
570
  }
563
571
 
564
572
  export declare enum RPCUrl {
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
- var f = Object.defineProperty;
2
- var B = (e, a, s) => a in e ? f(e, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[a] = s;
1
+ var h = Object.defineProperty;
2
+ var B = (e, a, s) => a in e ? h(e, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[a] = s;
3
3
  var r = (e, a, s) => (B(e, typeof a != "symbol" ? a + "" : a, s), s);
4
- const X = [
4
+ const Z = [
5
5
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
6
6
  {
7
7
  anonymous: !1,
@@ -99,7 +99,7 @@ const X = [
99
99
  stateMutability: "nonpayable",
100
100
  type: "function"
101
101
  }
102
- ], K = [
102
+ ], J = [
103
103
  {
104
104
  inputs: [{ internalType: "address", name: "rune", type: "address" }],
105
105
  stateMutability: "nonpayable",
@@ -274,7 +274,7 @@ const X = [
274
274
  stateMutability: "view",
275
275
  type: "function"
276
276
  }
277
- ], k = [
277
+ ], j = [
278
278
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
279
279
  {
280
280
  anonymous: !1,
@@ -438,7 +438,7 @@ const X = [
438
438
  stateMutability: "view",
439
439
  type: "function"
440
440
  }
441
- ], Y = [
441
+ ], $ = [
442
442
  { inputs: [], stateMutability: "nonpayable", type: "constructor" },
443
443
  {
444
444
  anonymous: !1,
@@ -591,13 +591,19 @@ const X = [
591
591
  type: "function"
592
592
  }
593
593
  ];
594
- var g = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e))(g || {});
595
- const W = [
594
+ var g = /* @__PURE__ */ ((e) => (e.TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC", e.TC_SUPPORTED_TO_ETH = "TC-ERC20", e.TC_SUPPORTED_TO_AVAX = "TC-ARC20", e.TC_SUPPORTED_TO_BSC = "TC-BEP20", e.ETH_TO_TC_SUPPORTED = "ERC20-TC", e.ETH_TO_ETH = "ERC20-ERC20", e.ETH_TO_AVAX = "ERC20-ARC20", e.ETH_TO_BSC = "ERC20-BEP20", e.AVAX_TO_TC_SUPPORTED = "ARC20-TC", e.AVAX_TO_ETH = "ARC20-ERC20", e.AVAX_TO_AVAX = "ARC20-ARC20", e.AVAX_TO_BSC = "ARC20-BEP20", e.BSC_TO_TC_SUPPORTED = "BEP20-TC", e.BSC_TO_ETH = "BEP20-ERC20", e.BSC_TO_AVAX = "BEP20-ARC20", e.BSC_TO_BSC = "BEP20-BEP20", e.GAIA_TO_OSMO = "OSMOSIS-IBC", e.CHANGELLY = "CHANGELLY", e))(g || {});
595
+ const b = [
596
+ "OSMOSIS-IBC"
597
+ /* GAIA_TO_OSMO */
598
+ ], P = [
599
+ "CHANGELLY"
600
+ /* CHANGELLY */
601
+ ], V = [
596
602
  "ERC20-ERC20",
597
603
  "ARC20-ARC20",
598
604
  "BEP20-BEP20"
599
605
  /* BSC_TO_BSC */
600
- ], Z = [
606
+ ], H = [
601
607
  "ERC20-TC",
602
608
  "ERC20-ARC20",
603
609
  "ERC20-BEP20",
@@ -608,15 +614,18 @@ const W = [
608
614
  "BEP20-ERC20",
609
615
  "BEP20-ARC20"
610
616
  /* BSC_TO_AVAX */
611
- ], J = [
617
+ ], L = [
612
618
  "TC-TC",
613
619
  "TC-ERC20",
614
620
  "TC-ARC20",
615
621
  "TC-BEP20"
616
622
  /* TC_SUPPORTED_TO_BSC */
617
623
  ];
618
- var S = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(S || {}), b = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(b || {}), n = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(n || {});
619
- const V = {
624
+ function q(e) {
625
+ return V.includes(e) ? "AGG_SWAP" : H.includes(e) ? "SWAP_IN" : L.includes(e) ? "SWAP_OUT" : b.includes(e) ? "OSMOSIS_SWAP" : P.includes(e) ? "CENTRALIZED_SWAPPER" : null;
626
+ }
627
+ var S = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(S || {}), R = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(R || {}), n = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(n || {});
628
+ const D = {
620
629
  [n.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
621
630
  [n.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
622
631
  [n.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
@@ -668,7 +677,7 @@ const V = {
668
677
  [n.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
669
678
  [n.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
670
679
  }, u = (e, a) => {
671
- let s = V[e];
680
+ let s = D[e];
672
681
  for (let i = 0; i < a.length; i++)
673
682
  s = s.replace(`{${i}}`, a[i]);
674
683
  return a.length === 0 ? s.replace("{0}", "") : s;
@@ -679,16 +688,16 @@ class I extends Error {
679
688
  revision: i,
680
689
  module: _,
681
690
  code: d,
682
- message: N,
683
- type: c,
684
- options: { shouldLog: O, shouldThrow: C, shouldTrace: h } = {
691
+ message: c,
692
+ type: N,
693
+ options: { shouldLog: O, shouldThrow: C, shouldTrace: f } = {
685
694
  shouldLog: !0,
686
695
  shouldThrow: !0,
687
696
  shouldTrace: !0
688
697
  },
689
698
  displayMessageParams: o
690
699
  }) {
691
- const A = N || u(d, o || []) || "";
700
+ const A = c || u(d, o || []) || "";
692
701
  super(A);
693
702
  r(this, "status");
694
703
  r(this, "revision");
@@ -700,9 +709,9 @@ class I extends Error {
700
709
  r(this, "stack");
701
710
  r(this, "options");
702
711
  r(this, "displayMessageParams");
703
- this.status = s, this.revision = i || "NO_REVISION", this.module = _, this.message = A, this.display = u(d, o || []), this.code = d, this.type = c || S.UNHANDLED_ERROR, this.options = {
712
+ this.status = s, this.revision = i || "NO_REVISION", this.module = _, this.message = A, this.display = u(d, o || []), this.code = d, this.type = N || S.UNHANDLED_ERROR, this.options = {
704
713
  shouldLog: O || !0,
705
- shouldTrace: h || !0,
714
+ shouldTrace: f || !0,
706
715
  shouldThrow: C || !1
707
716
  }, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
708
717
  }
@@ -727,7 +736,7 @@ class I extends Error {
727
736
  }
728
737
  }
729
738
  var t = /* @__PURE__ */ ((e) => (e.Arbitrum = "ARB", e.Avalanche = "AVAX", e.Base = "BASE", e.Binance = "BNB", e.BinanceSmartChain = "BSC", e.Bitcoin = "BTC", e.BitcoinCash = "BCH", e.Cosmos = "GAIA", e.Dash = "DASH", e.Digibyte = "DGB", e.Dogecoin = "DOGE", e.EOS = "EOS", e.Ethereum = "ETH", e.Kujira = "KUJI", e.Litecoin = "LTC", e.Maya = "MAYA", e.Optimism = "OP", e.Osmosis = "OSMO", e.Polygon = "MATIC", e.Ripple = "XRP", e.THORChain = "THOR", e.Zcash = "ZEC", e))(t || {});
730
- function j(e) {
739
+ function z(e) {
731
740
  switch (e) {
732
741
  case "ARB":
733
742
  return "ARB";
@@ -777,7 +786,7 @@ function j(e) {
777
786
  return;
778
787
  }
779
788
  }
780
- const P = {
789
+ const x = {
781
790
  ARB: "eip155:42161",
782
791
  AVAX: "eip155:43114",
783
792
  BSC: "eip155:56",
@@ -800,13 +809,13 @@ const P = {
800
809
  XRP: "ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",
801
810
  THOR: "cosmos:thorchain-mainnet-v1",
802
811
  ZEC: "bip122:0000000000196a45"
803
- }, H = {};
812
+ }, v = {};
804
813
  for (const e in t) {
805
- const a = P[t[e]];
806
- H[a] = t[e];
814
+ const a = x[t[e]];
815
+ v[a] = t[e];
807
816
  }
808
- var x = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(x || {}), R = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0/0", e.AVAX = "m/44'/60'/0'/0/0", e.BASE = "m/44'/60'/0'/0/0", e.BCH = "m/44'/145'/0'/0/0", e.BNB = "m/44'/714'/0'/0/0", e.BSC = "m/44'/60'/0'/0/0", e.BTC = "m/84'/0'/0'/0/0", e.DOGE = "m/44'/3'/0'/0/0", e.DASH = "m/44'/5'/0'/0/0", e.DGB = "m/44'/20'/0'/0/0", e.ETH = "m/44'/60'/0'/0/0", e.EOS = "m/44'/194'/0'/0/0", e.GAIA = "m/44'/118'/0'/0/0", e.KUJI = "m/44'/118'/0'/0/0", e.LTC = "m/84'/2'/0'/0/0", e.MATIC = "m/44'/60'/0'/0/0", e.MAYA = "m/44'/931'/0'/0/0", e.OP = "m/44'/60'/0'/0/0", e.OSMO = "m/44'/118'/0'/0/0", e.XRP = "m/44'/144'/0'/0/0", e.THOR = "m/44'/931'/0'/0/0", e.ZEC = "m/44'/133'/0'/0/0", e))(R || {});
809
- const $ = {
817
+ var M = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(M || {}), G = /* @__PURE__ */ ((e) => (e.ARB = "m/44'/60'/0'/0/0", e.AVAX = "m/44'/60'/0'/0/0", e.BASE = "m/44'/60'/0'/0/0", e.BCH = "m/44'/145'/0'/0/0", e.BNB = "m/44'/714'/0'/0/0", e.BSC = "m/44'/60'/0'/0/0", e.BTC = "m/84'/0'/0'/0/0", e.DOGE = "m/44'/3'/0'/0/0", e.DASH = "m/44'/5'/0'/0/0", e.DGB = "m/44'/20'/0'/0/0", e.ETH = "m/44'/60'/0'/0/0", e.EOS = "m/44'/194'/0'/0/0", e.GAIA = "m/44'/118'/0'/0/0", e.KUJI = "m/44'/118'/0'/0/0", e.LTC = "m/84'/2'/0'/0/0", e.MATIC = "m/44'/60'/0'/0/0", e.MAYA = "m/44'/931'/0'/0/0", e.OP = "m/44'/60'/0'/0/0", e.OSMO = "m/44'/118'/0'/0/0", e.XRP = "m/44'/144'/0'/0/0", e.THOR = "m/44'/931'/0'/0/0", e.ZEC = "m/44'/133'/0'/0/0", e))(G || {});
818
+ const Q = {
810
819
  ARB: [44, 60, 0, 0, 0],
811
820
  AVAX: [44, 60, 0, 0, 0],
812
821
  BASE: [44, 60, 0, 0, 0],
@@ -830,7 +839,7 @@ const $ = {
830
839
  THOR: [44, 931, 0, 0, 0],
831
840
  ZEC: [44, 133, 0, 0, 0]
832
841
  };
833
- var D = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DGB = 8] = "DGB", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.EOS = 6] = "EOS", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.OSMO = 6] = "OSMO", e[e.XRP = 6] = "XRP", e[e.THOR = 8] = "THOR", e[e.ZEC = 8] = "ZEC", e))(D || {});
842
+ var w = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DGB = 8] = "DGB", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.EOS = 6] = "EOS", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.OSMO = 6] = "OSMO", e[e.XRP = 6] = "XRP", e[e.THOR = 8] = "THOR", e[e.ZEC = 8] = "ZEC", e))(w || {});
834
843
  const y = [
835
844
  "ETH",
836
845
  "AVAX",
@@ -840,7 +849,7 @@ const y = [
840
849
  "OP",
841
850
  "MATIC"
842
851
  /* Polygon */
843
- ], q = [
852
+ ], ee = [
844
853
  "BTC",
845
854
  "BCH",
846
855
  "DASH",
@@ -849,13 +858,13 @@ const y = [
849
858
  "LTC",
850
859
  "ZEC"
851
860
  /* Zcash */
852
- ], z = [
861
+ ], te = [
853
862
  "GAIA",
854
863
  "THOR",
855
864
  "BNB",
856
865
  "OSMO"
857
866
  /* Osmosis */
858
- ], Q = [
867
+ ], ne = [
859
868
  "AVAX",
860
869
  "BNB",
861
870
  "BSC",
@@ -868,26 +877,26 @@ const y = [
868
877
  "THOR"
869
878
  /* THORChain */
870
879
  ];
871
- var m = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Base = "8453", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dash = "dash", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Osmosis = "osmosis-1", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(m || {}), E = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "https://base.llamarpc.com", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Base = "https://base.llamarpc.com", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dash = "https://dash.nownodes.io", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Osmosis = "https://lcd-osmosis.keplr.app", e.Polygon = "https://polygon-rpc.com", e.Ripple = "https://xrplcluster.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(E || {}), L = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.net", e.ThorswapStatic = "https://static.thorswap.net", e))(L || {});
872
- const p = Object.values(t), v = Object.keys(t), l = p.reduce(
880
+ var m = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Base = "8453", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dash = "dash", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Osmosis = "osmosis-1", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(m || {}), E = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://node-router.thorswap.net/avalanche-c", e.Binance = "https://base.llamarpc.com", e.BinanceSmartChain = "https://bsc-dataseed.binance.org", e.Base = "https://base.llamarpc.com", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dash = "https://dash.nownodes.io", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://node-router.thorswap.net/ethereum", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Osmosis = "https://lcd-osmosis.keplr.app", e.Polygon = "https://polygon-rpc.com", e.Ripple = "https://xrplcluster.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(E || {}), U = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.net", e.ThorswapStatic = "https://static.thorswap.net", e))(U || {});
881
+ const p = Object.values(t), F = Object.keys(t), l = p.reduce(
873
882
  (e, a) => {
874
- const s = v.find((i) => t[i] === a);
883
+ const s = F.find((i) => t[i] === a);
875
884
  return s && (e[a] = s), e;
876
885
  },
877
886
  {}
878
- ), ee = p.reduce(
887
+ ), ae = p.reduce(
879
888
  (e, a) => (e[a] = m[l[a]], e),
880
889
  {}
881
- ), te = p.reduce(
890
+ ), se = p.reduce(
882
891
  (e, a) => (e[a] = E[l[a]], e),
883
892
  {}
884
- ), ne = p.reduce(
893
+ ), re = p.reduce(
885
894
  (e, a) => {
886
895
  const s = `${l[a]}Hex`;
887
896
  return e[a] = m[s], e;
888
897
  },
889
898
  {}
890
- ), ae = {
899
+ ), ie = {
891
900
  "0xa4b1": "ARB",
892
901
  42161: "ARB",
893
902
  "0xa86a": "AVAX",
@@ -915,7 +924,7 @@ const p = Object.values(t), v = Object.keys(t), l = p.reduce(
915
924
  "thorchain-stagenet-v2": "THOR",
916
925
  "thorchain-mainnet-v1": "THOR"
917
926
  /* THORChain */
918
- }, se = {
927
+ }, pe = {
919
928
  ARB: "https://arbiscan.io",
920
929
  AVAX: "https://snowtrace.io",
921
930
  BSC: "https://bscscan.com",
@@ -939,7 +948,7 @@ const p = Object.values(t), v = Object.keys(t), l = p.reduce(
939
948
  THOR: "https://runescan.io",
940
949
  ZEC: "https://z.cash/ecosystem/zcash-explorer"
941
950
  };
942
- var M = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(M || {}), G = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(G || {}), w = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(w || {}), U = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.KEEPKEY = "KEEPKEY", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(U || {});
951
+ var X = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(X || {}), K = /* @__PURE__ */ ((e) => (e.BOND = "BOND", e.DEPOSIT = "+", e.LEAVE = "LEAVE", e.THORNAME_REGISTER = "~", e.UNBOND = "UNBOND", e.WITHDRAW = "-", e.OPEN_LOAN = "$+", e.CLOSE_LOAN = "$-", e))(K || {}), W = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(W || {}), Y = /* @__PURE__ */ ((e) => (e.KEYSTORE = "KEYSTORE", e.KEEPKEY = "KEEPKEY", e.XDEFI = "XDEFI", e.METAMASK = "METAMASK", e.COINBASE_WEB = "COINBASE_WEB", e.TREZOR = "TREZOR", e.TRUSTWALLET_WEB = "TRUSTWALLET_WEB", e.LEDGER = "LEDGER", e.KEPLR = "KEPLR", e.OKX = "OKX", e.BRAVE = "BRAVE", e.WALLETCONNECT = "WALLETCONNECT", e))(Y || {});
943
952
  const T = [
944
953
  t.Arbitrum,
945
954
  t.Avalanche,
@@ -957,7 +966,7 @@ const T = [
957
966
  t.Optimism,
958
967
  t.Polygon,
959
968
  t.THORChain
960
- ], re = {
969
+ ], de = {
961
970
  BRAVE: y,
962
971
  COINBASE_WEB: y,
963
972
  KEPLR: [t.Cosmos],
@@ -1017,41 +1026,44 @@ const T = [
1017
1026
  ]
1018
1027
  };
1019
1028
  export {
1020
- W as AGG_SWAP,
1029
+ V as AGG_SWAP,
1021
1030
  I as ApiError,
1022
- L as ApiUrl,
1023
- D as BaseDecimal,
1031
+ U as ApiUrl,
1032
+ w as BaseDecimal,
1033
+ P as CENTRALIZED_SWAPPER,
1024
1034
  t as Chain,
1025
1035
  m as ChainId,
1026
- ae as ChainIdToChain,
1027
- ee as ChainToChainId,
1028
- se as ChainToExplorerUrl,
1029
- ne as ChainToHexChainId,
1030
- P as ChainToNetworkId,
1031
- te as ChainToRPC,
1032
- x as ContractAddress,
1033
- z as CosmosChainList,
1034
- R as DerivationPath,
1036
+ ie as ChainIdToChain,
1037
+ ae as ChainToChainId,
1038
+ pe as ChainToExplorerUrl,
1039
+ re as ChainToHexChainId,
1040
+ x as ChainToNetworkId,
1041
+ se as ChainToRPC,
1042
+ M as ContractAddress,
1043
+ te as CosmosChainList,
1044
+ G as DerivationPath,
1035
1045
  n as ERROR_CODE,
1036
- b as ERROR_MODULE,
1046
+ R as ERROR_MODULE,
1037
1047
  S as ERROR_TYPE,
1038
1048
  y as EVMChainList,
1039
- M as ErrorCode,
1040
- w as FeeOption,
1041
- G as MemoType,
1042
- $ as NetworkDerivationPath,
1043
- H as NetworkIdToChain,
1049
+ X as ErrorCode,
1050
+ W as FeeOption,
1051
+ K as MemoType,
1052
+ Q as NetworkDerivationPath,
1053
+ v as NetworkIdToChain,
1054
+ b as OSMOSIS_SWAP,
1044
1055
  g as QuoteMode,
1045
1056
  E as RPCUrl,
1046
- Z as SWAP_IN,
1047
- J as SWAP_OUT,
1048
- k as TCAvalancheDepositABI,
1049
- Y as TCBscDepositABI,
1050
- K as TCEthereumVaultAbi,
1051
- Q as TCSupportedChainList,
1052
- q as UTXOChainList,
1053
- U as WalletOption,
1054
- re as availableChainsByWallet,
1055
- X as erc20ABI,
1056
- j as getChainEnumValue
1057
+ H as SWAP_IN,
1058
+ L as SWAP_OUT,
1059
+ j as TCAvalancheDepositABI,
1060
+ $ as TCBscDepositABI,
1061
+ J as TCEthereumVaultAbi,
1062
+ ne as TCSupportedChainList,
1063
+ ee as UTXOChainList,
1064
+ Y as WalletOption,
1065
+ de as availableChainsByWallet,
1066
+ q as classifySwap,
1067
+ Z as erc20ABI,
1068
+ z as getChainEnumValue
1057
1069
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@types/node": "20.10.0",
6
6
  "ethers": "6.9.0",
7
7
  "vite": "4.4.9",
8
- "@internal/config": "2.2.0"
8
+ "@internal/config": "2.2.1"
9
9
  },
10
10
  "eslintConfig": {
11
11
  "extends": "../../../internal/eslint-config"
@@ -33,7 +33,7 @@
33
33
  "repository": "https://github.com/thorswap/SwapKit.git",
34
34
  "type": "module",
35
35
  "types": "./dist/index.d.ts",
36
- "version": "4.2.0",
36
+ "version": "4.2.1",
37
37
  "scripts": {
38
38
  "build": "vite build",
39
39
  "build:watch": "nodemon --watch src --exec 'pnpm run build'",
@@ -118,6 +118,8 @@ export enum QuoteMode {
118
118
  BSC_TO_ETH = 'BEP20-ERC20',
119
119
  BSC_TO_AVAX = 'BEP20-ARC20',
120
120
  BSC_TO_BSC = 'BEP20-BEP20',
121
+ GAIA_TO_OSMO = 'OSMOSIS-IBC',
122
+ CHANGELLY = 'CHANGELLY',
121
123
  }
122
124
 
123
125
  export type Asset = {
@@ -127,6 +129,10 @@ export type Asset = {
127
129
  synth?: boolean;
128
130
  };
129
131
 
132
+ export const OSMOSIS_SWAP = [QuoteMode.GAIA_TO_OSMO];
133
+
134
+ export const CENTRALIZED_SWAPPER = [QuoteMode.CHANGELLY]
135
+
130
136
  export const AGG_SWAP = [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC];
131
137
 
132
138
  export const SWAP_IN = [
@@ -147,3 +153,22 @@ export const SWAP_OUT = [
147
153
  QuoteMode.TC_SUPPORTED_TO_AVAX,
148
154
  QuoteMode.TC_SUPPORTED_TO_BSC,
149
155
  ];
156
+
157
+ export function classifySwap(quoteMode:QuoteMode) {
158
+ if (AGG_SWAP.includes(quoteMode)) {
159
+ return 'AGG_SWAP';
160
+ }
161
+ if (SWAP_IN.includes(quoteMode)) {
162
+ return 'SWAP_IN';
163
+ }
164
+ if (SWAP_OUT.includes(quoteMode)) {
165
+ return 'SWAP_OUT';
166
+ }
167
+ if (OSMOSIS_SWAP.includes(quoteMode)) {
168
+ return 'OSMOSIS_SWAP';
169
+ }
170
+ if (CENTRALIZED_SWAPPER.includes(quoteMode)) {
171
+ return 'CENTRALIZED_SWAPPER';
172
+ }
173
+ return null;
174
+ }