@coinmasters/types 4.3.0 → 4.4.0
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 +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.es.js +16 -16
- package/package.json +2 -2
- package/src/commonTypes.ts +3 -5
- package/src/network.ts +6 -3
package/dist/index.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
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 _=(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))(_||{});const c=["OSMOSIS-IBC"],N=["CHANGELLY"],O=["ERC20-ERC20","ARC20-ARC20","BEP20-BEP20"],C=["ERC20-TC","ERC20-ARC20","ERC20-BEP20","ARC20-TC","ARC20-ERC20","ARC20-BEP20","BEP20-TC","BEP20-ERC20","BEP20-ARC20"],h=["TC-TC","TC-ERC20","TC-ARC20","TC-BEP20"],J=["MAYA_SUPPORTED_TO_MAYA_SUPPORTED"];function j(e){return O.includes(e)?"AGG_SWAP":C.includes(e)?"SWAP_IN":h.includes(e)?"SWAP_OUT":c.includes(e)?"OSMOSIS_SWAP":N.includes(e)?"CENTRALIZED_SWAPPER":null}var l=(e=>(e.VALIDATION_ERROR="VALIDATION_ERROR",e.REQUEST_PARAMETER_ERROR="REQUEST_PARAMETER_ERROR",e.RESPONSE_PARSING_ERROR="RESPONSE_PARSING_ERROR",e.UNSUPPORTED="UNSUPPORTED",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.INCOMPATIBLE_ASSETS_OPERATIONS="INCOMPATIBLE_ASSETS_OPERATIONS",e.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",e.DOWN_FOR_MAINTENANCE="DOWN_FOR_MAINTENANCE",e.MISSING_INBOUND_INFO="MISSING_INBOUND_INFO",e.QUOTE_FETCHING_ERROR="QUOTE_FETCHING_ERROR",e.AIRDROP_ERROR="AIRDROP_ERROR",e.UNHANDLED_ERROR="UNHANDLED_ERROR",e))(l||{}),f=(e=>(e.HEALTH_CONTROLLER="1000",e.LIQUIDITY_CONTROLLER="1001",e.PROVIDER_CONTROLLER="1002",e.QUOTE_CONTROLLER="1003",e.SWAP_CONTROLLER="1004",e.UTIL_CONTROLLER="1005",e.AIRDROP_CONTROLLER="1006",e.PROVIDER="2000",e.ASSET="2001",e.TOKEN_LIST="2002",e.QUOTE="2100",e.QUOTE_TXN_DETAILS="2101",e.THORCHAIN_PROVIDER="3000",e.UNISWAPV2_ETH_PROVIDER="3001",e.UNISWAPV3_ETH_PROVIDER="3002",e.SUSHISWAP_ETH_PROVIDER="3003",e.PANCAKESWAP_BSC_PROVIDER="3004",e.PANCAKESWAP_ETH_PROVIDER="3005",e.ONEINCH_ETH_PROVIDER="3006",e.ONEINCH_BSC_PROVIDER="3007",e.ONEINCH_AVAX_PROVIDER="3008",e.ZEROX_ETH_PROVIDER="3009",e.WOOFI_AVAX_PROVIDER="3010",e.PANGOLIN_AVAX_PROVIDER="3011",e.TRADERJOE_AVAX_PROVIDER="3012",e.KYBER_ETH_PROVIDER="3013",e.KYBER_AVAX_PROVIDER="3014",e.WOOFI_BSC_PROVIDER="3015",e.STARGATE_PROVIDER="3016",e.PROVIDER_UTIL="4000",e.TXN_DETAILS="5000",e.AIRDROP_UTIL="6000",e))(f||{}),n=(e=>(e.INVALID_INPUT_PARAMETERS="1000",e.UNKNOWN_PROVIDERS="1001",e.CANNOT_FIND_INBOUND_ADDRESS="1002",e.NO_INBOUND_ADDRESSES="1003",e.CHAIN_HALTED_OR_UNSUPPORTED="1004",e.MISSING_INPUT_PARAMETER="1005",e.INVALID_TYPE_GENERIC="1100",e.INVALID_NUMBER_STRING="1101",e.INVALID_NUMBER="1102",e.INVALID_BOOLEAN="1103",e.INVALID_OBJECT="1104",e.INVALID_ARRAY="1105",e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER="2000",e.SELL_BUY_ASSETS_ARE_THE_SAME="2001",e.MISSING_SOURCE_ADDRESS_FOR_SYNTH="2002",e.AFF_ADDRESS_AND_BPS_OR_NEITHER="2003",e.AFF_ADDRESS_TOO_LONG="2004",e.AFF_BPS_INTEGER_0_100="2005",e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN="2006",e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN="2007",e.PREFERRED_PROFVIDER_NOT_SUPPORTED="2008",e.DESTINATION_ADDRESS_SMART_CONTRACT="2009",e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER="2010",e.SOURCE_ADDRESS_SMART_CONTRACT="2011",e.INVALID_PROVIDER="2100",e.MISSING_CROSS_CHAIN_PROVIDER="2101",e.MISSING_AVAX_PROVIDER="2102",e.MISSING_BSC_PROVIDER="2103",e.MISSING_ETH_PROVIDER="2104",e.INVALID_PROVIDER_FOR_SWAP_OUT="2105",e.MISSING_ARB_PROVIDER="2106",e.INVALID_CHAIN="2200",e.INVALID_ASSET="2201",e.INVALID_ASSET_IDENTIFIER="2202",e.UNSUPPORTED_CHAIN="2204",e.UNSUPPORTED_ASSET="2203",e.UNSUPPORTED_ASSET_FOR_SWAPOUT="2205",e.INVALID_SOURCE_ADDRESS="2300",e.INVALID_DESTINATION_ADDRESS="2301",e.THORNODE_QUOTE_GENERIC_ERROR="3000",e.NOT_ENOUGH_SYNTH_BALANCE="3001",e.SYNTH_MINTING_CAP_REACHED="3002",e.INVALID_QUOTE_MODE="4000",e.NO_QUOTES="4001",e.SERVICE_UNAVAILABLE_GENERIC="5000",e.MISSING_GAS_DATA_GENERIC="5100",e.MISSING_TOKEN_INFO_GENERIC="5200",e.CANT_FIND_TOKEN_LIST="5201",e.NO_PRICE="5202",e.PRICE_IS_STALE="5203",e.ADDRESS_NOT_WHITELISTED="6000",e.ADDRESS_ALREADY_CLAIMED="6001",e.TEMPORARY_ERROR="9999",e))(n||{});const $={[n.INVALID_INPUT_PARAMETERS]:"Invalid input parameters: {0}.",[n.UNKNOWN_PROVIDERS]:"Unknown providers: {0}.",[n.CANNOT_FIND_INBOUND_ADDRESS]:"Cannot find inbound address.",[n.NO_INBOUND_ADDRESSES]:"No inbound addresses.",[n.CHAIN_HALTED_OR_UNSUPPORTED]:"Chain {0} halted or unsupported.",[n.MISSING_INPUT_PARAMETER]:"Missing input parameter: {0}.",[n.INVALID_TYPE_GENERIC]:"Invalid type",[n.INVALID_NUMBER_STRING]:"Invalid number string.",[n.INVALID_NUMBER]:"Invalid number.",[n.INVALID_BOOLEAN]:"Invalid boolean.",[n.INVALID_OBJECT]:"Invalid object.",[n.INVALID_ARRAY]:"Invalid array.",[n.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Sell amount must be a positive integer.",[n.SELL_BUY_ASSETS_ARE_THE_SAME]:"Sell and buy assets are the same.",[n.MISSING_SOURCE_ADDRESS_FOR_SYNTH]:"Source address is required for synth quote.",[n.AFF_ADDRESS_AND_BPS_OR_NEITHER]:"Must provide affiliateAddress and affiliateBasisPoints params, or neither.",[n.AFF_ADDRESS_TOO_LONG]:"affiliateAddress too long: 3 characters max.",[n.AFF_BPS_INTEGER_0_100]:"affiliateBasisPoints must be an integer between 0 and 100.",[n.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN]:"Source address {0} invalid for sell chain.",[n.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN]:"Destination address {0} invalid for buy chain.",[n.PREFERRED_PROFVIDER_NOT_SUPPORTED]:"Preferred provider not supported.",[n.DESTINATION_ADDRESS_SMART_CONTRACT]:"Destination address is a smart contract.",[n.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER]:"Buy amount must be a positive integer.",[n.INVALID_PROVIDER]:"Invalid provider {0}.",[n.MISSING_CROSS_CHAIN_PROVIDER]:"Missing cross-chain provider.",[n.MISSING_AVAX_PROVIDER]:"Missing AVAX provider.",[n.MISSING_BSC_PROVIDER]:"Missing BSC provider.",[n.MISSING_ETH_PROVIDER]:"Missing ETH provider.",[n.MISSING_ARB_PROVIDER]:"Missing ARB provider.",[n.INVALID_PROVIDER_FOR_SWAP_OUT]:"Invalid provider for swap out.",[n.INVALID_CHAIN]:"Invalid chain {0}.",[n.INVALID_ASSET]:"Invalid asset {0}.",[n.UNSUPPORTED_CHAIN]:"Unsupported chain {0}.",[n.UNSUPPORTED_ASSET]:"Unsupported asset {0}.",[n.UNSUPPORTED_ASSET_FOR_SWAPOUT]:"Unsupported asset {0} for swap out.",[n.THORNODE_QUOTE_GENERIC_ERROR]:"ThorNode quote generic error.",[n.INVALID_SOURCE_ADDRESS]:"Invalid source address {0}",[n.INVALID_DESTINATION_ADDRESS]:"Invalid destination address {0}",[n.NOT_ENOUGH_SYNTH_BALANCE]:"Source address doesn't have enough synth balance for this quote.",[n.SYNTH_MINTING_CAP_REACHED]:"Synth minting cap reached.",[n.INVALID_QUOTE_MODE]:"Invalid quote mode.",[n.NO_QUOTES]:"No quotes to service this request.",[n.SERVICE_UNAVAILABLE_GENERIC]:"Service unavailable.",[n.MISSING_GAS_DATA_GENERIC]:"Missing gas data.",[n.MISSING_TOKEN_INFO_GENERIC]:"Missing token info.",[n.CANT_FIND_TOKEN_LIST]:"Can't find tokenlist {0}.",[n.NO_PRICE]:"No price for asset {0}.",[n.PRICE_IS_STALE]:"Price is stale for asset {0}.",[n.ADDRESS_NOT_WHITELISTED]:"Address {0} not whitelisted for airdrop.",[n.ADDRESS_ALREADY_CLAIMED]:"Address {0} already claimed the airdrop."},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 A extends Error{constructor({status:s,revision:r,module:M,code:u,message:v,type:G,options:{shouldLog:U,shouldThrow:w,shouldTrace:X}={shouldLog:!0,shouldThrow:!0,shouldTrace:!0},displayMessageParams:T}){const I=v||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=M,this.message=I,this.display=y(u,T||[]),this.code=u,this.type=G||l.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 A(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 t=(e=>(e.Arbitrum="ARB",e.Avalanche="AVAX",e.Base="BASE",e.Binance="BNB",e.BinanceSmartChain="BSC",e.Bitcoin="BTC",e.BitcoinCash="BCH",e.Cosmos="GAIA",e.Dash="DASH",e.Digibyte="DGB",e.Dogecoin="DOGE",e.EOS="EOS",e.Ethereum="ETH",e.Kujira="KUJI",e.Litecoin="LTC",e.Maya="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(t||{});function q(e){switch(e){case"ARB":return"ARB";case"AVAX":return"AVAX";case"BASE":return"BASE";case"BNB":return"BNB";case"BSC":return"BSC";case"BTC":return"BTC";case"BCH":return"BCH";case"GAIA":return"GAIA";case"DASH":return"DASH";case"DGB":return"DGB";case"DOGE":return"DOGE";case"EOS":return"EOS";case"ETH":return"ETH";case"KUJI":return"KUJI";case"LTC":return"LTC";case"MAYA":return"MAYA";case"OP":return"OP";case"OSMO":return"OSMO";case"MATIC":return"MATIC";case"XRP":return"XRP";case"THOR":return"THOR";case"ZEC":return"ZEC";default:return}}const B={ARB:"eip155:42161",AVAX:"eip155:43114",BSC:"eip155:56",BNB:"binance:bnb-beacon-chain",BCH:"bip122:000000000000000000651ef99cb9fcbe",BTC:"bip122:000000000019d6689c085ae165831e93",BASE:"eip155:8453",GAIA:"cosmos:cosmoshub-4",DASH:"bip122:000007d91d1254d60e2dd1ae58038307",DGB:"bip122:digibytes-hash",DOGE:"bip122:00000000001a91e3dace36e2be3bf030",KUJI:"cosmos:kaiyo-1",EOS:"eos:cf057bbfb72640471fd910bcb67639c2",ETH:"eip155:1",LTC:"bip122:12a765e31ffd4059bada1e25190f6e98",MAYA:"cosmos:maya-mainnet-v1",OP:"eip155:10",OSMO:"cosmos:osmosis-1",MATIC:"eip155:137",XRP:"ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",THOR:"cosmos:thorchain-mainnet-v1",ZEC:"bip122:0000000000196a45"},P={};for(const e in t){const a=B[t[e]];P[a]=t[e]}var g=(e=>(e.ARB="0x0000000000000000000000000000000000000000",e.AVAX="0x0000000000000000000000000000000000000000",e.ETH="0x0000000000000000000000000000000000000000",e.BSC="0x0000000000000000000000000000000000000000",e.MATIC="0x0000000000000000000000000000000000001010",e.OP="0x4200000000000000000000000000000000000042",e))(g||{}),b=(e=>(e.ARB="m/44'/60'/0'/0/0",e.AVAX="m/44'/60'/0'/0/0",e.BASE="m/44'/60'/0'/0/0",e.BCH="m/44'/145'/0'/0/0",e.BNB="m/44'/714'/0'/0/0",e.BSC="m/44'/60'/0'/0/0",e.BTC="m/84'/0'/0'/0/0",e.DOGE="m/44'/3'/0'/0/0",e.DASH="m/44'/5'/0'/0/0",e.DGB="m/44'/20'/0'/0/0",e.ETH="m/44'/60'/0'/0/0",e.EOS="m/44'/194'/0'/0/0",e.GAIA="m/44'/118'/0'/0/0",e.KUJI="m/44'/118'/0'/0/0",e.LTC="m/84'/2'/0'/0/0",e.MATIC="m/44'/60'/0'/0/0",e.MAYA="m/44'/931'/0'/0/0",e.OP="m/44'/60'/0'/0/0",e.OSMO="m/44'/118'/0'/0/0",e.XRP="m/44'/144'/0'/0/0",e.THOR="m/44'/931'/0'/0/0",e.ZEC="m/44'/133'/0'/0/0",e))(b||{});const z={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BNB:[44,714,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DGB:[44,20,0,0,0],DOGE:[44,3,0,0,0],EOS:[44,194,0,0,0],ETH:[44,60,0,0,0],GAIA:[44,118,0,0,0],KUJI:[44,118,0,0,0],LTC:[84,2,0,0,0],MATIC:[44,60,0,0,0],MAYA:[44,931,0,0,0],OP:[44,60,0,0,0],OSMO:[44,118,0,0,0],XRP:[44,144,0,0,0],THOR:[44,931,0,0,0],ZEC:[44,133,0,0,0]};var V=(e=>(e[e.ARB=18]="ARB",e[e.AVAX=18]="AVAX",e[e.BCH=8]="BCH",e[e.BNB=8]="BNB",e[e.BSC=18]="BSC",e[e.BTC=8]="BTC",e[e.DASH=8]="DASH",e[e.DGB=8]="DGB",e[e.DOGE=8]="DOGE",e[e.ETH=18]="ETH",e[e.EOS=6]="EOS",e[e.GAIA=6]="GAIA",e[e.KUJI=6]="KUJI",e[e.LTC=8]="LTC",e[e.MATIC=18]="MATIC",e[e.MAYA=10]="MAYA",e[e.OP=18]="OP",e[e.OSMO=6]="OSMO",e[e.XRP=6]="XRP",e[e.THOR=8]="THOR",e[e.ZEC=8]="ZEC",e))(V||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],Q=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],ee=["GAIA","THOR","BNB","OSMO"],te=["AVAX","BNB","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"];var d=(e=>(e.Arbitrum="42161",e.ArbitrumHex="0xa4b1",e.Avalanche="43114",e.AvalancheHex="0xa86a",e.Base="8453",e.Binance="Binance-Chain-Tigris",e.BinanceSmartChain="56",e.BinanceSmartChainHex="0x38",e.Bitcoin="bitcoin",e.BitcoinCash="bitcoincash",e.Cosmos="cosmoshub-4",e.Dash="dash",e.Dogecoin="dogecoin",e.Kujira="kaiyo-1",e.Ethereum="1",e.EthereumHex="0x1",e.Litecoin="litecoin",e.Maya="mayachain-mainnet-v1",e.MayaStagenet="mayachain-stagenet-v1",e.Optimism="10",e.OptimismHex="0xa",e.Osmosis="osmosis-1",e.Polygon="137",e.PolygonHex="0x89",e.THORChain="thorchain-mainnet-v1",e.THORChainStagenet="thorchain-stagenet-v2",e))(d||{}),S=(e=>(e.Arbitrum="https://arb1.arbitrum.io/rpc",e.Avalanche="https://
|
2
|
+
`,this.stack||""),this.options.shouldThrow)throw Error(s,{cause:this.stack});return this.toErrorInfo()}}var t=(e=>(e.Arbitrum="ARB",e.Avalanche="AVAX",e.Base="BASE",e.Binance="BNB",e.BinanceSmartChain="BSC",e.Bitcoin="BTC",e.BitcoinCash="BCH",e.Cosmos="GAIA",e.Dash="DASH",e.Digibyte="DGB",e.Dogecoin="DOGE",e.EOS="EOS",e.Ethereum="ETH",e.Kujira="KUJI",e.Litecoin="LTC",e.Maya="MAYA",e.Optimism="OP",e.Osmosis="OSMO",e.Polygon="MATIC",e.Ripple="XRP",e.THORChain="THOR",e.Zcash="ZEC",e))(t||{});function q(e){switch(e){case"ARB":return"ARB";case"AVAX":return"AVAX";case"BASE":return"BASE";case"BNB":return"BNB";case"BSC":return"BSC";case"BTC":return"BTC";case"BCH":return"BCH";case"GAIA":return"GAIA";case"DASH":return"DASH";case"DGB":return"DGB";case"DOGE":return"DOGE";case"EOS":return"EOS";case"ETH":return"ETH";case"KUJI":return"KUJI";case"LTC":return"LTC";case"MAYA":return"MAYA";case"OP":return"OP";case"OSMO":return"OSMO";case"MATIC":return"MATIC";case"XRP":return"XRP";case"THOR":return"THOR";case"ZEC":return"ZEC";default:return}}const B={ARB:"eip155:42161",AVAX:"eip155:43114",BSC:"eip155:56",BNB:"binance:bnb-beacon-chain",BCH:"bip122:000000000000000000651ef99cb9fcbe",BTC:"bip122:000000000019d6689c085ae165831e93",BASE:"eip155:8453",GAIA:"cosmos:cosmoshub-4",DASH:"bip122:000007d91d1254d60e2dd1ae58038307",DGB:"bip122:digibytes-hash",DOGE:"bip122:00000000001a91e3dace36e2be3bf030",KUJI:"cosmos:kaiyo-1",EOS:"eos:cf057bbfb72640471fd910bcb67639c2",ETH:"eip155:1",LTC:"bip122:12a765e31ffd4059bada1e25190f6e98",MAYA:"cosmos:maya-mainnet-v1",OP:"eip155:10",OSMO:"cosmos:osmosis-1",MATIC:"eip155:137",XRP:"ripple:4109C6F2045FC7EFF4CDE8F9905D19C2",THOR:"cosmos:thorchain-mainnet-v1",ZEC:"bip122:0000000000196a45"},P={};for(const e in t){const a=B[t[e]];P[a]=t[e]}var g=(e=>(e.ARB="0x0000000000000000000000000000000000000000",e.AVAX="0x0000000000000000000000000000000000000000",e.ETH="0x0000000000000000000000000000000000000000",e.BSC="0x0000000000000000000000000000000000000000",e.MATIC="0x0000000000000000000000000000000000001010",e.OP="0x4200000000000000000000000000000000000042",e))(g||{}),b=(e=>(e.ARB="m/44'/60'/0'/0/0",e.AVAX="m/44'/60'/0'/0/0",e.BASE="m/44'/60'/0'/0/0",e.BCH="m/44'/145'/0'/0/0",e.BNB="m/44'/714'/0'/0/0",e.BSC="m/44'/60'/0'/0/0",e.BTC="m/84'/0'/0'/0/0",e.DOGE="m/44'/3'/0'/0/0",e.DASH="m/44'/5'/0'/0/0",e.DGB="m/44'/20'/0'/0/0",e.ETH="m/44'/60'/0'/0/0",e.EOS="m/44'/194'/0'/0/0",e.GAIA="m/44'/118'/0'/0/0",e.KUJI="m/44'/118'/0'/0/0",e.LTC="m/84'/2'/0'/0/0",e.MATIC="m/44'/60'/0'/0/0",e.MAYA="m/44'/931'/0'/0/0",e.OP="m/44'/60'/0'/0/0",e.OSMO="m/44'/118'/0'/0/0",e.XRP="m/44'/144'/0'/0/0",e.THOR="m/44'/931'/0'/0/0",e.ZEC="m/44'/133'/0'/0/0",e))(b||{});const z={ARB:[44,60,0,0,0],AVAX:[44,60,0,0,0],BASE:[44,60,0,0,0],BCH:[44,145,0,0,0],BNB:[44,714,0,0,0],BSC:[44,60,0,0,0],BTC:[84,0,0,0,0],DASH:[44,5,0,0,0],DGB:[44,20,0,0,0],DOGE:[44,3,0,0,0],EOS:[44,194,0,0,0],ETH:[44,60,0,0,0],GAIA:[44,118,0,0,0],KUJI:[44,118,0,0,0],LTC:[84,2,0,0,0],MATIC:[44,60,0,0,0],MAYA:[44,931,0,0,0],OP:[44,60,0,0,0],OSMO:[44,118,0,0,0],XRP:[44,144,0,0,0],THOR:[44,931,0,0,0],ZEC:[44,133,0,0,0]};var V=(e=>(e[e.ARB=18]="ARB",e[e.AVAX=18]="AVAX",e[e.BCH=8]="BCH",e[e.BNB=8]="BNB",e[e.BSC=18]="BSC",e[e.BTC=8]="BTC",e[e.DASH=8]="DASH",e[e.DGB=8]="DGB",e[e.DOGE=8]="DOGE",e[e.ETH=18]="ETH",e[e.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))(V||{});const p=["ETH","AVAX","BSC","ARB","OP","MATIC"],Q=["BTC","BCH","DASH","DGB","DOGE","LTC","ZEC"],ee=["GAIA","THOR","BNB","OSMO"],te=["AVAX","BNB","BSC","BTC","BCH","GAIA","DOGE","ETH","LTC","THOR"];var d=(e=>(e.Arbitrum="42161",e.ArbitrumHex="0xa4b1",e.Avalanche="43114",e.AvalancheHex="0xa86a",e.Base="8453",e.Binance="Binance-Chain-Tigris",e.BinanceSmartChain="56",e.BinanceSmartChainHex="0x38",e.Bitcoin="bitcoin",e.BitcoinCash="bitcoincash",e.Cosmos="cosmoshub-4",e.Dash="dash",e.Dogecoin="dogecoin",e.Kujira="kaiyo-1",e.Ethereum="1",e.EthereumHex="0x1",e.Litecoin="litecoin",e.Maya="mayachain-mainnet-v1",e.MayaStagenet="mayachain-stagenet-v1",e.Optimism="10",e.OptimismHex="0xa",e.Osmosis="osmosis-1",e.Polygon="137",e.PolygonHex="0x89",e.THORChain="thorchain-mainnet-v1",e.THORChainStagenet="thorchain-stagenet-v2",e))(d||{}),S=(e=>(e.Arbitrum="https://arb1.arbitrum.io/rpc",e.Avalanche="https://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.Maya="https://tendermint.mayachain.info",e.MayaStagenet="https://stagenet.tendermint.mayachain.info",e.Optimism="https://mainnet.optimism.io",e.Osmosis="https://lcd-osmosis.keplr.app",e.Polygon="https://polygon-rpc.com",e.Ripple="https://xrplcluster.com",e.THORChain="https://rpc.thorswap.net",e.THORChainStagenet="https://stagenet-rpc.ninerealms.com",e))(S||{}),R=(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))(R||{});const o=Object.values(t),ne=Object.keys(t),E=o.reduce((e,a)=>{const s=ne.find(r=>t[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 m=[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Osmosis,t.Ripple,t.Dogecoin,t.Dash,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],de={BRAVE:p,COINBASE_WEB:p,KEPLR:[t.Cosmos],KEYSTORE:[t.Arbitrum,t.Avalanche,t.Binance,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],LEDGER:m,TREZOR:[t.Bitcoin,t.BitcoinCash,t.Litecoin,t.Dogecoin,t.Ethereum],KEEPKEY:m,METAMASK:[t.Arbitrum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.BitcoinCash,t.Cosmos,t.Dogecoin,t.Ethereum,t.Litecoin,t.Optimism,t.Polygon,t.THORChain],TRUSTWALLET_WEB:p,XDEFI:m,WALLETCONNECT:[t.Ethereum,t.Binance,t.BinanceSmartChain,t.Avalanche,t.THORChain],OKX:[t.Ethereum,t.Avalanche,t.BinanceSmartChain,t.Bitcoin,t.Cosmos]};exports.AGG_SWAP=O;exports.ApiError=A;exports.ApiUrl=R;exports.BaseDecimal=V;exports.CENTRALIZED_SWAPPER=N;exports.Chain=t;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=n;exports.ERROR_MODULE=f;exports.ERROR_TYPE=l;exports.EVMChainList=p;exports.ErrorCode=H;exports.FeeOption=L;exports.MemoType=D;exports.NetworkDerivationPath=z;exports.NetworkIdToChain=P;exports.OSMOSIS_SWAP=c;exports.QuoteMode=_;exports.RPCUrl=S;exports.SWAP_IN=C;exports.SWAP_OUT=h;exports.TCAvalancheDepositABI=k;exports.TCBscDepositABI=Z;exports.TCEthereumVaultAbi=Y;exports.TCSupportedChainList=te;exports.UTXOChainList=Q;exports.UXTO_SWAP=J;exports.WalletOption=x;exports.availableChainsByWallet=de;exports.classifySwap=j;exports.erc20ABI=K;exports.getChainEnumValue=q;
|
package/dist/index.d.ts
CHANGED
@@ -74,6 +74,7 @@ export declare enum BaseDecimal {
|
|
74
74
|
DGB = 8,
|
75
75
|
DOGE = 8,
|
76
76
|
ETH = 18,
|
77
|
+
BASE = 18,
|
77
78
|
EOS = 6,
|
78
79
|
GAIA = 6,
|
79
80
|
KUJI = 6,
|
@@ -572,10 +573,10 @@ export declare enum QuoteMode {
|
|
572
573
|
|
573
574
|
export declare enum RPCUrl {
|
574
575
|
Arbitrum = "https://arb1.arbitrum.io/rpc",
|
575
|
-
Avalanche = "https://
|
576
|
+
Avalanche = "https://daemon.avalanche.shapeshift.com/ext/bc/C/rpc",
|
576
577
|
Binance = "https://base.llamarpc.com",
|
577
|
-
BinanceSmartChain = "https://
|
578
|
-
Base = "https://base.
|
578
|
+
BinanceSmartChain = "https://daemon.bnbsmartchain.shapeshift.com",
|
579
|
+
Base = "https://developer-access-mainnet.base.org",
|
579
580
|
Bitcoin = "https://node-router.thorswap.net/bitcoin",
|
580
581
|
BitcoinCash = "https://node-router.thorswap.net/bitcoin-cash",
|
581
582
|
Cosmos = "https://node-router.thorswap.net/cosmos/rpc",
|
package/dist/index.es.js
CHANGED
@@ -627,8 +627,8 @@ const g = [
|
|
627
627
|
function z(e) {
|
628
628
|
return V.includes(e) ? "AGG_SWAP" : H.includes(e) ? "SWAP_IN" : R.includes(e) ? "SWAP_OUT" : g.includes(e) ? "OSMOSIS_SWAP" : b.includes(e) ? "CENTRALIZED_SWAPPER" : null;
|
629
629
|
}
|
630
|
-
var S = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(S || {}),
|
631
|
-
const
|
630
|
+
var S = /* @__PURE__ */ ((e) => (e.VALIDATION_ERROR = "VALIDATION_ERROR", e.REQUEST_PARAMETER_ERROR = "REQUEST_PARAMETER_ERROR", e.RESPONSE_PARSING_ERROR = "RESPONSE_PARSING_ERROR", e.UNSUPPORTED = "UNSUPPORTED", e.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", e.INCOMPATIBLE_ASSETS_OPERATIONS = "INCOMPATIBLE_ASSETS_OPERATIONS", e.SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE", e.DOWN_FOR_MAINTENANCE = "DOWN_FOR_MAINTENANCE", e.MISSING_INBOUND_INFO = "MISSING_INBOUND_INFO", e.QUOTE_FETCHING_ERROR = "QUOTE_FETCHING_ERROR", e.AIRDROP_ERROR = "AIRDROP_ERROR", e.UNHANDLED_ERROR = "UNHANDLED_ERROR", e))(S || {}), L = /* @__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))(L || {}), n = /* @__PURE__ */ ((e) => (e.INVALID_INPUT_PARAMETERS = "1000", e.UNKNOWN_PROVIDERS = "1001", e.CANNOT_FIND_INBOUND_ADDRESS = "1002", e.NO_INBOUND_ADDRESSES = "1003", e.CHAIN_HALTED_OR_UNSUPPORTED = "1004", e.MISSING_INPUT_PARAMETER = "1005", e.INVALID_TYPE_GENERIC = "1100", e.INVALID_NUMBER_STRING = "1101", e.INVALID_NUMBER = "1102", e.INVALID_BOOLEAN = "1103", e.INVALID_OBJECT = "1104", e.INVALID_ARRAY = "1105", e.SELL_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2000", e.SELL_BUY_ASSETS_ARE_THE_SAME = "2001", e.MISSING_SOURCE_ADDRESS_FOR_SYNTH = "2002", e.AFF_ADDRESS_AND_BPS_OR_NEITHER = "2003", e.AFF_ADDRESS_TOO_LONG = "2004", e.AFF_BPS_INTEGER_0_100 = "2005", e.SOURCE_ADDRESS_INVALID_FOR_SELL_CHAIN = "2006", e.DESTINATION_ADDRESS_INVALID_FOR_BUY_CHAIN = "2007", e.PREFERRED_PROFVIDER_NOT_SUPPORTED = "2008", e.DESTINATION_ADDRESS_SMART_CONTRACT = "2009", e.BUY_AMOUNT_MUST_BE_POSITIVE_INTEGER = "2010", e.SOURCE_ADDRESS_SMART_CONTRACT = "2011", e.INVALID_PROVIDER = "2100", e.MISSING_CROSS_CHAIN_PROVIDER = "2101", e.MISSING_AVAX_PROVIDER = "2102", e.MISSING_BSC_PROVIDER = "2103", e.MISSING_ETH_PROVIDER = "2104", e.INVALID_PROVIDER_FOR_SWAP_OUT = "2105", e.MISSING_ARB_PROVIDER = "2106", e.INVALID_CHAIN = "2200", e.INVALID_ASSET = "2201", e.INVALID_ASSET_IDENTIFIER = "2202", e.UNSUPPORTED_CHAIN = "2204", e.UNSUPPORTED_ASSET = "2203", e.UNSUPPORTED_ASSET_FOR_SWAPOUT = "2205", e.INVALID_SOURCE_ADDRESS = "2300", e.INVALID_DESTINATION_ADDRESS = "2301", e.THORNODE_QUOTE_GENERIC_ERROR = "3000", e.NOT_ENOUGH_SYNTH_BALANCE = "3001", e.SYNTH_MINTING_CAP_REACHED = "3002", e.INVALID_QUOTE_MODE = "4000", e.NO_QUOTES = "4001", e.SERVICE_UNAVAILABLE_GENERIC = "5000", e.MISSING_GAS_DATA_GENERIC = "5100", e.MISSING_TOKEN_INFO_GENERIC = "5200", e.CANT_FIND_TOKEN_LIST = "5201", e.NO_PRICE = "5202", e.PRICE_IS_STALE = "5203", e.ADDRESS_NOT_WHITELISTED = "6000", e.ADDRESS_ALREADY_CLAIMED = "6001", e.TEMPORARY_ERROR = "9999", e))(n || {});
|
631
|
+
const D = {
|
632
632
|
[n.INVALID_INPUT_PARAMETERS]: "Invalid input parameters: {0}.",
|
633
633
|
[n.UNKNOWN_PROVIDERS]: "Unknown providers: {0}.",
|
634
634
|
[n.CANNOT_FIND_INBOUND_ADDRESS]: "Cannot find inbound address.",
|
@@ -680,7 +680,7 @@ const L = {
|
|
680
680
|
[n.ADDRESS_NOT_WHITELISTED]: "Address {0} not whitelisted for airdrop.",
|
681
681
|
[n.ADDRESS_ALREADY_CLAIMED]: "Address {0} already claimed the airdrop."
|
682
682
|
}, u = (e, a) => {
|
683
|
-
let s =
|
683
|
+
let s = D[e];
|
684
684
|
for (let i = 0; i < a.length; i++)
|
685
685
|
s = s.replace(`{${i}}`, a[i]);
|
686
686
|
return a.length === 0 ? s.replace("{0}", "") : s;
|
@@ -693,15 +693,15 @@ class E extends Error {
|
|
693
693
|
code: d,
|
694
694
|
message: c,
|
695
695
|
type: N,
|
696
|
-
options: { shouldLog: O, shouldThrow:
|
696
|
+
options: { shouldLog: O, shouldThrow: f, shouldTrace: C } = {
|
697
697
|
shouldLog: !0,
|
698
698
|
shouldThrow: !0,
|
699
699
|
shouldTrace: !0
|
700
700
|
},
|
701
701
|
displayMessageParams: o
|
702
702
|
}) {
|
703
|
-
const
|
704
|
-
super(
|
703
|
+
const l = c || u(d, o || []) || "";
|
704
|
+
super(l);
|
705
705
|
r(this, "status");
|
706
706
|
r(this, "revision");
|
707
707
|
r(this, "type");
|
@@ -712,10 +712,10 @@ class E extends Error {
|
|
712
712
|
r(this, "stack");
|
713
713
|
r(this, "options");
|
714
714
|
r(this, "displayMessageParams");
|
715
|
-
this.status = s, this.revision = i || "NO_REVISION", this.module = _, this.message =
|
715
|
+
this.status = s, this.revision = i || "NO_REVISION", this.module = _, this.message = l, this.display = u(d, o || []), this.code = d, this.type = N || S.UNHANDLED_ERROR, this.options = {
|
716
716
|
shouldLog: O || !0,
|
717
|
-
shouldTrace:
|
718
|
-
shouldThrow:
|
717
|
+
shouldTrace: C || !0,
|
718
|
+
shouldThrow: f || !1
|
719
719
|
}, this.displayMessageParams = o || [], this.options.shouldTrace && Error.captureStackTrace(this);
|
720
720
|
}
|
721
721
|
static fromErrorInfo(s) {
|
@@ -842,7 +842,7 @@ const ee = {
|
|
842
842
|
THOR: [44, 931, 0, 0, 0],
|
843
843
|
ZEC: [44, 133, 0, 0, 0]
|
844
844
|
};
|
845
|
-
var U = /* @__PURE__ */ ((e) => (e[e.ARB = 18] = "ARB", e[e.AVAX = 18] = "AVAX", e[e.BCH = 8] = "BCH", e[e.BNB = 8] = "BNB", e[e.BSC = 18] = "BSC", e[e.BTC = 8] = "BTC", e[e.DASH = 8] = "DASH", e[e.DGB = 8] = "DGB", e[e.DOGE = 8] = "DOGE", e[e.ETH = 18] = "ETH", e[e.EOS = 6] = "EOS", e[e.GAIA = 6] = "GAIA", e[e.KUJI = 6] = "KUJI", e[e.LTC = 8] = "LTC", e[e.MATIC = 18] = "MATIC", e[e.MAYA = 10] = "MAYA", e[e.OP = 18] = "OP", e[e.OSMO = 6] = "OSMO", e[e.XRP = 6] = "XRP", e[e.THOR = 8] = "THOR", e[e.ZEC = 8] = "ZEC", e))(U || {});
|
845
|
+
var U = /* @__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))(U || {});
|
846
846
|
const y = [
|
847
847
|
"ETH",
|
848
848
|
"AVAX",
|
@@ -880,22 +880,22 @@ const y = [
|
|
880
880
|
"THOR"
|
881
881
|
/* THORChain */
|
882
882
|
];
|
883
|
-
var m = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Base = "8453", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dash = "dash", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Osmosis = "osmosis-1", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(m || {}), I = /* @__PURE__ */ ((e) => (e.Arbitrum = "https://arb1.arbitrum.io/rpc", e.Avalanche = "https://
|
884
|
-
const p = Object.values(t), F = Object.keys(t),
|
883
|
+
var m = /* @__PURE__ */ ((e) => (e.Arbitrum = "42161", e.ArbitrumHex = "0xa4b1", e.Avalanche = "43114", e.AvalancheHex = "0xa86a", e.Base = "8453", e.Binance = "Binance-Chain-Tigris", e.BinanceSmartChain = "56", e.BinanceSmartChainHex = "0x38", e.Bitcoin = "bitcoin", e.BitcoinCash = "bitcoincash", e.Cosmos = "cosmoshub-4", e.Dash = "dash", e.Dogecoin = "dogecoin", e.Kujira = "kaiyo-1", e.Ethereum = "1", e.EthereumHex = "0x1", e.Litecoin = "litecoin", e.Maya = "mayachain-mainnet-v1", e.MayaStagenet = "mayachain-stagenet-v1", e.Optimism = "10", e.OptimismHex = "0xa", e.Osmosis = "osmosis-1", e.Polygon = "137", e.PolygonHex = "0x89", e.THORChain = "thorchain-mainnet-v1", e.THORChainStagenet = "thorchain-stagenet-v2", e))(m || {}), I = /* @__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.Maya = "https://tendermint.mayachain.info", e.MayaStagenet = "https://stagenet.tendermint.mayachain.info", e.Optimism = "https://mainnet.optimism.io", e.Osmosis = "https://lcd-osmosis.keplr.app", e.Polygon = "https://polygon-rpc.com", e.Ripple = "https://xrplcluster.com", e.THORChain = "https://rpc.thorswap.net", e.THORChainStagenet = "https://stagenet-rpc.ninerealms.com", e))(I || {}), w = /* @__PURE__ */ ((e) => (e.Cosmos = "https://node-router.thorswap.net/cosmos/rest", e.Kujira = "https://lcd-kujira.synergynodes.com/", e.MayanodeMainnet = "https://mayanode.mayachain.info", e.MayanodeStagenet = "https://stagenet.mayanode.mayachain.info", e.ThornodeMainnet = "https://thornode.thorswap.net", e.ThornodeStagenet = "https://stagenet-thornode.ninerealms.com", e.ThorswapApi = "https://api.thorswap.net", e.ThorswapStatic = "https://static.thorswap.net", e))(w || {});
|
884
|
+
const p = Object.values(t), F = Object.keys(t), A = p.reduce(
|
885
885
|
(e, a) => {
|
886
886
|
const s = F.find((i) => t[i] === a);
|
887
887
|
return s && (e[a] = s), e;
|
888
888
|
},
|
889
889
|
{}
|
890
890
|
), se = p.reduce(
|
891
|
-
(e, a) => (e[a] = m[
|
891
|
+
(e, a) => (e[a] = m[A[a]], e),
|
892
892
|
{}
|
893
893
|
), re = p.reduce(
|
894
|
-
(e, a) => (e[a] = I[
|
894
|
+
(e, a) => (e[a] = I[A[a]], e),
|
895
895
|
{}
|
896
896
|
), ie = p.reduce(
|
897
897
|
(e, a) => {
|
898
|
-
const s = `${
|
898
|
+
const s = `${A[a]}Hex`;
|
899
899
|
return e[a] = m[s], e;
|
900
900
|
},
|
901
901
|
{}
|
@@ -1046,7 +1046,7 @@ export {
|
|
1046
1046
|
ne as CosmosChainList,
|
1047
1047
|
G as DerivationPath,
|
1048
1048
|
n as ERROR_CODE,
|
1049
|
-
|
1049
|
+
L as ERROR_MODULE,
|
1050
1050
|
S as ERROR_TYPE,
|
1051
1051
|
y as EVMChainList,
|
1052
1052
|
X as ErrorCode,
|
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.
|
8
|
+
"@internal/config": "2.4.0"
|
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.
|
36
|
+
"version": "4.4.0",
|
37
37
|
"scripts": {
|
38
38
|
"build": "vite build",
|
39
39
|
"build:watch": "nodemon --watch src --exec 'pnpm run build'",
|
package/src/commonTypes.ts
CHANGED
@@ -132,7 +132,7 @@ export type Asset = {
|
|
132
132
|
|
133
133
|
export const OSMOSIS_SWAP = [QuoteMode.GAIA_TO_OSMO];
|
134
134
|
|
135
|
-
export const CENTRALIZED_SWAPPER = [QuoteMode.CHANGELLY]
|
135
|
+
export const CENTRALIZED_SWAPPER = [QuoteMode.CHANGELLY];
|
136
136
|
|
137
137
|
export const AGG_SWAP = [QuoteMode.ETH_TO_ETH, QuoteMode.AVAX_TO_AVAX, QuoteMode.BSC_TO_BSC];
|
138
138
|
|
@@ -155,11 +155,9 @@ export const SWAP_OUT = [
|
|
155
155
|
QuoteMode.TC_SUPPORTED_TO_BSC,
|
156
156
|
];
|
157
157
|
|
158
|
-
export const UXTO_SWAP = [
|
159
|
-
QuoteMode.MAYA_SUPPORTED_TO_MAYA_SUPPORTED,
|
160
|
-
];
|
158
|
+
export const UXTO_SWAP = [QuoteMode.MAYA_SUPPORTED_TO_MAYA_SUPPORTED];
|
161
159
|
|
162
|
-
export function classifySwap(quoteMode:QuoteMode) {
|
160
|
+
export function classifySwap(quoteMode: QuoteMode) {
|
163
161
|
if (AGG_SWAP.includes(quoteMode)) {
|
164
162
|
return 'AGG_SWAP';
|
165
163
|
}
|
package/src/network.ts
CHANGED
@@ -181,6 +181,7 @@ export enum BaseDecimal {
|
|
181
181
|
DGB = 8,
|
182
182
|
DOGE = 8,
|
183
183
|
ETH = 18,
|
184
|
+
BASE = 18,
|
184
185
|
EOS = 6,
|
185
186
|
GAIA = 6,
|
186
187
|
KUJI = 6,
|
@@ -285,10 +286,12 @@ export enum ChainId {
|
|
285
286
|
//TODO move these to pioneer proxy
|
286
287
|
export enum RPCUrl {
|
287
288
|
Arbitrum = 'https://arb1.arbitrum.io/rpc',
|
288
|
-
Avalanche = 'https://node-router.thorswap.net/avalanche-c',
|
289
|
+
// Avalanche = 'https://node-router.thorswap.net/avalanche-c',
|
290
|
+
Avalanche = 'https://daemon.avalanche.shapeshift.com/ext/bc/C/rpc',
|
289
291
|
Binance = 'https://base.llamarpc.com',
|
290
|
-
BinanceSmartChain = 'https://bsc-dataseed.binance.org',
|
291
|
-
|
292
|
+
// BinanceSmartChain = 'https://bsc-dataseed.binance.org',
|
293
|
+
BinanceSmartChain = 'https://daemon.bnbsmartchain.shapeshift.com',
|
294
|
+
Base = 'https://developer-access-mainnet.base.org',
|
292
295
|
Bitcoin = 'https://node-router.thorswap.net/bitcoin',
|
293
296
|
BitcoinCash = 'https://node-router.thorswap.net/bitcoin-cash',
|
294
297
|
Cosmos = 'https://node-router.thorswap.net/cosmos/rpc',
|