@dodoex/widgets 2.2.0 → 2.2.2-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +3 -1
- 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/store/selectors/token.d.ts +1 -1
- 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 +3 -1
- 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/store/selectors/token.d.ts +1 -1
- package/dist/src/utils/address.d.ts +1 -0
- package/package.json +9 -10
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,debounce as r}from"lodash";import{Box as a,useTheme as s,BaseButton as l,Input as c,SearchInput as d,Button as u,HoverOpacity as p,createTheme as m,ThemeProvider as h,CssBaseline as f,QuestionTooltip as g,RotatingIcon as b}from"@dodoex/components";import{getAddress as y}from"@ethersproject/address";import*as v from"react";import{useState as x,useMemo as E,useCallback as w,useEffect as C,useRef as A,useContext as O,createContext as T}from"react";import{useDispatch as k,useSelector as I,Provider as R}from"react-redux";import{CaretUp as S,Error as L,ErrorWarn as D,DoneBorder as _,ArrowTopRightBorder as N,ArrowBack as B,DoubleRight as P,DetailBorder as F,Done as j,Warn as M,Switch as U,Setting as H,Dodo as W}from"@dodoex/icons";import $ from"identicon.js";import{useWeb3React as V,initializeConnector as z,Web3ReactProvider as K}from"@web3-react/core";import{configureStore as G}from"@reduxjs/toolkit";import{combineReducers as Y}from"redux";import{Contract as q}from"@ethersproject/contracts";import{AddressZero as X}from"@ethersproject/constants";import{defaultAbiCoder as Z,Interface as Q}from"@ethersproject/abi";import{EIP1193 as J}from"@web3-react/eip1193";import{WalletConnect as ee}from"@web3-react/walletconnect";import{MetaMask as te}from"@web3-react/metamask";import{JsonRpcProvider as ne}from"@ethersproject/providers";import{Connector as oe}from"@web3-react/types";import{jsxs as ie,jsx as re,Fragment as ae}from"react/jsx-runtime";import{i18n as se}from"@lingui/core";import{VariableSizeList as le}from"react-window";import{en as ce,zh as de}from"make-plural/plurals";import ue from"axios";import{BigNumber as pe,parseFixed as me}from"@ethersproject/bignumber";import{createRoot as he}from"react-dom/client";function fe({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 ge({input:e,decimals:t,showPrecisionDecimals:n=2,noGroupSeparator:i}){if(null==e)return"-";const r=new o(e);if(r.isNaN())return"-";return fe({input:r,showDecimals:void 0===t?0:t>6?6:t>4?4:t,showPrecisionDecimals:n,noGroupSeparator:i})}function be(e){if("number"==typeof e)return be(new o(e));if(e.isNaN())return"NaN";if(e.isNegative())return`-${be(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 ye=(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=be(n.precision(t,o.ROUND_DOWN))),e}return be(n)},ve=(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?ye(n,t):n},xe=(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 Ee=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 we;!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"}(we||(we={}));const Ce={[we.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[we.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[we.GOERLI]:["https://goerli.optimism.io/"],[we.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"],[we.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[we.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"],[we.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[we.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[we.AURORA]:["https://mainnet.aurora.dev/"],[we.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"],[we.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[we.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[we.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[we.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[we.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"]},Ae={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},Oe={[we.MAINNET]:Object.assign(Object.assign({},Ae),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[we.RINKEBY]:Object.assign(Object.assign({},Ae),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[we.GOERLI]:Object.assign(Object.assign({},Ae),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[we.OPTIMISM]:Object.assign(Object.assign({},Ae),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[we.CRONOS]:Object.assign(Object.assign({},Ae),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[we.BOBA]:Object.assign(Object.assign({},Ae),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[we.BSC]:Object.assign(Object.assign({},Ae),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[we.OKCHAIN]:Object.assign(Object.assign({},Ae),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[we.HECO]:Object.assign(Object.assign({},Ae),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[we.POLYGON]:Object.assign(Object.assign({},Ae),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[we.MOONRIVER]:Object.assign(Object.assign({},Ae),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[we.ARBITRUM_ONE]:Object.assign(Object.assign({},Ae),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[we.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},Ae),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[we.AURORA]:Object.assign(Object.assign({},Ae),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[we.AVALANCHE]:Object.assign(Object.assign({},Ae),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},Te={[we.MAINNET]:"ethereum",[we.RINKEBY]:"rinkeby",[we.GOERLI]:"goerli",[we.OPTIMISM]:"optimism",[we.CRONOS]:"cronos",[we.BOBA]:"boba",[we.BSC]:"bsc",[we.OKCHAIN]:"okex-chain",[we.HECO]:"heco",[we.POLYGON]:"polygon",[we.MOONRIVER]:"moonriver",[we.ARBITRUM_ONE]:"arbitrum",[we.ARBITRUM_RINKEBY]:"arb-rinkeby",[we.AURORA]:"aurora",[we.AVALANCHE]:"avalanche"},ke={[we.MAINNET]:"etherscan.io",[we.RINKEBY]:"rinkeby.etherscan.io",[we.GOERLI]:"goerli.etherscan.io",[we.OPTIMISM]:"optimistic.etherscan.io",[we.CRONOS]:"cronoscan.com",[we.BOBA]:"blockexplorer.boba.network",[we.BSC]:"bscscan.com",[we.OKCHAIN]:"www.oklink.com/okexchain",[we.HECO]:"hecoinfo.com",[we.POLYGON]:"polygonscan.com",[we.MOONRIVER]:"moonriver.moonscan.io",[we.ARBITRUM_ONE]:"arbiscan.io",[we.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[we.AURORA]:"aurorascan.dev",[we.AVALANCHE]:"snowtrace.io"};function Ie(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 Re(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 Se={colorMode:"dark",slippage:3..toString(),ddl:20};var Le=(e=Se,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:we.MAINNET,latestBlockNumber:0};var _e=(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 Ne={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var Be,Pe=(e=Ne,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"}(Be||(Be={}));const Fe={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:Be.Initial};const je={settings:Se,wallet:De,globals:Fe,token:Ne},Me=G({reducer:Y({settings:Le,wallet:_e,token:Pe,globals:(e=Fe,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:je}),Ue=e=>(null!=e?e:Me.getState()).wallet.chainId,He=e=>(null!=e?e:Me.getState()).wallet.latestBlockNumber,We=e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),$e=e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})}));var Ve=[{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"}],ze={[we.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[we.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[we.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[we.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[we.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[we.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[we.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[we.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[we.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[we.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[we.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[we.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[we.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[we.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[we.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};function Ke(e,t,...n){return Re(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 Re(this,void 0,void 0,(function*(){const o=yield Ge(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 Ge(e,t,n){return Re(this,void 0,void 0,(function*(){let o=[e];e.length>800&&(o=i(e,800));let r=[];const a=o.map((e=>Re(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([Ge(e.slice(0,o),t,n),Ge(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]=Z.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 Ye(e,t,n,o){if(!function(e){try{return y(e)}catch(e){return!1}}(e)||e===X)throw Error(`Invalid 'address' parameter '${e}'.`);return new q(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(n,o))}function qe(){const{provider:e,account:t,chainId:n}=V(),[o,i]=x(!1),r=E((()=>ze[n]),[n]),a=w(((n,o)=>{if(e)return Ye(n,o,e,t)}),[e,t]),s=w((e=>{if(!r)return;const{MULTI_CALL:t}=r,n=a(t,Ve);return(()=>Re(this,void 0,void 0,(function*(){if(n){i(!0);try{const[o]=yield Ke(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 Xe=[{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 Ze(){const{provider:e,account:t}=V(),o=k(),i=I(He);C((()=>{(()=>{Re(this,void 0,void 0,(function*(){if(!e||!t)return;const i=yield e.getBalance(t);o((e=>t=>Re(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 Qe(){const{provider:e,chainId:t}=V(),n=k();C((()=>{const o=e=>{n((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(e))};return(()=>{Re(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 Je(e){return Number.parseInt(e,16)}class et extends oe{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:Je(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:Je(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return Re(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 tt([e,t]){return[e,t]}var nt;function ot(){return ot=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},ot.apply(this,arguments)}var it,rt;function at(){return at=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},at.apply(this,arguments)}var st;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(st||(st={}));const lt={[st.METAMASK]:{name:"MetaMask",type:st.METAMASK,icon:function(e){return v.createElement("svg",ot({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),nt||(nt=v.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},v.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"}),v.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)"}),v.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"}),v.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"}),v.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"}),v.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),v.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),v.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"}),v.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),v.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),v.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),v.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),v.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),v.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),v.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)"}),v.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)"}),v.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),v.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"}),v.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},v.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"}),v.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),v.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),v.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"}),v.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),v.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),v.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),v.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),v.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),v.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)"}),v.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),v.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"},[st.WALLET_CONNECT]:{name:"WalletConnect",type:st.WALLET_CONNECT,icon:function(e){return v.createElement("svg",at({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),it||(it=v.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},v.createElement("stop",{offset:0,stopColor:"#5d9df6"}),v.createElement("stop",{offset:1,stopColor:"#006fff"}))),rt||(rt=v.createElement("g",{fill:"none",fillRule:"evenodd"},v.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)"}),v.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)"}))))}}},ct={};function dt({provider:e,jsonRpcUrlMap:t,defaultChainId:n}){const o=console.error,i=E((()=>function(e,t){if(t){if(ne.isProvider(t))return tt(z((e=>new et(e,t))));if(ne.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return tt(z((n=>new J({actions:n,provider:t,onError:e}))))}}(o,e)),[o,e]),r=E((()=>function(e){return tt(z((t=>new te({actions:t,onError:e}))))}(o)),[o]),a=E((()=>t?Object.assign(Object.assign({},Ce),t):Ce),[t]),s=E((()=>function(e,t,n,o){return tt(z((i=>new ee({actions:i,options:{rpc:t,qrcode:e},onError:o,defaultChainId:n}))))}(!0,a,n,o)),[a,n,o]);return i&&(ct[st.INTEGRATOR]=i),ct[st.METAMASK]=r,ct[st.WALLET_CONNECT]=s,Object.values(ct)}function ut(){const{chainId:e}=V(),t=I(Ue);return E((()=>e||t||1),[e,t])}function pt({tokenList:e,popularTokenList:t}){const o=k(),[i,r]=x([]),{account:a}=V(),s=ut(),l=I(He),c=E((()=>(null==t?void 0:t.filter((e=>e.chainId===s)))||[]),[t,s]);!function({tokenList:e,addresses:t,blockNumber:o}){const{account:i}=V(),r=k(),a=E((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,t]),{getContract:s,contractConfig:l,call:c}=qe(),[d,u]=x(),p=E((()=>{if(!i||!a.length||!l)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=l,o=s(t,Xe);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 Q(Xe).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($e(c)),d}),[i,s,a]);C((()=>{(()=>{Re(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(We(t))),u(e);let n={};a.forEach((e=>{n[e]=!1})),r($e(n))}))})()}),[p,o])}({addresses:E((()=>{const e=i.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[i,t]),blockNumber:l}),C((()=>{(()=>{Re(this,void 0,void 0,(function*(){let t=[];if(e)t=e;else{t=(yield import("./tokenList-4ef211de.js")).default}const n=s,i=t.filter((e=>e.chainId===n));r(i),o((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(i))}))})()}),[e,o,s]),C((()=>{o(We({}))}),[a,s]),C((()=>{o((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(c))}),[c,o])}const mt=e=>(null!=e?e:Me.getState()).token.tokenList,ht=e=>(null!=e?e:Me.getState()).token.accountBalances,ft=e=>(null!=e?e:Me.getState()).token.ethBalance||new n(NaN),gt=e=>(null!=e?e:Me.getState()).token.defaultFromToken,bt=e=>(null!=e?e:Me.getState()).token.defaultToToken,yt=e=>(null!=e?e:Me.getState()).token.balanceLoadings;function vt(){const{account:e,chainId:t}=V(),n=I(ht),o=I(ft),i=E((()=>Oe[t||1]),[t]),r=w((t=>{var r;if(!e)return null;if(t.symbol===i.symbol&&xe(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 xt;function Et(e,t,n,o=0){if(n&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return xt.fully+o;const i=e.indexOf(t);return 0===i?xt.prefix+o:i>0?xt.other+o:xt.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(xt||(xt={}));function wt({value:e,onChange:t,occupiedAddrs:o,hiddenAddrs:i,showAddrs:r}){const[a,s]=x(""),l=I(mt),c=ut(),d=vt(),u=E((()=>new Set(i?i.map((e=>e.toLowerCase())):void 0)),[i]),p=E((()=>r?new Set(r.map((e=>e.toLowerCase()))):void 0),[r]),m=w((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=w((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=Et(e.symbol.toLocaleLowerCase(),o,!1,1));if(i)e.name.toLocaleLowerCase()===o&&(i=xt.fully+1);else{let t=Et(e.name.toLocaleLowerCase(),o,!1,10);t=t===xt.fully+10?xt.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=w((e=>{const n=e.address.toLowerCase();t(e,!!(null==o?void 0:o.some((e=>e.toLowerCase()===n))))}),[t,o]),g=E((()=>{const e=m(l);return h(e)||[]}),[l,m,h]);return{filter:a,setFilter:s,showTokenList:g,onSelectToken:f}}function Ct({width:e=24,height:t=24,marginRight:n=8,url:o,zIndex:i,cross:r,address:s,token:l,sx:c}){const[d,u]=x(!1),[p,m]=x(""),[h,f]=x(""),[g,b]=x(!1),y=w((()=>u(!0)),[]);let v=function(e){const t=I(mt),{chainId:n}=V();return E((()=>{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])}(s);l&&(v=l);const A=s||(null==v?void 0:v.address),O=null==v?void 0:v.symbol,T=null==O?void 0:O.charAt(0).toUpperCase(),k=E((()=>{const e=null==v?void 0:v.logoURI;return o||e||""}),[o,v]);return C((()=>{b(!1)}),[A,k]),C((()=>{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]),C((()=>{try{let t=A;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const n=new $(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)}}),[A,e]),ie(a,{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&&re(a,{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}),re(a,{component:"img",src:!(r?p:k)||g?h:r?p:k,onLoad:y,onError:e=>{const t=e.target;A&&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 At({token:t,onClick:n}){var o,i;const r=s();return ie(a,{component:l,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)?ie(ae,{children:[re(Ct,{address:null!==(o=null==t?void 0:t.address)&&void 0!==o?o:"",marginRight:6}),re(a,{children:null!==(i=null==t?void 0:t.symbol)&&void 0!==i?i:"-"})]}):re(e,{id:"SELECT TOKEN"}),re(a,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:S})]})}function Ot({onClick:t,balance:n,decimals:o,address:i,showMaxBtn:r}){const{palette:c}=s();return ie(a,{sx:{display:"flex",typography:"body2",color:c.text.secondary},children:[re(e,{id:"Balance:"})," ",i?ge({input:n,decimals:Math.min(o||4,4)}):"-",r&&n&&n.gt(0)&&re(a,{component:l,sx:{ml:6,color:(null==n?void 0:n.gt(0))?c.primary.main:c.text.disabled,cursor:i&&t?"pointer":"unset"},onClick:()=>t&&t(n?n.toString():""),children:re(e,{id:"Max"})})]})}function Tt({readOnly:e,sx:t,value:n,decimals:o,onChange:i,suffix:r,withClear:d,onFocus:u,placeholder:p}){const m=s(),h=E((()=>r||(d&&n&&i?re(a,{component:l,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{i&&i("")},children:re(a,{component:L,sx:{width:12,color:"text.primary"}})}):void 0)),[i,r,m.palette.text.primary,n,d]);return ie(a,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[re(c,{fullWidth:!0,value:n,readOnly:e,placeholder:p||"0.00",onFocus:u,onChange:e=>{const t=e.target.value,n=0===t.length?"":ve(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 kt({open:e,onClose:t,title:n,rightSlot:o,canBack:i=!0,children:r,height:s,testId:l}){return ie(a,{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:s},"data-testid":l,"data-active":e?"1":"0",children:[n?ie(a,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[re(a,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&i&&re(a,{component:L,sx:{color:"text.secondary",cursor:"pointer"},onClick:t})]}):"",r]})}const It=e=>(null!=e?e:Me.getState()).globals;function Rt({token:e,disabled:t,onClick:n}){return ie(a,{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:[re(Ct,{token:e}),e.symbol]})}function St({token:e,disabled:t,style:n,onClick:o}){const i=vt()(e),r=i?fe({input:i}):"";return ie(a,{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:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(Ct,{token:e}),ie(a,{children:[re(a,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),re(a,{sx:{mt:4,textAlign:"left"},children:r})]})]}),re(a,{sx:{color:"text.secondary"},children:e.name})]})}function Lt({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i,visible:r}){var s;const l=ut(),c=I((e=>((e,t)=>(null!=t?t:Me.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)))(l,e))),{showTokenList:u,filter:p,setFilter:m,onSelectToken:h}=wt({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i}),f=A(null),g=A(null),[b,y]=x(0);C((()=>{r&&f.current&&y(f.current.offsetHeight-34)}),[f,r]);const v=w((({index:t,style:n})=>{const o=!!(null==c?void 0:c.length);if(0===t&&o)return re(a,{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=>re(Rt,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>h(t)},t.address)))});const i=u[o?t-1:t];return re(St,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>h(i)})}),[u,c,g,e]),E=w((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 ie(a,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[re(d,{fullWidth:!0,height:48,value:p,onChange:e=>m(e.target.value),clearValue:()=>m(""),placeholder:se._("Enter the token symbol or address")}),re(a,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:f,children:re(le,{height:b,itemCount:u.length+((null==c?void 0:c.length)?1:0),itemSize:E,width:"100%",className:"token-list",children:v},null===(s=g.current)||void 0===s?void 0:s.offsetHeight)})]})}function Dt({open:t,value:n,onClose:o,occupiedAddrs:i,onTokenChange:r}){const{height:a}=I(It);return re(kt,{height:a,open:t,onClose:o,title:re(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:re(Lt,{value:n,visible:t,onChange:r,occupiedAddrs:i})})}function _t({sx:e,amt:t,token:n,readOnly:o,showMaxBtn:i,onMaxClick:r,fiatPriceTxt:l,occupiedAddrs:c,onInputFocus:d,onTokenClick:u,onInputChange:p,onTokenChange:m}){const h=s(),f=vt(),[g,b]=x(!1),y=n?f(n):null;return ie(a,{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:[ie(a,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[re(At,{token:n,onClick:()=>b(!0)}),re(Ot,{balance:y,onClick:r,showMaxBtn:i,address:null==n?void 0:n.address,decimals:null==n?void 0:n.decimals})]}),re(Tt,{value:t,onFocus:d,onChange:p,readOnly:o,withClear:!0}),re(a,{sx:{mt:4,typography:"body2",color:h.palette.text.secondary},children:l}),re(Dt,{value:n,open:g,occupiedAddrs:c,onClose:()=>{u&&u(),b(!1)},onTokenChange:(e,t)=>{m(e,t),b(!1)}})]})}const Nt={"en-US":ce,"zh-CN":de,pseudo:ce};function Bt({locale:e,children:n}){return C((()=>{(()=>{Re(this,void 0,void 0,(function*(){yield function(e="en-US"){return Re(this,void 0,void 0,(function*(){se.loadLocaleData(e,{plurals:()=>Nt[e]});try{const t=yield import(`./locales/${e}.js`);se.load(e,t.messages||t.default.messages)}catch(e){}se.activate(e)}))}(e)}))})()}),[e]),re(t,{i18n:se,children:n})}var Pt,Ft,jt;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Pt||(Pt={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(Ft||(Ft={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(jt||(jt={}));var Mt,Ut=[{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"}(Mt||(Mt={}));const Ht=(e,t)=>Re(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})),Wt=(e,t)=>Re(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(se._("Transaction rejected.")):e}}));var $t,Vt;!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"}(Vt||(Vt={}));const zt=new n(2).pow(256).minus(1),Kt=e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function Gt({onTxFail:e,onTxSubmit:t,onTxSuccess:o}={}){const{account:i,provider:r}=V(),a=ut(),[s,l]=x(!1),[c,d]=x(new Map),u=k(),[p,m]=x(null),[h,f]=x(""),[g,b]=x(null),[y,v]=x(!1),[C,A]=x(),O=w(((s,c,p,h=!1,g,y,x,E)=>Re(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===$t.Approval)O=yield((e,t,o,i,r,a)=>Re(void 0,void 0,void 0,(function*(){const s=Ye(e,Ut,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 Ht(l,r);return c&&(l.gasLimit=c),yield Wt(l,r)})))(c.token.address,i,c.contract,c.amt||zt,r,i),w=O.hash,f(w);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(C={value:c.value,data:c.data,to:c.to,gasLimit:c.gasLimit,from:i,chainId:a},!C.gasLimit)try{const e=yield Ht(C,r);e&&(C.gasLimit=e)}catch(e){console.debug(e)}if(O=yield Wt(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(Kt({contractStatus:Be.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=Oe[e])||void 0===n?void 0:n.symbol,i=[{error:"insufficient",msg:se._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:o})},{error:["External Swap execution Failed","Return amount is not enough"],msg:se._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:se._("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:se._("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:se._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:se._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:se._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:se._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:se._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:se._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:se._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:se._("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 Ft.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(Kt({contractStatus:Be.Pending})),t&&t(w,T),g&&g();const k={brief:s,spec:c,tx:w,subtitle:p};if(d((e=>e.set(w,[k,Pt.Running]))),h)return Ft.Submitted;if(g&&g(),null==O?void 0:O.wait){const e=yield O.wait(1);if(v(!0),e.status===jt.Success)return"TX"===T.opcode&&u(Kt({contractStatus:Be.TxSuccess})),"APPROVAL"===T.opcode&&u(Kt({contractStatus:Be.ApproveSuccess})),E&&E(w),o&&o(w,T),d((e=>e.set(w,[k,Pt.Success]))),Ft.Success}return v(!0),d((e=>e.set(w,[k,Pt.Failed]))),Ft.Failed}))),[i,a,l,r]),T=E((()=>({execute:O,requests:c,setShowing:b,waitingSubmit:s})),[O,c,b]),I=w((()=>{b(null),C&&(C(),A(void 0))}),[C]);return{showing:g,showingDone:y,transactionTx:h,errorMessage:p,setErrorMessage:m,closeShowing:I,ctxVal:T,requests:c}}function Yt(){const{requests:e}=Xt(),t=[];return null==e||e.forEach((function([e,n]){n===Pt.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const qt=T({execute:()=>Promise.resolve(Ft.Canceled),requests:void 0,waitingSubmit:!1});function Xt(){return O(qt)}var Zt;function Qt(){return Qt=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},Qt.apply(this,arguments)}var Jt=function(e){return v.createElement("svg",Qt({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Zt||(Zt=v.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},v.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},v.createElement("g",{transform:"translate(18.000000, 291.000000)"},v.createElement("g",{transform:"translate(40.000000, 83.000000)"},v.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function en({showingDone:e,errorMessage:t}){return re(a,t?{component:D,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:re(a,{component:Jt,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function tn({showingDone:e,showing:t}){return ie(a,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[re(a,{sx:{mt:60},children:e?se._("{0} confirmed",{0:null==t?void 0:t.brief}):se._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?re(a,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function nn({isStarted:t,isEnded:n,tx:o}){const[i,r]=x(0),{chainId:s}=V(),l=E((()=>`https://${ke[s||1]}/tx/${o}`),[o,s]),c=E((()=>{const e=Math.floor(i/60),t=i%60;return e?`${e}m ${t}s`:`${t}s`}),[i]),d=A();return C((()=>(r(0),d.current=setInterval((()=>{r((e=>e+1))}),1e3),()=>{clearInterval(d.current)})),[t]),C((()=>{clearInterval(d.current)}),[n]),ie(a,{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:[ie(a,{children:[re(e,{id:"Transaction Time:"}),c]}),ie(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:l,target:"_blank",rel:"noopener noreferrer",children:[re(e,{id:"Tx"}),re(a,{component:N,sx:{width:16,height:16,ml:6}})]})]})}function on(t){var{children:n}=t,o=Ie(t,["children"]);const{ctxVal:i,showing:r,closeShowing:s,showingDone:l,errorMessage:c,transactionTx:d}=Gt(o),p=k();return ie(qt.Provider,{value:i,children:[n,re(kt,{open:!!r,onClose:s,children:ie(a,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[ie(a,{children:[re(a,{sx:{textAlign:"center",pt:60},children:re(en,{showingDone:l,errorMessage:c})}),c?ie(a,{sx:{textAlign:"center",mt:60},children:[re(a,{children:re(e,{id:"Something went wrong."})}),re(a,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:c})]}):ie(ae,{children:[re(tn,{showingDone:l,showing:r}),re(nn,{isStarted:!!r,isEnded:l,tx:d})]})]}),re(u,{fullWidth:!0,size:u.Size.big,onClick:()=>{p(Kt({contractStatus:Be.Initial})),s()},sx:{mt:20},children:re(e,c?{id:"Dismiss"}:{id:"Close"})})]})})]})}function rn({token:e,fiatPrice:t}){return{marginAmount:E((()=>{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 an({width:e,height:t,feeRate:n,rebateTo:o,colorMode:i,apikey:r,defaultChainId:a,defaultToToken:s,defaultFromToken:l}){const c=k();C((()=>{i&&c((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(i))}),[i]),C((()=>{var e;a&&c((e=a,t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[a]),C((()=>{c(Kt({height:t}))}),[t]),C((()=>{c(Kt({width:e}))}),[e]),C((()=>{r&&c(Kt({apikey:r}))}),[r]),C((()=>{n&&c(Kt({feeRate:n}))}),[n]),C((()=>{o&&c(Kt({rebateTo:o}))}),[o]),C((()=>{l&&c((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(l))}),[l]),C((()=>{s&&c((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(s))}),[s])}function sn({refetch:e,interval:t}){let n;C((()=>(e(),clearTimeout(n),n=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(n))),[e])}function ln({fromToken:e,toToken:t,chainId:n}){const[o,i]=x(!1),[r,a]=x(""),[s,l]=x(""),c=w((()=>{if(!n||!e||!t)return;i(!0);const o=[e,t];ue.post("https://api.dodoex.io/price-api/api/v1/price/current/batch",{networks:o.map((()=>(e=>Te[e]||Te[we.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 sn({refetch:c}),{loading:o,refetch:c,toFiatPrice:s,fromFiatPrice:r}}const cn=e=>(null!=e?e:Me.getState()).settings.slippage,dn=e=>(null!=e?e:Me.getState()).settings.ddl;var un;function pn({toToken:e,fromToken:t,fromAmount:n,toAmount:o,marginAmount:i}){const{account:r,chainId:a,provider:s}=V(),l=I(Ue),c=E((()=>a||l),[a,l]),d=I(cn)||3,u=I(dn)||20,{feeRate:p,rebateTo:m,apikey:h,isReverseRouting:f}=I(It),g=E((()=>Math.floor(Date.now()/1e3)+60*u),[u]),[b,y]=x(un.Initial),[v,C]=x(null),[A,O]=x(""),[T,k]=x(null),[R,S]=x(null),[L,D]=x(null),[_,N]=x(pe.from(0)),[B,P]=x(null),[F,j]=x(null),[M,U]=x(""),[H,W]=x(""),[$,z]=x(""),[K,G]=x(0),Y=w((()=>Re(this,void 0,void 0,(function*(){if(!c||!t||!e)return;if(!f&&!n)return;if(f&&!o)return;y(un.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=me(String(o||1),e.decimals).toString():i.fromAmount=me(String(n||1),t.decimals).toString(),m&&p&&(i.rebateTo=m,i.fee=p);try{const e=(yield ue.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:i})).data.data;if((null==e?void 0:e.resAmount)?(y(un.Success),C(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),z(e.useSource),G(e.duration)):y(un.Failed),!r||!s)return;const t=yield Ht({from:r,to:e.to,value:e.value,data:e.data},s);t&&N(t)}catch(e){y(un.Failed),console.error(e)}}))),[g,r,c,e,p,d,m,t,s,n,o,h,f]);sn({refetch:Y});const q=E((()=>{const e=f?o:n;return b!==un.Loading&&e?v:null}),[b,f,o,n,v]),X=function(){const{chainId:e,account:t}=V(),n=Xt();return w((({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(se._("Swap"),Object.assign({opcode:$t.TX},p),l)}),[t,e])}(),Z=w((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,_,v,A,f]);return{status:b,refetch:Y,priceImpact:L,executeSwap:Z,baseFeeAmount:T,resAmount:q,additionalFeeAmount:R,resPricePerToToken:F,resPricePerFromToken:B}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(un||(un={}));function mn(e){pt(e),Ze(),Qe();const{provider:t,connector:n}=V();C((()=>{const t=e.defaultChainId||1;(null==n?void 0:n.connectEagerly)?n.connectEagerly(t):n.activate(t)}),[n]),C((()=>{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 an(Object.assign(Object.assign({},e),{width:o,height:i})),re(a,{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:re(on,{...e,children:e.children})})}function hn(e){const t=m({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),n=E((()=>e.defaultChainId||1),[e.defaultChainId]),o=dt({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:n}),i=`${o.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${n}`;return re(R,{store:Me,children:re(Bt,{locale:e.locale,children:re(h,{theme:t,children:ie(K,{connectors:o,children:[re(f,{container:".dodo-widget-container"}),re(mn,{...e})]},i)})})})}function fn(e){const{width:t}=I(It),n=E((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return re(g,{container:document.querySelector(".dodo-widget-container"),maxWidth:n,...e})}function gn({onClick:e}){const t=s();return re(p,{sx:{width:"100%",position:"relative"},onClick:e,children:re(a,{component:l,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:re(a,{component:B,sx:{width:18,color:"text.secondary"}})})})}function bn({open:t,execute:o,onClose:i,toToken:r,fromToken:c,fromAmount:d,toAmount:p,priceImpact:m,clearFromAmt:h,clearToAmt:f,baseFeeAmount:g,curToFiatPrice:b,curFromFiatPrice:y,pricePerFromToken:v,additionalFeeAmount:w}){var A,O;const T=s(),R=I(cn),L=k(),{contractStatus:D}=I(It),_=E((()=>new n(m).gt(15)),[m]),[N,B]=x(!1),[M,U]=x(!1);return C((()=>{D!==Be.Pending&&i(),D===Be.TxSuccess&&(f(),h())}),[D]),C((()=>{B(!1)}),[b]),re(kt,{open:t,onClose:()=>{L(Kt({contractStatus:Be.Initial})),i()},title:re(e,{id:"Swap summary"}),children:ie(a,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${T.palette.border.main}`},children:[ie(a,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${T.palette.border.main}`},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[ie(a,{children:[ie(a,{sx:{display:"flex"},children:[re(Ct,{width:16,height:16,address:null!==(A=null==c?void 0:c.address)&&void 0!==A?A:"",marginRight:6}),re(a,{children:`${ge({input:d,decimals:null==c?void 0:c.decimals})} ${null==c?void 0:c.symbol}`})]}),re(a,{sx:{mt:4,typography:"h6",color:T.palette.text.secondary},children:y?`$${fe({input:y,showDecimals:1})}`:"-"})]}),re(a,{sx:{width:16,mx:16},component:P}),ie(a,{children:[ie(a,{sx:{display:"flex"},children:[re(Ct,{width:16,height:16,marginRight:6,address:null!==(O=null==r?void 0:r.address)&&void 0!==O?O:""}),re(a,{children:`${ge({input:p,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),re(a,{sx:{typography:"h6",mt:4,color:T.palette.text.secondary},children:b?`$${fe({input:b,showDecimals:1})}(${m}%)`:"-"})]})]}),re(a,{sx:{mt:12,typography:"h6"},children:`1 ${null==c?void 0:c.symbol} = ${ge({input:new n(p).dividedBy(new n(d)),decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),ie(a,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${T.palette.border.main}`},children:[ie(a,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:T.palette.text.secondary},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(a,{sx:{width:16,mr:7},component:F}),re(e,{id:"Swap Detail"})]}),re(a,{component:l,children:re(a,{onClick:()=>U(!M),sx:{width:10,color:"text.secondary",transform:M?"rotateX(0deg)":"rotateX(180deg)"},component:S})})]}),ie(a,{sx:{mt:16,display:M?"initial":"none"},children:[ie(a,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(e,{id:"Basic Fee"}),re(fn,{title:re(e,{id:"Estimated service provider fees"}),ml:5})]}),re(a,{children:`${ge({input:g,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),ie(a,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(e,{id:"Additional Fee"}),re(fn,{title:re(e,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),re(a,{children:`${ge({input:w,decimals:null==r?void 0:r.decimals})} ${null==r?void 0:r.symbol}`})]}),ie(a,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(e,{id:"Price Impact"}),re(fn,{title:re(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),re(a,{children:`${m}%`})]}),ie(a,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(e,{id:"Slippage"}),re(fn,{title:re(e,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),re(a,{children:R})]})]})]}),re(a,{sx:{flex:1}}),_&&ie(a,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>B(!N),children:[re(a,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:re(a,N?{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:re(a,{component:j,sx:{width:14,color:"#1a1a1b"}})}:{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${T.palette.text.secondary}`}})}),re(a,{children:re(e,{components:{0:re(a,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:m},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),re(u,{isLoading:D==Be.Pending,disabled:_&&!N,fullWidth:!0,onClick:()=>{o(),L(Kt({contractStatus:Be.Pending}))},children:D==Be.Pending?re(e,{id:"Confirming"}):re(e,{id:"Confirm swap"})})]})})}function yn(e){var{sx:t,maxVal:n,decimals:i=2,onInputChange:r}=e,a=Ie(e,["sx","maxVal","decimals","onInputChange"]);return s(),re(c,{...a,onChange:e=>{const t=0===e.target.value.length?null:ve(e.target.value,i),a=n&&t&&new o(t).gt(n)?n.toString():t;console.log("finalVal:",a),r&&r(a)}})}function vn({open:t,onClose:n}){const o=s(),i=k(),r=I(cn),l=I(dn),c=E((()=>Number(r)>=50),[r]);return re(kt,{open:t,onClose:n,title:re(e,{id:"Settings"}),children:ie(a,{sx:{mx:20},children:[ie(a,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ie(a,{sx:{mb:16,display:"flex",alignItems:"center"},children:[re(e,{id:"Slippage Tolerance"}),re(fn,{title:re(e,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),ie(a,{sx:{display:"flex",flexDirection:"column"},children:[re(yn,{fullWidth:!0,maxVal:100,value:r,placeholder:3..toString(),onInputChange:e=>{i((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:re(a,{sx:{color:"text.disabled"},children:"%"}),height:36}),c&&re(a,{sx:{typography:"h6",mt:6,color:"error.main"},children:re(e,{id:"Maximum slippage do not exceed 50%"})})]})]}),ie(a,{sx:{py:20,borderTop:`1px solid ${o.palette.border.main}`},children:[ie(a,{sx:{mb:16,display:"flex",alignItems:"center"},children:[re(e,{id:"Transaction Deadline"}),re(fn,{title:re(e,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),re(yn,{value:l,fullWidth:!0,height:36,placeholder:se._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{i((e=>t=>Re(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function xn({toToken:t,fromToken:n,priceStatus:o,pricePerToToken:i,pricePerFromToken:r}){const[s,c]=x("-"),[d,u]=x(null),[p,m]=x("-"),[h,f]=x(null);C((()=>{c(null==n?void 0:n.symbol),m(null==t?void 0:t.symbol),u(i),f(r)}),[n,t,i,r]);const g=w((()=>{c(p),m(s),u(h),f(d)}),[s,d,p,h]);return re(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[un.Initial]:"-",[un.Loading]:ie(ae,{children:[re(b,{sx:{mr:5}}),re(e,{id:"Fetching best price..."})]}),[un.Failed]:ie(ae,{children:[re(a,{component:M,sx:{width:15,mr:5,color:"warning.main"}}),re(e,{id:"Quote not available"})]}),[un.Success]:ie(ae,{children:[re(a,{sx:{typography:"body2"},children:`1 ${s} = ${fe({input:h,showDecimals:4})} ${p}`}),re(a,{component:l,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:re(a,{sx:{width:16,color:"text.secondary"},onClick:g,component:U})})]})}[o]})}function En({open:t,onClose:n}){const o=I(Ue);return re(kt,{title:re(e,{id:"Connect to your wallet"}),open:t,onClose:n,children:re(a,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(lt).map((t=>ie(a,{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=ct[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:[re(a,{component:t.icon,sx:{width:32,height:32}}),re(a,{sx:{mt:8,typography:"caption"},children:t.name}),re(a,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:re(e,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function wn(){const{connector:t}=V(),[n,o]=x(!1);return ie(ae,{children:[re(u,{size:u.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),o(!0)},"data-testid":"connect-wallet-btn",children:re(e,{id:"Connect to a wallet"})}),re(En,{open:n,onClose:()=>o(!1)})]})}var Cn;!function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(Cn||(Cn={}));const An=({account:e,chainId:t,offset:o,contractAddress:i})=>{var r;const a=I(Ue),s=E((()=>{var e;return ze[null!==(e=t)&&void 0!==e?e:a]}),[t]),{isETH:l}=E((()=>Ee(t)),[t]),{DODO_APPROVE:c}=s||{},d=null!==(r=null!=i?i:c)&&void 0!==r?r:null,u=function(e){const{account:t}=V(),o=I(Ue),i=I(ht),r=E((()=>Oe[o]),[o]),a=w((o=>{var a;if(!t||!e)return null;if(o.symbol===r.symbol&&xe(o.address,r.address))return new n(zt);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=vt(),{runningRequests:m}=Yt(),h=I(yt),f=E((()=>{var e;return null===(e=Oe[null!=t?t:a])||void 0===e?void 0:e.address}),[t]),g=w(((t,i,r)=>{if(!t)return Cn.Loading;const a=!!(null==m?void 0:m.find((e=>e.spec.opcode===$t.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 Cn.Unchecked;if(!s||c.minus(null!=o?o:0).gt(s))return Cn.Unchecked;if(c.isZero())return Cn.Unchecked;return t.address===f?Cn.Sufficient:a?Cn.Approving:l&&c.minus(null!=o?o:0).gt(l)?Cn.Insufficient:Cn.Sufficient}),[p,u,e,o,d,t,h,m,f]),b=w((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=Xt(),v=k(),x=w(((t,o)=>Re(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?se._("Reset"):se._("Approve");var s;(yield y.execute(`${a} ${i}`,{opcode:$t.Approval,token:t,contract:d,amt:r}))===Ft.Success&&v((s=null!=r?r:zt,e=>Re(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:s})}))))}))),[d,e,t,y,v]),C=w((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:C,submitApprove:x}};function On(){var t,o;const i=s(),{isInflight:c}=Yt(),{chainId:d,account:p}=V(),m=k(),{isReverseRouting:h}=I(It),f=I(Ue),g=I(bt),y=I(gt),{isETH:v}=E((()=>Ee(d)),[d]),A=E((()=>{var e;return null===(e=Oe[null!=d?d:f])||void 0===e?void 0:e.address}),[d]),[O,T]=x(""),[R,S]=x(""),[L,D]=x(""),[_,N]=x(""),B=E((()=>r((e=>D(e)),1e3)),[]),F=E((()=>r((e=>N(e)),1e3)),[]),[j,U]=x(null),[$,z]=x(null),[K,G]=x(!1),[Y,q]=x(!1),{toFiatPrice:X,fromFiatPrice:Z}=ln({chainId:d,toToken:$,fromToken:j}),Q=vt(),J=E((()=>j?Q(j):null),[j,Q]);E((()=>$?Q($):null),[$,Q]);const{getApprovalState:ee,submitApprove:te,getPendingRest:ne,getMaxBalance:oe}=An({account:p,chainId:d}),se=E((()=>ne(h?$:j)),[null==j?void 0:j.address,null==$?void 0:$.address,ne,h]),{marginAmount:le}=rn({token:h?$:j,fiatPrice:h?X:Z}),{resAmount:ce,priceImpact:de,executeSwap:ue,baseFeeAmount:pe,additionalFeeAmount:me,resPricePerToToken:he,resPricePerFromToken:be,status:ye}=pn({toToken:$,fromToken:j,marginAmount:le,fromAmount:L,toAmount:_}),ve=w((e=>{const t=e.toString();T(t),B(t)}),[T,B]),xe=w((e=>{const t=e.toString();S(t),F(t)}),[S,F]);C((()=>{d&&(z(null),U(null),h?xe(""):ve("")),y&&y.chainId===d&&(U(y),y.amount&&(m(Kt({isReverseRouting:!1})),ve(y.amount))),g&&g.chainId===d&&(z(g),g.amount&&y&&!y.amount&&(m(Kt({isReverseRouting:!0})),xe(g.amount)))}),[g,y,d,ve,xe]);const Ce=w((()=>{ve(""),xe(""),U($),z(j)}),[U,$,z,j,ve,xe]),Ae=w((e=>h?xe(oe($)):ve(oe(j))),[ve,xe,oe,j,$,h]),Te=E((()=>(100*Number(de)).toFixed(2)),[de]),ke=E((()=>{const e=h?ce:L;return e&&Z?new n(Z).multipliedBy(e):null}),[Z,L,h,ce]),Ie=E((()=>{const e=h?_:ce;return e&&X?new n(X).multipliedBy(e):null}),[X,_,h,ce]),Re=E((()=>ie(a,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[re(fn,{title:re(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),ie(a,{sx:{display:"flex"},children:[re(e,{id:"Current price impact"}),ie(a,{sx:{color:i.palette.error.main,ml:4},children:[Te,"%"]})]})]})),[Te]),Se=E((()=>re(xn,{toToken:$,fromToken:j,priceStatus:ye,pricePerToToken:he,pricePerFromToken:be})),[$,j,ye,he,be]),Le=E((()=>!we[d||1]),[d]),De=E((()=>ye===un.Loading?re(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:ie(ae,{children:[re(b,{sx:{mr:5}}),re(e,{id:"Fetching best price..."})]})}):Le?ie(ae,{children:[re(a,{component:M,sx:{mr:6,width:16,color:"warning.main"}}),re(e,{id:"Unsupported network - switch to trade"})]}):O&&new n(Te).gt(15)?Re:Se),[ye,Se,O,Re,Te,Le]),_e=E((()=>h?new n(R).gt(0)?ge({input:ce,decimals:null==j?void 0:j.decimals}):"-":O),[O,R,ce,j,h]),Ne=E((()=>h?R:new n(O).gt(0)?ge({input:ce,decimals:null==$?void 0:$.decimals}):"-"),[O,R,ce,$,h]),Be=E((()=>{const t=ee(j,L),o=t===Cn.Approving,i=t===Cn.Insufficient&&!se,r=v?.1:.02,a=A===(null==j?void 0:j.address),s=new n(J||0);return p?c?re(u,{fullWidth:!0,isLoading:!0,disabled:!0,children:re(e,{id:"Transaction Pending"})}):j&&$?i?re(u,{fullWidth:!0,disabled:o,onClick:()=>te(j),children:re(e,o?{id:"Approving"}:{id:"Approve"})}):new n(h?_:L).gt(0)?ye===un.Loading?re(u,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:re(e,{id:"Fetching Price..."})}):ce?s.lt(h?ce:L)||a&&s.lte(r)?re(u,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:re(e,{id:"Insufficient balance"})}):re(u,{fullWidth:!0,onClick:()=>G(!0),"data-testid":"swap-review-btn",children:re(e,{id:"Review Swap"})}):re(u,{fullWidth:!0,disabled:!0,children:re(e,{id:"Quote not available"})}):re(u,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:re(e,{id:"Enter an amount"})}):re(u,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:re(e,{id:"Select Tokens"})}):re(wn,{})}),[v,p,_,L,$,ce,j,c,ue,se,te,ye,J,ee,A,h]),Pe=E((()=>j&&$?ie(a,{sx:{display:"flex",alignItems:"center"},children:[re(Ct,{token:j,sx:{width:16,height:16,mr:6}}),`${ge({input:h?ce:L,decimals:null==j?void 0:j.decimals})} ${j.symbol}`,re(a,{component:P,sx:{width:12,height:12,mx:16}}),re(Ct,{token:$,sx:{width:16,height:16,mr:6}}),`${ge({input:h?_:ce,decimals:null==$?void 0:$.decimals})} ${$.symbol}`]}):re(a,{})),[j,$,L,_,ce,h]);return ie(ae,{children:[ie(a,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[re(e,{id:"Swap"}),re(a,{component:l,children:re(a,{component:H,onClick:()=>q(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),ie(a,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[ie(a,{children:[re(_t,{sx:{mb:4},token:j,amt:_e,onMaxClick:Ae,onInputChange:ve,onInputFocus:()=>{h&&ve(""),m(Kt({isReverseRouting:!1}))},showMaxBtn:!h&&!O,occupiedAddrs:[null!==(t=null==$?void 0:$.address)&&void 0!==t?t:""],fiatPriceTxt:ke?`$${fe({input:ke,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return Ce();ve(""),xe(""),U(e)},readOnly:h}),re(gn,{onClick:Ce}),re(_t,{token:$,amt:Ne,onInputChange:xe,onInputFocus:()=>{h||xe(""),m(Kt({isReverseRouting:!0}))},occupiedAddrs:[null!==(o=null==j?void 0:j.address)&&void 0!==o?o:""],fiatPriceTxt:Ie?`$${fe({input:Ie,showDecimals:1})}(${Te}%)`:"-",onTokenChange:(e,t)=>{if(t)return Ce();ve(""),xe(""),z(e)},readOnly:!h}),re(a,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:De})]}),Be,ie(a,{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:[re(a,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:i.palette.text.disabled}},component:W}),re(e,{id:"Powered by DODO protocol"})]})]}),re(bn,{toToken:$,fromToken:j,fromAmount:h?ce:L,toAmount:h?_:ce,open:K,baseFeeAmount:pe,priceImpact:Te,additionalFeeAmount:me,curToFiatPrice:Ie,execute:()=>ue(Pe),clearFromAmt:()=>ve(""),clearToAmt:()=>xe(""),curFromFiatPrice:ke,pricePerFromToken:be,onClose:()=>G(!1)}),re(vn,{open:Y,onClose:()=>q(!1)})]})}function Tn(e){return re(hn,{...e,children:re(On,{})})}function kn(e){const t=document.getElementById("dodo-swap-widget");he(t).render(re(hn,{...e,children:re(On,{})}))}export{kn as InitSwapWidget,Tn 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 l,unionBy as d,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 le}from"@ethersproject/providers";import{Connector as de}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:l=!1,noGroupSeparator:d=!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)),l&&(r=r.minus(r.integerValue(n.ROUND_DOWN))),d?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 l=new n(e);if(l.isNaN())return"-";return fe({input:l,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 l=0;for(;!a.isZero()&&l<100;){const e=a.times(10),t=e.integerValue(n.ROUND_FLOOR);o+=t.toString(),a=e.minus(t),l+=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,l){function d(e){try{r(n.next(e))}catch(e){l(e)}}function i(e){try{r(n.throw(e))}catch(e){l(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(d,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),l=new Map;for(const{req:e,resp:t}of o)l.set(e,null==t?void 0:t.result);return a.map((e=>e.filter((e=>!e.callData||l.get(e.callData))).map(((e,t)=>e.processor(e.callData?l.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 l=[];const d=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 d;try{d=yield t.provider.call(o)}catch(n){const o=e.length;if(o>20){const n=Math.floor(o/2),[d,i]=yield Promise.all([qe(e.slice(0,n),t,a),qe(e.slice(n,o),t,a)]);l=[...l,...d,...i]}else{const e="[sendCallReqs] error";console.error(e,n)}}if(void 0===d)throw new Error("Unexpected batch result");const[i,r]=ee.decode(["uint256","bytes[]"],d);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(d)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{l=[...l,...e]})),l}))}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),l=k((()=>Qe[a]),[a]),d=T(((a,n)=>{if(e)return Ke(a,n,e,t)}),[e,t]),i=T((e=>{if(!l)return;const{MULTI_CALL:t}=l,a=d(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)}})))()}),[l,d]);return{getContract:d,contractConfig:l,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,lt;function dt(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 de{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:dt(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:dt(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),lt||(lt=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(le.isProvider(t))return rt(P((e=>new it(e,t))));if(le.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]),l=k((()=>function(e){return rt(P((t=>new oe({actions:t,onError:e}))))}(n)),[n]),d=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,d,a,n)),[d,a,n]);return o&&(ut[ht.INTEGRATOR]=o),ut[ht.METAMASK]=l,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([])),l=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&&l()}),[e]),{cgTokenList:n,loading:t===Et.Loading,refetch:l}}!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(),l=w(),d=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||!d.length||!r)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=r,n=i(t,et);if(!n)return;let c={};const s=d.map((l=>(c[l]=!0,{callData:{data:n.interface.encodeFunctionData("isERC20",[l,o,e]),to:t},processor:e=>{const t=new te(et).decodeFunctionResult("isERC20",e),{balance:n,isOk:o}=t,d=parseInt(t.decimals),i=new a(10).pow(d),r=new a(t.allownance.toString()).div(i);return o?{address:l,decimals:d,symbol:t.symbol,name:t.name,balance:new a(n.toString()).div(i),allowance:r}:{address:l,balance:new a(0),allowance:new a(0)}}})));return l(Ge(c)),s}),[o,i,JSON.stringify(d)]);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})})),l(Le(t))),p(e);let a={};d.forEach((e=>{a[e]=!1})),l(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(l(e))t=e;else if(e===nt.Coingecko||e===nt.All){const e=m.concat(s.toArray());t=d(h,e,(e=>e.address.toLowerCase()))}else t=d(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]),l=T((t=>{var l;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 d=null===(l=a[t.address.toLocaleLowerCase()])||void 0===l?void 0:l.tokenBalances;return!d||(null==d?void 0:d.isNaN())?null:d}),[a,n,e]);return l}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:l}){const[d,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((()=>l?new Set(l.map((e=>e.toLowerCase()))):void 0),[l]),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=[];d?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,d,{matchAddress:!0});t&&o.push({sort:t,token:e})})):t.forEach((e=>{o.push({sort:0,token:e})}));const l=[];return o.sort(((t,o)=>{const l=t.token,d=o.token;if(e){if(l.address===e.address)return-1;if(d.address===e.address)return 1}if(null==n?void 0:n.includes(l.address))return-1;if(null==n?void 0:n.includes(d.address))return 1;const i=s&&s(l)||new a(0),r=s&&s(d)||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(l.address))return-1;if(null==c?void 0:c.includes(d.address))return 1;const h=m.map((e=>e.address));return(null==h?void 0:h.includes(l.address))?-1:(null==h?void 0:h.includes(d.address))?1:l.symbol.localeCompare(d.symbol)})).some((e=>!!(d&&l.length>21)||(l.push(e.token),!1))),l}),[d,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:d,setFilter:i,showTokenList:E,onSelectToken:W}}function Ot({width:e=24,height:t=24,marginRight:a=8,url:n,zIndex:o,cross:l,address:d,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])}(d);i&&(f=i);const g=d||(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((()=>{l&&(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,l]),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:!(l?m:Z)||R?b:l?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 l=c();return ce(r,{component:s,sx:{display:"flex",alignItems:"center",color:l.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:l}){const{palette:d}=c();return ce(r,{sx:{display:"flex",typography:"body2",color:d.text.secondary},children:[se(e,{id:"Balance:"})," ",o?ge({input:a,decimals:Math.min(n||4,4)}):"-",l&&a&&a.gt(0)&&se(r,{component:s,sx:{ml:6,color:(null==a?void 0:a.gt(0))?d.primary.main:d.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:l,withClear:d,onFocus:i,placeholder:m}){const h=c(),b=k((()=>l||(d&&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,l,h.palette.text.primary,a,d]);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:l=!0,children:d,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&&l&&se(r,{component:O,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>a&&a()),300)}})]}):"",d]})}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 l=c(),d=wt(),{account:i}=G(),s=d(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:l.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:l}){const d=Wt(),i=V((e=>kt(d,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((()=>{l&&b.current&&R(b.current.offsetHeight-34)}),[b,l]);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 l=c[o?a-1:a];return se(Xt,{token:l,disabled:!!e&&e.address===l.address,style:n,onClick:()=>h(l)},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:l}){const{height:d}=V(Ct);return se(Yt,{height:d,open:t,onClose:n,title:se(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:se(Bt,{value:a,visible:t,onChange:l,occupiedAddrs:o})})}function zt({sx:e,amt:t,token:a,readOnly:n,showMaxBtn:o,onMaxClick:l,fiatPriceTxt:d,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:l,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:d}),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:l}=e,d={from:n,to:o,value:a,data:l};a&&!/^0x0*$/.test(a)||delete d.value;try{return(yield t.estimateGas(d)).add(5e4)}catch(e){t.call(d).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:l}=G(),d=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||!l)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,l,d)=>Oe(void 0,void 0,void 0,(function*(){const i=Ke(e,_t,l,d).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,l);return c&&(r.gasLimit=c),yield Kt(r,l)})))(c.token.address,o,c.contract,c.amt||ta,l,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:d},!T.gasLimit)try{const e=yield qt(T,l);e&&(T.gasLimit=e)}catch(e){console.debug(e)}if(N=yield Kt(T,l),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 l="";return o.some((e=>Array.isArray(e.error)?e.error.some((a=>t.indexOf(a)>-1&&(l=e.msg,!0))):t.indexOf(e.error)>-1&&(l=e.msg,!0))),l||t}(d,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,d,r,l,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}=da(),t=[];return null==e||e.forEach((function([e,a]){a===Lt.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const la=S({execute:()=>Promise.resolve(Gt.Canceled),requests:void 0,waitingSubmit:!1});function da(){return Z(la)}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,l]=y(0),{chainId:d}=G(),i=k((()=>`https://${Me[d||1]}/tx/${n}`),[n,d]),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&&(l(0),clearInterval(s.current),s.current=setInterval((()=>{l((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:l,closeShowing:d,showingDone:i,errorMessage:c,transactionTx:s}=na(n),p=w();return ce(la.Provider,{value:o,children:[a,se(Yt,{open:!!l,onClose:d,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:l}),se(ma,{isStarted:!!l,isEnded:i,tx:s})]})]}),se(h,{fullWidth:!0,size:h.Size.big,onClick:()=>{p(aa({contractStatus:He.Initial})),d()},sx:{mt:20},children:se(e,c?{id:"Dismiss"}:{id:"Close"})})]})})]})}function ba({token:e,fiatPrice:t}){return{marginAmount:k((()=>{var o;const l=null!==(o=null==e?void 0:e.decimals)&&void 0!==o?o:6,d=((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),l);return(d.lt(new a(1).times(new a(10).pow(l-3)))?new a(0):d).toString(10)}),[null==e?void 0:e.decimals,t])}}function ua({width:e,height:t,feeRate:a,rebateTo:n,colorMode:o,apikey:l,defaultChainId:d,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;d&&c((e=d,t=>Oe(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[d]),F((()=>{c(aa({height:t}))}),[t]),F((()=>{c(aa({width:e}))}),[e]),F((()=>{l&&c(aa({apikey:l}))}),[l]),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),{apikey:l}=V(Ct),[d,i]=y(""),[r,c]=y(""),s=T((()=>{if(!a||!e||!t)return;o(!0);const n=[e,t];ie.post("https://api.dodoex.io/frontend-price-api/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:l}}).then((a=>{var n;o(!1);const l=null===(n=a.data)||void 0===n?void 0:n.data;l&&(i(l.find((t=>t.address===e.address)).price),c(l.find((e=>e.address===t.address)).price))})).catch((e=>{o(!1),console.error(e)}))}),[a,e,t,l]);return Ra({refetch:s}),{loading:n,refetch:s,toFiatPrice:r,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:l,chainId:d,provider:i}=G(),r=V(je),c=k((()=>d||r),[d,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:l||"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),!l||!i)return;const t=yield qt({from:l,to:e.to,value:e.value,data:e.data},i);t&&v(t)}catch(e){E(ga.Failed),console.error(e)}}))),[R,l,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=da();return T((({to:e,data:n,useSource:o,duration:l,ddl:d,gasLimit:i,subtitle:r,value:c})=>{const s=60*d,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:l,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:l,fromToken:d,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==d?void 0:d.logoURI,address:null!==(x=null==d?void 0:d.address)&&void 0!==x?x:"",marginRight:6}),se(r,{children:`${ge({input:i,decimals:null==d?void 0:d.decimals})} ${null==d?void 0:d.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==l?void 0:l.logoURI,address:null!==(T=null==l?void 0:l.address)&&void 0!==T?T:""}),se(r,{children:`${ge({input:p,decimals:null==l?void 0:l.decimals})} ${null==l?void 0:l.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==d?void 0:d.symbol} = ${ge({input:new a(p).dividedBy(new a(i)),decimals:null==l?void 0:l.decimals})} ${null==l?void 0:l.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==l?void 0:l.decimals})} ${null==l?void 0:l.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==l?void 0:l.decimals})} ${null==l?void 0:l.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:l}=e,d=Ue(e,["sx","maxVal","decimals","onInputChange"]);return c(),se(p,{...d,onChange:e=>{const t=0===e.target.value.length?null:ke(e.target.value,o),d=a&&t&&new n(t).gt(a)?a.toString():t;console.log("finalVal:",d),l&&l(d)}})}function Sa({open:t,onClose:a}){const n=c(),o=w(),l=V(Ea),d=V(fa),i=k((()=>Number(l)>=50),[l]);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:l,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:d,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:l}){const[d,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(l)}),[a,t,o,l]);const R=T((()=>{i(m),h(d),p(b),u(c)}),[d,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 ${d} = ${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[l]=o;null===(n=l.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?a(e):l.connectEagerly?l.connectEagerly(t):l.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 l;const d=V(je),i=k((()=>{var e;return Qe[null!==(e=t)&&void 0!==e?e:d]}),[t]),{isETH:r}=k((()=>Fe(t)),[t]),{DODO_APPROVE:c}=i||{},s=null!==(l=null!=o?o:c)&&void 0!==l?l:null,p=function(e){const{account:t}=G(),n=V(je),o=V(Tt),l=k((()=>we[n]),[n]),d=T((n=>{var d;if(!t||!e)return null;if(n.symbol===l.symbol&&Te(n.address,l.address))return new a(ta);const i=null===(d=null==o?void 0:o[n.address.toLowerCase()])||void 0===d?void 0:d.tokenAllowances;return null!=i?i:null}),[t,e,l.symbol,l.address,o]);return d}(s),m=wt(),{runningRequests:h}=oa(),b=V(St),u=k((()=>{var e;return null===(e=we[null!=t?t:d])||void 0===e?void 0:e.address}),[t]),R=T(((t,o,l)=>{if(!t)return ot.Loading;const d=!!(null==h?void 0:h.find((e=>e.spec.opcode===$t.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),i=null!=l?l: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:d?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=da(),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),l=n?new a(0):void 0,d=n?me._("Reset"):me._("Approve");var i;(yield E.execute(`${d} ${o}`,{opcode:$t.Approval,token:t,contract:s,amt:l}))===Gt.Success&&f((i=null!=l?l: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 l=r?.1:.02;return u===(null==e?void 0:e.address)&&(o=n.gt(l)?n.minus(l):t),o.toString()}),[t,m,r]);return{getApprovalState:R,getPendingRest:W,getMaxBalance:x,submitApprove:g}};function Oa(){var t,n;const o=c(),{isInflight:l}=oa(),{chainId:d,account:p}=G(),m=w(),{isReverseRouting:b}=V(Ct),u=V(je),R=V(Zt),W=V(Nt),{isETH:E}=k((()=>Fe(d)),[d]),g=k((()=>{var e;return null===(e=we[null!=d?d:u])||void 0===e?void 0:e.address}),[d]),[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:d,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:d}),oe=k((()=>ae(b?X:Y)),[null==Y?void 0:Y.address,null==X?void 0:X.address,ae,b]),{marginAmount:le}=ba({token:b?X:Y,fiatPrice:b?_:q}),{resAmount:de,priceImpact:ie,executeSwap:re,baseFeeAmount:me,additionalFeeAmount:he,resPricePerToToken:be,resPricePerFromToken:ue,status:Re}=xa({toToken:X,fromToken:Y,marginAmount:le,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((()=>{d&&(B(null),C(null),b?Ee(""):We("")),W&&W.chainId===d&&(C(W),W.amount&&(m(aa({isReverseRouting:!1})),We(W.amount))),R&&R.chainId===d&&(B(R),R.amount&&W&&!W.amount&&(m(aa({isReverseRouting:!0})),Ee(R.amount)))}),[R,W,d,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?de:M;return e&&q?new a(q).multipliedBy(e):null}),[q,M,b,de]),Ze=k((()=>{const e=b?O:de;return e&&_?new a(_).multipliedBy(e):null}),[_,O,b,de]),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[d||1]),[d]),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:de,decimals:null==Y?void 0:Y.decimals}):"-":x),[x,Z,de,Y,b]),ve=k((()=>b?Z:new a(x).gt(0)?ge({input:de,decimals:null==X?void 0:X.decimals}):"-"),[x,Z,de,X,b]),Ie=k((()=>{const t=ee(Y,b?de||0:M),n=t===ot.Approving,o=t===ot.Insufficient&&!oe,d=E?.1:.02,i=g===(null==Y?void 0:Y.address),r=new a($||0);return p?l?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..."})}):de&&Re!==ga.Failed?r.lt(b?de:M)||i&&r.lte(d)?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,de,Y,l,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?de: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:de,decimals:null==X?void 0:X.decimals})} ${null==X?void 0:X.symbol}`]}):se(r,{})),[Y,X,M,O,de,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?de:M,toAmount:b?O:de,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;
|