@coinmasters/types 4.4.7 → 4.4.9
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 +2 -2
- package/dist/index.d.ts +13 -18
- package/dist/index.es.js +122 -122
- package/package.json +2 -2
- package/src/commonTypes.ts +30 -57
- package/src/network.ts +5 -5
package/dist/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var F=Object.defineProperty;var W=(e,a,s)=>a in e?F(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s;var i=(e,a,s)=>(W(e,typeof a!="symbol"?a+"":a,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=[{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"}],Y=[{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"}],k=[{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 c=(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.MAYA_SUPPORTED_TO_MAYA_SUPPORTED="MAYA_SUPPORTED_TO_MAYA_SUPPORTED",e.CHANGELLY="CHANGELLY",e.RANGO="RANGO",e))(c||{});const _=["OSMOSIS-IBC"],m=["CHANGELLY"],N=["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"],C=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"],J=["MAYA_SUPPORTED_TO_MAYA_SUPPORTED"],h=["RANGO"];function j(e){return N.includes(e)?"AGG_SWAP":O.includes(e)?"SWAP_IN":C.includes(e)?"SWAP_OUT":_.includes(e)?"OSMOSIS_SWAP":m.includes(e)||m.includes(e)||h.includes(e)?"CENTRALIZED_SWAPPER":null}var A=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.REQUEST_PARAMETER_ERROR="REQUEST_PARAMETER_ERROR",e.RESPONSE_PARSING_ERROR="RESPONSE_PARSING_ERROR",e.UNSUPPORTED="UNSUPPORTED",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.INCOMPATIBLE_ASSETS_OPERATIONS="INCOMPATIBLE_ASSETS_OPERATIONS",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.DOWN_FOR_MAINTENANCE="DOWN_FOR_MAINTENANCE",e.MISSING_INBOUND_INFO="MISSING_INBOUND_INFO",e.QUOTE_FETCHING_ERROR="QUOTE_FETCHING_ERROR",e.AIRDROP_ERROR="AIRDROP_ERROR",e.UNHANDLED_ERROR="UNHANDLED_ERROR",e))(A||{}),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||{}),t=(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))(t||{});const $={[t.INVALID_INPUT_PARAMETERS]:"Invalid input parameters: {0}.",[t.UNKNOWN_PROVIDERS]:"Unknown providers: {0}.",[t.CANNOT_FIND_INBOUND_ADDRESS]:"Cannot find inbound address.",[t.NO_INBOUND_ADDRESSES]:"No inbound addresses.",[t.CHAIN_HALTED_OR_UNSUPPORTED]:"Chain {0} halted or unsupported.",[t.MISSING_INPUT_PARAMETER]:"Missing input parameter: {0}.",[t.INVALID_TYPE_GENERIC]:"Invalid type",[t.INVALID_NUMBER_STRING]:"Invalid number string.",[t.INVALID_NUMBER]:"Invalid number.",[t.INVALID_BOOLEAN]:"Invalid boolean.",[t.INVALID_OBJECT]:"Invalid object.",[t.INVALID_ARRAY]:"Invalid array.",[t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Sell amount must be a positive integer.",[t.SELL_BUY_ASSETS_ARE_THE_SAME]:"Sell and buy assets are the same.",[t.MISSING_SOURCE_ADDRESS_FOR_SYNTH]:"Source address is required for synth quote.",[t.AFF_ADDRESS_AND_BPS_OR_NEITHER]:"Must provide affiliateAddress and affiliateBasisPoints params, or neither.",[t.AFF_ADDRESS_TOO_LONG]:"affiliateAddress too long: 3 characters max.",[t.AFF_BPS_INTEGER_0_100]:"affiliateBasisPoints must be an integer between 0 and 100.",[t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]:"Source address {0} invalid for sell chain.",[t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]:"Destination address {0} invalid for buy chain.",[t.PREFERRED_PROFVIDER_NOT_SUPPORTED]:"Preferred provider not supported.",[t.DESTINATION_ADDRESS_SMART_CONTRACT]:"Destination address is a smart contract.",[t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Buy amount must be a positive integer.",[t.INVALID_PROVIDER]:"Invalid provider {0}.",[t.MISSING_CROSS_CHAIN_PROVIDER]:"Missing cross-chain provider.",[t.MISSING_AVAX_PROVIDER]:"Missing AVAX provider.",[t.MISSING_BSC_PROVIDER]:"Missing BSC provider.",[t.MISSING_ETH_PROVIDER]:"Missing ETH provider.",[t.MISSING_ARB_PROVIDER]:"Missing ARB provider.",[t.INVALID_PROVIDER_FOR_SWAP_OUT]:"Invalid provider for swap out.",[t.INVALID_CHAIN]:"Invalid chain {0}.",[t.INVALID_ASSET]:"Invalid asset {0}.",[t.UNSUPPORTED_CHAIN]:"Unsupported chain {0}.",[t.UNSUPPORTED_ASSET]:"Unsupported asset {0}.",[t.UNSUPPORTED_ASSET_FOR_SWAPOUT]:"Unsupported asset {0} for swap out.",[t.THORNODE_QUOTE_GENERIC_ERROR]:"ThorNode quote generic error.",[t.INVALID_SOURCE_ADDRESS]:"Invalid source address {0}",[t.INVALID_DESTINATION_ADDRESS]:"Invalid destination address {0}",[t.NOT_ENOUGH_SYNTH_BALANCE]:"Source address doesn't have enough synth balance for this quote.",[t.SYNTH_MINTING_CAP_REACHED]:"Synth minting cap reached.",[t.INVALID_QUOTE_MODE]:"Invalid quote mode.",[t.NO_QUOTES]:"No quotes to service this request.",[t.SERVICE_UNAVAILABLE_GENERIC]:"Service unavailable.",[t.MISSING_GAS_DATA_GENERIC]:"Missing gas data.",[t.MISSING_TOKEN_INFO_GENERIC]:"Missing token info.",[t.CANT_FIND_TOKEN_LIST]:"Can't find tokenlist {0}.",[t.NO_PRICE]:"No price for asset {0}.",[t.PRICE_IS_STALE]:"Price is stale for asset {0}.",[t.ADDRESS_NOT_WHITELISTED]:"Address {0} not whitelisted for airdrop.",[t.ADDRESS_ALREADY_CLAIMED]:"Address {0} already claimed the airdrop."},y=(e,a)=>{let s=$[e];for(let r=0;r<a.length;r++)s=s.replace(`{${r}}`,a[r]);return a.length===0?s.replace("{0}",""):s};class l extends Error{constructor({status:s,revision:r,module:v,code:u,message:M,type:G,options:{shouldLog:U,shouldThrow:w,shouldTrace:X}={shouldLog:!0,shouldThrow:!0,shouldTrace:!0},displayMessageParams:T}){const I=M||y(u,T||[])||"";super(I);i(this,"status");i(this,"revision");i(this,"type");i(this,"module");i(this,"code");i(this,"message");i(this,"display");i(this,"stack");i(this,"options");i(this,"displayMessageParams");this.status=s,this.revision=r||"NO_REVISION",this.module=v,this.message=I,this.display=y(u,T||[]),this.code=u,this.type=G||A.UNHANDLED_ERROR,this.options={shouldLog:U||!0,shouldTrace:X||!0,shouldThrow:w||!1},this.displayMessageParams=T||[],this.options.shouldTrace&&Error.captureStackTrace(this)}static fromErrorInfo(s){return new l(s)}toErrorInfo(){return{...this,identifier:this.identifier}}get identifier(){return`${this.revision}-${this.type||"NO_TYPE"}-${this.module}-${this.code}`}get displayMessage(){return y(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 n=(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.Mayachain="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(n||{});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 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 n){const a=B[n[e]];P[a]=n[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 R=(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.BASE=18]="BASE",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))(R||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],Q=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],ee=["GAIA","THOR","BNB","OSMO"],ne=["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.Mayachain="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://daemon.avalanche.shapeshift.com/ext/bc/C/rpc",e.Binance="https://base.llamarpc.com",e.BinanceSmartChain="https://daemon.bnbsmartchain.shapeshift.com",e.Base="https://developer-access-mainnet.base.org",e.Bitcoin="https://node-router.thorswap.net/bitcoin",e.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash",e.Cosmos="https://node-router.thorswap.net/cosmos/rpc",e.Kujira="https://rpc-kujira.synergynodes.com/",e.Dash="https://dash.nownodes.io",e.Dogecoin="https://node-router.thorswap.net/dogecoin",e.Ethereum="https://daemon.ethereum.shapeshift.com",e.Litecoin="https://node-router.thorswap.net/litecoin",e.Mayachain="https://mayanode.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||{}),V=(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))(V||{});const o=Object.values(n),te=Object.keys(n),E=o.reduce((e,a)=>{const s=te.find(r=>n[r]===a);return s&&(e[a]=s),e},{}),ae=o.reduce((e,a)=>(e[a]=d[E[a]],e),{}),se=o.reduce((e,a)=>(e[a]=S[E[a]],e),{}),ie=o.reduce((e,a)=>{const s=`${E[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"},pe={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 H=(e=>(e[e.NoError=36864]="NoError",e))(H||{}),D=(e=>(e.BOND="BOND",e.DEPOSIT="+",e.LEAVE="LEAVE",e.THORNAME_REGISTER="~",e.UNBOND="UNBOND",e.WITHDRAW="-",e.OPEN_LOAN="$+",e.CLOSE_LOAN="$-",e))(D||{}),L=(e=>(e.Average="average",e.Fast="fast",e.Fastest="fastest",e))(L||{}),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 de=[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Osmosis,n.Ripple,n.Dogecoin,n.Dash,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],oe={BRAVE:p,COINBASE_WEB:p,KEPLR:[n.Cosmos],KEYSTORE:[n.Arbitrum,n.Base,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],LEDGER:de,TREZOR:[n.Bitcoin,n.BitcoinCash,n.Litecoin,n.Dogecoin,n.Ethereum],KEEPKEY:[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Osmosis,n.Ripple,n.Dogecoin,n.Dash,n.Mayachain,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],METAMASK:[n.Arbitrum,n.Avalanche,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],TRUSTWALLET_WEB:p,XDEFI:[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Ripple,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],WALLETCONNECT:[n.Ethereum,n.Binance,n.BinanceSmartChain,n.Avalanche,n.THORChain],OKX:[n.Ethereum,n.Avalanche,n.BinanceSmartChain,n.Bitcoin,n.Cosmos]};exports.AGG_SWAP=N;exports.ApiError=l;exports.ApiUrl=V;exports.BaseDecimal=R;exports.CENTRALIZED_SWAPPER=m;exports.Chain=n;exports.ChainId=d;exports.ChainIdToChain=re;exports.ChainToChainId=ae;exports.ChainToExplorerUrl=pe;exports.ChainToHexChainId=ie;exports.ChainToNetworkId=B;exports.ChainToRPC=se;exports.ContractAddress=g;exports.CosmosChainList=ee;exports.DerivationPath=b;exports.ERROR_CODE=t;exports.ERROR_MODULE=f;exports.ERROR_TYPE=A;exports.EVMChainList=p;exports.ErrorCode=H;exports.FeeOption=L;exports.MemoType=D;exports.NetworkDerivationPath=q;exports.NetworkIdToChain=P;exports.OSMOSIS_SWAP=_;exports.QuoteMode=c;exports.RANGO=h;exports.RPCUrl=S;exports.SWAP_IN=O;exports.SWAP_OUT=C;exports.TCAvalancheDepositABI=k;exports.TCBscDepositABI=Z;exports.TCEthereumVaultAbi=Y;exports.TCSupportedChainList=ne;exports.UTXOChainList=Q;exports.UXTO_SWAP=J;exports.WalletOption=x;exports.availableChainsByWallet=oe;exports.classifySwap=j;exports.erc20ABI=K;exports.getChainEnumValue=z;
|
1
|
+
"use strict";var v=Object.defineProperty;var G=(e,a,s)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s;var i=(e,a,s)=>(G(e,typeof a!="symbol"?a+"":a,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=[{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"}],w=[{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 I=(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.MAYA_SUPPORTED_TO_MAYA_SUPPORTED="MAYA_SUPPORTED_TO_MAYA_SUPPORTED",e.CHANGELLY="CHANGELLY",e.RANGO="RANGO",e))(I||{});const c={AGG_SWAP:["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],SWAP_IN:["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],SWAP_OUT:["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"],OSMOSIS_SWAP:["OSMOSIS-IBC"],CENTRALIZED_SWAPPER:["CHANGELLY"],UXTO_SWAP:["MAYA_SUPPORTED_TO_MAYA_SUPPORTED","RANGO"]};function K(e){var a;return((a=Object.entries(c).find(([s,r])=>r.includes(e)))==null?void 0:a[0])||null}var m=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.REQUEST_PARAMETER_ERROR="REQUEST_PARAMETER_ERROR",e.RESPONSE_PARSING_ERROR="RESPONSE_PARSING_ERROR",e.UNSUPPORTED="UNSUPPORTED",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.INCOMPATIBLE_ASSETS_OPERATIONS="INCOMPATIBLE_ASSETS_OPERATIONS",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.DOWN_FOR_MAINTENANCE="DOWN_FOR_MAINTENANCE",e.MISSING_INBOUND_INFO="MISSING_INBOUND_INFO",e.QUOTE_FETCHING_ERROR="QUOTE_FETCHING_ERROR",e.AIRDROP_ERROR="AIRDROP_ERROR",e.UNHANDLED_ERROR="UNHANDLED_ERROR",e))(m||{}),_=(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))(_||{}),t=(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))(t||{});const Y={[t.INVALID_INPUT_PARAMETERS]:"Invalid input parameters: {0}.",[t.UNKNOWN_PROVIDERS]:"Unknown providers: {0}.",[t.CANNOT_FIND_INBOUND_ADDRESS]:"Cannot find inbound address.",[t.NO_INBOUND_ADDRESSES]:"No inbound addresses.",[t.CHAIN_HALTED_OR_UNSUPPORTED]:"Chain {0} halted or unsupported.",[t.MISSING_INPUT_PARAMETER]:"Missing input parameter: {0}.",[t.INVALID_TYPE_GENERIC]:"Invalid type",[t.INVALID_NUMBER_STRING]:"Invalid number string.",[t.INVALID_NUMBER]:"Invalid number.",[t.INVALID_BOOLEAN]:"Invalid boolean.",[t.INVALID_OBJECT]:"Invalid object.",[t.INVALID_ARRAY]:"Invalid array.",[t.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Sell amount must be a positive integer.",[t.SELL_BUY_ASSETS_ARE_THE_SAME]:"Sell and buy assets are the same.",[t.MISSING_SOURCE_ADDRESS_FOR_SYNTH]:"Source address is required for synth quote.",[t.AFF_ADDRESS_AND_BPS_OR_NEITHER]:"Must provide affiliateAddress and affiliateBasisPoints params, or neither.",[t.AFF_ADDRESS_TOO_LONG]:"affiliateAddress too long: 3 characters max.",[t.AFF_BPS_INTEGER_0_100]:"affiliateBasisPoints must be an integer between 0 and 100.",[t.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]:"Source address {0} invalid for sell chain.",[t.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]:"Destination address {0} invalid for buy chain.",[t.PREFERRED_PROFVIDER_NOT_SUPPORTED]:"Preferred provider not supported.",[t.DESTINATION_ADDRESS_SMART_CONTRACT]:"Destination address is a smart contract.",[t.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Buy amount must be a positive integer.",[t.INVALID_PROVIDER]:"Invalid provider {0}.",[t.MISSING_CROSS_CHAIN_PROVIDER]:"Missing cross-chain provider.",[t.MISSING_AVAX_PROVIDER]:"Missing AVAX provider.",[t.MISSING_BSC_PROVIDER]:"Missing BSC provider.",[t.MISSING_ETH_PROVIDER]:"Missing ETH provider.",[t.MISSING_ARB_PROVIDER]:"Missing ARB provider.",[t.INVALID_PROVIDER_FOR_SWAP_OUT]:"Invalid provider for swap out.",[t.INVALID_CHAIN]:"Invalid chain {0}.",[t.INVALID_ASSET]:"Invalid asset {0}.",[t.UNSUPPORTED_CHAIN]:"Unsupported chain {0}.",[t.UNSUPPORTED_ASSET]:"Unsupported asset {0}.",[t.UNSUPPORTED_ASSET_FOR_SWAPOUT]:"Unsupported asset {0} for swap out.",[t.THORNODE_QUOTE_GENERIC_ERROR]:"ThorNode quote generic error.",[t.INVALID_SOURCE_ADDRESS]:"Invalid source address {0}",[t.INVALID_DESTINATION_ADDRESS]:"Invalid destination address {0}",[t.NOT_ENOUGH_SYNTH_BALANCE]:"Source address doesn't have enough synth balance for this quote.",[t.SYNTH_MINTING_CAP_REACHED]:"Synth minting cap reached.",[t.INVALID_QUOTE_MODE]:"Invalid quote mode.",[t.NO_QUOTES]:"No quotes to service this request.",[t.SERVICE_UNAVAILABLE_GENERIC]:"Service unavailable.",[t.MISSING_GAS_DATA_GENERIC]:"Missing gas data.",[t.MISSING_TOKEN_INFO_GENERIC]:"Missing token info.",[t.CANT_FIND_TOKEN_LIST]:"Can't find tokenlist {0}.",[t.NO_PRICE]:"No price for asset {0}.",[t.PRICE_IS_STALE]:"Price is stale for asset {0}.",[t.ADDRESS_NOT_WHITELISTED]:"Address {0} not whitelisted for airdrop.",[t.ADDRESS_ALREADY_CLAIMED]:"Address {0} already claimed the airdrop."},T=(e,a)=>{let s=Y[e];for(let r=0;r<a.length;r++)s=s.replace(`{${r}}`,a[r]);return a.length===0?s.replace("{0}",""):s};class l extends Error{constructor({status:s,revision:r,module:R,code:u,message:H,type:D,options:{shouldLog:L,shouldThrow:x,shouldTrace:M}={shouldLog:!0,shouldThrow:!0,shouldTrace:!0},displayMessageParams:y}){const E=H||T(u,y||[])||"";super(E);i(this,"status");i(this,"revision");i(this,"type");i(this,"module");i(this,"code");i(this,"message");i(this,"display");i(this,"stack");i(this,"options");i(this,"displayMessageParams");this.status=s,this.revision=r||"NO_REVISION",this.module=R,this.message=E,this.display=T(u,y||[]),this.code=u,this.type=D||m.UNHANDLED_ERROR,this.options={shouldLog:L||!0,shouldTrace:M||!0,shouldThrow:x||!1},this.displayMessageParams=y||[],this.options.shouldTrace&&Error.captureStackTrace(this)}static fromErrorInfo(s){return new l(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 n=(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.Mayachain="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(n||{});function W(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:mayachain-mainnet-v1",OP:"eip155:10",OSMO:"cosmos:osmosis-1",MATIC:"eip155:137",XRP:"ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",THOR:"cosmos:thorchain-mainnet-v1",ZEC:"bip122:0000000000196a45"},O={};for(const e in n){const a=N[n[e]];O[a]=n[e]}var C=(e=>(e.ARB="0x0000000000000000000000000000000000000000",e.AVAX="0x0000000000000000000000000000000000000000",e.ETH="0x0000000000000000000000000000000000000000",e.BSC="0x0000000000000000000000000000000000000000",e.MATIC="0x0000000000000000000000000000000000001010",e.OP="0x4200000000000000000000000000000000000042",e))(C||{}),h=(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))(h||{});const k={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 B=(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.BASE=18]="BASE",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))(B||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],Z=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],J=["GAIA","THOR","BNB","OSMO"],j=["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.Mayachain="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||{}),A=(e=>(e.Arbitrum="https://arb1.arbitrum.io/rpc",e.Avalanche="https://daemon.avalanche.shapeshift.com/ext/bc/C/rpc",e.Binance="https://base.llamarpc.com",e.BinanceSmartChain="https://daemon.bnbsmartchain.shapeshift.com",e.Base="https://developer-access-mainnet.base.org",e.Bitcoin="https://node-router.thorswap.net/bitcoin",e.BitcoinCash="https://node-router.thorswap.net/bitcoin-cash",e.Cosmos="https://node-router.thorswap.net/cosmos/rpc",e.Kujira="https://rpc-kujira.synergynodes.com/",e.Dash="https://dash.nownodes.io",e.Dogecoin="https://node-router.thorswap.net/dogecoin",e.Ethereum="https://daemon.ethereum.shapeshift.com",e.Litecoin="https://node-router.thorswap.net/litecoin",e.Mayachain="https://mayanode.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://thornode.ninerealms.com",e.THORChainStagenet="https://thornode.ninerealms.com",e))(A||{}),f=(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.ninerealms.com",e.ThornodeStagenet="https://thornode.ninerealms.com",e.ThorswapApi="https://api.thorswap.net",e.ThorswapStatic="https://static.thorswap.net",e))(f||{});const o=Object.values(n),$=Object.keys(n),S=o.reduce((e,a)=>{const s=$.find(r=>n[r]===a);return s&&(e[a]=s),e},{}),q=o.reduce((e,a)=>(e[a]=d[S[a]],e),{}),z=o.reduce((e,a)=>(e[a]=A[S[a]],e),{}),Q=o.reduce((e,a)=>{const s=`${S[a]}Hex`;return e[a]=d[s],e},{}),ee={"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"},ne={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 P=(e=>(e[e.NoError=36864]="NoError",e))(P||{}),g=(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||{}),b=(e=>(e.Average="average",e.Fast="fast",e.Fastest="fastest",e))(b||{}),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 te=[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Osmosis,n.Ripple,n.Dogecoin,n.Dash,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],ae={BRAVE:p,COINBASE_WEB:p,KEPLR:[n.Cosmos],KEYSTORE:[n.Arbitrum,n.Base,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],LEDGER:te,TREZOR:[n.Bitcoin,n.BitcoinCash,n.Litecoin,n.Dogecoin,n.Ethereum],KEEPKEY:[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Osmosis,n.Ripple,n.Dogecoin,n.Dash,n.Mayachain,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],METAMASK:[n.Arbitrum,n.Avalanche,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],TRUSTWALLET_WEB:p,XDEFI:[n.Arbitrum,n.Avalanche,n.Binance,n.BinanceSmartChain,n.Bitcoin,n.BitcoinCash,n.Cosmos,n.Ripple,n.Dogecoin,n.Ethereum,n.Litecoin,n.Optimism,n.Polygon,n.THORChain],WALLETCONNECT:[n.Ethereum,n.Binance,n.BinanceSmartChain,n.Avalanche,n.THORChain],OKX:[n.Ethereum,n.Avalanche,n.BinanceSmartChain,n.Bitcoin,n.Cosmos]};exports.ApiError=l;exports.ApiUrl=f;exports.BaseDecimal=B;exports.Chain=n;exports.ChainId=d;exports.ChainIdToChain=ee;exports.ChainToChainId=q;exports.ChainToExplorerUrl=ne;exports.ChainToHexChainId=Q;exports.ChainToNetworkId=N;exports.ChainToRPC=z;exports.ContractAddress=C;exports.CosmosChainList=J;exports.DerivationPath=h;exports.ERROR_CODE=t;exports.ERROR_MODULE=_;exports.ERROR_TYPE=m;exports.EVMChainList=p;exports.ErrorCode=P;exports.FeeOption=b;exports.MemoType=g;exports.NetworkDerivationPath=k;exports.NetworkIdToChain=O;exports.QuoteMode=I;exports.RPCUrl=A;exports.SWAP_TYPES=c;exports.TCAvalancheDepositABI=F;exports.TCBscDepositABI=X;exports.TCEthereumVaultAbi=w;exports.TCSupportedChainList=j;exports.UTXOChainList=Z;exports.WalletOption=V;exports.availableChainsByWallet=ae;exports.classifySwap=K;exports.erc20ABI=U;exports.getChainEnumValue=W;
|
package/dist/index.d.ts
CHANGED
@@ -8,8 +8,6 @@ export declare type AddChainWalletParams = {
|
|
8
8
|
walletMethods: any;
|
9
9
|
};
|
10
10
|
|
11
|
-
export declare const AGG_SWAP: QuoteMode[];
|
12
|
-
|
13
11
|
export declare class ApiError extends Error {
|
14
12
|
readonly status: number;
|
15
13
|
readonly revision: string;
|
@@ -48,8 +46,8 @@ export declare enum ApiUrl {
|
|
48
46
|
Kujira = "https://lcd-kujira.synergynodes.com/",
|
49
47
|
MayanodeMainnet = "https://mayanode.mayachain.info",
|
50
48
|
MayanodeStagenet = "https://stagenet.mayanode.mayachain.info",
|
51
|
-
ThornodeMainnet = "https://thornode.
|
52
|
-
ThornodeStagenet = "https://
|
49
|
+
ThornodeMainnet = "https://thornode.ninerealms.com",
|
50
|
+
ThornodeStagenet = "https://thornode.ninerealms.com",
|
53
51
|
ThorswapApi = "https://api.thorswap.net",
|
54
52
|
ThorswapStatic = "https://static.thorswap.net"
|
55
53
|
}
|
@@ -88,8 +86,6 @@ export declare enum BaseDecimal {
|
|
88
86
|
ZEC = 8
|
89
87
|
}
|
90
88
|
|
91
|
-
export declare const CENTRALIZED_SWAPPER: QuoteMode[];
|
92
|
-
|
93
89
|
export declare enum Chain {
|
94
90
|
Arbitrum = "ARB",
|
95
91
|
Avalanche = "AVAX",
|
@@ -231,7 +227,7 @@ declare type ChainWallet = {
|
|
231
227
|
walletType: WalletOption;
|
232
228
|
};
|
233
229
|
|
234
|
-
export declare function classifySwap(quoteMode: QuoteMode):
|
230
|
+
export declare function classifySwap(quoteMode: QuoteMode): string | null;
|
235
231
|
|
236
232
|
export declare type ConnectConfig = {
|
237
233
|
stagenet?: boolean;
|
@@ -547,8 +543,6 @@ export declare const NetworkDerivationPath: Record<Chain, DerivationPathArray>;
|
|
547
543
|
|
548
544
|
export declare const NetworkIdToChain: Record<string, Chain>;
|
549
545
|
|
550
|
-
export declare const OSMOSIS_SWAP: QuoteMode[];
|
551
|
-
|
552
546
|
export declare enum QuoteMode {
|
553
547
|
TC_SUPPORTED_TO_TC_SUPPORTED = "TC-TC",
|
554
548
|
TC_SUPPORTED_TO_ETH = "TC-ERC20",
|
@@ -572,8 +566,6 @@ export declare enum QuoteMode {
|
|
572
566
|
RANGO = "RANGO"
|
573
567
|
}
|
574
568
|
|
575
|
-
export declare const RANGO: QuoteMode[];
|
576
|
-
|
577
569
|
export declare enum RPCUrl {
|
578
570
|
Arbitrum = "https://arb1.arbitrum.io/rpc",
|
579
571
|
Avalanche = "https://daemon.avalanche.shapeshift.com/ext/bc/C/rpc",
|
@@ -594,8 +586,8 @@ export declare enum RPCUrl {
|
|
594
586
|
Osmosis = "https://lcd-osmosis.keplr.app",
|
595
587
|
Polygon = "https://polygon-rpc.com",
|
596
588
|
Ripple = "https://xrplcluster.com",
|
597
|
-
THORChain = "https://
|
598
|
-
THORChainStagenet = "https://
|
589
|
+
THORChain = "https://thornode.ninerealms.com",
|
590
|
+
THORChainStagenet = "https://thornode.ninerealms.com"
|
599
591
|
}
|
600
592
|
|
601
593
|
export declare type Signature = {
|
@@ -607,9 +599,14 @@ export declare type Signature = {
|
|
607
599
|
signature: string;
|
608
600
|
};
|
609
601
|
|
610
|
-
export declare const
|
611
|
-
|
612
|
-
|
602
|
+
export declare const SWAP_TYPES: {
|
603
|
+
AGG_SWAP: QuoteMode[];
|
604
|
+
SWAP_IN: QuoteMode[];
|
605
|
+
SWAP_OUT: QuoteMode[];
|
606
|
+
OSMOSIS_SWAP: QuoteMode[];
|
607
|
+
CENTRALIZED_SWAPPER: QuoteMode[];
|
608
|
+
UXTO_SWAP: QuoteMode[];
|
609
|
+
};
|
613
610
|
|
614
611
|
export declare const TCAvalancheDepositABI: ({
|
615
612
|
inputs: never[];
|
@@ -825,8 +822,6 @@ export declare type UTXOChain = Chain.Bitcoin | Chain.BitcoinCash | Chain.Dogeco
|
|
825
822
|
|
826
823
|
export declare const UTXOChainList: UTXOChain[];
|
827
824
|
|
828
|
-
export declare const UXTO_SWAP: QuoteMode[];
|
829
|
-
|
830
825
|
export declare enum WalletOption {
|
831
826
|
'KEYSTORE' = "KEYSTORE",
|
832
827
|
'KEEPKEY' = "KEEPKEY",
|
package/dist/index.es.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var i = (e, a, s) => (
|
4
|
-
const
|
1
|
+
var C = Object.defineProperty;
|
2
|
+
var f = (e, a, s) => a in e ? C(e, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[a] = s;
|
3
|
+
var i = (e, a, s) => (f(e, typeof a != "symbol" ? a + "" : a, s), s);
|
4
|
+
const K = [
|
5
5
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
6
6
|
{
|
7
7
|
anonymous: !1,
|
@@ -99,7 +99,7 @@ const J = [
|
|
99
99
|
stateMutability: "nonpayable",
|
100
100
|
type: "function"
|
101
101
|
}
|
102
|
-
],
|
102
|
+
], Y = [
|
103
103
|
{
|
104
104
|
inputs: [{ internalType: "address", name: "rune", type: "address" }],
|
105
105
|
stateMutability: "nonpayable",
|
@@ -274,7 +274,7 @@ const J = [
|
|
274
274
|
stateMutability: "view",
|
275
275
|
type: "function"
|
276
276
|
}
|
277
|
-
],
|
277
|
+
], W = [
|
278
278
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
279
279
|
{
|
280
280
|
anonymous: !1,
|
@@ -438,7 +438,7 @@ const J = [
|
|
438
438
|
stateMutability: "view",
|
439
439
|
type: "function"
|
440
440
|
}
|
441
|
-
],
|
441
|
+
], k = [
|
442
442
|
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
443
443
|
{
|
444
444
|
anonymous: !1,
|
@@ -591,47 +591,53 @@ const J = [
|
|
591
591
|
type: "function"
|
592
592
|
}
|
593
593
|
];
|
594
|
-
var
|
595
|
-
const
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
],
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
594
|
+
var B = /* @__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.MAYA_SUPPORTED_TO_MAYA_SUPPORTED = "MAYA_SUPPORTED_TO_MAYA_SUPPORTED", e.CHANGELLY = "CHANGELLY", e.RANGO = "RANGO", e))(B || {});
|
595
|
+
const P = {
|
596
|
+
AGG_SWAP: [
|
597
|
+
"ERC20-ERC20",
|
598
|
+
"ARC20-ARC20",
|
599
|
+
"BEP20-BEP20"
|
600
|
+
/* BSC_TO_BSC */
|
601
|
+
],
|
602
|
+
SWAP_IN: [
|
603
|
+
"ERC20-TC",
|
604
|
+
"ERC20-ARC20",
|
605
|
+
"ERC20-BEP20",
|
606
|
+
"ARC20-TC",
|
607
|
+
"ARC20-ERC20",
|
608
|
+
"ARC20-BEP20",
|
609
|
+
"BEP20-TC",
|
610
|
+
"BEP20-ERC20",
|
611
|
+
"BEP20-ARC20"
|
612
|
+
/* BSC_TO_AVAX */
|
613
|
+
],
|
614
|
+
SWAP_OUT: [
|
615
|
+
"TC-TC",
|
616
|
+
"TC-ERC20",
|
617
|
+
"TC-ARC20",
|
618
|
+
"TC-BEP20"
|
619
|
+
/* TC_SUPPORTED_TO_BSC */
|
620
|
+
],
|
621
|
+
OSMOSIS_SWAP: [
|
622
|
+
"OSMOSIS-IBC"
|
623
|
+
/* GAIA_TO_OSMO */
|
624
|
+
],
|
625
|
+
CENTRALIZED_SWAPPER: [
|
626
|
+
"CHANGELLY"
|
627
|
+
/* CHANGELLY */
|
628
|
+
],
|
629
|
+
UXTO_SWAP: [
|
630
|
+
"MAYA_SUPPORTED_TO_MAYA_SUPPORTED",
|
631
|
+
"RANGO"
|
632
|
+
/* RANGO */
|
633
|
+
]
|
634
|
+
};
|
635
|
+
function Z(e) {
|
636
|
+
var a;
|
637
|
+
return ((a = Object.entries(P).find(([s, r]) => r.includes(e))) == null ? void 0 : a[0]) || null;
|
632
638
|
}
|
633
|
-
var
|
634
|
-
const
|
639
|
+
var A = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(A || {}), g = /* @__PURE__ */ ((e) => (e.HEALTH_CONTROLLER = "1000", e.LIQUIDITY_CONTROLLER = "1001", e.PROVIDER_CONTROLLER = "1002", e.QUOTE_CONTROLLER = "1003", e.SWAP_CONTROLLER = "1004", e.UTIL_CONTROLLER = "1005", e.AIRDROP_CONTROLLER = "1006", e.PROVIDER = "2000", e.ASSET = "2001", e.TOKEN_LIST = "2002", e.QUOTE = "2100", e.QUOTE_TXN_DETAILS = "2101", e.THORCHAIN_PROVIDER = "3000", e.UNISWAPV2_ETH_PROVIDER = "3001", e.UNISWAPV3_ETH_PROVIDER = "3002", e.SUSHISWAP_ETH_PROVIDER = "3003", e.PANCAKESWAP_BSC_PROVIDER = "3004", e.PANCAKESWAP_ETH_PROVIDER = "3005", e.ONEINCH_ETH_PROVIDER = "3006", e.ONEINCH_BSC_PROVIDER = "3007", e.ONEINCH_AVAX_PROVIDER = "3008", e.ZEROX_ETH_PROVIDER = "3009", e.WOOFI_AVAX_PROVIDER = "3010", e.PANGOLIN_AVAX_PROVIDER = "3011", e.TRADERJOE_AVAX_PROVIDER = "3012", e.KYBER_ETH_PROVIDER = "3013", e.KYBER_AVAX_PROVIDER = "3014", e.WOOFI_BSC_PROVIDER = "3015", e.STARGATE_PROVIDER = "3016", e.PROVIDER_UTIL = "4000", e.TXN_DETAILS = "5000", e.AIRDROP_UTIL = "6000", e))(g || {}), t = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.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))(t || {});
|
640
|
+
const b = {
|
635
641
|
[t.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
|
636
642
|
[t.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
|
637
643
|
[t.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
|
@@ -683,28 +689,28 @@ const D = {
|
|
683
689
|
[t.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
|
684
690
|
[t.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
|
685
691
|
}, u = (e, a) => {
|
686
|
-
let s =
|
692
|
+
let s = b[e];
|
687
693
|
for (let r = 0; r < a.length; r++)
|
688
694
|
s = s.replace(`{${r}}`, a[r]);
|
689
695
|
return a.length === 0 ? s.replace("{0}", "") : s;
|
690
696
|
};
|
691
|
-
class
|
697
|
+
class S extends Error {
|
692
698
|
constructor({
|
693
699
|
status: s,
|
694
700
|
revision: r,
|
695
|
-
module:
|
701
|
+
module: I,
|
696
702
|
code: d,
|
697
703
|
message: _,
|
698
|
-
type:
|
699
|
-
options: { shouldLog:
|
704
|
+
type: c,
|
705
|
+
options: { shouldLog: N, shouldThrow: O, shouldTrace: h } = {
|
700
706
|
shouldLog: !0,
|
701
707
|
shouldThrow: !0,
|
702
708
|
shouldTrace: !0
|
703
709
|
},
|
704
710
|
displayMessageParams: o
|
705
711
|
}) {
|
706
|
-
const
|
707
|
-
super(
|
712
|
+
const l = _ || u(d, o || []) || "";
|
713
|
+
super(l);
|
708
714
|
i(this, "status");
|
709
715
|
i(this, "revision");
|
710
716
|
i(this, "type");
|
@@ -715,14 +721,14 @@ class E extends Error {
|
|
715
721
|
i(this, "stack");
|
716
722
|
i(this, "options");
|
717
723
|
i(this, "displayMessageParams");
|
718
|
-
this.status = s, this.revision = r || "NO_REVISION", this.module =
|
719
|
-
shouldLog:
|
720
|
-
shouldTrace:
|
721
|
-
shouldThrow:
|
724
|
+
this.status = s, this.revision = r || "NO_REVISION", this.module = I, this.message = l, this.display = u(d, o || []), this.code = d, this.type = c || A.UNHANDLED_ERROR, this.options = {
|
725
|
+
shouldLog: N || !0,
|
726
|
+
shouldTrace: h || !0,
|
727
|
+
shouldThrow: O || !1
|
722
728
|
}, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
|
723
729
|
}
|
724
730
|
static fromErrorInfo(s) {
|
725
|
-
return new
|
731
|
+
return new S(s);
|
726
732
|
}
|
727
733
|
toErrorInfo() {
|
728
734
|
return { ...this, identifier: this.identifier };
|
@@ -742,7 +748,7 @@ class E extends Error {
|
|
742
748
|
}
|
743
749
|
}
|
744
750
|
var n = /* @__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.Mayachain = "MAYA", e.Optimism = "OP", e.Osmosis = "OSMO", e.Polygon = "MATIC", e.Ripple = "XRP", e.THORChain = "THOR", e.Zcash = "ZEC", e))(n || {});
|
745
|
-
function
|
751
|
+
function J(e) {
|
746
752
|
switch (e) {
|
747
753
|
case "ARB":
|
748
754
|
return "ARB";
|
@@ -792,7 +798,7 @@ function ee(e) {
|
|
792
798
|
return;
|
793
799
|
}
|
794
800
|
}
|
795
|
-
const
|
801
|
+
const V = {
|
796
802
|
ARB: "eip155:42161",
|
797
803
|
AVAX: "eip155:43114",
|
798
804
|
BSC: "eip155:56",
|
@@ -808,20 +814,20 @@ const x = {
|
|
808
814
|
EOS: "eos:cf057bbfb72640471fd910bcb67639c2",
|
809
815
|
ETH: "eip155:1",
|
810
816
|
LTC: "bip122:12a765e31ffd4059bada1e25190f6e98",
|
811
|
-
MAYA: "cosmos:
|
817
|
+
MAYA: "cosmos:mayachain-mainnet-v1",
|
812
818
|
OP: "eip155:10",
|
813
819
|
OSMO: "cosmos:osmosis-1",
|
814
820
|
MATIC: "eip155:137",
|
815
821
|
XRP: "ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",
|
816
822
|
THOR: "cosmos:thorchain-mainnet-v1",
|
817
823
|
ZEC: "bip122:0000000000196a45"
|
818
|
-
},
|
824
|
+
}, H = {};
|
819
825
|
for (const e in n) {
|
820
|
-
const a =
|
821
|
-
|
826
|
+
const a = V[n[e]];
|
827
|
+
H[a] = n[e];
|
822
828
|
}
|
823
|
-
var
|
824
|
-
const
|
829
|
+
var R = /* @__PURE__ */ ((e) => (e.ARB = "0x0000000000000000000000000000000000000000", e.AVAX = "0x0000000000000000000000000000000000000000", e.ETH = "0x0000000000000000000000000000000000000000", e.BSC = "0x0000000000000000000000000000000000000000", e.MATIC = "0x0000000000000000000000000000000000001010", e.OP = "0x4200000000000000000000000000000000000042", e))(R || {}), L = /* @__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))(L || {});
|
830
|
+
const j = {
|
825
831
|
ARB: [44, 60, 0, 0, 0],
|
826
832
|
AVAX: [44, 60, 0, 0, 0],
|
827
833
|
BASE: [44, 60, 0, 0, 0],
|
@@ -845,7 +851,7 @@ const ne = {
|
|
845
851
|
THOR: [44, 931, 0, 0, 0],
|
846
852
|
ZEC: [44, 133, 0, 0, 0]
|
847
853
|
};
|
848
|
-
var
|
854
|
+
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.BASE = 18] = "BASE", 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 || {});
|
849
855
|
const y = [
|
850
856
|
"ETH",
|
851
857
|
"AVAX",
|
@@ -855,7 +861,7 @@ const y = [
|
|
855
861
|
"OP",
|
856
862
|
"MATIC"
|
857
863
|
/* Polygon */
|
858
|
-
],
|
864
|
+
], $ = [
|
859
865
|
"BTC",
|
860
866
|
"BCH",
|
861
867
|
"DASH",
|
@@ -864,13 +870,13 @@ const y = [
|
|
864
870
|
"LTC",
|
865
871
|
"ZEC"
|
866
872
|
/* Zcash */
|
867
|
-
],
|
873
|
+
], q = [
|
868
874
|
"GAIA",
|
869
875
|
"THOR",
|
870
876
|
"BNB",
|
871
877
|
"OSMO"
|
872
878
|
/* Osmosis */
|
873
|
-
],
|
879
|
+
], z = [
|
874
880
|
"AVAX",
|
875
881
|
"BNB",
|
876
882
|
"BSC",
|
@@ -883,26 +889,26 @@ const y = [
|
|
883
889
|
"THOR"
|
884
890
|
/* THORChain */
|
885
891
|
];
|
886
|
-
var T = /* @__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.Mayachain = "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))(T || {}),
|
887
|
-
const p = Object.values(n),
|
892
|
+
var T = /* @__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.Mayachain = "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))(T || {}), E = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://daemon.avalanche.shapeshift.com/ext/bc/C/rpc", e.Binance = "https://base.llamarpc.com", e.BinanceSmartChain = "https://daemon.bnbsmartchain.shapeshift.com", e.Base = "https://developer-access-mainnet.base.org", e.Bitcoin = "https://node-router.thorswap.net/bitcoin", e.BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash", e.Cosmos = "https://node-router.thorswap.net/cosmos/rpc", e.Kujira = "https://rpc-kujira.synergynodes.com/", e.Dash = "https://dash.nownodes.io", e.Dogecoin = "https://node-router.thorswap.net/dogecoin", e.Ethereum = "https://daemon.ethereum.shapeshift.com", e.Litecoin = "https://node-router.thorswap.net/litecoin", e.Mayachain = "https://mayanode.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://thornode.ninerealms.com", e.THORChainStagenet = "https://thornode.ninerealms.com", e))(E || {}), x = /* @__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.ninerealms.com", e.ThornodeStagenet = "https://thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.net", e.ThorswapStatic = "https://static.thorswap.net", e))(x || {});
|
893
|
+
const p = Object.values(n), M = Object.keys(n), m = p.reduce(
|
888
894
|
(e, a) => {
|
889
|
-
const s =
|
895
|
+
const s = M.find((r) => n[r] === a);
|
890
896
|
return s && (e[a] = s), e;
|
891
897
|
},
|
892
898
|
{}
|
893
|
-
),
|
899
|
+
), Q = p.reduce(
|
894
900
|
(e, a) => (e[a] = T[m[a]], e),
|
895
901
|
{}
|
896
|
-
),
|
897
|
-
(e, a) => (e[a] =
|
902
|
+
), ee = p.reduce(
|
903
|
+
(e, a) => (e[a] = E[m[a]], e),
|
898
904
|
{}
|
899
|
-
),
|
905
|
+
), ne = p.reduce(
|
900
906
|
(e, a) => {
|
901
907
|
const s = `${m[a]}Hex`;
|
902
908
|
return e[a] = T[s], e;
|
903
909
|
},
|
904
910
|
{}
|
905
|
-
),
|
911
|
+
), te = {
|
906
912
|
"0xa4b1": "ARB",
|
907
913
|
42161: "ARB",
|
908
914
|
"0xa86a": "AVAX",
|
@@ -930,7 +936,7 @@ const p = Object.values(n), F = Object.keys(n), m = p.reduce(
|
|
930
936
|
"thorchain-stagenet-v2": "THOR",
|
931
937
|
"thorchain-mainnet-v1": "THOR"
|
932
938
|
/* THORChain */
|
933
|
-
},
|
939
|
+
}, ae = {
|
934
940
|
ARB: "https://arbiscan.io",
|
935
941
|
AVAX: "https://snowtrace.io",
|
936
942
|
BSC: "https://bscscan.com",
|
@@ -954,8 +960,8 @@ const p = Object.values(n), F = Object.keys(n), m = p.reduce(
|
|
954
960
|
THOR: "https://runescan.io",
|
955
961
|
ZEC: "https://z.cash/ecosystem/zcash-explorer"
|
956
962
|
};
|
957
|
-
var
|
958
|
-
const
|
963
|
+
var v = /* @__PURE__ */ ((e) => (e[e.NoError = 36864] = "NoError", e))(v || {}), 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 || {}), U = /* @__PURE__ */ ((e) => (e.Average = "average", e.Fast = "fast", e.Fastest = "fastest", e))(U || {}), w = /* @__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))(w || {});
|
964
|
+
const F = [
|
959
965
|
n.Arbitrum,
|
960
966
|
n.Avalanche,
|
961
967
|
n.Binance,
|
@@ -972,7 +978,7 @@ const k = [
|
|
972
978
|
n.Optimism,
|
973
979
|
n.Polygon,
|
974
980
|
n.THORChain
|
975
|
-
],
|
981
|
+
], se = {
|
976
982
|
BRAVE: y,
|
977
983
|
COINBASE_WEB: y,
|
978
984
|
KEPLR: [n.Cosmos],
|
@@ -992,7 +998,7 @@ const k = [
|
|
992
998
|
n.Polygon,
|
993
999
|
n.THORChain
|
994
1000
|
],
|
995
|
-
LEDGER:
|
1001
|
+
LEDGER: F,
|
996
1002
|
TREZOR: [
|
997
1003
|
n.Bitcoin,
|
998
1004
|
n.BitcoinCash,
|
@@ -1066,46 +1072,40 @@ const k = [
|
|
1066
1072
|
]
|
1067
1073
|
};
|
1068
1074
|
export {
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
U as BaseDecimal,
|
1073
|
-
l as CENTRALIZED_SWAPPER,
|
1075
|
+
S as ApiError,
|
1076
|
+
x as ApiUrl,
|
1077
|
+
D as BaseDecimal,
|
1074
1078
|
n as Chain,
|
1075
1079
|
T as ChainId,
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1080
|
+
te as ChainIdToChain,
|
1081
|
+
Q as ChainToChainId,
|
1082
|
+
ae as ChainToExplorerUrl,
|
1083
|
+
ne as ChainToHexChainId,
|
1084
|
+
V as ChainToNetworkId,
|
1085
|
+
ee as ChainToRPC,
|
1086
|
+
R as ContractAddress,
|
1087
|
+
q as CosmosChainList,
|
1088
|
+
L as DerivationPath,
|
1085
1089
|
t as ERROR_CODE,
|
1086
|
-
|
1087
|
-
|
1090
|
+
g as ERROR_MODULE,
|
1091
|
+
A as ERROR_TYPE,
|
1088
1092
|
y as EVMChainList,
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
se as
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
ue as availableChainsByWallet,
|
1108
|
-
Q as classifySwap,
|
1109
|
-
J as erc20ABI,
|
1110
|
-
ee as getChainEnumValue
|
1093
|
+
v as ErrorCode,
|
1094
|
+
U as FeeOption,
|
1095
|
+
G as MemoType,
|
1096
|
+
j as NetworkDerivationPath,
|
1097
|
+
H as NetworkIdToChain,
|
1098
|
+
B as QuoteMode,
|
1099
|
+
E as RPCUrl,
|
1100
|
+
P as SWAP_TYPES,
|
1101
|
+
W as TCAvalancheDepositABI,
|
1102
|
+
k as TCBscDepositABI,
|
1103
|
+
Y as TCEthereumVaultAbi,
|
1104
|
+
z as TCSupportedChainList,
|
1105
|
+
$ as UTXOChainList,
|
1106
|
+
w as WalletOption,
|
1107
|
+
se as availableChainsByWallet,
|
1108
|
+
Z as classifySwap,
|
1109
|
+
K as erc20ABI,
|
1110
|
+
J as getChainEnumValue
|
1111
1111
|
};
|
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.4.
|
8
|
+
"@internal/config": "2.4.9"
|
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.4.
|
36
|
+
"version": "4.4.9",
|
37
37
|
"scripts": {
|
38
38
|
"build": "vite build",
|
39
39
|
"build:watch": "nodemon --watch src --exec 'pnpm run build'",
|
package/src/commonTypes.ts
CHANGED
@@ -101,6 +101,12 @@ export type ExtendParams<WalletConnectMethodNames = ''> = {
|
|
101
101
|
}[];
|
102
102
|
};
|
103
103
|
|
104
|
+
export type Asset = {
|
105
|
+
chain: Chain;
|
106
|
+
symbol: string;
|
107
|
+
ticker: string;
|
108
|
+
synth?: boolean;
|
109
|
+
};
|
104
110
|
export enum QuoteMode {
|
105
111
|
TC_SUPPORTED_TO_TC_SUPPORTED = 'TC-TC',
|
106
112
|
TC_SUPPORTED_TO_ETH = 'TC-ERC20',
|
@@ -124,63 +130,30 @@ export enum QuoteMode {
|
|
124
130
|
RANGO = 'RANGO',
|
125
131
|
}
|
126
132
|
|
127
|
-
export
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
133
|
+
export const SWAP_TYPES = {
|
134
|
+
AGG_SWAP: [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC],
|
135
|
+
SWAP_IN: [
|
136
|
+
QuoteMode.ETH_TO_TC_SUPPORTED,
|
137
|
+
QuoteMode.ETH_TO_AVAX,
|
138
|
+
QuoteMode.ETH_TO_BSC,
|
139
|
+
QuoteMode.AVAX_TO_TC_SUPPORTED,
|
140
|
+
QuoteMode.AVAX_TO_ETH,
|
141
|
+
QuoteMode.AVAX_TO_BSC,
|
142
|
+
QuoteMode.BSC_TO_TC_SUPPORTED,
|
143
|
+
QuoteMode.BSC_TO_ETH,
|
144
|
+
QuoteMode.BSC_TO_AVAX,
|
145
|
+
],
|
146
|
+
SWAP_OUT: [
|
147
|
+
QuoteMode.TC_SUPPORTED_TO_TC_SUPPORTED,
|
148
|
+
QuoteMode.TC_SUPPORTED_TO_ETH,
|
149
|
+
QuoteMode.TC_SUPPORTED_TO_AVAX,
|
150
|
+
QuoteMode.TC_SUPPORTED_TO_BSC,
|
151
|
+
],
|
152
|
+
OSMOSIS_SWAP: [QuoteMode.GAIA_TO_OSMO],
|
153
|
+
CENTRALIZED_SWAPPER: [QuoteMode.CHANGELLY],
|
154
|
+
UXTO_SWAP: [QuoteMode.MAYA_SUPPORTED_TO_MAYA_SUPPORTED, QuoteMode.RANGO],
|
132
155
|
};
|
133
156
|
|
134
|
-
export
|
135
|
-
|
136
|
-
export const CENTRALIZED_SWAPPER = [QuoteMode.CHANGELLY];
|
137
|
-
|
138
|
-
export const AGG_SWAP = [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC];
|
139
|
-
|
140
|
-
export const SWAP_IN = [
|
141
|
-
QuoteMode.ETH_TO_TC_SUPPORTED,
|
142
|
-
QuoteMode.ETH_TO_AVAX,
|
143
|
-
QuoteMode.ETH_TO_BSC,
|
144
|
-
QuoteMode.AVAX_TO_TC_SUPPORTED,
|
145
|
-
QuoteMode.AVAX_TO_ETH,
|
146
|
-
QuoteMode.AVAX_TO_BSC,
|
147
|
-
QuoteMode.BSC_TO_TC_SUPPORTED,
|
148
|
-
QuoteMode.BSC_TO_ETH,
|
149
|
-
QuoteMode.BSC_TO_AVAX,
|
150
|
-
];
|
151
|
-
|
152
|
-
export const SWAP_OUT = [
|
153
|
-
QuoteMode.TC_SUPPORTED_TO_TC_SUPPORTED,
|
154
|
-
QuoteMode.TC_SUPPORTED_TO_ETH,
|
155
|
-
QuoteMode.TC_SUPPORTED_TO_AVAX,
|
156
|
-
QuoteMode.TC_SUPPORTED_TO_BSC,
|
157
|
-
];
|
158
|
-
|
159
|
-
export const UXTO_SWAP = [QuoteMode.MAYA_SUPPORTED_TO_MAYA_SUPPORTED];
|
160
|
-
|
161
|
-
export const RANGO = [QuoteMode.RANGO];
|
162
|
-
|
163
|
-
export function classifySwap(quoteMode: QuoteMode) {
|
164
|
-
if (AGG_SWAP.includes(quoteMode)) {
|
165
|
-
return 'AGG_SWAP';
|
166
|
-
}
|
167
|
-
if (SWAP_IN.includes(quoteMode)) {
|
168
|
-
return 'SWAP_IN';
|
169
|
-
}
|
170
|
-
if (SWAP_OUT.includes(quoteMode)) {
|
171
|
-
return 'SWAP_OUT';
|
172
|
-
}
|
173
|
-
if (OSMOSIS_SWAP.includes(quoteMode)) {
|
174
|
-
return 'OSMOSIS_SWAP';
|
175
|
-
}
|
176
|
-
if (CENTRALIZED_SWAPPER.includes(quoteMode)) {
|
177
|
-
return 'CENTRALIZED_SWAPPER';
|
178
|
-
}
|
179
|
-
if (CENTRALIZED_SWAPPER.includes(quoteMode)) {
|
180
|
-
return 'CENTRALIZED_SWAPPER';
|
181
|
-
}
|
182
|
-
if (RANGO.includes(quoteMode)) {
|
183
|
-
return 'CENTRALIZED_SWAPPER';
|
184
|
-
}
|
185
|
-
return null;
|
157
|
+
export function classifySwap(quoteMode: QuoteMode): string | null {
|
158
|
+
return Object.entries(SWAP_TYPES).find(([_, modes]) => modes.includes(quoteMode))?.[0] || null;
|
186
159
|
}
|
package/src/network.ts
CHANGED
@@ -90,7 +90,7 @@ export const ChainToNetworkId: Record<Chain, string> = {
|
|
90
90
|
[Chain.EOS]: 'eos:cf057bbfb72640471fd910bcb67639c2',
|
91
91
|
[Chain.Ethereum]: 'eip155:1',
|
92
92
|
[Chain.Litecoin]: 'bip122:12a765e31ffd4059bada1e25190f6e98',
|
93
|
-
[Chain.Mayachain]: 'cosmos:
|
93
|
+
[Chain.Mayachain]: 'cosmos:mayachain-mainnet-v1',
|
94
94
|
[Chain.Optimism]: 'eip155:10',
|
95
95
|
[Chain.Osmosis]: 'cosmos:osmosis-1',
|
96
96
|
[Chain.Polygon]: 'eip155:137',
|
@@ -313,8 +313,8 @@ export enum RPCUrl {
|
|
313
313
|
Osmosis = 'https://lcd-osmosis.keplr.app',
|
314
314
|
Polygon = 'https://polygon-rpc.com',
|
315
315
|
Ripple = 'https://xrplcluster.com',
|
316
|
-
THORChain = 'https://
|
317
|
-
THORChainStagenet = 'https://
|
316
|
+
THORChain = 'https://thornode.ninerealms.com',
|
317
|
+
THORChainStagenet = 'https://thornode.ninerealms.com',
|
318
318
|
}
|
319
319
|
|
320
320
|
export enum ApiUrl {
|
@@ -322,8 +322,8 @@ export enum ApiUrl {
|
|
322
322
|
Kujira = 'https://lcd-kujira.synergynodes.com/',
|
323
323
|
MayanodeMainnet = 'https://mayanode.mayachain.info',
|
324
324
|
MayanodeStagenet = 'https://stagenet.mayanode.mayachain.info',
|
325
|
-
ThornodeMainnet = 'https://thornode.
|
326
|
-
ThornodeStagenet = 'https://
|
325
|
+
ThornodeMainnet = 'https://thornode.ninerealms.com',
|
326
|
+
ThornodeStagenet = 'https://thornode.ninerealms.com',
|
327
327
|
ThorswapApi = 'https://api.thorswap.net',
|
328
328
|
ThorswapStatic = 'https://static.thorswap.net',
|
329
329
|
}
|