@dodoex/widgets 2.2.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/e2e/constants.d.ts +8 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locales/en-US.js +1 -1
- package/dist/cjs/src/components/Swap/components/Dialog.d.ts +3 -1
- package/dist/cjs/src/components/Widget/index.d.ts +3 -3
- package/dist/cjs/src/constants/api.d.ts +2 -0
- package/dist/cjs/src/hooks/Token/index.d.ts +1 -1
- package/dist/cjs/src/hooks/Token/type.d.ts +8 -0
- package/dist/cjs/src/hooks/Token/useGetCGTokenList.d.ts +13 -0
- package/dist/cjs/src/hooks/Token/useGetTokenStatus.d.ts +1 -1
- package/dist/cjs/src/hooks/Token/useInitTokenList.d.ts +2 -2
- package/dist/cjs/src/hooks/contract/useFetchBlockNumber.d.ts +3 -1
- package/dist/cjs/src/store/reducers/token.d.ts +1 -4
- package/dist/cjs/src/utils/address.d.ts +1 -0
- package/dist/e2e/constants.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/src/components/Swap/components/Dialog.d.ts +3 -1
- package/dist/src/components/Widget/index.d.ts +3 -3
- package/dist/src/constants/api.d.ts +2 -0
- package/dist/src/hooks/Token/index.d.ts +1 -1
- package/dist/src/hooks/Token/type.d.ts +8 -0
- package/dist/src/hooks/Token/useGetCGTokenList.d.ts +13 -0
- package/dist/src/hooks/Token/useGetTokenStatus.d.ts +1 -1
- package/dist/src/hooks/Token/useInitTokenList.d.ts +2 -2
- package/dist/src/hooks/contract/useFetchBlockNumber.d.ts +3 -1
- package/dist/src/store/reducers/token.d.ts +1 -4
- package/dist/src/utils/address.d.ts +1 -0
- package/package.json +9 -10
- package/dist/cjs/tokenList-ee5e15c8.cjs +0 -1
- package/dist/tokenList-4ef211de.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Trans as e,I18nProvider as t}from"@lingui/react";import n,{BigNumber as o}from"bignumber.js";import{chunk as i,unionBy as r,debounce as a}from"lodash";import{Box as s,useTheme as l,BaseButton as c,Input as d,SearchInput as u,Button as p,HoverOpacity as m,createTheme as h,ThemeProvider as f,CssBaseline as g,QuestionTooltip as b,RotatingIcon as y}from"@dodoex/components";import{getAddress as v}from"@ethersproject/address";import*as x from"react";import{useState as E,useMemo as w,useCallback as C,useEffect as A,useRef as O,useContext as T,createContext as k}from"react";import{useDispatch as I,useSelector as R,Provider as S}from"react-redux";import{CaretUp as L,Error as D,ErrorWarn as N,DoneBorder as _,ArrowTopRightBorder as B,ArrowBack as P,DoubleRight as F,DetailBorder as j,Done as M,Warn as U,Switch as H,Setting as W,Dodo as $}from"@dodoex/icons";import V from"identicon.js";import{useWeb3React as z,initializeConnector as K,Web3ReactProvider as G}from"@web3-react/core";import{configureStore as Y}from"@reduxjs/toolkit";import{combineReducers as q}from"redux";import{Contract as X}from"@ethersproject/contracts";import{AddressZero as Z}from"@ethersproject/constants";import{defaultAbiCoder as Q,Interface as J}from"@ethersproject/abi";import{EIP1193 as ee}from"@web3-react/eip1193";import{WalletConnect as te}from"@web3-react/walletconnect";import{MetaMask as ne}from"@web3-react/metamask";import{JsonRpcProvider as oe}from"@ethersproject/providers";import{Connector as ie}from"@web3-react/types";import{jsxs as re,jsx as ae,Fragment as se}from"react/jsx-runtime";import{i18n as le}from"@lingui/core";import{VariableSizeList as ce}from"react-window";import{en as de,zh as ue}from"make-plural/plurals";import pe from"axios";import{BigNumber as me,parseFixed as he}from"@ethersproject/bignumber";import{createRoot as fe}from"react-dom/client";function ge({input:e,showDecimals:t=4,showPrecisionDecimals:n=2,showIntegerOnly:i=!1,showDecimalsOnly:r=!1,noGroupSeparator:a=!1}){const s=new o(e);if(s.isNaN())return"-";let l=s.dp(t,o.ROUND_DOWN);return l.eq(0)&&(s.gt(0)||s.lt(0))&&(l=s.sd(null!=n?n:t,o.ROUND_DOWN)),i&&(l=l.integerValue(o.ROUND_DOWN)),r&&(l=l.minus(l.integerValue(o.ROUND_DOWN))),a?l.toFormat({decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0}):l.toFormat()}function be({input:e,decimals:t,showPrecisionDecimals:n=2,noGroupSeparator:i}){if(null==e)return"-";const r=new o(e);if(r.isNaN())return"-";return ge({input:r,showDecimals:void 0===t?0:t>6?6:t>4?4:t,showPrecisionDecimals:n,noGroupSeparator:i})}function ye(e){if("number"==typeof e)return ye(new o(e));if(e.isNaN())return"NaN";if(e.isNegative())return`-${ye(e.negated())}`;if(e.isZero())return"0";let t=e.integerValue(o.ROUND_FLOOR),n=e.minus(t),i="";for(;!t.isZero();){i=t.modulo(10).toString().toString()+i,t=t.idiv(10)}if(""===i&&(i="0"),n.isZero())return i;i+=".";let r=0;for(;!n.isZero()&&r<100;){const e=n.times(10),t=e.integerValue(o.ROUND_FLOOR);i+=t.toString(),n=e.minus(t),r+=1}return i}const ve=(e,t)=>{if("string"==typeof e&&!e.match(/[-+]?\d+(.+d+)?/))return e;const n=new o(e);if(t){let e=n.toFixed(t,o.ROUND_DOWN);return new o(e).isZero()&&(e=ye(n.precision(t,o.ROUND_DOWN))),e}return ye(n)},xe=(e,t)=>{let n=e;const o=n.match("[0-9。.]+");n=o&&o.length>0?o[0]:"",n=n.replace("。",".");let i=0;if(n){const e=n.split("."),t=0===e[0].length?["0"]:[e[0]];e.length>1?t[1]=e.slice(1,e.length).join(""):t[0].length>1&&"0"===t[0][0]&&(t[0]=t[0].slice(1,t[0].length)),t.length>1&&(i=t[1].length),n=t.join(".")}return t>=0&&i>t?ve(n,t):n},Ee=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const n=e.substring(2,e.length).toLowerCase(),o=t.substring(2,t.length).toLowerCase();return n.length>o.length?n.endsWith(o):o.endsWith(n)};const we=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var Ce;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(Ce||(Ce={}));const Ae={[Ce.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[Ce.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[Ce.GOERLI]:["https://goerli.optimism.io/"],[Ce.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[Ce.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[Ce.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[Ce.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[Ce.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[Ce.AURORA]:["https://mainnet.aurora.dev/"],[Ce.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[Ce.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[Ce.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[Ce.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[Ce.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[Ce.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},Oe={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},Te={[Ce.MAINNET]:Object.assign(Object.assign({},Oe),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[Ce.RINKEBY]:Object.assign(Object.assign({},Oe),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[Ce.GOERLI]:Object.assign(Object.assign({},Oe),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[Ce.OPTIMISM]:Object.assign(Object.assign({},Oe),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[Ce.CRONOS]:Object.assign(Object.assign({},Oe),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[Ce.BOBA]:Object.assign(Object.assign({},Oe),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[Ce.BSC]:Object.assign(Object.assign({},Oe),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[Ce.OKCHAIN]:Object.assign(Object.assign({},Oe),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[Ce.HECO]:Object.assign(Object.assign({},Oe),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[Ce.POLYGON]:Object.assign(Object.assign({},Oe),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[Ce.MOONRIVER]:Object.assign(Object.assign({},Oe),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[Ce.ARBITRUM_ONE]:Object.assign(Object.assign({},Oe),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[Ce.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},Oe),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[Ce.AURORA]:Object.assign(Object.assign({},Oe),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[Ce.AVALANCHE]:Object.assign(Object.assign({},Oe),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},ke={[Ce.MAINNET]:"ethereum",[Ce.RINKEBY]:"rinkeby",[Ce.GOERLI]:"goerli",[Ce.OPTIMISM]:"optimism",[Ce.CRONOS]:"cronos",[Ce.BOBA]:"boba",[Ce.BSC]:"bsc",[Ce.OKCHAIN]:"okex-chain",[Ce.HECO]:"heco",[Ce.POLYGON]:"polygon",[Ce.MOONRIVER]:"moonriver",[Ce.ARBITRUM_ONE]:"arbitrum",[Ce.ARBITRUM_RINKEBY]:"arb-rinkeby",[Ce.AURORA]:"aurora",[Ce.AVALANCHE]:"avalanche"},Ie={[Ce.MAINNET]:"etherscan.io",[Ce.RINKEBY]:"rinkeby.etherscan.io",[Ce.GOERLI]:"goerli.etherscan.io",[Ce.OPTIMISM]:"optimistic.etherscan.io",[Ce.CRONOS]:"cronoscan.com",[Ce.BOBA]:"blockexplorer.boba.network",[Ce.BSC]:"bscscan.com",[Ce.OKCHAIN]:"www.oklink.com/okexchain",[Ce.HECO]:"hecoinfo.com",[Ce.POLYGON]:"polygonscan.com",[Ce.MOONRIVER]:"moonriver.moonscan.io",[Ce.ARBITRUM_ONE]:"arbiscan.io",[Ce.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[Ce.AURORA]:"aurorascan.dev",[Ce.AVALANCHE]:"snowtrace.io"};function Re(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function Se(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}const Le={colorMode:"dark",slippage:3..toString(),ddl:20};var De=(e=Le,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const Ne={chainId:Ce.MAINNET,latestBlockNumber:0};var _e=(e=Ne,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const Be={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var Pe,Fe=(e=Be,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const n=e.accountBalances;return Object.keys(n).map((e=>{n[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:n});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(Pe||(Pe={}));const je={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:Pe.Initial};const Me={settings:Le,wallet:Ne,globals:je,token:Be},Ue=Y({reducer:q({settings:De,wallet:_e,token:Fe,globals:(e=je,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e}),middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:Me}),He=e=>(null!=e?e:Ue.getState()).wallet.chainId,We=e=>(null!=e?e:Ue.getState()).wallet.latestBlockNumber,$e=e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),Ve=e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})}));var ze=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],Ke={[Ce.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[Ce.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[Ce.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[Ce.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[Ce.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[Ce.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[Ce.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[Ce.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[Ce.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[Ce.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[Ce.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[Ce.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[Ce.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[Ce.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[Ce.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};function Ge(e,t,...n){return Se(this,void 0,void 0,(function*(){const o=[];for(const e of n)for(const t of e)t.callData&&o.push(t.callData);const i=yield function(e,t,n){return Se(this,void 0,void 0,(function*(){const o=yield Ye(e,t,n),i=new Map;for(const{req:e,resp:t}of o)i.set(e,t);return e.map((e=>({req:e,resp:i.get(e)})))}))}(o,e,t),r=new Map;for(const{req:e,resp:t}of i)r.set(e,null==t?void 0:t.result);return n.map((e=>e.filter((e=>!e.callData||r.get(e.callData))).map(((e,t)=>e.processor(e.callData?r.get(e.callData):null,t)))))}))}function Ye(e,t,n){return Se(this,void 0,void 0,(function*(){let o=[e];e.length>800&&(o=i(e,800));let r=[];const a=o.map((e=>Se(this,void 0,void 0,(function*(){const o=e.map((e=>[e.to,e.data])),i={data:t.interface.encodeFunctionData("aggregate",[o]),to:n};let a;try{a=yield t.provider.call(i)}catch(o){const i=e.length;if(i>20){const o=Math.floor(i/2),[a,s]=yield Promise.all([Ye(e.slice(0,o),t,n),Ye(e.slice(o,i),t,n)]);r=[...r,...a,...s]}else{const e="[sendCallReqs] error";console.error(e,o)}}if(void 0===a)throw new Error("Unexpected batch result");const[s,l]=Q.decode(["uint256","bytes[]"],a);if(e.length!==l.length)throw new Error("Unexpected length mismatch");return l.map(((t,n)=>({resp:{result:t},req:e[n]})))}))));return(yield Promise.allSettled(a)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{r=[...r,...e]})),r}))}function qe(e,t,n,o){if(!function(e){try{return v(e)}catch(e){return!1}}(e)||e===Z)throw Error(`Invalid 'address' parameter '${e}'.`);return new X(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(n,o))}function Xe(){const{provider:e,account:t,chainId:n}=z(),[o,i]=E(!1),r=w((()=>Ke[n]),[n]),a=C(((n,o)=>{if(e)return qe(n,o,e,t)}),[e,t]),s=C((e=>{if(!r)return;const{MULTI_CALL:t}=r,n=a(t,ze);return(()=>Se(this,void 0,void 0,(function*(){if(n){i(!0);try{const[o]=yield Ge(n,t,e);return o}catch(e){console.error("Contract: useMultiContract is error",e)}i(!1)}})))()}),[r,a]);return{getContract:a,contractConfig:r,call:s,loading:o}}var Ze=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function Qe(){const{provider:e,account:t}=z(),o=I(),i=R(We);A((()=>{(()=>{Se(this,void 0,void 0,(function*(){if(!e||!t)return;const i=yield e.getBalance(t);o((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new n(i.toString()).div(1e18)))}))})()}),[e,t,o,i])}function Je(){const{provider:e,chainId:t}=z(),n=I();A((()=>{const o=e=>{n((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(e))};return(()=>{Se(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();o(n),e.on("block",o)}))})(),()=>{null==e||e.off("block",o)}}),[e,n,t])}function et(e){return Number.parseInt(e,16)}class tt extends ie{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:et(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:et(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return Se(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},n]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:n})}catch(e){throw this.actions.resetState(),e}}))}}function nt([e,t]){return[e,t]}var ot;function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},it.apply(this,arguments)}var rt,at;function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},st.apply(this,arguments)}var lt;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(lt||(lt={}));const ct={[lt.METAMASK]:{name:"MetaMask",type:lt.METAMASK,icon:function(e){return x.createElement("svg",it({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),ot||(ot=x.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},x.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),x.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),x.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),x.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),x.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),x.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),x.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),x.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),x.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),x.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),x.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),x.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),x.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),x.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),x.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),x.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),x.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),x.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),x.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},x.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),x.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),x.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),x.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),x.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),x.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),x.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),x.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),x.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),x.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),x.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),x.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[lt.WALLET_CONNECT]:{name:"WalletConnect",type:lt.WALLET_CONNECT,icon:function(e){return x.createElement("svg",st({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),rt||(rt=x.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},x.createElement("stop",{offset:0,stopColor:"#5d9df6"}),x.createElement("stop",{offset:1,stopColor:"#006fff"}))),at||(at=x.createElement("g",{fill:"none",fillRule:"evenodd"},x.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),x.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},dt={};function ut({provider:e,jsonRpcUrlMap:t,defaultChainId:n}){const o=console.error,i=w((()=>function(e,t){if(t){if(oe.isProvider(t))return nt(K((e=>new tt(e,t))));if(oe.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return nt(K((n=>new ee({actions:n,provider:t,onError:e}))))}}(o,e)),[o,e]),r=w((()=>function(e){return nt(K((t=>new ne({actions:t,onError:e}))))}(o)),[o]),a=w((()=>t?Object.assign(Object.assign({},Ae),t):Ae),[t]),s=w((()=>function(e,t,n,o){return nt(K((i=>new te({actions:i,options:{rpc:t,qrcode:e},onError:o,defaultChainId:n}))))}(!0,a,n,o)),[a,n,o]);return i&&(dt[lt.INTEGRATOR]=i),dt[lt.METAMASK]=r,dt[lt.WALLET_CONNECT]=s,Object.values(dt)}function pt(){const{chainId:e}=z(),t=R(He);return w((()=>e||t||1),[e,t])}function mt({tokenList:e,popularTokenList:t}){const o=I(),[i,a]=E([]),{account:s}=z(),l=pt(),c=R(We),d=w((()=>(null==t?void 0:t.filter((e=>e.chainId===l)))||[]),[t,l]);!function({tokenList:e,addresses:t,blockNumber:o}){const{account:i}=z(),r=I(),a=w((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,t]),{getContract:s,contractConfig:l,call:c}=Xe(),[d,u]=E(),p=w((()=>{if(!i||!a.length||!l)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=l,o=s(t,Ze);if(!o)return;let c={};const d=a.map((r=>(c[r]=!0,{callData:{data:o.interface.encodeFunctionData("isERC20",[r,i,e]),to:t},processor:e=>{const t=new J(Ze).decodeFunctionResult("isERC20",e),{balance:o,isOk:i}=t,a=parseInt(t.decimals),s=new n(10).pow(a),l=new n(t.allownance.toString()).div(s);return i?{address:r,decimals:a,symbol:t.symbol,name:t.name,balance:new n(o.toString()).div(s),allowance:l}:{address:r,balance:new n(0),allowance:new n(0)}}})));return r(Ve(c)),d}),[i,s,JSON.stringify(a)]);A((()=>{(()=>{Se(this,void 0,void 0,(function*(){if(!p)return;const e=yield c(p),t={};e&&(e.forEach((e=>{t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance}})),r($e(t))),u(e);let n={};a.forEach((e=>{n[e]=!1})),r(Ve(n))}))})()}),[p,o])}({addresses:w((()=>{const e=i.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[i,t]),blockNumber:c}),A((()=>{(()=>{Se(this,void 0,void 0,(function*(){let t=[];if(e)t=e;else{const e=yield import("./tokenList-4ef211de.js");t=r(e.default,d,"address")}const n=l,i=t.filter((e=>e.chainId===n));a(i),o((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(i))}))})()}),[e,o,l,d]),A((()=>{o($e({}))}),[s,l]),A((()=>{o((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(d))}),[d,o])}const ht=e=>(null!=e?e:Ue.getState()).token.tokenList,ft=e=>(null!=e?e:Ue.getState()).token.accountBalances,gt=e=>(null!=e?e:Ue.getState()).token.ethBalance||new n(NaN),bt=e=>(null!=e?e:Ue.getState()).token.defaultFromToken,yt=e=>(null!=e?e:Ue.getState()).token.defaultToToken,vt=e=>(null!=e?e:Ue.getState()).token.balanceLoadings;function xt(){const{account:e,chainId:t}=z(),n=R(ft),o=R(gt),i=w((()=>Te[t||1]),[t]),r=C((t=>{var r;if(!e)return null;if(t.symbol===i.symbol&&Ee(t.address,i.address))return!o||(null==o?void 0:o.isNaN())?null:o;const a=null===(r=n[t.address.toLocaleLowerCase()])||void 0===r?void 0:r.tokenBalances;return!a||(null==a?void 0:a.isNaN())?null:a}),[n,o,e]);return r}var Et;function wt(e,t,n,o=0){if(n&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return Et.fully+o;const i=e.indexOf(t);return 0===i?Et.prefix+o:i>0?Et.other+o:Et.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(Et||(Et={}));function Ct({value:e,onChange:t,occupiedAddrs:o,hiddenAddrs:i,showAddrs:r}){const[a,s]=E(""),l=R(ht),c=pt(),d=xt(),u=w((()=>new Set(i?i.map((e=>e.toLowerCase())):void 0)),[i]),p=w((()=>r?new Set(r.map((e=>e.toLowerCase()))):void 0),[r]),m=C((e=>e.filter((e=>{if(e.chainId!==c)return!1;let t=!0;return t=p?p.has(e.address.toLowerCase()):!u.has(e.address.toLowerCase()),t}))),[p,c,u]),h=C((t=>{if(null===t)return null;const i=[];a?t.forEach((e=>{const t=((e,t,{matchAddress:n}={})=>{if(!t)return 0;const o=t.toLocaleLowerCase();let i=0;n&&e.address.toLocaleLowerCase()===o&&(i=1),i||(i=wt(e.symbol.toLocaleLowerCase(),o,!1,1));if(i)e.name.toLocaleLowerCase()===o&&(i=Et.fully+1);else{let t=wt(e.name.toLocaleLowerCase(),o,!1,10);t=t===Et.fully+10?Et.fully+1:t,i=t}return i})(e,a,{matchAddress:!0});t&&i.push({sort:t,token:e})})):t.forEach((e=>{i.push({sort:0,token:e})}));const r=[];return i.sort(((t,i)=>{const r=t.token,a=i.token;if(e){if(r.address===e.address)return-1;if(a.address===e.address)return 1}if(null==o?void 0:o.includes(r.address))return-1;if(null==o?void 0:o.includes(a.address))return 1;const s=d&&d(r)||new n(0),l=d&&d(a)||new n(0);return s.eq(l)?t.sort!==i.sort?t.sort>i.sort?1:-1:r.symbol.localeCompare(a.symbol):s.gt(l)?-1:1})).some((e=>!!(a&&r.length>21)||(r.push(e.token),!1))),r}),[a,d,o,e]),f=C((e=>{const n=e.address.toLowerCase();t(e,!!(null==o?void 0:o.some((e=>e.toLowerCase()===n))))}),[t,o]),g=w((()=>{const e=m(l);return h(e)||[]}),[l,m,h]);return{filter:a,setFilter:s,showTokenList:g,onSelectToken:f}}function At({width:e=24,height:t=24,marginRight:n=8,url:o,zIndex:i,cross:r,address:a,token:l,sx:c}){const[d,u]=E(!1),[p,m]=E(""),[h,f]=E(""),[g,b]=E(!1),y=C((()=>u(!0)),[]);let v=function(e){const t=R(ht),{chainId:n}=z();return w((()=>{if(!e)return;let o=t.find((({address:t,chainId:o})=>o===n&&t===e));return o||(o=t.find((({address:t})=>t===e))),o}),[e,t,n])}(a);l&&(v=l);const x=a||(null==v?void 0:v.address),O=null==v?void 0:v.symbol,T=null==O?void 0:O.charAt(0).toUpperCase(),k=w((()=>{const e=null==v?void 0:v.logoURI;return o||e||""}),[o,v]);return A((()=>{b(!1)}),[x,k]),A((()=>{r&&(k?function(e,t){const n=new XMLHttpRequest;let o;n.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n.response)},n.onerror=function(){t()};try{o=new URL(e)}catch(e){}finally{n.open("GET",o||e),n.responseType="blob",n.send()}}(k,(e=>{m(e)})):m(""))}),[k,r]),A((()=>{try{let t=x;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const n=new V(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();f(`data:image/svg+xml;base64,${n}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[x,e]),re(s,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:n,zIndex:i},c||{}),style:{width:e,height:t},children:[!d&&ae(s,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:T}),ae(s,{component:"img",src:!(r?p:k)||g?h:r?p:k,onLoad:y,onError:e=>{const t=e.target;x&&h&&b(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function Ot({token:t,onClick:n}){var o,i;const r=l();return re(s,{component:c,sx:{display:"flex",alignItems:"center",color:r.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{n&&n(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?re(se,{children:[ae(At,{url:null==t?void 0:t.logoURI,address:null!==(o=null==t?void 0:t.address)&&void 0!==o?o:"",marginRight:6}),ae(s,{children:null!==(i=null==t?void 0:t.symbol)&&void 0!==i?i:"-"})]}):ae(e,{id:"SELECT TOKEN"}),ae(s,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:L})]})}function Tt({onClick:t,balance:n,decimals:o,address:i,showMaxBtn:r}){const{palette:a}=l();return re(s,{sx:{display:"flex",typography:"body2",color:a.text.secondary},children:[ae(e,{id:"Balance:"})," ",i?be({input:n,decimals:Math.min(o||4,4)}):"-",r&&n&&n.gt(0)&&ae(s,{component:c,sx:{ml:6,color:(null==n?void 0:n.gt(0))?a.primary.main:a.text.disabled,cursor:i&&t?"pointer":"unset"},onClick:()=>t&&t(n?n.toString():""),children:ae(e,{id:"Max"})})]})}function kt({readOnly:e,sx:t,value:n,decimals:o,onChange:i,suffix:r,withClear:a,onFocus:u,placeholder:p}){const m=l(),h=w((()=>r||(a&&n&&i?ae(s,{component:c,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{i&&i("")},children:ae(s,{component:D,sx:{width:12,color:"text.primary"}})}):void 0)),[i,r,m.palette.text.primary,n,a]);return re(s,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[ae(d,{fullWidth:!0,value:n,readOnly:e,placeholder:p||"0.00",onFocus:u,onChange:e=>{const t=e.target.value,n=0===t.length?"":xe(t,o);i&&i(n)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&n&&h]})}function It({open:e,onClose:t,title:n,rightSlot:o,canBack:i=!0,children:r,height:a,testId:l}){return re(s,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:a},"data-testid":l,"data-active":e?"1":"0",children:[n?re(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[ae(s,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&i&&ae(s,{component:D,sx:{color:"text.secondary",cursor:"pointer"},onClick:t})]}):"",r]})}const Rt=e=>(null!=e?e:Ue.getState()).globals;function St({token:e,disabled:t,onClick:n}){return re(s,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||n()},children:[ae(At,{token:e}),e.symbol]})}function Lt({token:e,disabled:t,style:n,onClick:o}){const i=xt()(e),r=i?ge({input:i}):"";return re(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:n,onClick:()=>{t||o()},"data-testid":"token-picker-item",children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(At,{token:e}),re(s,{children:[ae(s,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),ae(s,{sx:{mt:4,textAlign:"left"},children:r})]})]}),ae(s,{sx:{color:"text.secondary"},children:e.name})]})}function Dt({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i,visible:r}){var a;const l=pt(),c=R((e=>((e,t)=>(null!=t?t:Ue.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)))(l,e))),{showTokenList:d,filter:p,setFilter:m,onSelectToken:h}=Ct({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i}),f=O(null),g=O(null),[b,y]=E(0);A((()=>{r&&f.current&&y(f.current.offsetHeight-34)}),[f,r]);const v=C((({index:t,style:n})=>{const o=!!(null==c?void 0:c.length);if(0===t&&o)return ae(s,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},ref:g,style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:c.map((t=>ae(St,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>h(t)},t.address)))});const i=d[o?t-1:t];return ae(Lt,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>h(i)})}),[d,c,g,e]),x=C((e=>{var t;if(0===e&&(null==c?void 0:c.length)){const e=(null===(t=g.current)||void 0===t?void 0:t.offsetHeight)||0;return e<=52?0:e}return 52}),[g,c]);return re(s,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[ae(u,{fullWidth:!0,height:48,value:p,onChange:e=>m(e.target.value),clearValue:()=>m(""),placeholder:le._("Enter the token symbol or address")}),ae(s,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:f,children:ae(ce,{height:b,itemCount:d.length+((null==c?void 0:c.length)?1:0),itemSize:x,width:"100%",className:"token-list",children:v},null===(a=g.current)||void 0===a?void 0:a.offsetHeight)})]})}function Nt({open:t,value:n,onClose:o,occupiedAddrs:i,onTokenChange:r}){const{height:a}=R(Rt);return ae(It,{height:a,open:t,onClose:o,title:ae(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:ae(Dt,{value:n,visible:t,onChange:r,occupiedAddrs:i})})}function _t({sx:e,amt:t,token:n,readOnly:o,showMaxBtn:i,onMaxClick:r,fiatPriceTxt:a,occupiedAddrs:c,onInputFocus:d,onTokenClick:u,onInputChange:p,onTokenChange:m}){const h=l(),f=xt(),[g,b]=E(!1),y=n?f(n):null;return re(s,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:h.palette.background.input},e),children:[re(s,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[ae(Ot,{token:n,onClick:()=>b(!0)}),ae(Tt,{balance:y,onClick:r,showMaxBtn:i,address:null==n?void 0:n.address,decimals:null==n?void 0:n.decimals})]}),ae(kt,{value:t,onFocus:d,onChange:p,readOnly:o,withClear:!0}),ae(s,{sx:{mt:4,typography:"body2",color:h.palette.text.secondary},children:a}),ae(Nt,{value:n,open:g,occupiedAddrs:c,onClose:()=>{u&&u(),b(!1)},onTokenChange:(e,t)=>{m(e,t),b(!1)}})]})}const Bt={"en-US":de,"zh-CN":ue,pseudo:de};function Pt({locale:e,children:n}){return A((()=>{(()=>{Se(this,void 0,void 0,(function*(){yield function(e="en-US"){return Se(this,void 0,void 0,(function*(){le.loadLocaleData(e,{plurals:()=>Bt[e]});try{const t=yield import(`./locales/${e}.js`);le.load(e,t.messages||t.default.messages)}catch(e){}le.activate(e)}))}(e)}))})()}),[e]),ae(t,{i18n:le,children:n})}var Ft,jt,Mt;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Ft||(Ft={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(jt||(jt={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(Mt||(Mt={}));var Ut,Ht=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(Ut||(Ut={}));const Wt=(e,t)=>Se(void 0,void 0,void 0,(function*(){const{value:n,from:o,to:i,data:r}=e,a={from:o,to:i,value:n,data:r};n&&!/^0x0*$/.test(n)||delete a.value;try{return(yield t.estimateGas(a)).add(5e4)}catch(e){t.call(a).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),$t=(e,t)=>Se(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(le._("Transaction rejected.")):e}}));var Vt,zt;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(Vt||(Vt={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(zt||(zt={}));const Kt=new n(2).pow(256).minus(1),Gt=e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function Yt({onTxFail:e,onTxSubmit:t,onTxSuccess:o}={}){const{account:i,provider:r}=z(),a=pt(),[s,l]=E(!1),[c,d]=E(new Map),u=I(),[p,m]=E(null),[h,f]=E(""),[g,b]=E(null),[y,v]=E(!1),[x,A]=E(),O=C(((s,c,p,h=!1,g,y,x,E)=>Se(this,void 0,void 0,(function*(){if(f(""),m(""),!i||!r)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let w,C,O;A((()=>x)),l(!1);try{if(l(!0),c.opcode===Vt.Approval)O=yield((e,t,o,i,r,a)=>Se(void 0,void 0,void 0,(function*(){const s=qe(e,Ht,r,a).interface.encodeFunctionData("approve",[o,i.toFixed()]),l={from:t,to:e,data:s,value:`0x${new n("0").toString(16)}`,gasLimit:void 0},c=yield Wt(l,r);return c&&(l.gasLimit=c),yield $t(l,r)})))(c.token.address,i,c.contract,c.amt||Kt,r,i),w=O.hash,f(w);else{if(c.opcode!==Vt.TX)throw new Error(`Op ${c.opcode} not implemented!`);if(""===c.to)throw new Error("Submission: malformed to");if(0===c.data.length)throw new Error("Submission: malformed data");if(0===c.data.indexOf("0x")&&c.data.length<=2)throw new Error("Submission: malformed data");if(C={value:c.value,data:c.data,to:c.to,gasLimit:c.gasLimit,from:i,chainId:a},!C.gasLimit)try{const e=yield Wt(C,r);e&&(C.gasLimit=e)}catch(e){console.debug(e)}if(O=yield $t(C,r),w=O.hash,f(w),!w)throw new Error(`Unexpected tx: ${w}`)}}catch(t){if(l(!1),b({spec:c,brief:s,subtitle:p}),console.error(t),t.message){u(Gt({contractStatus:Pe.Failed}));const n={error:t.message,brief:s};y&&Object.assign(n,y),e&&e(t,y),m(function(e,t){var n;const o=null===(n=Te[e])||void 0===n?void 0:n.symbol,i=[{error:"insufficient",msg:le._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:o})},{error:["External Swap execution Failed","Return amount is not enough"],msg:le._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:le._("SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:le._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:le._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:le._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:le._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:le._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:le._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:le._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:le._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:le._("Service update, please wait and try again")}];let r="";return i.some((e=>Array.isArray(e.error)?e.error.some((n=>t.indexOf(n)>-1&&(r=e.msg,!0))):t.indexOf(e.error)>-1&&(r=e.msg,!0))),r||t}(a,t.message))}return jt.Failed}b({spec:c,brief:s,subtitle:p}),v(!1),l(!1);const T=Object.assign(Object.assign(Object.assign(Object.assign({brief:s},c),C),{tx:w,subtitle:p}),y);u(Gt({contractStatus:Pe.Pending})),t&&t(w,T),g&&g();const k={brief:s,spec:c,tx:w,subtitle:p};if(d((e=>e.set(w,[k,Ft.Running]))),h)return jt.Submitted;if(g&&g(),null==O?void 0:O.wait){const e=yield O.wait(1);if(v(!0),e.status===Mt.Success)return"TX"===T.opcode&&u(Gt({contractStatus:Pe.TxSuccess})),"APPROVAL"===T.opcode&&u(Gt({contractStatus:Pe.ApproveSuccess})),E&&E(w),o&&o(w,T),d((e=>e.set(w,[k,Ft.Success]))),jt.Success}return v(!0),d((e=>e.set(w,[k,Ft.Failed]))),jt.Failed}))),[i,a,l,r]),T=w((()=>({execute:O,requests:c,setShowing:b,waitingSubmit:s})),[O,c,b]),k=C((()=>{b(null),x&&(x(),A(void 0))}),[x]);return{showing:g,showingDone:y,transactionTx:h,errorMessage:p,setErrorMessage:m,closeShowing:k,ctxVal:T,requests:c}}function qt(){const{requests:e}=Zt(),t=[];return null==e||e.forEach((function([e,n]){n===Ft.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const Xt=k({execute:()=>Promise.resolve(jt.Canceled),requests:void 0,waitingSubmit:!1});function Zt(){return T(Xt)}var Qt;function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Jt.apply(this,arguments)}var en=function(e){return x.createElement("svg",Jt({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Qt||(Qt=x.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},x.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},x.createElement("g",{transform:"translate(18.000000, 291.000000)"},x.createElement("g",{transform:"translate(40.000000, 83.000000)"},x.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function tn({showingDone:e,errorMessage:t}){return ae(s,t?{component:N,sx:{width:64,height:64,color:"error.main"}}:e?{component:_,sx:{width:64,height:64,color:"success.main"}}:{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:ae(s,{component:en,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function nn({showingDone:e,showing:t}){return re(s,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[ae(s,{sx:{mt:60},children:e?le._("{0} confirmed",{0:null==t?void 0:t.brief}):le._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?ae(s,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function on({isStarted:t,isEnded:n,tx:o}){const[i,r]=E(0),{chainId:a}=z(),l=w((()=>`https://${Ie[a||1]}/tx/${o}`),[o,a]),c=w((()=>{const e=Math.floor(i/60),t=i%60;return e?`${e}m ${t}s`:`${t}s`}),[i]),d=O();return A((()=>(r(0),d.current=setInterval((()=>{r((e=>e+1))}),1e3),()=>{clearInterval(d.current)})),[t]),A((()=>{clearInterval(d.current)}),[n]),re(s,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[re(s,{children:[ae(e,{id:"Transaction Time:"}),c]}),re(m,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:l,target:"_blank",rel:"noopener noreferrer",children:[ae(e,{id:"Tx"}),ae(s,{component:B,sx:{width:16,height:16,ml:6}})]})]})}function rn(t){var{children:n}=t,o=Re(t,["children"]);const{ctxVal:i,showing:r,closeShowing:a,showingDone:l,errorMessage:c,transactionTx:d}=Yt(o),u=I();return re(Xt.Provider,{value:i,children:[n,ae(It,{open:!!r,onClose:a,children:re(s,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[re(s,{children:[ae(s,{sx:{textAlign:"center",pt:60},children:ae(tn,{showingDone:l,errorMessage:c})}),c?re(s,{sx:{textAlign:"center",mt:60},children:[ae(s,{children:ae(e,{id:"Something went wrong."})}),ae(s,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:c})]}):re(se,{children:[ae(nn,{showingDone:l,showing:r}),ae(on,{isStarted:!!r,isEnded:l,tx:d})]})]}),ae(p,{fullWidth:!0,size:p.Size.big,onClick:()=>{u(Gt({contractStatus:Pe.Initial})),a()},sx:{mt:20},children:ae(e,c?{id:"Dismiss"}:{id:"Close"})})]})})]})}function an({token:e,fiatPrice:t}){return{marginAmount:w((()=>{var i;const r=null!==(i=null==e?void 0:e.decimals)&&void 0!==i?i:6,a=((e,t,n)=>{const i=new o(e).times(new o(10).pow(t));return n?i:i.dp(0)})(null!=t?new n(500).div(t):new n(0),r);return(a.lt(new n(1).times(new n(10).pow(r-3)))?new n(0):a).toString(10)}),[null==e?void 0:e.decimals,t])}}function sn({width:e,height:t,feeRate:n,rebateTo:o,colorMode:i,apikey:r,defaultChainId:a,defaultToToken:s,defaultFromToken:l}){const c=I();A((()=>{i&&c((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(i))}),[i]),A((()=>{var e;a&&c((e=a,t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[a]),A((()=>{c(Gt({height:t}))}),[t]),A((()=>{c(Gt({width:e}))}),[e]),A((()=>{r&&c(Gt({apikey:r}))}),[r]),A((()=>{n&&c(Gt({feeRate:n}))}),[n]),A((()=>{o&&c(Gt({rebateTo:o}))}),[o]),A((()=>{l&&c((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(l))}),[l]),A((()=>{s&&c((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(s))}),[s])}function ln({refetch:e,interval:t}){let n;A((()=>(e(),clearTimeout(n),n=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(n))),[e])}function cn({fromToken:e,toToken:t,chainId:n}){const[o,i]=E(!1),[r,a]=E(""),[s,l]=E(""),c=C((()=>{if(!n||!e||!t)return;i(!0);const o=[e,t];pe.post("https://api.dodoex.io/price-api/api/v1/price/current/batch",{networks:o.map((()=>(e=>ke[e]||ke[Ce.MAINNET])(n))),addresses:o.map((e=>e.address)),symbols:o.map((e=>e.symbol)),isCache:!0},{headers:{apikey:"dodofrontend777888ofopensource"}}).then((n=>{var o;i(!1);const r=null===(o=n.data)||void 0===o?void 0:o.data;r&&(a(r.find((t=>t.address===e.address)).price),l(r.find((e=>e.address===t.address)).price))})).catch((e=>{i(!1),console.error(e)}))}),[n,e,t]);return ln({refetch:c}),{loading:o,refetch:c,toFiatPrice:s,fromFiatPrice:r}}const dn=e=>(null!=e?e:Ue.getState()).settings.slippage,un=e=>(null!=e?e:Ue.getState()).settings.ddl;var pn;function mn({toToken:e,fromToken:t,fromAmount:n,toAmount:o,marginAmount:i}){const{account:r,chainId:a,provider:s}=z(),l=R(He),c=w((()=>a||l),[a,l]),d=R(dn)||3,u=R(un)||20,{feeRate:p,rebateTo:m,apikey:h,isReverseRouting:f}=R(Rt),g=w((()=>Math.floor(Date.now()/1e3)+60*u),[u]),[b,y]=E(pn.Initial),[v,x]=E(null),[A,O]=E(""),[T,k]=E(null),[I,S]=E(null),[L,D]=E(null),[N,_]=E(me.from(0)),[B,P]=E(null),[F,j]=E(null),[M,U]=E(""),[H,W]=E(""),[$,V]=E(""),[K,G]=E(0),Y=C((()=>Se(this,void 0,void 0,(function*(){if(!c||!t||!e)return;if(!f&&!n)return;if(f&&!o)return;y(pn.Loading);const i={chainId:c,deadLine:g,apikey:h,slippage:d,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:r||"0x0000000000000000000000000000000000000000"};f?i.toAmount=he(String(o||1),e.decimals).toString():i.fromAmount=he(String(n||1),t.decimals).toString(),m&&p&&(i.rebateTo=m,i.fee=p);try{const e=(yield pe.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:i})).data.data;if((null==e?void 0:e.resAmount)?(y(pn.Success),x(e.resAmount),D(e.priceImpact),P(e.resPricePerFromToken),j(e.resPricePerToToken),k(e.baseFeeAmount),S(e.additionalFeeAmount),U(e.to),W(e.data),O(e.value),V(e.useSource),G(e.duration)):y(pn.Failed),!r||!s)return;const t=yield Wt({from:r,to:e.to,value:e.value,data:e.data},s);t&&_(t)}catch(e){y(pn.Failed),console.error(e)}}))),[g,r,c,e,p,d,m,t,s,n,o,h,f]);ln({refetch:Y});const q=w((()=>{const e=f?o:n;return b!==pn.Loading&&e?v:null}),[b,f,o,n,v]),X=function(){const{chainId:e,account:t}=z(),n=Zt();return C((({to:e,data:o,useSource:i,duration:r,ddl:a,gasLimit:s,subtitle:l,value:c})=>{const d=60*a,u=c;i&&"weth"!==i.toLowerCase()&&s&&s.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const p={from:t,to:e,data:o,value:u,route:i,duration:r,ddlSecRel:d,gasLimit:s};n.execute(le._("Swap"),Object.assign({opcode:Vt.TX},p),l)}),[t,e])}(),Z=C((e=>{t&&(f?v:n)&&X({to:M,data:H,useSource:$,duration:K,ddl:u,value:A,subtitle:e})}),[M,u,H,K,$,t,n,N,v,A,f]);return{status:b,refetch:Y,priceImpact:L,executeSwap:Z,baseFeeAmount:T,resAmount:q,additionalFeeAmount:I,resPricePerToToken:F,resPricePerFromToken:B}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(pn||(pn={}));function hn(e){mt(e),Qe(),Je();const{provider:t,connector:n}=z();A((()=>{const t=e.defaultChainId||1;(null==n?void 0:n.connectEagerly)?n.connectEagerly(t):n.activate(t)}),[n]),A((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const o=e.width||375,i=e.height||494;return sn(Object.assign(Object.assign({},e),{width:o,height:i})),ae(s,{sx:{width:o,height:i,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:ae(rn,{...e,children:e.children})})}function fn(e){const t=h({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),n=w((()=>e.defaultChainId||1),[e.defaultChainId]),o=ut({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:n}),i=`${o.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${n}`;return ae(S,{store:Ue,children:ae(Pt,{locale:e.locale,children:ae(f,{theme:t,children:re(G,{connectors:o,children:[ae(g,{container:".dodo-widget-container"}),ae(hn,{...e})]},i)})})})}function gn(e){const{width:t}=R(Rt),n=w((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return ae(b,{container:document.querySelector(".dodo-widget-container"),maxWidth:n,...e})}function bn({onClick:e}){const t=l();return ae(m,{sx:{width:"100%",position:"relative"},onClick:e,children:ae(s,{component:c,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:ae(s,{component:P,sx:{width:18,color:"text.secondary"}})})})}function yn({open:t,execute:o,onClose:i,toToken:r,fromToken:a,fromAmount:d,toAmount:u,priceImpact:m,clearFromAmt:h,clearToAmt:f,baseFeeAmount:g,curToFiatPrice:b,curFromFiatPrice:y,pricePerFromToken:v,additionalFeeAmount:x}){var C,O;const T=l(),k=R(dn),S=I(),{contractStatus:D}=R(Rt),N=w((()=>new n(m).gt(15)),[m]),[_,B]=E(!1),[P,U]=E(!1);return A((()=>{D!==Pe.Pending&&i(),D===Pe.TxSuccess&&(f(),h())}),[D]),A((()=>{B(!1)}),[b]),ae(It,{open:t,onClose:()=>{S(Gt({contractStatus:Pe.Initial})),i()},title:ae(e,{id:"Swap summary"}),children:re(s,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${T.palette.border.main}`},children:[re(s,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${T.palette.border.main}`},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[re(s,{children:[re(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[ae(At,{width:16,height:16,url:null==a?void 0:a.logoURI,address:null!==(C=null==a?void 0:a.address)&&void 0!==C?C:"",marginRight:6}),ae(s,{children:`${be({input:d,decimals:null==a?void 0:a.decimals})} ${null==a?void 0:a.symbol}`})]}),ae(s,{sx:{mt:4,typography:"h6",color:T.palette.text.secondary},children:y?`$${ge({input:y,showDecimals:1})}`:"-"})]}),ae(s,{sx:{width:16,mx:16},component:F}),re(s,{children:[re(s,{sx:{display:"flex"},children:[ae(At,{width:16,height:16,marginRight:6,url:null==r?void 0:r.logoURI,address:null!==(O=null==r?void 0:r.address)&&void 0!==O?O:""}),ae(s,{children:`${be({input:u,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),ae(s,{sx:{typography:"h6",mt:4,color:T.palette.text.secondary},children:b?`$${ge({input:b,showDecimals:1})}(${m}%)`:"-"})]})]}),ae(s,{sx:{mt:12,typography:"h6"},children:`1 ${null==a?void 0:a.symbol} = ${be({input:new n(u).dividedBy(new n(d)),decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),re(s,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${T.palette.border.main}`},children:[re(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:T.palette.text.secondary},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(s,{sx:{width:16,mr:7},component:j}),ae(e,{id:"Swap Detail"})]}),ae(s,{component:c,children:ae(s,{onClick:()=>U(!P),sx:{width:10,color:"text.secondary",transform:P?"rotateX(0deg)":"rotateX(180deg)"},component:L})})]}),re(s,{sx:{mt:16,display:P?"initial":"none"},children:[re(s,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(e,{id:"Basic Fee"}),ae(gn,{title:ae(e,{id:"Estimated service provider fees"}),ml:5})]}),ae(s,{children:`${be({input:g,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),re(s,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(e,{id:"Additional Fee"}),ae(gn,{title:ae(e,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),ae(s,{children:`${be({input:x,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),re(s,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(e,{id:"Price Impact"}),ae(gn,{title:ae(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),ae(s,{children:`${m}%`})]}),re(s,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(e,{id:"Slippage"}),ae(gn,{title:ae(e,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),ae(s,{children:k})]})]})]}),ae(s,{sx:{flex:1}}),N&&re(s,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>B(!_),children:[ae(s,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:ae(s,_?{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:ae(s,{component:M,sx:{width:14,color:"#1a1a1b"}})}:{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${T.palette.text.secondary}`}})}),ae(s,{children:ae(e,{components:{0:ae(s,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:m},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),ae(p,{isLoading:D==Pe.Pending,disabled:N&&!_,fullWidth:!0,onClick:()=>{o(),S(Gt({contractStatus:Pe.Pending}))},children:D==Pe.Pending?ae(e,{id:"Confirming"}):ae(e,{id:"Confirm swap"})})]})})}function vn(e){var{sx:t,maxVal:n,decimals:i=2,onInputChange:r}=e,a=Re(e,["sx","maxVal","decimals","onInputChange"]);return l(),ae(d,{...a,onChange:e=>{const t=0===e.target.value.length?null:xe(e.target.value,i),a=n&&t&&new o(t).gt(n)?n.toString():t;console.log("finalVal:",a),r&&r(a)}})}function xn({open:t,onClose:n}){const o=l(),i=I(),r=R(dn),a=R(un),c=w((()=>Number(r)>=50),[r]);return ae(It,{open:t,onClose:n,title:ae(e,{id:"Settings"}),children:re(s,{sx:{mx:20},children:[re(s,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[re(s,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ae(e,{id:"Slippage Tolerance"}),ae(gn,{title:ae(e,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),re(s,{sx:{display:"flex",flexDirection:"column"},children:[ae(vn,{fullWidth:!0,maxVal:100,value:r,placeholder:3..toString(),onInputChange:e=>{i((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:ae(s,{sx:{color:"text.disabled"},children:"%"}),height:36}),c&&ae(s,{sx:{typography:"h6",mt:6,color:"error.main"},children:ae(e,{id:"Maximum slippage do not exceed 50%"})})]})]}),re(s,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[re(s,{sx:{mb:16,display:"flex",alignItems:"center"},children:[ae(e,{id:"Transaction Deadline"}),ae(gn,{title:ae(e,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),ae(vn,{value:a,fullWidth:!0,height:36,placeholder:le._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{i((e=>t=>Se(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function En({toToken:t,fromToken:n,priceStatus:o,pricePerToToken:i,pricePerFromToken:r}){const[a,l]=E("-"),[d,u]=E(null),[p,m]=E("-"),[h,f]=E(null);A((()=>{l(null==n?void 0:n.symbol),m(null==t?void 0:t.symbol),u(i),f(r)}),[n,t,i,r]);const g=C((()=>{l(p),m(a),u(h),f(d)}),[a,d,p,h]);return ae(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[pn.Initial]:"-",[pn.Loading]:re(se,{children:[ae(y,{sx:{mr:5}}),ae(e,{id:"Fetching best price..."})]}),[pn.Failed]:re(se,{children:[ae(s,{component:U,sx:{width:15,mr:5,color:"warning.main"}}),ae(e,{id:"Quote not available"})]}),[pn.Success]:re(se,{children:[ae(s,{sx:{typography:"body2"},children:`1 ${a} = ${ge({input:h,showDecimals:4})} ${p}`}),ae(s,{component:c,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:ae(s,{sx:{width:16,color:"text.secondary"},onClick:g,component:H})})]})}[o]})}function wn({open:t,onClose:n}){const o=R(He);return ae(It,{title:ae(e,{id:"Connect to your wallet"}),open:t,onClose:n,children:ae(s,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(ct).map((t=>re(s,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,n){var o;const i=dt[e];if(!i)throw new Error(`Unknown wallet type: ${e}`);const[r]=i;null===(o=r.activate(t))||void 0===o||o.catch((e=>{4001!==e.code?n(e):r.connectEagerly?r.connectEagerly(t):r.activate(t)}))}(t.type,o,(e=>{console.error(e)}))},children:[ae(s,{component:t.icon,sx:{width:32,height:32}}),ae(s,{sx:{mt:8,typography:"caption"},children:t.name}),ae(s,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:ae(e,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function Cn(){const{connector:t}=z(),[n,o]=E(!1);return re(se,{children:[ae(p,{size:p.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),o(!0)},"data-testid":"connect-wallet-btn",children:ae(e,{id:"Connect to a wallet"})}),ae(wn,{open:n,onClose:()=>o(!1)})]})}var An;!function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(An||(An={}));const On=({account:e,chainId:t,offset:o,contractAddress:i})=>{var r;const a=R(He),s=w((()=>{var e;return Ke[null!==(e=t)&&void 0!==e?e:a]}),[t]),{isETH:l}=w((()=>we(t)),[t]),{DODO_APPROVE:c}=s||{},d=null!==(r=null!=i?i:c)&&void 0!==r?r:null,u=function(e){const{account:t}=z(),o=R(He),i=R(ft),r=w((()=>Te[o]),[o]),a=C((o=>{var a;if(!t||!e)return null;if(o.symbol===r.symbol&&Ee(o.address,r.address))return new n(Kt);const s=null===(a=null==i?void 0:i[o.address.toLowerCase()])||void 0===a?void 0:a.tokenAllowances;return null!=s?s:null}),[t,e,r.symbol,r.address,i]);return a}(d),p=xt(),{runningRequests:m}=qt(),h=R(vt),f=w((()=>{var e;return null===(e=Te[null!=t?t:a])||void 0===e?void 0:e.address}),[t]),g=C(((t,i,r)=>{if(!t)return An.Loading;const a=!!(null==m?void 0:m.find((e=>e.spec.opcode===Vt.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),s=null!=r?r:t?p(t):null,l=t?u(t):null,c=new n(null!=i?i:0);if(!e)return An.Unchecked;if(!s||c.minus(null!=o?o:0).gt(s))return An.Unchecked;if(c.isZero())return An.Unchecked;return t.address===f?An.Sufficient:a?An.Approving:l&&c.minus(null!=o?o:0).gt(l)?An.Insufficient:An.Sufficient}),[p,u,e,o,d,t,h,m,f]),b=C((e=>{const t=e?u(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[u]),y=Zt(),v=I(),x=C(((t,o)=>Se(void 0,void 0,void 0,(function*(){if(!d||!e||!t)return;const i=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),r=o?new n(0):void 0,a=o?le._("Reset"):le._("Approve");var s;(yield y.execute(`${a} ${i}`,{opcode:Vt.Approval,token:t,contract:d,amt:r}))===jt.Success&&v((s=null!=r?r:Kt,e=>Se(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:s})}))))}))),[d,e,t,y,v]),E=C((e=>{const t=new n(0);if(!e)return t.toNumber();const o=p(e);if(!o)return t.toNumber();let i=o;const r=l?.1:.02;return f===(null==e?void 0:e.address)&&(i=o.gt(r)?o.minus(r):t),i.toNumber()}),[t,p,l]);return{getApprovalState:g,getPendingRest:b,getMaxBalance:E,submitApprove:x}};function Tn(){var t,o;const i=l(),{isInflight:r}=qt(),{chainId:d,account:u}=z(),m=I(),{isReverseRouting:h}=R(Rt),f=R(He),g=R(yt),b=R(bt),{isETH:v}=w((()=>we(d)),[d]),x=w((()=>{var e;return null===(e=Te[null!=d?d:f])||void 0===e?void 0:e.address}),[d]),[O,T]=E(""),[k,S]=E(""),[L,D]=E(""),[N,_]=E(""),B=w((()=>a((e=>D(e)),1e3)),[]),P=w((()=>a((e=>_(e)),1e3)),[]),[j,M]=E(null),[H,V]=E(null),[K,G]=E(!1),[Y,q]=E(!1),{toFiatPrice:X,fromFiatPrice:Z}=cn({chainId:d,toToken:H,fromToken:j}),Q=xt(),J=w((()=>j?Q(j):null),[j,Q]);w((()=>H?Q(H):null),[H,Q]);const{getApprovalState:ee,submitApprove:te,getPendingRest:ne,getMaxBalance:oe}=On({account:u,chainId:d}),ie=w((()=>ne(h?H:j)),[null==j?void 0:j.address,null==H?void 0:H.address,ne,h]),{marginAmount:le}=an({token:h?H:j,fiatPrice:h?X:Z}),{resAmount:ce,priceImpact:de,executeSwap:ue,baseFeeAmount:pe,additionalFeeAmount:me,resPricePerToToken:he,resPricePerFromToken:fe,status:ye}=mn({toToken:H,fromToken:j,marginAmount:le,fromAmount:L,toAmount:N}),ve=C((e=>{const t=e.toString();T(t),B(t)}),[T,B]),xe=C((e=>{const t=e.toString();S(t),P(t)}),[S,P]);A((()=>{d&&(V(null),M(null),h?xe(""):ve("")),b&&b.chainId===d&&(M(b),b.amount&&(m(Gt({isReverseRouting:!1})),ve(b.amount))),g&&g.chainId===d&&(V(g),g.amount&&b&&!b.amount&&(m(Gt({isReverseRouting:!0})),xe(g.amount)))}),[g,b,d,ve,xe]);const Ee=C((()=>{ve(""),xe(""),M(H),V(j)}),[M,H,V,j,ve,xe]),Ae=C((e=>h?xe(oe(H)):ve(oe(j))),[ve,xe,oe,j,H,h]),Oe=w((()=>(100*Number(de)).toFixed(2)),[de]),ke=w((()=>{const e=h?ce:L;return e&&Z?new n(Z).multipliedBy(e):null}),[Z,L,h,ce]),Ie=w((()=>{const e=h?N:ce;return e&&X?new n(X).multipliedBy(e):null}),[X,N,h,ce]),Re=w((()=>re(s,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[ae(gn,{title:ae(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),re(s,{sx:{display:"flex"},children:[ae(e,{id:"Current price impact"}),re(s,{sx:{color:i.palette.error.main,ml:4},children:[Oe,"%"]})]})]})),[Oe]),Se=w((()=>ae(En,{toToken:H,fromToken:j,priceStatus:ye,pricePerToToken:he,pricePerFromToken:fe})),[H,j,ye,he,fe]),Le=w((()=>!Ce[d||1]),[d]),De=w((()=>ye===pn.Loading?ae(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:re(se,{children:[ae(y,{sx:{mr:5}}),ae(e,{id:"Fetching best price..."})]})}):Le?re(se,{children:[ae(s,{component:U,sx:{mr:6,width:16,color:"warning.main"}}),ae(e,{id:"Unsupported network - switch to trade"})]}):O&&new n(Oe).gt(15)?Re:Se),[ye,Se,O,Re,Oe,Le]),Ne=w((()=>h?new n(k).gt(0)?be({input:ce,decimals:null==j?void 0:j.decimals}):"-":O),[O,k,ce,j,h]),_e=w((()=>h?k:new n(O).gt(0)?be({input:ce,decimals:null==H?void 0:H.decimals}):"-"),[O,k,ce,H,h]),Be=w((()=>{const t=ee(j,h?ce||0:L),o=t===An.Approving,i=t===An.Insufficient&&!ie,a=v?.1:.02,s=x===(null==j?void 0:j.address),l=new n(J||0);return u?r?ae(p,{fullWidth:!0,isLoading:!0,disabled:!0,children:ae(e,{id:"Transaction Pending"})}):j&&H?i?ae(p,{fullWidth:!0,disabled:o,onClick:()=>te(j),children:ae(e,o?{id:"Approving"}:{id:"Approve"})}):new n(h?N:L).gt(0)?ye===pn.Loading?ae(p,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:ae(e,{id:"Fetching Price..."})}):ce?l.lt(h?ce:L)||s&&l.lte(a)?ae(p,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:ae(e,{id:"Insufficient balance"})}):ae(p,{fullWidth:!0,onClick:()=>G(!0),"data-testid":"swap-review-btn",children:ae(e,{id:"Review Swap"})}):ae(p,{fullWidth:!0,disabled:!0,children:ae(e,{id:"Quote not available"})}):ae(p,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:ae(e,{id:"Enter an amount"})}):ae(p,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:ae(e,{id:"Select Tokens"})}):ae(Cn,{})}),[v,u,N,L,H,ce,j,r,ue,ie,te,ye,J,ee,x,h]),Pe=w((()=>j&&H?re(s,{sx:{display:"flex",alignItems:"center"},children:[ae(At,{token:j,sx:{width:16,height:16,mr:6}}),`${be({input:h?ce:L,decimals:null==j?void 0:j.decimals})} ${j.symbol}`,ae(s,{component:F,sx:{width:12,height:12,mx:16}}),ae(At,{token:H,sx:{width:16,height:16,mr:6}}),`${be({input:h?N:ce,decimals:null==H?void 0:H.decimals})} ${H.symbol}`]}):ae(s,{})),[j,H,L,N,ce,h]);return re(se,{children:[re(s,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[ae(e,{id:"Swap"}),ae(s,{component:c,children:ae(s,{component:W,onClick:()=>q(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),re(s,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[re(s,{children:[ae(_t,{sx:{mb:4},token:j,amt:Ne,onMaxClick:Ae,onInputChange:ve,onInputFocus:()=>{h&&ve(""),m(Gt({isReverseRouting:!1}))},showMaxBtn:!h&&!O,occupiedAddrs:[null!==(t=null==H?void 0:H.address)&&void 0!==t?t:""],fiatPriceTxt:ke?`$${ge({input:ke,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return Ee();ve(""),xe(""),M(e)},readOnly:h}),ae(bn,{onClick:Ee}),ae(_t,{token:H,amt:_e,onInputChange:xe,onInputFocus:()=>{h||xe(""),m(Gt({isReverseRouting:!0}))},occupiedAddrs:[null!==(o=null==j?void 0:j.address)&&void 0!==o?o:""],fiatPriceTxt:Ie?`$${ge({input:Ie,showDecimals:1})}(${Oe}%)`:"-",onTokenChange:(e,t)=>{if(t)return Ee();ve(""),xe(""),V(e)},readOnly:!h}),ae(s,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:De})]}),Be,re(s,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:i.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[ae(s,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:i.palette.text.disabled}},component:$}),ae(e,{id:"Powered by DODO protocol"})]})]}),ae(yn,{toToken:H,fromToken:j,fromAmount:h?ce:L,toAmount:h?N:ce,open:K,baseFeeAmount:pe,priceImpact:Oe,additionalFeeAmount:me,curToFiatPrice:Ie,execute:()=>ue(Pe),clearFromAmt:()=>ve(""),clearToAmt:()=>xe(""),curFromFiatPrice:ke,pricePerFromToken:fe,onClose:()=>G(!1)}),ae(xn,{open:Y,onClose:()=>q(!1)})]})}function kn(e){return ae(fn,{...e,children:ae(Tn,{})})}function In(e){const t=document.getElementById("dodo-swap-widget");fe(t).render(ae(fn,{...e,children:ae(Tn,{})}))}export{In as InitSwapWidget,kn as SwapWidget};
|
|
1
|
+
import{Trans as e,I18nProvider as t}from"@lingui/react";import a,{BigNumber as n}from"bignumber.js";import{chunk as o,isArray as d,unionBy as l,debounce as i}from"lodash";import{Box as r,useTheme as c,BaseButton as s,Input as p,SearchInput as m,Button as h,HoverOpacity as b,createTheme as u,ThemeProvider as R,CssBaseline as W,QuestionTooltip as E,RotatingIcon as f}from"@dodoex/components";import{getAddress as g}from"@ethersproject/address";import*as x from"react";import{useState as y,useMemo as k,useCallback as T,useEffect as F,useRef as N,useContext as Z,createContext as S}from"react";import{useDispatch as w,useSelector as V,Provider as M}from"react-redux";import{CaretUp as U,Error as O,Loading as v,ErrorWarn as I,DoneBorder as D,ArrowTopRightBorder as Y,ArrowBack as C,DoubleRight as H,DetailBorder as X,Done as B,Warn as A,Switch as z,Setting as j,Dodo as J}from"@dodoex/icons";import L from"identicon.js";import{useWeb3React as G,initializeConnector as P,Web3ReactProvider as Q}from"@web3-react/core";import{configureStore as _}from"@reduxjs/toolkit";import{combineReducers as q}from"redux";import{Contract as K}from"@ethersproject/contracts";import{AddressZero as $}from"@ethersproject/constants";import{defaultAbiCoder as ee,Interface as te}from"@ethersproject/abi";import{EIP1193 as ae}from"@web3-react/eip1193";import{WalletConnect as ne}from"@web3-react/walletconnect";import{MetaMask as oe}from"@web3-react/metamask";import{JsonRpcProvider as de}from"@ethersproject/providers";import{Connector as le}from"@web3-react/types";import ie from"axios";import{List as re}from"immutable";import{jsxs as ce,jsx as se,Fragment as pe}from"react/jsx-runtime";import{i18n as me}from"@lingui/core";import{VariableSizeList as he}from"react-window";import{en as be,zh as ue}from"make-plural/plurals";import{BigNumber as Re,parseFixed as We}from"@ethersproject/bignumber";import{createRoot as Ee}from"react-dom/client";function fe({input:e,showDecimals:t=4,showPrecisionDecimals:a=2,showIntegerOnly:o=!1,showDecimalsOnly:d=!1,noGroupSeparator:l=!1}){const i=new n(e);if(i.isNaN())return"-";let r=i.dp(t,n.ROUND_DOWN);return r.eq(0)&&(i.gt(0)||i.lt(0))&&(r=i.sd(null!=a?a:t,n.ROUND_DOWN)),o&&(r=r.integerValue(n.ROUND_DOWN)),d&&(r=r.minus(r.integerValue(n.ROUND_DOWN))),l?r.toFormat({decimalSeparator:".",groupSeparator:"",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0}):r.toFormat()}function ge({input:e,decimals:t,showPrecisionDecimals:a=2,noGroupSeparator:o}){if(null==e)return"-";const d=new n(e);if(d.isNaN())return"-";return fe({input:d,showDecimals:void 0===t?0:t>6?6:t>4?4:t,showPrecisionDecimals:a,noGroupSeparator:o})}function xe(e){if("number"==typeof e)return xe(new n(e));if(e.isNaN())return"NaN";if(e.isNegative())return`-${xe(e.negated())}`;if(e.isZero())return"0";let t=e.integerValue(n.ROUND_FLOOR),a=e.minus(t),o="";for(;!t.isZero();){o=t.modulo(10).toString().toString()+o,t=t.idiv(10)}if(""===o&&(o="0"),a.isZero())return o;o+=".";let d=0;for(;!a.isZero()&&d<100;){const e=a.times(10),t=e.integerValue(n.ROUND_FLOOR);o+=t.toString(),a=e.minus(t),d+=1}return o}const ye=(e,t)=>{if("string"==typeof e&&!e.match(/[-+]?\d+(.+d+)?/))return e;const a=new n(e);if(t){let e=a.toFixed(t,n.ROUND_DOWN);return new n(e).isZero()&&(e=xe(a.precision(t,n.ROUND_DOWN))),e}return xe(a)},ke=(e,t)=>{let a=e;const n=a.match("[0-9。.]+");a=n&&n.length>0?n[0]:"",a=a.replace("。",".");let o=0;if(a){const e=a.split("."),t=0===e[0].length?["0"]:[e[0]];e.length>1?t[1]=e.slice(1,e.length).join(""):t[0].length>1&&"0"===t[0][0]&&(t[0]=t[0].slice(1,t[0].length)),t.length>1&&(o=t[1].length),a=t.join(".")}return t>=0&&o>t?ye(a,t):a},Te=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const a=e.substring(2,e.length).toLowerCase(),n=t.substring(2,t.length).toLowerCase();return a.length>n.length?a.endsWith(n):n.endsWith(a)};const Fe=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var Ne;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(Ne||(Ne={}));const Ze={[Ne.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[Ne.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[Ne.GOERLI]:["https://goerli.optimism.io/"],[Ne.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[Ne.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[Ne.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[Ne.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[Ne.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[Ne.AURORA]:["https://mainnet.aurora.dev/"],[Ne.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[Ne.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[Ne.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[Ne.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[Ne.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[Ne.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},Se={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},we={[Ne.MAINNET]:Object.assign(Object.assign({},Se),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[Ne.RINKEBY]:Object.assign(Object.assign({},Se),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[Ne.GOERLI]:Object.assign(Object.assign({},Se),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[Ne.OPTIMISM]:Object.assign(Object.assign({},Se),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[Ne.CRONOS]:Object.assign(Object.assign({},Se),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[Ne.BOBA]:Object.assign(Object.assign({},Se),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[Ne.BSC]:Object.assign(Object.assign({},Se),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[Ne.OKCHAIN]:Object.assign(Object.assign({},Se),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[Ne.HECO]:Object.assign(Object.assign({},Se),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[Ne.POLYGON]:Object.assign(Object.assign({},Se),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[Ne.MOONRIVER]:Object.assign(Object.assign({},Se),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[Ne.ARBITRUM_ONE]:Object.assign(Object.assign({},Se),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[Ne.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},Se),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[Ne.AURORA]:Object.assign(Object.assign({},Se),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[Ne.AVALANCHE]:Object.assign(Object.assign({},Se),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},Ve={[Ne.MAINNET]:"ethereum",[Ne.RINKEBY]:"rinkeby",[Ne.GOERLI]:"goerli",[Ne.OPTIMISM]:"optimism",[Ne.CRONOS]:"cronos",[Ne.BOBA]:"boba",[Ne.BSC]:"bsc",[Ne.OKCHAIN]:"okex-chain",[Ne.HECO]:"heco",[Ne.POLYGON]:"polygon",[Ne.MOONRIVER]:"moonriver",[Ne.ARBITRUM_ONE]:"arbitrum",[Ne.ARBITRUM_RINKEBY]:"arb-rinkeby",[Ne.AURORA]:"aurora",[Ne.AVALANCHE]:"avalanche"},Me={[Ne.MAINNET]:"etherscan.io",[Ne.RINKEBY]:"rinkeby.etherscan.io",[Ne.GOERLI]:"goerli.etherscan.io",[Ne.OPTIMISM]:"optimistic.etherscan.io",[Ne.CRONOS]:"cronoscan.com",[Ne.BOBA]:"blockexplorer.boba.network",[Ne.BSC]:"bscscan.com",[Ne.OKCHAIN]:"www.oklink.com/okexchain",[Ne.HECO]:"hecoinfo.com",[Ne.POLYGON]:"polygonscan.com",[Ne.MOONRIVER]:"moonriver.moonscan.io",[Ne.ARBITRUM_ONE]:"arbiscan.io",[Ne.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[Ne.AURORA]:"aurorascan.dev",[Ne.AVALANCHE]:"snowtrace.io"};function Ue(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}function Oe(e,t,a,n){return new(a||(a=Promise))((function(o,d){function l(e){try{r(n.next(e))}catch(e){d(e)}}function i(e){try{r(n.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(l,i)}r((n=n.apply(e,t||[])).next())}))}const ve={colorMode:"dark",slippage:3..toString(),ddl:20};var Ie=(e=ve,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const De={chainId:Ne.MAINNET,latestBlockNumber:0};var Ye=(e=De,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const Ce={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var He,Xe=(e=Ce,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const a=e.accountBalances;return Object.keys(a).map((e=>{a[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:a});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(He||(He={}));const Be={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:He.Initial};const Ae={settings:ve,wallet:De,globals:Be,token:Ce},ze=_({reducer:q({settings:Ie,wallet:Ye,token:Xe,globals:(e=Be,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e}),middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:Ae}),je=e=>(null!=e?e:ze.getState()).wallet.chainId,Je=e=>(null!=e?e:ze.getState()).wallet.latestBlockNumber,Le=e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),Ge=e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})}));var Pe=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],Qe={[Ne.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[Ne.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[Ne.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[Ne.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[Ne.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[Ne.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[Ne.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[Ne.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[Ne.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[Ne.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[Ne.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[Ne.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[Ne.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[Ne.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[Ne.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};function _e(e,t,...a){return Oe(this,void 0,void 0,(function*(){const n=[];for(const e of a)for(const t of e)t.callData&&n.push(t.callData);const o=yield function(e,t,a){return Oe(this,void 0,void 0,(function*(){const n=yield qe(e,t,a),o=new Map;for(const{req:e,resp:t}of n)o.set(e,t);return e.map((e=>({req:e,resp:o.get(e)})))}))}(n,e,t),d=new Map;for(const{req:e,resp:t}of o)d.set(e,null==t?void 0:t.result);return a.map((e=>e.filter((e=>!e.callData||d.get(e.callData))).map(((e,t)=>e.processor(e.callData?d.get(e.callData):null,t)))))}))}function qe(e,t,a){return Oe(this,void 0,void 0,(function*(){let n=[e];e.length>800&&(n=o(e,800));let d=[];const l=n.map((e=>Oe(this,void 0,void 0,(function*(){const n=e.map((e=>[e.to,e.data])),o={data:t.interface.encodeFunctionData("aggregate",[n]),to:a};let l;try{l=yield t.provider.call(o)}catch(n){const o=e.length;if(o>20){const n=Math.floor(o/2),[l,i]=yield Promise.all([qe(e.slice(0,n),t,a),qe(e.slice(n,o),t,a)]);d=[...d,...l,...i]}else{const e="[sendCallReqs] error";console.error(e,n)}}if(void 0===l)throw new Error("Unexpected batch result");const[i,r]=ee.decode(["uint256","bytes[]"],l);if(e.length!==r.length)throw new Error("Unexpected length mismatch");return r.map(((t,a)=>({resp:{result:t},req:e[a]})))}))));return(yield Promise.allSettled(l)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{d=[...d,...e]})),d}))}function Ke(e,t,a,n){if(!function(e){try{return g(e)}catch(e){return!1}}(e)||e===$)throw Error(`Invalid 'address' parameter '${e}'.`);return new K(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(a,n))}function $e(){const{provider:e,account:t,chainId:a}=G(),[n,o]=y(!1),d=k((()=>Qe[a]),[a]),l=T(((a,n)=>{if(e)return Ke(a,n,e,t)}),[e,t]),i=T((e=>{if(!d)return;const{MULTI_CALL:t}=d,a=l(t,Pe);return(()=>Oe(this,void 0,void 0,(function*(){if(a){o(!0);try{const[n]=yield _e(a,t,e);return n}catch(e){console.error("Contract: useMultiContract is error",e)}o(!1)}})))()}),[d,l]);return{getContract:l,contractConfig:d,call:i,loading:n}}var et=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function tt(){const{provider:e,account:t}=G(),n=w(),o=V(Je);F((()=>{(()=>{Oe(this,void 0,void 0,(function*(){if(!e||!t)return;const o=yield e.getBalance(t);n((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new a(o.toString()).div(1e18)))}))})()}),[e,t,n,o])}function at(){const{provider:e,chainId:t}=G(),a=w(),n=T((()=>Oe(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();a((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(n))}))),[e,t]);return{updateBlockNumber:n}}var nt,ot,dt;function lt(e){return Number.parseInt(e,16)}!function(e){e.All="all",e.Default="default",e.Coingecko="coingecko"}(nt||(nt={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(ot||(ot={}));class it extends le{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:lt(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:lt(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return Oe(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},a]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:a})}catch(e){throw this.actions.resetState(),e}}))}}function rt([e,t]){return[e,t]}function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ct.apply(this,arguments)}var st,pt;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},mt.apply(this,arguments)}var ht;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(ht||(ht={}));const bt={[ht.METAMASK]:{name:"MetaMask",type:ht.METAMASK,icon:function(e){return x.createElement("svg",ct({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),dt||(dt=x.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},x.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),x.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),x.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),x.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),x.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),x.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),x.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),x.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),x.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),x.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),x.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),x.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),x.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),x.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),x.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),x.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),x.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),x.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),x.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},x.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),x.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),x.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),x.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),x.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),x.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),x.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),x.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),x.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),x.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),x.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),x.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[ht.WALLET_CONNECT]:{name:"WalletConnect",type:ht.WALLET_CONNECT,icon:function(e){return x.createElement("svg",mt({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),st||(st=x.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},x.createElement("stop",{offset:0,stopColor:"#5d9df6"}),x.createElement("stop",{offset:1,stopColor:"#006fff"}))),pt||(pt=x.createElement("g",{fill:"none",fillRule:"evenodd"},x.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),x.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},ut={};function Rt({provider:e,jsonRpcUrlMap:t,defaultChainId:a}){const n=console.error,o=k((()=>function(e,t){if(t){if(de.isProvider(t))return rt(P((e=>new it(e,t))));if(de.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return rt(P((a=>new ae({actions:a,provider:t,onError:e}))))}}(n,e)),[n,e]),d=k((()=>function(e){return rt(P((t=>new oe({actions:t,onError:e}))))}(n)),[n]),l=k((()=>t?Object.assign(Object.assign({},Ze),t):Ze),[t]),i=k((()=>function(e,t,a,n){return rt(P((o=>new ne({actions:o,options:{rpc:t,qrcode:e},onError:n,defaultChainId:a}))))}(!0,l,a,n)),[l,a,n]);return o&&(ut[ht.INTEGRATOR]=o),ut[ht.METAMASK]=d,ut[ht.WALLET_CONNECT]=i,Object.values(ut)}function Wt(){const{chainId:e}=G(),t=V(je);return k((()=>e||t||1),[e,t])}var Et;function ft(){const e=Wt(),[t,a]=y(Et.Initial),[n,o]=y(re([])),d=T((()=>Oe(this,void 0,void 0,(function*(){try{a(Et.Loading);const t=(e=>({[Ne.ARBITRUM_ONE]:"https://tokens.coingecko.com/arbitrum-one/all.json",[Ne.AURORA]:"https://tokens.coingecko.com/aurora/all.json",[Ne.BSC]:"https://tokens.coingecko.com/binance-smart-chain/all.json"}[e]||"https://tokens.coingecko.com/uniswap/all.json"))(e),n=yield ie.get(t);n&&n.data&&n.data.tokens&&o(re(n.data.tokens)),a(Et.Success)}catch(e){a(Et.Failed),console.error(e)}}))),[e]);return F((()=>{e&&d()}),[e]),{cgTokenList:n,loading:t===Et.Loading,refetch:d}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(Et||(Et={}));var gt=[{chainId:1,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:1,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1,address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/xZmadzpVOnpuq2jNG_5EGKeqMET0LU_gmfnp4VxkcxI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSHQwWXZKMGNnU0lGTFM0aHExTV9jOXVITV9fMHpXaHBKSGVOQU5neTBuby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkoxYzJSZk4ySTJOalJpWWpReVpDOWlkWE5rWHpkaU5qWTBZbUkwTW1RdWNHNW4ucG5n.webp"},{chainId:1,address:"0x6b175474e89094c44da98b954eedeac495271d0f",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/h2lbKBfBJ2LNSTNCuwjsBkshT4eXzDDmAV0lhWS0llA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUnVJNWt2eHBwalI4TTZsenFZZVAyTTB4eVFMUGJ0S1hONDdWVTN1dUszZy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpBNU5qUmpPVFUxT1M1d2JtYy5wbmc.webp"},{chainId:1,address:"0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:1,address:"0xdac17f958d2ee523a2206206994597c13d831ec7",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/mI69kq-S-tNT1W57qYizPd5r2WNFzpAq5y6NhOcrTkY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVEZhSVNLVVZIWThLTVhyTkVmZDRXRUJmMGJoSHRweHY3Q1hDT0dKbGY2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT0dVeFpEaG1PVEEyWlM1d2JtYy5wbmc.webp"},{chainId:4,address:"0x99cf6999fc481663fb10be55827f3584e3c25f3c",name:"LINE",decimals:18,symbol:"LINE",logoURI:""},{chainId:4,address:"0xeaa70c2a40820dF9D38149C84dd943CFcB562587",name:"DODO",decimals:18,symbol:"DODO",logoURI:""},{chainId:4,address:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:""},{chainId:4,address:"0xab0733588776B8881F7712f6AbCa98F510e6B63D",name:"USDC",decimals:6,symbol:"USDC",logoURI:""},{chainId:4,address:"0x0aDCBAE18580120667f7Ff6c6451A426B13c67B7",name:"USDT Token",decimals:6,symbol:"USDT",logoURI:""},{chainId:4,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:""},{chainId:5,symbol:"USDC",address:"0xC4106029d03c33731Ca01Ba59b5A6368c660E596",name:"USDC",decimals:6,logoURI:""},{chainId:5,symbol:"USDT",address:"0xed8a325D87D3b6edED04FB992A1482231647EE5e",name:"USDT Token",decimals:6,logoURI:""},{chainId:5,symbol:"WETH",address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",name:"Wrapped Ether",decimals:18,logoURI:""},{chainId:5,symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,logoURI:""},{chainId:56,address:"0xe9e7cea3dedca5984780bafc599bd69add087d56",name:"BUSD Token",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/BvxyffA5gsLB4bLmlOVkfu7AVami78-VcW_6_i8I6kc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vbC1Sa25meFB3ZXlCOGVYSWJ2b04wdHczLTlzckZOckxfRHdTTnRLSHVRRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZlluVnpaRjgyTXpsbFlqZzNZV0V4WDJKMWMyUmZOak01WldJNE4yRmhNVjlsT1dVMVlXRTBOemxtTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0x55d398326f99059ff775485246999027b3197955",name:"Tether USD",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/QOl7CvP_WSmTUOMthbxQsNKjDj0s5kSjup69dW_-UeA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTjdQU3RXV2ZGaGNTVzM1QlE2TEJIaF9keVROUEJqa1RLTXRwTll5cEhSWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZmRYTmtkRjh4TlRZME1XWmpaRFF3WDNWelpIUmZNVFUyTkRGbVkyUTBNRjlqWmpJMVpUYzVZVE5qTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:56,address:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",name:"BTCB Token",decimals:18,symbol:"BTCB",logoURI:"https://cmp.dodoex.io/fZG0z_RZ1U73_LuuC3RGrrZvNR-bgrCUjkwvaro-PCY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZ1NXN0RuYWNkMnc2YWxSQnFmcENqTHNDZWJhc2VtQTc0dDJlTEdDZjhfNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpJNVlXRmpZamxoTVM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3",name:"Dai Token",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/bhz9Vtma8hPb_-GnhwqQkhfTQ5PwKcR1Qbzn7aBKlfs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZW04OHB4YXNDdEg0Nl9BcjhVandzZWR2SFBFUUtjVWVkc0FmV2lvenB2Yy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWVRoaFptSmxaRFppWkM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:56,address:"0x2170ed0880ac9a755fd29b2688956bd959f933f8",name:"Ethereum Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:56,address:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",name:"Binance-Peg USD Coin",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:56,address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",name:"Wrapped BNB",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/-Pua5rc9k9iW4yuF5ajLVKzMkRhBq06D8HiEZ5gjezA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDZOWTdBTmdOYWdFOHpXYUMtX2IzYXVPOUxsTEp6QlpLTUR3VlM5eW9DQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT1dRellXTmtZMlEzTnk1d2JtYy5wbmc.webp"},{chainId:128,address:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f",name:"Wrapped HT",decimals:18,symbol:"WHT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x0298c2b32eae4da002a15f36fdf7615bea3da047",name:"Heco-Peg HUSD Token",decimals:8,symbol:"HUSD",logoURI:"https://cmp.dodoex.io/LiOyD0GGt0t4bk4xz3RWAxvqFPyYCqfM4z0AqneT3xM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVXRWWnNCVUxTREZNR002SUM0OGI0VV9UV05oYUU4MzFkdnh1Y1hkLTE2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTkRjM09WODFZbU0yWVdFek9EUTRMbkJ1WncucG5n.webp"},{chainId:128,address:"0x3d760a45d0887dfd89a2f5385a236b29cb46ed2a",name:"Heco-Peg DAIHECO Token",decimals:18,symbol:"DAI-HECO",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:128,address:"0x64ff637fb478863b7468bc97d30a5bf3a428a1fd",name:"Heco-Peg ETH Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:128,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"HT",decimals:18,symbol:"HT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x9362bbef4b8313a8aa9f0c9808b80577aa26b73b",name:"Heco-Peg USDCHECO Token",decimals:6,symbol:"USDC-HECO",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:128,address:"0xa71edc38d189767582c38a3145b5873052c3e47a",name:"Heco-Peg USDTHECO Token",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:137,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MATIC",decimals:18,symbol:"MATIC",logoURI:"https://cmp.dodoex.io/cQFrEB6yGIqMkh_6Pie8VR3kIStL58IS-y8FbroHVwA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2VNUUk2dkpoaXljeldrczJaWWdGdk8zSEoxSWFIa053LXZYeXFneER4US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekZmTWpkbE56TXlNRE13TWk4eFh6STNaVGN6TWpBek1ESXVjRzVuLnBuZw.webp"},{chainId:137,address:"0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/KEPetVp3nQkB6BZ_cb05trEfBbGxFEg92UnF8NZsEzM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE5wTlRseEJGbFRDalM1ZFh3SWJ3Mm1hZ3NPUFFkZ3Z1UEhuZDZrNWdyMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk4yUTBaamxtTldOaU15OUVUMFJQWHpka05HWTVaalZqWWpNdWNHNW4ucG5n.webp"},{chainId:137,address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/hdRkGay_hj0t1OzN5C3c30cmch26tJhHUSroffg7ciY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOHd3UndQOG9DTTdBcF9NOW11bGVOQWRqYjhBOXpvX2FYUE5pVTNBYUtzYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhnMlgwSXhOelUwTnpSZlJUZzVNRGswWDBNME5GOUVZVGs0WWprMU5GOUZaV1JsWDBGRFh6UTVOVEkzTVdRd1gwWmZiRzluYjE4MFpXSXdNVE0zTVRZeExuQnVady5wbmc.webp"},{chainId:137,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:137,address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/er3iAGv39hCC7F8AydW_AteD3hnZj9HI2XcAaruHeqA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE9WUWtzN3JQWU5OZWdmNTRuNC1Za1NGTFYyLXVGZmlJRFVYem85aVMzOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlFUQmlPRFk1T1RGak5qSXhPR0l6Tm1NeFpERTVYMFEwWVRKbE9WOUZZakJqWDBVek5qQTJaVjlDTkRoZmJHOW5iMTlpTmpGbE5EVmtNbVF6TG5CdVp3LnBuZw.webp"},{chainId:137,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/WeK6L9_RjWUfAsnMuOAdyXIZVE3JK_H3lZU5vk2m7Tg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTFJ0aEt6X2VrSXdmTEh6NnAycW5rSkRFeUk1RXZrODlXQ0J2VW43MUJLNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoa1gwRkRYekUzWDBZNU5UaGZSREpsWlRVeU0yRXlNakEyTWpBMk9UazBOVGszWDBNeE0xOUVPRE14WldNM1gyeHZaMjlmWXpCbU9XVTFaamxoTmk1d2JtYy5wbmc.webp"},{chainId:137,address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/_KjvB9pCVqbIIv_UnQvRWpjySBHiFnuHNSXUm_52UZM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDQ4OVYzTW1NMi1qaFJueEQ2Y3MyY1gydXdGS2tkRHpiRGZsbkZhTTJxOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhneU1qWXdYMFpCUTE4MVgwVTFOVFF5WVRjM00xOUJZVFEwWmw5Q1gwTm1aVjlFWmpkZlF6RTVNMkpqTWw5RE5UazVYMnh2WjI5Zk5HTmpORE0zTlRneFppNXdibWMucG5n.webp"},{chainId:137,address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",name:"Wrapped MATIC",decimals:18,symbol:"WMATIC",logoURI:"https://cmp.dodoex.io/HfZVSaAES3QRplSybW2uoKmYf6pVTRaxufn95_Qto_A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMERhZEZTUUVFX0d4YlBoMHY3Wk1Hb1FwaWtOQm1vaWFyZTFlaFdJbU44dy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjFoZEdsalgyVmlOekZtTkdFMU9XRXZiV0YwYVdOZlpXSTNNV1kwWVRVNVlTNTNaV0p3LndlYnA.webp"},{chainId:42161,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:42161,address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/6VmZGvbENd4TM1VK0rsYrfznRtG-GwxP-zCy2qyc9bM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWnJZUDB0ZHVTLUdDNE5FTThmRmV1RHhVWklPNUZpWnpqdkdBc0lfNlBQMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh5TW1GbU4yVTVOVFJpTDFkRlZFaGZhV052Ymw4eU1tRm1OMlU1TlRSaUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:42161,address:"0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/6U51l5aajoRrCaO6cpbrclQ2olWNDzuShggOCfoktCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8va3RkSlhwQ3dsQVZtZXNPb1dvQV95SG9IazBnV3UxUExienBKa1AxYnlJdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5tTmtPVEV4WXprNE15OUVUMFJQWHpaalpEa3hNV001T0RNdWNHNW4ucG5n.webp"},{chainId:42161,address:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",name:"USD Coin (Arb1)",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:42161,address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1285,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MOVR",decimals:18,symbol:"MOVR",logoURI:"https://cmp.dodoex.io/Clhd0YhBfsWh48Ej4taGHcJ7dfKiCbtdMgyhNU7QAJg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZlBFT3c5LVdpQWhDVDJteGRmQ2gtb2hnQU1aaXBvWnllUl9TcVNpa3R4NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMemt5T0RWZk4yWTVNREF5T1dNMU1pODVNamcxWHpkbU9UQXdNamxqTlRJdWQyVmljQS53ZWJw.webp"},{chainId:1285,address:"0x98878b06940ae243284ca214f92bb71a2b032b8a",name:"Wrapped MOVR",decimals:18,symbol:"WMOVR",logoURI:"https://cmp.dodoex.io/oXW0_VSLU29rbyQK3LtaHymbMfdv6F_ri20EeyMVBEU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDVYMDFLd21zZXFRNFB6SGxJdEdvN3dveHVaUkFVbmQ5bDhCNU5VQ2N6by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMGhmVG1OdmRWOUlNSGhmTkRBd2VEUXdNRjlrTlRBNFpHSmxNVE0yTDBoZlRtTnZkVjlJTUhoZk5EQXdlRFF3TUY5a05UQTRaR0psTVRNMkxtcHdady5qcGc.webp"},{chainId:1285,address:"0x5D9ab5522c64E1F6ef5e3627ECCc093f56167818",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/SKu1xTvsm3q0RZC9CdiGw0zkq9k1P2ygK4TMenBYNC8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQVMtWEpUX3pncF9MSlFxdFJiaE1Fd3lTZlNBMWp0MUhHbUFGYV9QQUdTdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWRYTmtYems0TjJNd1lUUmtNRGt1YW5Cbi5qcGc.webp"},{chainId:1285,address:"0x80A16016cC4A2E6a2CACA8a4a498b1699fF0f844",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0xE9460BD2FFB12b668fA32919C785C239f974D37C",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/onw4bpUWC5-GPBwFMHLE3BcRaQ1S_hqlUxW-8H3l5g0/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTi1ITXhGVWtxUU9fR3cxRFl1empZblgwejFzQ1pIMG1nMWRlOG5Qdmk2NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zll6SXdZVEl4WTJFNU5pOUVUMFJQWDJNeU1HRXlNV05oT1RZdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xB44a9B6905aF7c801311e8F4E76932ee959c663C",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/LyxjB8w94UjDhRuXa9xNlg7YcMuOC6akWBPCtgbq_Qw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vLXNSOWJzZTlrLTFIY1VUeUE3WE9KZWplQkRRS2ZtSFpRV2I3RE1iemlHMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkhSZk1UVTJOREZtWTJRME1DOTFjMlIwWHpFMU5qUXhabU5rTkRBdWMzWm4uc3Zn.webp"},{chainId:1285,address:"0x2bF9b864cdc97b08B6D79ad4663e71B8aB65c45c",name:"WBNB Token",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/HSdBZz6OV3HFUq1RqW8hdavA1cfhjWEfqP12BINZppw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUTAzVVlDM3hSN0J2SHo5UmgtcHZ0WWctRGdPNlF1b2xKUmE0QjBHaWlmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWJtSmZNalE0TmpZeFpHTXhaaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8",name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/6qiR9e_WPVs0u8U4DgdGMcaKFzJzypJqME5wUNe7XsY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMUMxeHZaUVJ4b0NlTW1sNXg0eUMzTGcySmhNXzYwcHpMMlk3elBwSGJFQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMnh2WjI5Zk4ySXpNMlU0TW1WbFlTOXNiMmR2WHpkaU16TmxPREpsWldFdWNHNW4ucG5n.webp"},{chainId:1285,address:"0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:66,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"OKT",decimals:18,symbol:"OKT",logoURI:"https://cmp.dodoex.io/pcltGNcIp7DP33nj3YxxBpuFEekNcOW3pwq9tjSrpY4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTzJHSDJYTndRancwbXMzQXNidG5xNzRkVEROVld3QWFOU1dXU2ZnU01QTS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTVOalF5T1RCZk1qQXlNakExTWpBd056STNORFl3TWpJdWMzWm4uc3Zn.webp"},{chainId:66,address:"0x382bB369d343125BfB2117af9c149795C6C65C50",name:"USDT",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:66,address:"0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:66,address:"0x54e4622DC504176b3BB432dCCAf504569699a7fF",name:"BTCK",decimals:18,symbol:"BTCK",logoURI:"https://cmp.dodoex.io/L3kcNUKg94qnX8OPFlEvHKqWybnJD8SA9HTne3PW-Rg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vNU1MQTB3Q3V6eEs4Q3ZMV0RqempuOVhzalBTWE1zbUpWZ0RRN1RPMG9FWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpVUTB0Zk1HWmlaRGRsTWpnNU5pOUNWRU5MWHpCbVltUTNaVEk0T1RZdWNHNW4ucG5n.webp"},{chainId:66,address:"0x332730a4F6E03D9C55829435f10360E13cfA41Ff",name:"BUSD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:66,address:"0x21cDE7E32a6CAF4742d00d44B07279e7596d26B9",name:"DAIK",decimals:18,symbol:"DAIK",logoURI:"https://cmp.dodoex.io/LOb-sXupURNN9HA0zBSfLfpZlx52N9qRSDUyzk3cg0A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vck5pZzMtWU5TOUl4T3ZHX19taTFRSU9WYTZsczdZNXViRVhGcTJJVGplby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJCU1V0Zk5ESTVNV1l4WlRoa1pTOUVRVWxMWHpReU9URm1NV1U0WkdVdWNHNW4ucG5n.webp"},{chainId:66,address:"0xEF71CA2EE68F45B9Ad6F72fbdb33d707b872315C",name:"ETHK",decimals:18,symbol:"ETHK",logoURI:"https://cmp.dodoex.io/IwBclhMMQLOo79RdRo6-HnUiXxshO_hSi02YK3L6MFI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcFBSd192aEx2MHh3WkRHU2k3eGYyYVJiQjlocVhfU2tacUdGc3RJR0pYRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFZVU0V0Zk1UQTVNamMzTW1VMU9DOUZWRWhMWHpFd09USTNOekpsTlRndWNHNW4ucG5n.webp"},{chainId:66,address:"0xc946DAf81b08146B1C7A8Da2A851Ddf2B3EAaf85",name:"USDC",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0xdCAC52E001f5bd413aa6ea83956438F29098166b",name:"USDK",decimals:18,symbol:"USDK",logoURI:"https://cmp.dodoex.io/X-_D75ZOpI-yC70WjdgC8wiqcssfRIALEv0eUfD3HiE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vd290dHEzaWdkTDVzQlhSR2VFZkhQLTNpZHhDZzV0V3VGQmE3YjNrNUZITS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkV0Zk56aGpZekV6TW1OaVpDOVZVMFJMWHpjNFkyTXhNekpqWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0x506f731F7656e2FB34b587B912808f2a7aB640BD",name:"WBTCK",decimals:18,symbol:"WBTCK",logoURI:"https://cmp.dodoex.io/7Gb1gYkvjWESf9ungWe4YKOrr5GY5UILmTwU_U95kCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOTQ4NWZpU2NmUzBNc2V1YVZXWXo2Z1RuNVVidXJvZkxmN1VGSWhMdndjTS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOTFgyVXlZamRpWVRJNU16TXZWMEpVUTB0ZlpUSmlOMkpoTWprek15NXdibWMucG5n.webp"},{chainId:288,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:288,address:"0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:288,address:"0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b",name:"Binance",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:288,address:"0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7",name:"Boba Token",decimals:18,symbol:"BOBA",logoURI:"https://cmp.dodoex.io/p7--p24wKrXpF7IGh6Q_RT6J0ZGS2_FURnXxeyMDvO4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQlVsWE9GWS1wUTIxbTJJOTdIRFN2VHlvMzR2MGJWQllYU1ByczFwaWNuYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpQUWtGZk16SmtZamczT1dJMk1TOUNUMEpCWHpNeVpHSTROemxpTmpFdWNHNW4ucG5n.webp"},{chainId:288,address:"0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:288,address:"0x572c5B5BF34f75FB62c39b9BFE9A75bb0bb47984",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/8CGANX_wy00isVg8PgA_A-IKbfIn55Yu9ZujzUukXlQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDJhLVNEOFJvWDlGaW9IUVNzSkh2WkZzNlBpbVlNTWxTZGhZalJmMXVVQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk1tRm1NMll4WkRZd055OUVUMFJQWHpKaFpqTm1NV1EyTURjdWNHNW4ucG5n.webp"},{chainId:288,address:"0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:288,address:"0xdc0486f8bf31DF57a952bcd3c1d3e166e3d9eC8b",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:288,address:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:1313161554,address:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79",name:"Aurora",decimals:18,symbol:"Aurora",logoURI:"https://cmp.dodoex.io/2C2jfpO2-VYuwlga3SdtP5I6eJNJXIYq3LvPU4aFuiU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcHFWVWlJOEQ4VU5iUEZYRElvUnA3cFhEZFc4dmx4dWEtTmxubmxlam1PMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkYxY205eVlWOHlOVEprWlRFeE56YzBMMkYxY205eVlWOHlOVEprWlRFeE56YzBMbmRsWW5BLndlYnA.webp"},{chainId:1313161554,address:"0xe3520349F477A5F6EB06107066048508498A291b",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1313161554,address:"0xe301eD8C7630C9678c39E4E45193D1e7Dfb914f7",name:"DODO Bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/SEcMDWMmtHb3GFW5l7fTKYurpTqALHdZI3D6qzad1rs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQXRNMzllUjhRQzhYTl8tem5HU0pSLS1lV0tPUW91V3p2ci0zQ014WlJTSS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekl3TUhneU1EQmZNVjh3WWpReFl6VTJZV1UxTHpJd01IZ3lNREJmTVY4d1lqUXhZelUyWVdVMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x4988a896b1227218e4A686fdE5EabdcAbd91571f",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1313161554,address:"0xF4eB217Ba2454613b15dBdea6e5f22276410e89e",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Avalanche",decimals:18,symbol:"AVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",name:"Wrapped AVAX",decimals:18,symbol:"WAVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98",name:"Binance USD",decimals:18,symbol:"BUSD.e",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",name:"Dai Stablecoin",decimals:18,symbol:"DAI.e",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:43114,address:"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",name:"USD Coin",decimals:6,symbol:"USDC.e",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xc7198437980c041c805A1EDcbA50c1Ce5db95118",name:"Tether USD",decimals:6,symbol:"USDT.e ",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:43114,address:"0x50b7545627a5162F82A992c33b87aDc75187B218",name:"Wrapped BTC",decimals:8,symbol:"WBTC.e",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",name:"Wrapped Ether",decimals:18,symbol:"WETH.e",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:25,address:"0x66e428c3f67a68878562e79A0234c1F83c208770",name:"USDT",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/p_nSk7MW-bCcwp-tgtWC8az4e4Q0YMirg6rv6yVjC-I/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vODVNVlpTTllrTFlySWdlX2VQemNVOUpydkNKeFpDM2JhaGV0NnN5S0d5WS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTJPREl3TWpoZk1qQXlNakExTVRjd016STVNakV6TURjdWQyVmljQS53ZWJw.webp"},{chainId:25,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"CRO",decimals:1,symbol:"CRO",logoURI:"https://cmp.dodoex.io/HYsQIOyyuC6P1Ik_Rs5a6ws2CKMzJbajJewE77C0rf8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZzc2UURUMEIwbHJjc3VTSTlodTZTTnlqMEp3WWNtUEFRWV9qWDV0VVBhMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6YzRNRGc0TkRkZk1qQXlNakExTVRjd056UXdNekExTWpFdWNHNW4ucG5n.webp"},{chainId:10,address:"0x4200000000000000000000000000000000000006",name:"WETH",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/f9SbZq39ynUZS5ueKvAwzLmKUfcZvYpKDaysT3dkcvM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2NkVzJUWjladmRiX3BVSjZ3b2YzeHRvYk94YUw3bEV5RmhhemhJUFhlMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RXdNamd3TkRaZk1qQXlNakEwTWpJd01UQXpORGc1TURVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"DAI",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/04gwZiu2K_9fdb2zLwzsX1nONCbBWrZOvTyOoEFhx3g/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaDJCcmdhUmZxUzBLZDBEOVpZbEUteEtNMVdzeFFtRzBEWVpKOGJCaWN4US9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6SXlNRFUwTVRsZk1qQXlNakEwTWpJd01UQTBNak00TlRVdWFuQm4uanBn.webp"},{chainId:10,address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",name:"USDC",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/XbtxsPIscM6p5ClHbLO0JumFHA9U23eON8-MDh-Plkg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaG1nM3hRa1BUTUtkcUNFVnd0LXU4S2lwTW5od1JCdGhLYWxENW9vSWlTZy9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6UXlNRFEyTkRaZk1qQXlNakEwTWpJd01UQTFNekF4TmpVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/bcyoORJ04NyP1HhYUZ9RrTZ-MEOFeNnMcrr__JZ6Ruw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vV1lHaU9IVFVnVWs4Q3Z3WmNyN0hWX2w4SlNrQjRVQUh1UXpzaWd4U3Nmay9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6VTVPREk0T1Y4eU1ESXlNRFF5TWpBeU1qTTBNelk0TlM1d2JtYy5wbmc.webp"}];function xt({tokenList:e,popularTokenList:t}){const n=w(),[o,i]=y([]),{account:r}=G(),c=Wt(),{cgTokenList:s}=ft(),p=V(Je),m=k((()=>(null==gt?void 0:gt.filter((e=>e.chainId===c)))||[]),[gt,c]),h=k((()=>(null==t?void 0:t.filter((e=>e.chainId===c)))||[]),[t,c]);!function({tokenList:e,addresses:t,blockNumber:n}){const{account:o}=G(),d=w(),l=k((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,JSON.stringify(t)]),{getContract:i,contractConfig:r,call:c}=$e(),[s,p]=y(),m=k((()=>{if(!o||!l.length||!r)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=r,n=i(t,et);if(!n)return;let c={};const s=l.map((d=>(c[d]=!0,{callData:{data:n.interface.encodeFunctionData("isERC20",[d,o,e]),to:t},processor:e=>{const t=new te(et).decodeFunctionResult("isERC20",e),{balance:n,isOk:o}=t,l=parseInt(t.decimals),i=new a(10).pow(l),r=new a(t.allownance.toString()).div(i);return o?{address:d,decimals:l,symbol:t.symbol,name:t.name,balance:new a(n.toString()).div(i),allowance:r}:{address:d,balance:new a(0),allowance:new a(0)}}})));return d(Ge(c)),s}),[o,i,JSON.stringify(l)]);F((()=>{(()=>{Oe(this,void 0,void 0,(function*(){if(!m)return;const e=yield c(m),t={};e&&(e.forEach((e=>{e.address.toLocaleLowerCase()!=="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLocaleLowerCase()&&(t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance})})),d(Le(t))),p(e);let a={};l.forEach((e=>{a[e]=!1})),d(Ge(a))}))})()}),[m,n])}({addresses:k((()=>{const e=o.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[o,t]),blockNumber:p}),F((()=>{(()=>{Oe(this,void 0,void 0,(function*(){let t=[];if(d(e))t=e;else if(e===nt.Coingecko||e===nt.All){const e=m.concat(s.toArray());t=l(h,e,(e=>e.address.toLowerCase()))}else t=l(h,m,(e=>e.address.toLowerCase()));const a=c,o=t.filter((e=>e.chainId===a));i(o),n((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(o))}))})()}),[e,n,c,s,h,m]),F((()=>{n(Le({}))}),[r,c]),F((()=>{n((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(h))}),[h,n])}const yt=e=>(null!=e?e:ze.getState()).token.tokenList,kt=(e,t)=>(null!=t?t:ze.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)),Tt=e=>(null!=e?e:ze.getState()).token.accountBalances,Ft=e=>(null!=e?e:ze.getState()).token.ethBalance||new a(NaN),Nt=e=>(null!=e?e:ze.getState()).token.defaultFromToken,Zt=e=>(null!=e?e:ze.getState()).token.defaultToToken,St=e=>(null!=e?e:ze.getState()).token.balanceLoadings;function wt(){const{account:e,chainId:t}=G(),a=V(Tt),n=V(Ft),o=k((()=>we[t||1]),[t]),d=T((t=>{var d;if(!e)return null;if(t.symbol===o.symbol&&Te(t.address,o.address))return!n||(null==n?void 0:n.isNaN())?null:n;const l=null===(d=a[t.address.toLocaleLowerCase()])||void 0===d?void 0:d.tokenBalances;return!l||(null==l?void 0:l.isNaN())?null:l}),[a,n,e]);return d}var Vt;function Mt(e,t,a,n=0){if(a&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return Vt.fully+n;const o=e.indexOf(t);return 0===o?Vt.prefix+n:o>0?Vt.other+n:Vt.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(Vt||(Vt={}));function Ut({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:d}){const[l,i]=y(""),r=V(yt),c=Wt(),s=wt(),p=V((e=>kt(c,e))),m=k((()=>(null==gt?void 0:gt.filter((e=>e.chainId===c)))||[]),[gt,c]),h=k((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),b=k((()=>d?new Set(d.map((e=>e.toLowerCase()))):void 0),[d]),u=T((e=>e.filter((e=>{if(e.chainId!==c)return!1;let t=!0;return t=b?b.has(e.address.toLowerCase()):!h.has(e.address.toLowerCase()),t}))),[b,c,h]),R=T((t=>{if(null===t)return null;const o=[];l?t.forEach((e=>{const t=((e,t,{matchAddress:a}={})=>{if(!t)return 0;const n=t.toLocaleLowerCase();let o=0;a&&e.address.toLocaleLowerCase()===n&&(o=1),o||(o=Mt(e.symbol.toLocaleLowerCase(),n,!1,1));if(o)e.name.toLocaleLowerCase()===n&&(o=Vt.fully+1);else{let t=Mt(e.name.toLocaleLowerCase(),n,!1,10);t=t===Vt.fully+10?Vt.fully+1:t,o=t}return o})(e,l,{matchAddress:!0});t&&o.push({sort:t,token:e})})):t.forEach((e=>{o.push({sort:0,token:e})}));const d=[];return o.sort(((t,o)=>{const d=t.token,l=o.token;if(e){if(d.address===e.address)return-1;if(l.address===e.address)return 1}if(null==n?void 0:n.includes(d.address))return-1;if(null==n?void 0:n.includes(l.address))return 1;const i=s&&s(d)||new a(0),r=s&&s(l)||new a(0);if(!i.eq(r))return i.gt(r)?-1:1;if(t.sort!==o.sort)return t.sort>o.sort?1:-1;const c=p.map((e=>e.address));if(null==c?void 0:c.includes(d.address))return-1;if(null==c?void 0:c.includes(l.address))return 1;const h=m.map((e=>e.address));return(null==h?void 0:h.includes(d.address))?-1:(null==h?void 0:h.includes(l.address))?1:d.symbol.localeCompare(l.symbol)})).some((e=>!!(l&&d.length>21)||(d.push(e.token),!1))),d}),[l,s,n,e,p,m]),W=T((e=>{const a=e.address.toLowerCase();t(e,!!(null==n?void 0:n.some((e=>e.toLowerCase()===a))))}),[t,n]),E=k((()=>{const e=u(r);return R(e)||[]}),[r,u,R]);return{filter:l,setFilter:i,showTokenList:E,onSelectToken:W}}function Ot({width:e=24,height:t=24,marginRight:a=8,url:n,zIndex:o,cross:d,address:l,token:i,sx:c}){const[s,p]=y(!1),[m,h]=y(""),[b,u]=y(""),[R,W]=y(!1),E=T((()=>p(!0)),[]);let f=function(e){const t=V(yt),{chainId:a}=G();return k((()=>{if(!e)return;let n=t.find((({address:t,chainId:n})=>n===a&&t===e));return n||(n=t.find((({address:t})=>t===e))),n}),[e,t,a])}(l);i&&(f=i);const g=l||(null==f?void 0:f.address),x=null==f?void 0:f.symbol,N=null==x?void 0:x.charAt(0).toUpperCase(),Z=k((()=>{const e=null==f?void 0:f.logoURI;return n||e||""}),[n,f]);return F((()=>{W(!1)}),[g,Z]),F((()=>{d&&(Z?function(e,t){const a=new XMLHttpRequest;let n;a.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(a.response)},a.onerror=function(){t()};try{n=new URL(e)}catch(e){}finally{a.open("GET",n||e),a.responseType="blob",a.send()}}(Z,(e=>{h(e)})):h(""))}),[Z,d]),F((()=>{try{let t=g;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const a=new L(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();u(`data:image/svg+xml;base64,${a}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[g,e]),ce(r,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:a,zIndex:o},c||{}),style:{width:e,height:t},children:[!s&&se(r,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:N}),se(r,{component:"img",src:!(d?m:Z)||R?b:d?m:Z,onLoad:E,onError:e=>{const t=e.target;g&&b&&W(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function vt({token:t,onClick:a}){var n,o;const d=c();return ce(r,{component:s,sx:{display:"flex",alignItems:"center",color:d.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{a&&a(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?ce(pe,{children:[se(Ot,{url:null==t?void 0:t.logoURI,address:null!==(n=null==t?void 0:t.address)&&void 0!==n?n:"",marginRight:6}),se(r,{children:null!==(o=null==t?void 0:t.symbol)&&void 0!==o?o:"-"})]}):se(e,{id:"SELECT TOKEN"}),se(r,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:U})]})}function It({onClick:t,balance:a,decimals:n,address:o,showMaxBtn:d}){const{palette:l}=c();return ce(r,{sx:{display:"flex",typography:"body2",color:l.text.secondary},children:[se(e,{id:"Balance:"})," ",o?ge({input:a,decimals:Math.min(n||4,4)}):"-",d&&a&&a.gt(0)&&se(r,{component:s,sx:{ml:6,color:(null==a?void 0:a.gt(0))?l.primary.main:l.text.disabled,cursor:o&&t?"pointer":"unset"},onClick:()=>t&&t(a?a.toString():""),children:se(e,{id:"Max"})})]})}function Dt({readOnly:e,sx:t,value:a,decimals:n,onChange:o,suffix:d,withClear:l,onFocus:i,placeholder:m}){const h=c(),b=k((()=>d||(l&&a&&o?se(r,{component:s,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{o&&o("")},children:se(r,{component:O,sx:{width:12,color:"text.primary"}})}):void 0)),[o,d,h.palette.text.primary,a,l]);return ce(r,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[se(p,{fullWidth:!0,value:a,readOnly:e,placeholder:m||"0.00",onFocus:i,onChange:e=>{const t=e.target.value,a=0===t.length?"":ke(t,n);o&&o(a)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&a&&b]})}function Yt({open:e,onClose:t,afterClose:a,title:n,rightSlot:o,canBack:d=!0,children:l,height:i,testId:c}){return ce(r,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:i},"data-testid":c,"data-active":e?"1":"0",children:[n?ce(r,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[se(r,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&d&&se(r,{component:O,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>a&&a()),300)}})]}):"",l]})}const Ct=e=>(null!=e?e:ze.getState()).globals;function Ht({token:e,disabled:t,onClick:a}){return ce(r,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||a()},children:[se(Ot,{token:e}),e.symbol]})}function Xt({token:e,disabled:t,style:n,onClick:o}){const d=c(),l=wt(),{account:i}=G(),s=l(e),p=s?fe({input:s}):"";return ce(r,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:n,onClick:()=>{t||o()},"data-testid":"token-picker-item",children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(Ot,{token:e}),ce(r,{children:[se(r,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),i&&se(r,{sx:{mt:4,textAlign:"left"},children:new a(p).gte(0)?p:se(r,{component:v,width:18,sx:{"& path":{fill:d.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})]}),se(r,{sx:{color:"text.secondary",textAlign:"right"},children:e.name})]})}function Bt({value:e,onChange:t,occupiedAddrs:a,hiddenAddrs:n,showAddrs:o,visible:d}){const l=Wt(),i=V((e=>kt(l,e))),{showTokenList:c,filter:s,setFilter:p,onSelectToken:h}=Ut({value:e,onChange:t,occupiedAddrs:a,hiddenAddrs:n,showAddrs:o}),b=N(null),[u,R]=y(0);F((()=>{d&&b.current&&R(b.current.offsetHeight-34)}),[b,d]);const W=T((({key:t,index:a,style:n})=>{const o=!!(null==i?void 0:i.length);if(0===a&&o)return se(r,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:i.map((t=>se(Ht,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>h(t)},t.address)))},t);const d=c[o?a-1:a];return se(Xt,{token:d,disabled:!!e&&e.address===d.address,style:n,onClick:()=>h(d)},t)}),[c,i,e]),E=T((e=>{if(0===e&&(null==i?void 0:i.length)){return 74+51*Math.floor(i.length/3)}return 52}),[i]);return ce(r,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[se(m,{fullWidth:!0,height:48,value:s,onChange:e=>p(e.target.value),clearValue:()=>p(""),placeholder:me._("Enter the token symbol or address")}),se(r,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:b,children:se(he,{height:u,itemCount:c.length+((null==i?void 0:i.length)?1:0),itemSize:E,width:"100%",className:"token-list",children:W},i.length)})]})}function At({open:t,value:a,onClose:n,occupiedAddrs:o,onTokenChange:d}){const{height:l}=V(Ct);return se(Yt,{height:l,open:t,onClose:n,title:se(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:se(Bt,{value:a,visible:t,onChange:d,occupiedAddrs:o})})}function zt({sx:e,amt:t,token:a,readOnly:n,showMaxBtn:o,onMaxClick:d,fiatPriceTxt:l,occupiedAddrs:i,onInputFocus:s,onTokenClick:p,onInputChange:m,onTokenChange:h}){const b=c(),u=wt(),[R,W]=y(!1),E=a?u(a):null;return ce(r,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:b.palette.background.input},e),children:[ce(r,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[se(vt,{token:a,onClick:()=>W(!0)}),se(It,{balance:E,onClick:d,showMaxBtn:o,address:null==a?void 0:a.address,decimals:null==a?void 0:a.decimals})]}),se(Dt,{value:t,onFocus:s,onChange:m,readOnly:n,withClear:!0}),se(r,{sx:{mt:4,typography:"body2",color:b.palette.text.secondary},children:l}),se(At,{value:a,open:R,occupiedAddrs:i,onClose:()=>{W(!1),p&&p()},onTokenChange:(e,t)=>{W(!1),setTimeout((()=>h(e,t)),300)}})]})}const jt={"en-US":be,"zh-CN":ue,pseudo:be};function Jt({locale:e,children:a}){return F((()=>{(()=>{Oe(this,void 0,void 0,(function*(){yield function(e="en-US"){return Oe(this,void 0,void 0,(function*(){me.loadLocaleData(e,{plurals:()=>jt[e]});try{const t=yield import(`./locales/${e}.js`);me.load(e,t.messages||t.default.messages)}catch(e){}me.activate(e)}))}(e)}))})()}),[e]),se(t,{i18n:me,children:a})}var Lt,Gt,Pt;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Lt||(Lt={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(Gt||(Gt={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(Pt||(Pt={}));var Qt,_t=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(Qt||(Qt={}));const qt=(e,t)=>Oe(void 0,void 0,void 0,(function*(){const{value:a,from:n,to:o,data:d}=e,l={from:n,to:o,value:a,data:d};a&&!/^0x0*$/.test(a)||delete l.value;try{return(yield t.estimateGas(l)).add(5e4)}catch(e){t.call(l).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),Kt=(e,t)=>Oe(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(me._("Transaction rejected.")):e}}));var $t,ea;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}($t||($t={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(ea||(ea={}));const ta=new a(2).pow(256).minus(1),aa=e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function na({onTxFail:e,onTxSubmit:t,onTxSuccess:n}={}){const{account:o,provider:d}=G(),l=Wt(),[i,r]=y(!1),[c,s]=y(new Map),p=w(),[m,h]=y(null),[b,u]=y(""),[R,W]=y(null),[E,f]=y(!1),[g,x]=y(),{updateBlockNumber:F}=at(),N=T(((i,c,m,b=!1,R,E,g,y)=>Oe(this,void 0,void 0,(function*(){if(u(""),h(""),!o||!d)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let k,T,N;x((()=>g)),r(!1);try{if(r(!0),c.opcode===$t.Approval)N=yield((e,t,n,o,d,l)=>Oe(void 0,void 0,void 0,(function*(){const i=Ke(e,_t,d,l).interface.encodeFunctionData("approve",[n,o.toFixed()]),r={from:t,to:e,data:i,value:`0x${new a("0").toString(16)}`,gasLimit:void 0},c=yield qt(r,d);return c&&(r.gasLimit=c),yield Kt(r,d)})))(c.token.address,o,c.contract,c.amt||ta,d,o),k=N.hash,u(k);else{if(c.opcode!==$t.TX)throw new Error(`Op ${c.opcode} not implemented!`);if(""===c.to)throw new Error("Submission: malformed to");if(0===c.data.length)throw new Error("Submission: malformed data");if(0===c.data.indexOf("0x")&&c.data.length<=2)throw new Error("Submission: malformed data");if(T={value:c.value,data:c.data,to:c.to,gasLimit:c.gasLimit,from:o,chainId:l},!T.gasLimit)try{const e=yield qt(T,d);e&&(T.gasLimit=e)}catch(e){console.debug(e)}if(N=yield Kt(T,d),k=N.hash,u(k),!k)throw new Error(`Unexpected tx: ${k}`)}}catch(t){if(r(!1),W({spec:c,brief:i,subtitle:m}),console.error(t),t.message){p(aa({contractStatus:He.Failed}));const a={error:t.message,brief:i};E&&Object.assign(a,E),e&&e(t,E),h(function(e,t){var a;const n=null===(a=we[e])||void 0===a?void 0:a.symbol,o=[{error:"insufficient",msg:me._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:n})},{error:["External Swap execution Failed","Return amount is not enough"],msg:me._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:me._("SafeERC20: low-level call failed. Please contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:me._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:me._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:me._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:me._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:me._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:me._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:me._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:me._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:me._("Service update, please wait and try again")}];let d="";return o.some((e=>Array.isArray(e.error)?e.error.some((a=>t.indexOf(a)>-1&&(d=e.msg,!0))):t.indexOf(e.error)>-1&&(d=e.msg,!0))),d||t}(l,t.message))}return Gt.Failed}W({spec:c,brief:i,subtitle:m}),f(!1),r(!1);const Z=Object.assign(Object.assign(Object.assign(Object.assign({brief:i},c),T),{tx:k,subtitle:m}),E);p(aa({contractStatus:He.Pending})),t&&t(k,Z),R&&R();const S={brief:i,spec:c,tx:k,subtitle:m};if(s((e=>e.set(k,[S,Lt.Running]))),b)return Gt.Submitted;if(R&&R(),null==N?void 0:N.wait){const e=yield N.wait(1);if(f(!0),e.status===Pt.Success)return"TX"===Z.opcode&&p(aa({contractStatus:He.TxSuccess})),"APPROVAL"===Z.opcode&&p(aa({contractStatus:He.ApproveSuccess})),y&&y(k),n&&n(k,Z),yield F(),s((e=>e.set(k,[S,Lt.Success]))),Gt.Success}return yield F(),f(!0),s((e=>e.set(k,[S,Lt.Failed]))),Gt.Failed}))),[o,l,r,d,F]),Z=k((()=>({execute:N,requests:c,setShowing:W,waitingSubmit:i})),[N,c,W]),S=T((()=>{W(null),g&&(g(),x(void 0))}),[g]);return{showing:R,showingDone:E,transactionTx:b,errorMessage:m,setErrorMessage:h,closeShowing:S,ctxVal:Z,requests:c}}function oa(){const{requests:e}=la(),t=[];return null==e||e.forEach((function([e,a]){a===Lt.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const da=S({execute:()=>Promise.resolve(Gt.Canceled),requests:void 0,waitingSubmit:!1});function la(){return Z(da)}var ia;function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ra.apply(this,arguments)}var ca=function(e){return x.createElement("svg",ra({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),ia||(ia=x.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},x.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},x.createElement("g",{transform:"translate(18.000000, 291.000000)"},x.createElement("g",{transform:"translate(40.000000, 83.000000)"},x.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function sa({showingDone:e,errorMessage:t}){return se(r,t?{component:I,sx:{width:64,height:64,color:"error.main"}}:e?{component:D,sx:{width:64,height:64,color:"success.main"}}:{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:se(r,{component:ca,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function pa({showingDone:e,showing:t}){return ce(r,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[se(r,{sx:{mt:60},children:e?me._("{0} confirmed",{0:null==t?void 0:t.brief}):me._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?se(r,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function ma({isStarted:t,isEnded:a,tx:n}){const[o,d]=y(0),{chainId:l}=G(),i=k((()=>`https://${Me[l||1]}/tx/${n}`),[n,l]),c=k((()=>{const e=Math.floor(o/60),t=o%60;return e?`${e}m ${t}s`:`${t}s`}),[o]),s=N();return F((()=>(t&&(d(0),clearInterval(s.current),s.current=setInterval((()=>{d((e=>e+1))}),1e3)),()=>{clearInterval(s.current)})),[t]),F((()=>{clearInterval(s.current)}),[a]),ce(r,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[ce(r,{children:[se(e,{id:"Transaction Time:"}),c]}),ce(b,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:i,target:"_blank",rel:"noopener noreferrer",children:[se(e,{id:"Tx"}),se(r,{component:Y,sx:{width:16,height:16,ml:6}})]})]})}function ha(t){var{children:a}=t,n=Ue(t,["children"]);const{ctxVal:o,showing:d,closeShowing:l,showingDone:i,errorMessage:c,transactionTx:s}=na(n),p=w();return ce(da.Provider,{value:o,children:[a,se(Yt,{open:!!d,onClose:l,children:ce(r,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[ce(r,{children:[se(r,{sx:{textAlign:"center",pt:60},children:se(sa,{showingDone:i,errorMessage:c})}),c?ce(r,{sx:{textAlign:"center",mt:60},children:[se(r,{children:se(e,{id:"Something went wrong."})}),se(r,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:c})]}):ce(pe,{children:[se(pa,{showingDone:i,showing:d}),se(ma,{isStarted:!!d,isEnded:i,tx:s})]})]}),se(h,{fullWidth:!0,size:h.Size.big,onClick:()=>{p(aa({contractStatus:He.Initial})),l()},sx:{mt:20},children:se(e,c?{id:"Dismiss"}:{id:"Close"})})]})})]})}function ba({token:e,fiatPrice:t}){return{marginAmount:k((()=>{var o;const d=null!==(o=null==e?void 0:e.decimals)&&void 0!==o?o:6,l=((e,t,a)=>{const o=new n(e).times(new n(10).pow(t));return a?o:o.dp(0)})(null!=t?new a(500).div(t):new a(0),d);return(l.lt(new a(1).times(new a(10).pow(d-3)))?new a(0):l).toString(10)}),[null==e?void 0:e.decimals,t])}}function ua({width:e,height:t,feeRate:a,rebateTo:n,colorMode:o,apikey:d,defaultChainId:l,defaultToToken:i,defaultFromToken:r}){const c=w();F((()=>{o&&c((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(o))}),[o]),F((()=>{var e;l&&c((e=l,t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[l]),F((()=>{c(aa({height:t}))}),[t]),F((()=>{c(aa({width:e}))}),[e]),F((()=>{d&&c(aa({apikey:d}))}),[d]),F((()=>{a&&c(aa({feeRate:a}))}),[a]),F((()=>{n&&c(aa({rebateTo:n}))}),[n]),F((()=>{r&&c((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(r))}),[r]),F((()=>{i&&c((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(i))}),[i])}function Ra({refetch:e,interval:t}){let a;F((()=>(e(),clearTimeout(a),a=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(a))),[e])}function Wa({fromToken:e,toToken:t,chainId:a}){const[n,o]=y(!1),[d,l]=y(""),[i,r]=y(""),c=T((()=>{if(!a||!e||!t)return;o(!0);const n=[e,t];ie.post("https://api.dodoex.io/price-api/api/v1/price/current/batch",{networks:n.map((()=>(e=>Ve[e]||Ve[Ne.MAINNET])(a))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},{headers:{apikey:"dodofrontend777888ofopensource"}}).then((a=>{var n;o(!1);const d=null===(n=a.data)||void 0===n?void 0:n.data;d&&(l(d.find((t=>t.address===e.address)).price),r(d.find((e=>e.address===t.address)).price))})).catch((e=>{o(!1),console.error(e)}))}),[a,e,t]);return Ra({refetch:c}),{loading:n,refetch:c,toFiatPrice:i,fromFiatPrice:d}}const Ea=e=>(null!=e?e:ze.getState()).settings.slippage,fa=e=>(null!=e?e:ze.getState()).settings.ddl;var ga;function xa({toToken:e,fromToken:t,fromAmount:a,toAmount:n,marginAmount:o}){const{account:d,chainId:l,provider:i}=G(),r=V(je),c=k((()=>l||r),[l,r]),s=V(Ea)||3,p=V(fa)||20,{feeRate:m,rebateTo:h,apikey:b,isReverseRouting:u}=V(Ct),R=k((()=>Math.floor(Date.now()/1e3)+60*p),[p]),[W,E]=y(ga.Initial),[f,g]=y(null),[x,F]=y(""),[N,Z]=y(null),[S,w]=y(null),[M,U]=y(null),[O,v]=y(Re.from(0)),[I,D]=y(null),[Y,C]=y(null),[H,X]=y(""),[B,A]=y(""),[z,j]=y(""),[J,L]=y(0),P=T((()=>Oe(this,void 0,void 0,(function*(){if(!c||!t||!e)return;if(!u&&!a)return;if(u&&!n)return;E(ga.Loading);const o={chainId:c,deadLine:R,apikey:b,slippage:s,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:d||"0x0000000000000000000000000000000000000000"};u?o.toAmount=We(String(n||1),e.decimals).toString():o.fromAmount=We(String(a||1),t.decimals).toString(),h&&m&&(o.rebateTo=h,o.fee=m);try{const e=(yield ie.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:o})).data.data;if((null==e?void 0:e.resAmount)?(E(ga.Success),g(e.resAmount),U(e.priceImpact),D(e.resPricePerFromToken),C(e.resPricePerToToken),Z(e.baseFeeAmount),w(e.additionalFeeAmount),X(e.to),A(e.data),F(e.value),j(e.useSource),L(e.duration)):E(ga.Failed),!d||!i)return;const t=yield qt({from:d,to:e.to,value:e.value,data:e.data},i);t&&v(t)}catch(e){E(ga.Failed),console.error(e)}}))),[R,d,c,e,m,s,h,t,i,a,n,b,u]);Ra({refetch:P});const Q=k((()=>{const e=u?n:a;return W!==ga.Loading&&e?f:null}),[W,u,n,a,f]),_=function(){const{chainId:e,account:t}=G(),a=la();return T((({to:e,data:n,useSource:o,duration:d,ddl:l,gasLimit:i,subtitle:r,value:c})=>{const s=60*l,p=c;o&&"weth"!==o.toLowerCase()&&i&&i.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const m={from:t,to:e,data:n,value:p,route:o,duration:d,ddlSecRel:s,gasLimit:i};a.execute(me._("Swap"),Object.assign({opcode:$t.TX},m),r)}),[t,e])}(),q=T((e=>{t&&(u?f:a)&&_({to:H,data:B,useSource:z,duration:J,ddl:p,value:x,subtitle:e})}),[H,p,B,J,z,t,a,O,f,x,u]);return{status:W,refetch:P,priceImpact:M,executeSwap:q,baseFeeAmount:N,resAmount:Q,additionalFeeAmount:S,resPricePerToToken:Y,resPricePerFromToken:I}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(ga||(ga={}));function ya(e){xt(e),tt(),at();const{provider:t,connector:a}=G();F((()=>{const t=e.defaultChainId||1;(null==a?void 0:a.connectEagerly)?a.connectEagerly(t):a.activate(t)}),[a]),F((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const n=e.width||375,o=e.height||494;return ua(Object.assign(Object.assign({},e),{width:n,height:o})),se(r,{sx:{width:n,height:o,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:se(ha,{...e,children:e.children})})}function ka(e){const t=u({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),a=k((()=>e.defaultChainId||1),[e.defaultChainId]),n=Rt({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:a}),o=`${n.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${a}`;return se(M,{store:ze,children:se(Jt,{locale:e.locale,children:se(R,{theme:t,children:ce(Q,{connectors:n,children:[se(W,{container:".dodo-widget-container"}),se(ya,{...e})]},o)})})})}function Ta(e){const{width:t}=V(Ct),a=k((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return se(E,{container:document.querySelector(".dodo-widget-container"),maxWidth:a,...e})}function Fa({onClick:e}){const t=c();return se(b,{sx:{width:"100%",position:"relative"},onClick:e,children:se(r,{component:s,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:se(r,{component:C,sx:{width:18,color:"text.secondary"}})})})}function Na({open:t,execute:n,onClose:o,toToken:d,fromToken:l,fromAmount:i,toAmount:p,priceImpact:m,clearFromAmt:b,clearToAmt:u,baseFeeAmount:R,curToFiatPrice:W,curFromFiatPrice:E,pricePerFromToken:f,additionalFeeAmount:g}){var x,T;const N=c(),Z=V(Ea),S=w(),{contractStatus:M}=V(Ct),O=k((()=>new a(m).gt(15)),[m]),[v,I]=y(!1),[D,Y]=y(!1);return F((()=>{M!==He.Pending&&o(),M===He.TxSuccess&&(u(),b())}),[M]),F((()=>{I(!1)}),[W]),se(Yt,{open:t,onClose:()=>{S(aa({contractStatus:He.Initial})),o()},title:se(e,{id:"Swap summary"}),children:ce(r,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${N.palette.border.main}`},children:[ce(r,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${N.palette.border.main}`},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[ce(r,{children:[ce(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[se(Ot,{width:16,height:16,url:null==l?void 0:l.logoURI,address:null!==(x=null==l?void 0:l.address)&&void 0!==x?x:"",marginRight:6}),se(r,{children:`${ge({input:i,decimals:null==l?void 0:l.decimals})} ${null==l?void 0:l.symbol}`})]}),se(r,{sx:{mt:4,typography:"h6",color:N.palette.text.secondary},children:E?`$${fe({input:E,showDecimals:1})}`:"-"})]}),se(r,{sx:{width:16,mx:16},component:H}),ce(r,{children:[ce(r,{sx:{display:"flex"},children:[se(Ot,{width:16,height:16,marginRight:6,url:null==d?void 0:d.logoURI,address:null!==(T=null==d?void 0:d.address)&&void 0!==T?T:""}),se(r,{children:`${ge({input:p,decimals:null==d?void 0:d.decimals})} ${null==d?void 0:d.symbol}`})]}),se(r,{sx:{typography:"h6",mt:4,color:N.palette.text.secondary},children:W?`$${fe({input:W,showDecimals:1})}(${m}%)`:"-"})]})]}),se(r,{sx:{mt:12,typography:"h6"},children:`1 ${null==l?void 0:l.symbol} = ${ge({input:new a(p).dividedBy(new a(i)),decimals:null==d?void 0:d.decimals})} ${null==d?void 0:d.symbol}`})]}),ce(r,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${N.palette.border.main}`},children:[ce(r,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:N.palette.text.secondary},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(r,{sx:{width:16,mr:7},component:X}),se(e,{id:"Swap Detail"})]}),se(r,{component:s,children:se(r,{onClick:()=>Y(!D),sx:{width:10,color:"text.secondary",transform:D?"rotateX(0deg)":"rotateX(180deg)"},component:U})})]}),ce(r,{sx:{mt:16,display:D?"initial":"none"},children:[ce(r,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(e,{id:"Basic Fee"}),se(Ta,{title:se(e,{id:"Estimated service provider fees"}),ml:5})]}),se(r,{children:`${ge({input:R,decimals:null==d?void 0:d.decimals})} ${null==d?void 0:d.symbol}`})]}),ce(r,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(e,{id:"Additional Fee"}),se(Ta,{title:se(e,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),se(r,{children:`${ge({input:g,decimals:null==d?void 0:d.decimals})} ${null==d?void 0:d.symbol}`})]}),ce(r,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(e,{id:"Price Impact"}),se(Ta,{title:se(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),se(r,{children:`${m}%`})]}),ce(r,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(e,{id:"Slippage"}),se(Ta,{title:se(e,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),se(r,{children:Z})]})]})]}),se(r,{sx:{flex:1}}),O&&ce(r,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>I(!v),children:[se(r,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:se(r,v?{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:se(r,{component:B,sx:{width:14,color:"#1a1a1b"}})}:{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${N.palette.text.secondary}`}})}),se(r,{children:se(e,{components:{0:se(r,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:m},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),se(h,{isLoading:M==He.Pending,disabled:O&&!v,fullWidth:!0,onClick:()=>{n(),S(aa({contractStatus:He.Pending}))},children:M==He.Pending?se(e,{id:"Confirming"}):se(e,{id:"Confirm swap"})})]})})}function Za(e){var{sx:t,maxVal:a,decimals:o=2,onInputChange:d}=e,l=Ue(e,["sx","maxVal","decimals","onInputChange"]);return c(),se(p,{...l,onChange:e=>{const t=0===e.target.value.length?null:ke(e.target.value,o),l=a&&t&&new n(t).gt(a)?a.toString():t;console.log("finalVal:",l),d&&d(l)}})}function Sa({open:t,onClose:a}){const n=c(),o=w(),d=V(Ea),l=V(fa),i=k((()=>Number(d)>=50),[d]);return se(Yt,{open:t,onClose:a,title:se(e,{id:"Settings"}),children:ce(r,{sx:{mx:20},children:[ce(r,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[ce(r,{sx:{mb:16,display:"flex",alignItems:"center"},children:[se(e,{id:"Slippage Tolerance"}),se(Ta,{title:se(e,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),ce(r,{sx:{display:"flex",flexDirection:"column"},children:[se(Za,{fullWidth:!0,maxVal:100,value:d,placeholder:3..toString(),onInputChange:e=>{o((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:se(r,{sx:{color:"text.disabled"},children:"%"}),height:36}),i&&se(r,{sx:{typography:"h6",mt:6,color:"error.main"},children:se(e,{id:"Maximum slippage do not exceed 50%"})})]})]}),ce(r,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[ce(r,{sx:{mb:16,display:"flex",alignItems:"center"},children:[se(e,{id:"Transaction Deadline"}),se(Ta,{title:se(e,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),se(Za,{value:l,fullWidth:!0,height:36,placeholder:me._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{o((e=>t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function wa({toToken:t,fromToken:a,priceStatus:n,pricePerToToken:o,pricePerFromToken:d}){const[l,i]=y("-"),[c,p]=y(null),[m,h]=y("-"),[b,u]=y(null);F((()=>{i(null==a?void 0:a.symbol),h(null==t?void 0:t.symbol),p(o),u(d)}),[a,t,o,d]);const R=T((()=>{i(m),h(l),p(b),u(c)}),[l,c,m,b]);return se(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[ga.Initial]:"-",[ga.Loading]:ce(pe,{children:[se(f,{sx:{mr:5}}),se(e,{id:"Fetching best price..."})]}),[ga.Failed]:ce(pe,{children:[se(r,{component:A,sx:{width:15,mr:5,color:"warning.main"}}),se(e,{id:"Quote not available"})]}),[ga.Success]:ce(pe,{children:[se(r,{sx:{typography:"body2"},children:`1 ${l} = ${fe({input:b,showDecimals:4})} ${m}`}),se(r,{component:s,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:se(r,{sx:{width:16,color:"text.secondary"},onClick:R,component:z})})]})}[n]})}function Va({open:t,onClose:a}){const n=V(je);return se(Yt,{title:se(e,{id:"Connect to your wallet"}),open:t,onClose:a,children:se(r,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(bt).map((t=>ce(r,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,a){var n;const o=ut[e];if(!o)throw new Error(`Unknown wallet type: ${e}`);const[d]=o;null===(n=d.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?a(e):d.connectEagerly?d.connectEagerly(t):d.activate(t)}))}(t.type,n,(e=>{console.error(e)}))},children:[se(r,{component:t.icon,sx:{width:32,height:32}}),se(r,{sx:{mt:8,typography:"caption"},children:t.name}),se(r,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:se(e,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function Ma(){const{connector:t}=G(),[a,n]=y(!1);return ce(pe,{children:[se(h,{size:h.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),n(!0)},"data-testid":"connect-wallet-btn",children:se(e,{id:"Connect to a wallet"})}),se(Va,{open:a,onClose:()=>n(!1)})]})}const Ua=({account:e,chainId:t,offset:n,contractAddress:o})=>{var d;const l=V(je),i=k((()=>{var e;return Qe[null!==(e=t)&&void 0!==e?e:l]}),[t]),{isETH:r}=k((()=>Fe(t)),[t]),{DODO_APPROVE:c}=i||{},s=null!==(d=null!=o?o:c)&&void 0!==d?d:null,p=function(e){const{account:t}=G(),n=V(je),o=V(Tt),d=k((()=>we[n]),[n]),l=T((n=>{var l;if(!t||!e)return null;if(n.symbol===d.symbol&&Te(n.address,d.address))return new a(ta);const i=null===(l=null==o?void 0:o[n.address.toLowerCase()])||void 0===l?void 0:l.tokenAllowances;return null!=i?i:null}),[t,e,d.symbol,d.address,o]);return l}(s),m=wt(),{runningRequests:h}=oa(),b=V(St),u=k((()=>{var e;return null===(e=we[null!=t?t:l])||void 0===e?void 0:e.address}),[t]),R=T(((t,o,d)=>{if(!t)return ot.Loading;const l=!!(null==h?void 0:h.find((e=>e.spec.opcode===$t.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),i=null!=d?d:t?m(t):null,r=t?p(t):null,c=new a(null!=o?o:0);if(!e)return ot.Unchecked;if(!i||c.minus(null!=n?n:0).gt(i))return ot.Unchecked;if(c.isZero())return ot.Unchecked;return t.address===u?ot.Sufficient:l?ot.Approving:r&&c.minus(null!=n?n:0).gt(r)?ot.Insufficient:ot.Sufficient}),[m,p,e,n,s,t,b,h,u]),W=T((e=>{const t=e?p(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[p]),E=la(),f=w(),g=T(((t,n)=>Oe(void 0,void 0,void 0,(function*(){if(!s||!e||!t)return;const o=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),d=n?new a(0):void 0,l=n?me._("Reset"):me._("Approve");var i;(yield E.execute(`${l} ${o}`,{opcode:$t.Approval,token:t,contract:s,amt:d}))===Gt.Success&&f((i=null!=d?d:ta,e=>Oe(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:i})}))))}))),[s,e,t,E,f]),x=T((e=>{const t=new a(0);if(!e)return t.toString();const n=m(e);if(!n)return t.toString();let o=n;const d=r?.1:.02;return u===(null==e?void 0:e.address)&&(o=n.gt(d)?n.minus(d):t),o.toString()}),[t,m,r]);return{getApprovalState:R,getPendingRest:W,getMaxBalance:x,submitApprove:g}};function Oa(){var t,n;const o=c(),{isInflight:d}=oa(),{chainId:l,account:p}=G(),m=w(),{isReverseRouting:b}=V(Ct),u=V(je),R=V(Zt),W=V(Nt),{isETH:E}=k((()=>Fe(l)),[l]),g=k((()=>{var e;return null===(e=we[null!=l?l:u])||void 0===e?void 0:e.address}),[l]),[x,N]=y(""),[Z,S]=y(""),[M,U]=y(""),[O,v]=y(""),I=k((()=>i((e=>U(e)),1e3)),[]),D=k((()=>i((e=>v(e)),1e3)),[]),[Y,C]=y(null),[X,B]=y(null),[z,L]=y(!1),[P,Q]=y(!1),{toFiatPrice:_,fromFiatPrice:q}=Wa({chainId:l,toToken:X,fromToken:Y}),K=wt(),$=k((()=>Y?K(Y):null),[Y,K]);k((()=>X?K(X):null),[X,K]);const{getApprovalState:ee,submitApprove:te,getPendingRest:ae,getMaxBalance:ne}=Ua({account:p,chainId:l}),oe=k((()=>ae(b?X:Y)),[null==Y?void 0:Y.address,null==X?void 0:X.address,ae,b]),{marginAmount:de}=ba({token:b?X:Y,fiatPrice:b?_:q}),{resAmount:le,priceImpact:ie,executeSwap:re,baseFeeAmount:me,additionalFeeAmount:he,resPricePerToToken:be,resPricePerFromToken:ue,status:Re}=xa({toToken:X,fromToken:Y,marginAmount:de,fromAmount:M,toAmount:O}),We=T((e=>{const t=e.toString();N(t),I(t)}),[N,I]),Ee=T((e=>{const t=e.toString();S(t),D(t)}),[S,D]);F((()=>{l&&(B(null),C(null),b?Ee(""):We("")),W&&W.chainId===l&&(C(W),W.amount&&(m(aa({isReverseRouting:!1})),We(W.amount))),R&&R.chainId===l&&(B(R),R.amount&&W&&!W.amount&&(m(aa({isReverseRouting:!0})),Ee(R.amount)))}),[R,W,l,We,Ee]);const xe=T((()=>{We(""),Ee(""),C(X),B(Y)}),[C,X,B,Y,We,Ee]),ye=T((e=>b?Ee(ne(X)):We(ne(Y))),[We,Ee,ne,Y,X,b]),ke=k((()=>(100*Number(ie)).toFixed(2)),[ie]),Te=k((()=>{const e=b?le:M;return e&&q?new a(q).multipliedBy(e):null}),[q,M,b,le]),Ze=k((()=>{const e=b?O:le;return e&&_?new a(_).multipliedBy(e):null}),[_,O,b,le]),Se=k((()=>ce(r,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[se(Ta,{title:se(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),ce(r,{sx:{display:"flex"},children:[se(e,{id:"Current price impact"}),ce(r,{sx:{color:o.palette.error.main,ml:4},children:[ke,"%"]})]})]})),[ke]),Ve=k((()=>se(wa,{toToken:X,fromToken:Y,priceStatus:Re,pricePerToToken:be,pricePerFromToken:ue})),[X,Y,Re,be,ue]),Me=k((()=>!Ne[l||1]),[l]),Ue=k((()=>Re===ga.Loading?se(r,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:ce(pe,{children:[se(f,{sx:{mr:5}}),se(e,{id:"Fetching best price..."})]})}):Me?ce(pe,{children:[se(r,{component:A,sx:{mr:6,width:16,color:"warning.main"}}),se(e,{id:"Unsupported network - switch to trade"})]}):x&&new a(ke).gt(15)?Se:Ve),[Re,Ve,x,Se,ke,Me]),Oe=k((()=>b?new a(Z).gt(0)?ge({input:le,decimals:null==Y?void 0:Y.decimals}):"-":x),[x,Z,le,Y,b]),ve=k((()=>b?Z:new a(x).gt(0)?ge({input:le,decimals:null==X?void 0:X.decimals}):"-"),[x,Z,le,X,b]),Ie=k((()=>{const t=ee(Y,b?le||0:M),n=t===ot.Approving,o=t===ot.Insufficient&&!oe,l=E?.1:.02,i=g===(null==Y?void 0:Y.address),r=new a($||0);return p?d?se(h,{fullWidth:!0,isLoading:!0,disabled:!0,children:se(e,{id:"Transaction Pending"})}):Y&&X?o?se(h,{fullWidth:!0,disabled:n,onClick:()=>te(Y),children:se(e,n?{id:"Approving"}:{id:"Approve"})}):new a(b?O:M).gt(0)?Re===ga.Loading?se(h,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:se(e,{id:"Fetching Price..."})}):le&&Re!==ga.Failed?r.lt(b?le:M)||i&&r.lte(l)?se(h,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:se(e,{id:"Insufficient balance"})}):se(h,{fullWidth:!0,onClick:()=>L(!0),"data-testid":"swap-review-btn",children:se(e,{id:"Review Swap"})}):se(h,{fullWidth:!0,disabled:!0,children:se(e,{id:"Quote not available"})}):se(h,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:se(e,{id:"Enter an amount"})}):se(h,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:se(e,{id:"Select Tokens"})}):se(Ma,{})}),[E,p,O,M,X,le,Y,d,re,oe,te,Re,$,ee,g,b]),De=k((()=>Y&&X?ce(r,{sx:{display:"flex",alignItems:"center"},children:[se(Ot,{token:Y,sx:{width:16,height:16,mr:6}}),`${ge({input:b?le:M,decimals:null==Y?void 0:Y.decimals})} ${null==Y?void 0:Y.symbol}`,se(r,{component:H,sx:{width:12,height:12,mx:16}}),se(Ot,{token:X,sx:{width:16,height:16,mr:6}}),`${ge({input:b?O:le,decimals:null==X?void 0:X.decimals})} ${null==X?void 0:X.symbol}`]}):se(r,{})),[Y,X,M,O,le,b]);return ce(pe,{children:[ce(r,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[se(e,{id:"Swap"}),se(r,{component:s,children:se(r,{component:j,onClick:()=>Q(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),ce(r,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[ce(r,{children:[se(zt,{sx:{mb:4},token:Y,amt:Oe,onMaxClick:ye,onInputChange:We,onInputFocus:()=>{b&&We(""),m(aa({isReverseRouting:!1}))},showMaxBtn:!b&&!x,occupiedAddrs:[null!==(t=null==X?void 0:X.address)&&void 0!==t?t:""],fiatPriceTxt:Te?`$${fe({input:Te,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return xe();We(""),Ee(""),C(e)},readOnly:b}),se(Fa,{onClick:xe}),se(zt,{token:X,amt:ve,onInputChange:Ee,onInputFocus:()=>{b||Ee(""),m(aa({isReverseRouting:!0}))},occupiedAddrs:[null!==(n=null==Y?void 0:Y.address)&&void 0!==n?n:""],fiatPriceTxt:Ze?`$${fe({input:Ze,showDecimals:1})}(${ke}%)`:"-",onTokenChange:(e,t)=>{if(t)return xe();We(""),Ee(""),B(e)},readOnly:!b}),se(r,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:Ue})]}),Ie,ce(r,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:o.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[se(r,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:o.palette.text.disabled}},component:J}),se(e,{id:"Powered by DODO protocol"})]})]}),se(Na,{toToken:X,fromToken:Y,fromAmount:b?le:M,toAmount:b?O:le,open:z,baseFeeAmount:me,priceImpact:ke,additionalFeeAmount:he,curToFiatPrice:Ze,execute:()=>re(De),clearFromAmt:()=>We(""),clearToAmt:()=>Ee(""),curFromFiatPrice:Te,pricePerFromToken:ue,onClose:()=>L(!1)}),se(Sa,{open:P,onClose:()=>Q(!1)})]})}function va(e){return se(ka,{...e,children:se(Oa,{})})}function Ia(e){const t=document.getElementById("dodo-swap-widget");Ee(t).render(se(ka,{...e,children:se(Oa,{})}))}export{Ia as InitSwapWidget,va as SwapWidget};
|
package/dist/locales/en-US.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*eslint-disable*/
|
|
2
2
|
|
|
3
|
-
var enUS={messages:{"Additional Fee":"Additional Fee","Additional routing fees set by the Widget user":"Additional routing fees set by the Widget user","Approve":"Approve","Approving":"Approving","Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","Balance:":"Balance:","Basic Fee":"Basic Fee","Close":"Close","Confirm swap":"Confirm swap","Confirming":"Confirming","Connect to a wallet":"Connect to a wallet","Connect to your wallet":"Connect to your wallet","Connect to your {0} Wallet":["Connect to your ",["0"]," Wallet"],"Current price impact":"Current price impact","Dismiss":"Dismiss","Due to the market condition, market price and estimated price may have a slight difference":"Due to the market condition, market price and estimated price may have a slight difference","Enter an amount":"Enter an amount","Enter the token symbol or address":"Enter the token symbol or address","Estimated service provider fees":"Estimated service provider fees","Fetching Price...":"Fetching Price...","Fetching best price...":"Fetching best price...","ForceStop exception":"ForceStop exception","Gas price is too low, please adjust in your wallet and try again":"Gas price is too low, please adjust in your wallet and try again","High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","If your transaction time exceeds the deadline, your transaction will be rescinded.":"If your transaction time exceeds the deadline, your transaction will be rescinded.","Insufficient balance":"Insufficient balance","Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet":["Insufficient funds - Please retry after depositing more ",["EtherTokenSymbol"]," into your wallet"],"Max":"Max","Maximum slippage do not exceed 50%":"Maximum slippage do not exceed 50%","No ForceStop access":"No ForceStop access","Powered by DODO protocol":"Powered by DODO protocol","Price Impact":"Price Impact","Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.":"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.","Price impact reaches <0>{priceImpact}</0>%, accept the quote":["Price impact reaches <0>",["priceImpact"],"</0>%, accept the quote"],"Quote not available":"Quote not available","RPC node data exception":"RPC node data exception","Reset":"Reset","Review Swap":"Review Swap","SELECT TOKEN":"SELECT TOKEN","SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.":"SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.","Select Tokens":"Select Tokens","Select a token":"Select a token","Service update, please wait and try again":"Service update, please wait and try again","Settings":"Settings","Slippage":"Slippage","Slippage Tolerance":"Slippage Tolerance","Something went wrong.":"Something went wrong.","Swap":"Swap","Swap Detail":"Swap Detail","Swap summary":"Swap summary","This CP has been settled by other addrs":"This CP has been settled by other addrs","Transaction Deadline":"Transaction Deadline","Transaction Pending":"Transaction Pending","Transaction Time:":"Transaction Time:","Transaction rejected.":"Transaction rejected.","Tx":"Tx","Unable to SETTLE during the cooling-off period":"Unable to SETTLE during the cooling-off period","Unsupported network - switch to trade":"Unsupported network - switch to trade","User denied transaction signature.":"User denied transaction signature.","View on Etherscan":"View on Etherscan","Wallet incompatibility":"Wallet incompatibility","{0} confirmed":[["0"]," confirmed"],"{0} pending":[["0"]," pending"],"{DEFAULT_SWAP_DDL} minutes":[["DEFAULT_SWAP_DDL"]," minutes"]}};
|
|
3
|
+
var enUS={messages:{"Additional Fee":"Additional Fee","Additional routing fees set by the Widget user":"Additional routing fees set by the Widget user","Approve":"Approve","Approving":"Approving","Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","Balance:":"Balance:","Basic Fee":"Basic Fee","Close":"Close","Confirm swap":"Confirm swap","Confirming":"Confirming","Connect to a wallet":"Connect to a wallet","Connect to your wallet":"Connect to your wallet","Connect to your {0} Wallet":["Connect to your ",["0"]," Wallet"],"Current price impact":"Current price impact","Dismiss":"Dismiss","Due to the market condition, market price and estimated price may have a slight difference":"Due to the market condition, market price and estimated price may have a slight difference","Enter an amount":"Enter an amount","Enter the token symbol or address":"Enter the token symbol or address","Estimated service provider fees":"Estimated service provider fees","Fetching Price...":"Fetching Price...","Fetching best price...":"Fetching best price...","ForceStop exception":"ForceStop exception","Gas price is too low, please adjust in your wallet and try again":"Gas price is too low, please adjust in your wallet and try again","High slippage tolerance will increase the success rate of transaction, but might not get the best quote.":"High slippage tolerance will increase the success rate of transaction, but might not get the best quote.","If your transaction time exceeds the deadline, your transaction will be rescinded.":"If your transaction time exceeds the deadline, your transaction will be rescinded.","Insufficient balance":"Insufficient balance","Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet":["Insufficient funds - Please retry after depositing more ",["EtherTokenSymbol"]," into your wallet"],"Max":"Max","Maximum slippage do not exceed 50%":"Maximum slippage do not exceed 50%","No ForceStop access":"No ForceStop access","Powered by DODO protocol":"Powered by DODO protocol","Price Impact":"Price Impact","Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.":"Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.","Price impact reaches <0>{priceImpact}</0>%, accept the quote":["Price impact reaches <0>",["priceImpact"],"</0>%, accept the quote"],"Quote not available":"Quote not available","RPC node data exception":"RPC node data exception","Reset":"Reset","Review Swap":"Review Swap","SELECT TOKEN":"SELECT TOKEN","SafeERC20: low-level call failed. Please contact the DODO team.":"SafeERC20: low-level call failed. Please contact the DODO team.","SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.":"SafeERC20: low-level call failed. Please log a Zendesk support ticket or contact the DODO team.","Select Tokens":"Select Tokens","Select a token":"Select a token","Service update, please wait and try again":"Service update, please wait and try again","Settings":"Settings","Slippage":"Slippage","Slippage Tolerance":"Slippage Tolerance","Something went wrong.":"Something went wrong.","Swap":"Swap","Swap Detail":"Swap Detail","Swap summary":"Swap summary","This CP has been settled by other addrs":"This CP has been settled by other addrs","Transaction Deadline":"Transaction Deadline","Transaction Pending":"Transaction Pending","Transaction Time:":"Transaction Time:","Transaction rejected.":"Transaction rejected.","Tx":"Tx","Unable to SETTLE during the cooling-off period":"Unable to SETTLE during the cooling-off period","Unsupported network - switch to trade":"Unsupported network - switch to trade","User denied transaction signature.":"User denied transaction signature.","View on Etherscan":"View on Etherscan","Wallet incompatibility":"Wallet incompatibility","{0} confirmed":[["0"]," confirmed"],"{0} pending":[["0"]," pending"],"{DEFAULT_SWAP_DDL} minutes":[["DEFAULT_SWAP_DDL"]," minutes"]}};
|
|
4
4
|
|
|
5
5
|
export { enUS as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const transitionTime = 300;
|
|
2
3
|
export interface DialogProps {
|
|
3
4
|
open: boolean;
|
|
4
5
|
onClose?: () => void;
|
|
6
|
+
afterClose?: () => void;
|
|
5
7
|
title?: string | React.ReactNode;
|
|
6
8
|
rightSlot?: React.ReactNode;
|
|
7
9
|
canBack?: boolean;
|
|
@@ -9,4 +11,4 @@ export interface DialogProps {
|
|
|
9
11
|
height?: number | string;
|
|
10
12
|
testId?: string;
|
|
11
13
|
}
|
|
12
|
-
export default function Dialog({ open, onClose, title, rightSlot, canBack, children, height, testId, }: DialogProps): JSX.Element;
|
|
14
|
+
export default function Dialog({ open, onClose, afterClose, title, rightSlot, canBack, children, height, testId, }: DialogProps): JSX.Element;
|