import { getServiceDomain } from '../domains'; import blocknativeIcon from '../images/blocknative.png'; import flashbotsIcon from '../images/flashbots.svg?url'; import { crossChainArbitrumOne, crossChainAurora, crossChainAvax, crossChainBSC, crossChainBase, crossChainBoba, crossChainConflux, crossChainEthereum, crossChainHeco, crossChainLinea, crossChainMoonRiver, crossChainOk, crossChainOptimism, crossChainPolygon, crossChainScroll, } from './bridge-candidates'; import { kArbSepCandidates, kArbitrumCandidates, kAuroraCandidates, kAvaxCandidates, kBSCCandidates, kBTRCandidates, kBaseCandidates, kBasegorCandidates, kBobaCandidates, kCFXCandidates, kCandidates, kDODOChainTestnetCandidates, kGorCandidates, kHecoCandidates, kKCSCandidates, kLineaCandidates, kMantaCandidates, kMantleCandidates, kMaticCandidates, kMoonriverCandidates, kOkchainCandidates, kOptimismCandidates, kSCRAlphaCandidates, kSCRCandidates, kSCRSepoliaCandidates, kSepCandidates, kX1Candidates, kZircuitTestnetCandidates, kZircuitMainnetCandidates, kOKBCandidates, kZeroSepoliaCandidates, kZeroMainnetCandidates, kHSKCandidates, kHemiCandidates, } from './candidates'; import { DexKey, dexListObj } from './dexConfig'; import { Chain, ThegraphKeyMap } from './type'; export const DEFAULT_CHAIN_ID = 1; export const kGoodPrice = 40000000000; export const kGreatPrice = 30000000000; export const kBSCGoodPrice = 20000000000; export const kBSCGreatPrice = 15000000000; export function getChain(chainId: number): Chain { // https://docs.bnbchain.org/docs/rpc#mainnet-chainid-0x38-56-in-decimal const BSCChain: Chain = { enable: true, name: 'Binance Smart Chain Mainnet', chainId: 56, chain: 'BSC', network: 'BSC', platformId: 'bsc', networkId: 56, ledgerAppName: 'Binance Smart Chain', configUrl: `https://config.${getServiceDomain()}/configs/bsc.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/bsc.json`, thegraphKey: ThegraphKeyMap.bsc, fromTokenInit: { name: 'BUSD Token', symbol: 'BUSD', address: '0xe9e7cea3dedca5984780bafc599bd69add087d56', decimals: 18, chainId: 56, }, toTokenInit: { symbol: 'USDT', address: '0x55d398326f99059ff775485246999027b3197955', name: 'Tether USD', decimals: 18, chainId: 56, }, scanUrlDomain: 'bscscan.com', blockTime: 3000, bscTradeMiningEnable: false, providerCandidates: kBSCCandidates, bridgeProviderCandidates: crossChainBSC, gaspriceStandard: { good: kBSCGoodPrice, great: kBSCGreatPrice, }, viewOnScanKey: 'common.viewOnBscScan', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: true, limitOrderContract: '0x68961ed2e31f9b0D3e2eb40Cc480c18F56537Fdc', limitOrderBotAddress: '0xE465758cedC7e0B33bf5590f88759097a60f707d', dexKeys: [ 'pancakeV2', 'pancakeV1', 'MDEX', 'bakery', 'biSwap', 'apeSwap', 'babySwap', ], addChainParameters: { chainId: '0x38', chainName: 'BNB Smart Chain Mainnet', rpcUrls: [ 'https://bsc-dataseed1.bnbchain.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', 'wss://bsc-ws-node.nariox.org', 'https://bsc-dataseed1.defibit.io', 'https://bsc.nodereal.io', ], nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18, }, blockExplorerUrls: ['https://bscscan.com/'], }, routeV3Enable: true, }; /** * @see https://chainlist.org/zh * @see https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-1.json */ const chainIdToChainConfig: Record = { // ETH // mainnet 1: { enable: true, name: 'Ethereum Mainnet', chainId: 1, chain: 'ETH', network: 'ETH', networkId: 1, platformId: 'ethereum', ledgerAppName: 'Ethereum', configUrl: `https://config.${getServiceDomain()}/configs/mainnet.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/mainnet.json`, thegraphKey: ThegraphKeyMap.eth, cirAddress: '0x357c5E9cfA8B834EDcef7C7aAbD8F9Db09119d11', fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'Ether', decimals: 18, source: 'dodo', chainId: 1, }, toTokenInit: { symbol: 'USDC', address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', name: 'USD Coin', decimals: 6, source: 'dodo', chainId: 1, }, scanUrlDomain: 'etherscan.io', blockTime: 12000, vDODOEnable: true, preminingEnable: true, providerCandidates: kCandidates, bridgeProviderCandidates: crossChainEthereum, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnEtherscan', dspPoolEnable: true, gasSelectSpeeds: { rapid: '15s', fast: '1min', medium: '3min', }, nftEnable: true, limitOrderContract: '0xb38D394D52A15910b8acc173b816624dc90066cd', limitOrderBotAddress: '0x29E7dB1B8B5377dF660E26f1E95938C29beB9d79', dexKeys: ['uniswapV2', 'sushiSwap', 'shibaSwap'], addChainParameters: { chainId: '0x1', }, routeV3Enable: false, swapSlippageMaxSlippagePercentage: 0.5, privacySwapSupplierEndpoints: [ { key: 'Flashbots', name: 'Flashbots', logo: flashbotsIcon?.src ?? flashbotsIcon, docUrl: 'https://docs.flashbots.net/new-to-mev', addChainParameters: { chainId: '0x1', chainName: 'Flashbots Protect', rpcUrls: ['https://rpc.flashbots.net/fast'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://etherscan.io/'], }, isPrivacyEndpoint: { // FlashbotsRPC https://etherscan.io/address/0xf1a54b0759b58661cea17cff19dd37940a9b5f1a#code contract: '0xf1a54b0759b58661cEa17CfF19dd37940a9b5f1A', rpcMethod: 'isFlashRPC', }, }, { key: 'Blocknative', name: 'Blocknative', logo: blocknativeIcon.src ?? blocknativeIcon, docUrl: 'https://docs.blocknative.com/', addChainParameters: { chainId: '0x1', chainName: 'Blocknative', rpcUrls: ['https://rpc.blocknative.com/boost'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://etherscan.io/'], }, isPrivacyEndpoint: { // https://etherscan.io/address/0x76838FdE3Aeb876dC10E6e3bB2a1757dEA58a25C#code contract: '0x76838FdE3Aeb876dC10E6e3bB2a1757dEA58a25C', rpcMethod: 'isBlocknativeRPC', }, }, ], platformGasReserve: 0.1, }, // goerli // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-5.json // https://docs.etherscan.io/v/goerli-etherscan/ 5: { enable: true, name: 'Goerli', chainId: 5, chain: 'ETH', network: 'Goerli', networkId: 5, platformId: 'gor', configUrl: 'https://config.dodoex.io/configs/gor.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/gor.json', thegraphKey: ThegraphKeyMap.gor, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 5, }, toTokenInit: { symbol: 'USDC', address: '0xC4106029d03c33731Ca01Ba59b5A6368c660E596', decimals: 6, name: 'USDC', chainId: 5, }, scanUrlDomain: 'goerli.etherscan.io', blockTime: 12000, vDODOEnable: true, providerCandidates: kGorCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnEtherscan', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: true, limitOrderContract: '0x488380Af8c73e22c0c5d28b6aE24DB5022cB346d', limitOrderBotAddress: '0x75853988EA221120c82c9CE0Fff2008B5FF011bd', dexKeys: [], addChainParameters: { chainId: '0x5', }, isTestNet: true, routeV3Enable: false, platformGasReserve: 0.1, }, // Ethereum Testnet Sepolia // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-11155111.json // https://docs.etherscan.io/v/sepolia-etherscan/ 11155111: { enable: true, name: 'Sepolia', chainId: 11155111, chain: 'ETH', network: 'Sepolia', networkId: 11155111, platformId: 'sepolia', configUrl: 'https://config.dodoex.io/configs/sep.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/sep.json', thegraphKey: ThegraphKeyMap.sep, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 11155111, }, toTokenInit: { symbol: 'WETH', address: '0x7B07164ecFaF0F0D85DFC062Bc205a4674c75Aa0', decimals: 18, name: 'Wrapped Ether', chainId: 11155111, }, scanUrlDomain: 'sepolia.etherscan.io', blockTime: 12000, vDODOEnable: false, providerCandidates: kSepCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnEtherscan', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, limitOrderContract: '0x6990254C0Dcae91e2FD93C493D33570cDaBC3dC6', limitOrderBotAddress: '0xbD3666DA3127983202C47E0Bc44982A8293E603c', addChainParameters: { chainId: '0xaa36a7', }, isTestNet: true, routeV2Enable: true, platformGasReserve: 0.1, }, /** * optimistic ethereum * @see https://community.optimism.io/docs/useful-tools/networks/ */ 10: { enable: true, name: 'Optimism', chainId: 10, chain: 'Optimism', network: 'Optimism', networkId: 10, platformId: 'optimism', configUrl: `https://config.${getServiceDomain()}/configs/optimism.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/optimism.json`, thegraphKey: ThegraphKeyMap.optimism, fromTokenInit: { symbol: 'WETH', address: '0x4200000000000000000000000000000000000006', name: 'Wrapped Ether', decimals: 18, source: 'dodo', chainId: 10, }, toTokenInit: { address: '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', decimals: 6, symbol: 'USDT', name: 'Tether USD', source: 'DODO', chainId: 10, }, scanUrlDomain: 'optimistic.etherscan.io', // L2 blockTime: 12000, bscTradeMiningEnable: false, providerCandidates: kOptimismCandidates, bridgeProviderCandidates: crossChainOptimism, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, nftEnable: false, limitOrderContract: '', limitOrderBotAddress: '', dexKeys: [], addChainParameters: { chainId: '0xa', chainName: 'OP Mainnet', rpcUrls: [ // 以下两个节点在 2022.08.05 上午都无法使用 'https://mainnet.optimism.io', 'https://optimism-mainnet.public.blastapi.io', // alchemy 私人节点,用来测试移动端 metamask 添加 optimism 链 // 'https://opt-mainnet.g.alchemy.com/v2/NND6JvlZtqzFPXPAJ37IXsMALnD88CNS', ], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://optimistic.etherscan.io'], }, routeV3Enable: false, platformGasReserve: 0.01, }, // boba mainnet 288: { enable: true, chainId: 288, name: 'BOBA L2', platformId: 'boba', configUrl: `https://config.${getServiceDomain()}/configs/boba.json`, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'ETH', decimals: 18, source: 'dodo', chainId: 288, }, toTokenInit: { symbol: 'USDC', address: '0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc', name: 'USD Coin', decimals: 6, source: 'dodo', chainId: 288, }, thegraphKey: ThegraphKeyMap.boba, scanUrlDomain: 'blockexplorer.boba.network', blockTime: 2000, providerCandidates: kBobaCandidates, bridgeProviderCandidates: crossChainBoba, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, limitOrderContract: '0x00971e21955F1bb8021a5eF2546beC2Ff896EE42', limitOrderBotAddress: '0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8', dexKeys: ['ooLongSwap'], addChainParameters: { chainId: '0x120', chainName: 'BOBA L2', rpcUrls: [ 'https://mainnet.boba.network', 'https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f', 'https://lightning-replica.boba.network', ], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://blockexplorer.boba.network'], }, routeV3Enable: false, }, // BSC // mainnet 56: BSCChain, 86: BSCChain, // OKEXChain // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-66.json 66: { enable: true, name: 'OKTC', chainId: 66, chain: 'okxchain', network: 'OKTC', networkId: 66, platformId: 'okex-chain', configUrl: `https://config.${getServiceDomain()}/configs/okchain.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/okchain.json`, thegraphKey: ThegraphKeyMap.okchain, fromTokenInit: { symbol: 'OKT', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'OKT', decimals: 18, source: 'dodo', chainId: 66, }, toTokenInit: { symbol: 'USDT', address: '0x382bB369d343125BfB2117af9c149795C6C65C50', name: 'USDT', decimals: 18, source: 'other', chainId: 66, }, scanUrlDomain: 'www.oklink.com/okexchain', blockTime: 4000, vDODOEnable: false, providerCandidates: kOkchainCandidates, bridgeProviderCandidates: crossChainOk, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnOKTExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '15s', fast: '1min', medium: '3min', }, limitOrderContract: '0x329654d697A831C2C9aceD56265Ed1E4bD5C85A0', limitOrderBotAddress: '0x4BFa49b0a0B6B08D3D82b8AB45feC0c737880155', addChainParameters: { chainId: '0x42', chainName: 'OKXChain Mainnet', rpcUrls: [ 'https://exchainrpc.okex.org', 'https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff', ], nativeCurrency: { name: 'OKT', symbol: 'OKT', decimals: 18, }, blockExplorerUrls: ['https://www.oklink.com/en/okc'], }, routeV3Enable: false, }, /** * Heco 主网 * https://docs.hecochain.com/#/mainnet */ 128: { enable: true, name: 'Huobi ECO Chain Mainnet', chainId: 128, chain: 'Heco', network: 'Heco', platformId: 'heco', networkId: 128, configUrl: `https://config.${getServiceDomain()}/configs/heco.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/heco.json`, fromTokenInit: { symbol: 'WHT', name: 'Wrapped HT', address: '0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f', decimals: 18, chainId: 128, }, toTokenInit: { symbol: 'HUSD', name: 'Heco-Peg HUSD Token', address: '0x0298c2b32eae4da002a15f36fdf7615bea3da047', decimals: 8, chainId: 128, }, scanUrlDomain: 'hecoinfo.com', thegraphKey: ThegraphKeyMap.heco, // https://docs.hecochain.com/#/intro?id=%e7%81%ab%e5%b8%81%e7%94%9f%e6%80%81%e9%93%beheco%e6%80%a7%e8%83%bd blockTime: 3000, providerCandidates: kHecoCandidates, bridgeProviderCandidates: crossChainHeco, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnHecoScan', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, limitOrderContract: '0x3c3a0793406F9A88c331860BE4dd55DACa5b6d79', limitOrderBotAddress: '0x09F5FcDD8D379D5bAC139E6DC3522b5053cebB02', dexKeys: ['MDEX'], /** * * @returns 注册 heco 网络 * @see https://docs.metamask.io/guide/rpc-api.html#wallet-addethereumchain * @see https://www.defibox.com/defiStrategy/113 * @see https://chainid.network/chains.json */ addChainParameters: { chainId: '0x80', chainName: 'Huobi ECO Chain Mainnet', rpcUrls: [ 'https://http-mainnet.hecochain.com', 'wss://ws-mainnet.hecochain.com', 'https://pub001.hg.network/rpc', ], nativeCurrency: { name: 'Huobi ECO Chain Native Token', symbol: 'HT', decimals: 18, }, blockExplorerUrls: ['https://hecoinfo.com'], }, routeV3Enable: false, }, /** * Polygon matic 主网 * https://docs.matic.network/docs/develop/network-details/network */ 137: { enable: true, name: 'Polygon', chainId: 137, chain: 'Polygon', network: 'Polygon', networkId: 137, platformId: 'polygon', ledgerAppName: 'Polygon', configUrl: `https://config.${getServiceDomain()}/configs/matic.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/matic.json`, fromTokenInit: { symbol: 'POL', name: 'Polygon Ecosystem Token', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, chainId: 137, }, toTokenInit: { symbol: 'DODO', name: 'DODO bird', address: '0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78', decimals: 18, chainId: 137, }, scanUrlDomain: 'polygonscan.com', thegraphKey: ThegraphKeyMap.polygon, // https://docs.hecochain.com/#/intro?id=%e7%81%ab%e5%b8%81%e7%94%9f%e6%80%81%e9%93%beheco%e6%80%a7%e8%83%bd blockTime: 2200, providerCandidates: kMaticCandidates, bridgeProviderCandidates: crossChainPolygon, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnMatic', dspPoolEnable: true, gasSelectSpeeds: { rapid: '1s', fast: '3s', medium: '6s', }, limitOrderContract: '0xA2b931567C3F074fe99d37C1cDd0c6626cca541f', limitOrderBotAddress: '0x44Ee839De23bdf72B5cF460B9f45B0B47A0E4c22', dexKeys: ['quickSwap', 'sushiSwap'], /** * * @see https://docs.polygon.technology/docs/develop/metamask/config-polygon-on-metamask#add-the-polygon-network-manually * @see https://medium.com/stakingbits/setting-up-metamask-for-polygon-matic-network-838058f6d844 */ addChainParameters: { chainId: '0x89', chainName: 'Polygon Mainnet', rpcUrls: [ '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://polygon-bor.publicnode.com', ], nativeCurrency: { name: 'Polygon Ecosystem Token', symbol: 'POL', decimals: 18, }, blockExplorerUrls: ['https://polygonscan.com/'], }, routeV3Enable: false, }, /** * KCC Mainnet * @link https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-321.json * @link https://docs.kcc.io/#/en-us/?id=how-to-configure-metamask-wallet */ 321: { enable: true, chainId: 321, name: 'KCC Mainnet', platformId: 'kcs', configUrl: `https://config.${getServiceDomain()}/configs/kcs.json`, fromTokenInit: { symbol: 'KCS', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'KuCoin Token', decimals: 18, chainId: 321, }, toTokenInit: { symbol: 'USDT', address: '0x0039f574ee5cc39bdd162e9a88e3eb1f111baf48', name: 'KCC-Peg Tether USD', decimals: 18, chainId: 321, }, scanUrlDomain: 'explorer.kcc.io/en', thegraphKey: ThegraphKeyMap.kcs, blockTime: 3000, providerCandidates: kKCSCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, limitOrderContract: '0xf5Ec1a19e1570bDf0A3AaA6585274f27027270b1', limitOrderBotAddress: '0x8eA40e8Da3ae64Bad5E77a5f7DB346499F543baC', dexKeys: [], addChainParameters: { chainId: '0x141', chainName: 'KCC Mainnet', rpcUrls: [ 'https://rpc-mainnet.kcc.network', 'https://kcc.mytokenpocket.vip', 'https://public-rpc.blockpi.io/http/kcc', ], nativeCurrency: { name: 'KuCoin Token', symbol: 'KCS', decimals: 18, }, blockExplorerUrls: ['https://explorer.kcc.io/en/'], }, }, // Moonriver 1285: { enable: true, chainId: 1285, name: 'Moonriver', platformId: 'moonriver', configUrl: `https://config.${getServiceDomain()}/configs/moonriver.json`, fromTokenInit: { symbol: 'MOVR', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'MOVR', decimals: 18, source: 'dodo', chainId: 1285, }, toTokenInit: { symbol: 'WMOVR', address: '0x98878b06940ae243284ca214f92bb71a2b032b8a', name: 'WMOVR', decimals: 18, source: 'dodo', chainId: 1285, }, scanUrlDomain: 'moonriver.moonscan.io', thegraphKey: ThegraphKeyMap.moonriver, blockTime: 6000, providerCandidates: kMoonriverCandidates, bridgeProviderCandidates: crossChainMoonRiver, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '1s', fast: '3s', medium: '6s', }, limitOrderContract: '0x8D4111c075CEbA32dD20EC82ecb586B85A8ca467', limitOrderBotAddress: '0x800A526b9aB8f2d13cE2ab9Cf000A8D64b0ab866', dexKeys: ['sushiSwap', 'solarBeam'], addChainParameters: { chainId: '0x505', chainName: 'Moonriver', rpcUrls: [ 'https://rpc.api.moonriver.moonbeam.network', 'wss://wss.api.moonriver.moonbeam.network', ], nativeCurrency: { name: 'MOVR', symbol: 'MOVR', decimals: 18, }, blockExplorerUrls: ['https://moonriver.moonscan.io'], }, routeV3Enable: false, }, // Arbitrum 42161: { enable: true, name: 'Arbitrum Mainnet', chainId: 42161, chain: 'Arbitrum', network: 'Arbitrum', networkId: 42161, platformId: 'arbitrum', // needs confirm configUrl: `https://config.${getServiceDomain()}/configs/arbitrum.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/arbitrum.json`, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'Ether', decimals: 18, source: 'dodo', chainId: 42161, }, toTokenInit: { symbol: 'WETH', address: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', name: 'Wrap Eth', decimals: 18, source: 'dodo', chainId: 42161, }, scanUrlDomain: 'arbiscan.io', thegraphKey: ThegraphKeyMap.arbitrum, blockTime: 12000, // not stable providerCandidates: kArbitrumCandidates, bridgeProviderCandidates: crossChainArbitrumOne, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnArbitrum', dspPoolEnable: true, gasSelectSpeeds: { rapid: '1s', fast: '3s', medium: '6s', }, limitOrderContract: '0x2676315Ce2E9B81F2ffEB7105091c72417cdB1f0', limitOrderBotAddress: '0x93C7A43B78E2B1007bC10aC5F6f8e978D04e8ab0', dexKeys: ['sushiSwap'], addChainParameters: { chainId: '0xa4b1', chainName: 'Arbitrum one', rpcUrls: ['https://arb1.arbitrum.io/rpc'], nativeCurrency: { name: 'Ethereum', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://arbiscan.io'], }, routeV3Enable: false, platformGasReserve: 0.01, }, // Aurora 1313161554: { enable: true, name: 'Aurora', chainId: 1313161554, platformId: 'aurora', // needs confirm configUrl: `https://config.${getServiceDomain()}/configs/aurora.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/aurora.json`, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'Ether', decimals: 18, source: 'dodo', chainId: 1313161554, }, toTokenInit: { symbol: 'WETH', address: '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB', name: 'Wrap Eth', decimals: 18, source: 'dodo', chainId: 1313161554, }, scanUrlDomain: 'aurorascan.dev', thegraphKey: ThegraphKeyMap.aurora, blockTime: 1000, // not stable providerCandidates: kAuroraCandidates, bridgeProviderCandidates: crossChainAurora, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '1s', fast: '3s', medium: '6s', }, limitOrderContract: '0x53a51a124EFCDA74fC607a272615e7e93f661a94', limitOrderBotAddress: '0x27566bf9504466F6f3a1571E1863Da42fff4D25E', dexKeys: ['trisolaris', 'wannaSwap'], addChainParameters: { chainId: '0x4e454152', chainName: 'Aurora Mainnet', rpcUrls: ['https://mainnet.aurora.dev'], nativeCurrency: { name: 'Ethereum', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://aurorascan.dev/'], }, routeV3Enable: false, }, // Avalanche 43114: { enable: true, name: 'Avalanche', chainId: 43114, platformId: 'avalanche', // needs confirm configUrl: `https://config.${getServiceDomain()}/configs/avalanche.json`, nftConfigUrl: `https://config.${getServiceDomain()}/nft-configs/avalanche.json`, fromTokenInit: { symbol: 'AVAX', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', name: 'Avalanche', decimals: 18, source: 'dodo', chainId: 43114, }, toTokenInit: { symbol: 'WAVAX', address: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', name: 'Wrapped AVAX', decimals: 18, source: 'dodo', chainId: 43114, }, scanUrlDomain: 'snowtrace.io', thegraphKey: ThegraphKeyMap.avalanche, blockTime: 1000, // not stable providerCandidates: kAvaxCandidates, bridgeProviderCandidates: crossChainAvax, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '1s', fast: '3s', medium: '6s', }, limitOrderContract: '0x5Cd953fC2001487D74142B9c8B74eE95A95b7139', limitOrderBotAddress: '0xe3B40F8D8346d428EAB28d9Fd672b784d921cfBD', dexKeys: ['traderJoe', 'pangolin', 'sushi'], addChainParameters: { chainId: '0xa86a', chainName: 'Avalanche C-Chain', rpcUrls: [ 'https://api.avax.network/ext/bc/C/rpc', 'https://rpc.ankr.com/avalanche', 'https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc', ], nativeCurrency: { name: 'Avalanche', symbol: 'AVAX', decimals: 18, }, blockExplorerUrls: ['https://snowtrace.io/'], }, routeV3Enable: false, }, // base // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-8453.json // https://docs.base.org/ 8453: { enable: true, name: 'Base', chainId: 8453, chain: 'ETH', network: 'base', networkId: 8453, platformId: 'base', configUrl: 'https://config.dodoex.io/configs/base.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/base.json', thegraphKey: ThegraphKeyMap.base, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'Ether', chainId: 8453, }, toTokenInit: { symbol: 'USDbC', address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', decimals: 6, name: 'USD Base Coin', chainId: 8453, }, scanUrlDomain: 'basescan.org', blockTime: 2000, vDODOEnable: false, providerCandidates: kBaseCandidates, bridgeProviderCandidates: crossChainBase, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x2105', chainName: 'Base', rpcUrls: ['https://mainnet.base.org'], nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://basescan.org'], }, isTestNet: false, routeV3Enable: false, platformGasReserve: 0.01, }, // basegor // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-5.json // https://docs.etherscan.io/v/goerli-etherscan/ 84531: { enable: true, name: 'Base Goerli', chainId: 84531, chain: 'ETH', network: 'basegor', networkId: 84531, platformId: 'basegor', configUrl: 'https://config.dodoex.io/configs/basegor.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/basegor.json', thegraphKey: ThegraphKeyMap.basegor, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'Goerli Ether', chainId: 84531, }, toTokenInit: { symbol: 'WETH', address: '0x4200000000000000000000000000000000000006', decimals: 18, name: 'Wrapped Ether', chainId: 84531, }, scanUrlDomain: 'goerli.basescan.org', blockTime: 2000, vDODOEnable: false, providerCandidates: kBasegorCandidates, bridgeProviderCandidates: crossChainBase, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x14a33', chainName: 'Base Goerli', rpcUrls: ['https://goerli.base.org'], nativeCurrency: { name: 'Goerli Ether', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://goerli.basescan.org/'], }, isTestNet: true, platformGasReserve: 0.01, }, // cfx // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-1030.json 1030: { enable: true, name: 'Conflux eSpace', chainId: 1030, chain: 'Conflux', network: 'cfx', networkId: 1030, platformId: 'cfx', configUrl: 'https://config.dodoex.io/configs/cfx.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/cfx.json', thegraphKey: ThegraphKeyMap.cfx, fromTokenInit: { symbol: 'WCFX', address: '0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b', decimals: 18, name: 'Wrapped Conflux', chainId: 1030, }, toTokenInit: { symbol: 'NUT', address: '0xfe197e7968807b311d476915db585831b43a7e3b', decimals: 18, name: 'Nucleon Governance Token', chainId: 1030, }, scanUrlDomain: 'evm.confluxscan.net', blockTime: 1500, vDODOEnable: false, providerCandidates: kCFXCandidates, bridgeProviderCandidates: crossChainConflux, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x406', chainName: 'Conflux eSpace', rpcUrls: ['https://evm.confluxrpc.com'], nativeCurrency: { name: 'CFX', symbol: 'CFX', decimals: 18, }, blockExplorerUrls: ['https://evm.confluxscan.net'], }, isTestNet: false, routeV3Enable: false, }, // Scroll Alpha Testnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-534353.json 534353: { enable: true, name: 'Scroll Alpha Testnet', chainId: 534353, chain: 'ETH', network: 'scr-alpha', networkId: 534353, platformId: 'scr-alpha', configUrl: 'https://config.dodoex.io/configs/scr-alpha.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/scr-alpha.json', thegraphKey: ThegraphKeyMap.scrAlpha, fromTokenInit: { symbol: 'WETH', address: '0xa1EA0B2354F5A344110af2b6AD68e75545009a03', decimals: 18, name: 'Wrapped Ether', chainId: 534353, }, toTokenInit: { symbol: 'USDT', address: '0xa5EC55A6Dc6AAFa491Aa5A8c92432C8Ccb4066C1', decimals: 18, name: 'USDT', isMintable: true, chainId: 534353, }, scanUrlDomain: 'blockscout.scroll.io', blockTime: 3000, vDODOEnable: false, providerCandidates: kSCRAlphaCandidates, bridgeProviderCandidates: crossChainScroll, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x82751', chainName: 'Scroll Alpha Testnet', rpcUrls: ['https://alpha-rpc.scroll.io/l2'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://blockscout.scroll.io'], }, isTestNet: true, routeV3Enable: false, platformGasReserve: 0.01, }, // Scroll Sepolia Testnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-534353.json 534351: { enable: true, name: 'Scroll Sepolia Testnet', chainId: 534351, chain: 'ETH', network: 'scr-sepolia', networkId: 534351, platformId: 'scr-sepolia', configUrl: 'https://config.dodoex.io/configs/scr-sepolia.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/scr-sepolia.json', thegraphKey: ThegraphKeyMap.scrSepolia, fromTokenInit: { symbol: 'WETH', address: '0xa7b9C3a116b20bEDDdBE4d90ff97157f67F0bD97', decimals: 18, name: 'Wrapped Ether', chainId: 534351, }, toTokenInit: { symbol: 'USDT', address: '0xFfd2eCE82f7959ae184D10fe17865d27B4f0FB94', decimals: 6, name: 'USDT', chainId: 534351, }, scanUrlDomain: 'sepolia-blockscout.scroll.io', blockTime: 3000, vDODOEnable: false, providerCandidates: kSCRSepoliaCandidates, bridgeProviderCandidates: crossChainScroll, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x8274f', chainName: 'Scroll Sepolia Testnet', rpcUrls: ['https://sepolia-rpc.scroll.io/'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://sepolia-blockscout.scroll.io'], }, isTestNet: true, routeV3Enable: false, platformGasReserve: 0.01, }, // Linea // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-59144.json // https://docs.linea.build/use-mainnet/info-contracts 59144: { enable: true, name: 'linea', chainId: 59144, chain: 'ETH', network: 'linea', networkId: 59144, platformId: 'linea', configUrl: 'https://config.dodoex.io/configs/linea.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/linea.json', thegraphKey: ThegraphKeyMap.linea, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'Ether', chainId: 59144, }, toTokenInit: { symbol: 'USDT', address: '0xA219439258ca9da29E9Cc4cE5596924745e12B93', decimals: 6, name: 'Tether USD', chainId: 59144, }, scanUrlDomain: 'lineascan.build', blockTime: 2000, vDODOEnable: false, providerCandidates: kLineaCandidates, bridgeProviderCandidates: crossChainLinea, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0xe708', chainName: 'Linea Mainnet', rpcUrls: ['https://linea-mainnet.infura.io/v3'], nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://lineascan.build/'], }, isTestNet: false, routeV3Enable: false, platformGasReserve: 0.01, }, // Scroll // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-534352.json 534352: { enable: true, name: 'Scroll', chainId: 534352, chain: 'ETH', network: 'scr', networkId: 534352, platformId: 'scr', configUrl: 'https://config.dodoex.io/configs/scr.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/scr.json', thegraphKey: ThegraphKeyMap.scr, fromTokenInit: { symbol: 'WETH', address: '0x5300000000000000000000000000000000000004', decimals: 18, name: 'Wrapped Ether', chainId: 534352, }, toTokenInit: { symbol: 'USDC', address: '0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4', decimals: 6, name: 'USD Coin', chainId: 534352, }, scanUrlDomain: 'scrollscan.com', // https://blockscout.scroll.io/ blockTime: 3000, vDODOEnable: false, providerCandidates: kSCRCandidates, bridgeProviderCandidates: crossChainScroll, gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x82750', chainName: 'Scroll', rpcUrls: ['https://rpc.scroll.io/'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://scrollscan.com/'], }, isTestNet: false, routeV3Enable: false, platformGasReserve: 0.01, }, // Manta // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-169.json 169: { enable: true, name: 'Manta Pacific Mainnet', chainId: 169, chain: 'Manta Pacific', network: 'manta', networkId: 169, platformId: 'manta', configUrl: 'https://config.dodoex.io/configs/manta.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/manta.json', thegraphKey: ThegraphKeyMap.manta, fromTokenInit: { symbol: 'WETH', address: '0x0Dc808adcE2099A9F62AA87D9670745AbA741746', decimals: 18, name: 'Wrapped Ether', chainId: 169, }, toTokenInit: { symbol: 'USDC', address: '0xb73603c5d87fa094b7314c74ace2e64d165016fb', decimals: 6, name: 'USD Coin', chainId: 169, }, scanUrlDomain: 'pacific-explorer.manta.network', blockTime: 10000, vDODOEnable: false, providerCandidates: kMantaCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0xa9', chainName: 'Manta Pacific Mainnet', rpcUrls: ['https://pacific-rpc.manta.network/http'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://pacific-explorer.manta.network/'], }, isTestNet: false, routeV3Enable: false, platformGasReserve: 0.01, }, // Mantle // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-5000.json 5000: { enable: true, name: 'Mantle', chainId: 5000, chain: 'ETH', network: 'mantle', networkId: 5000, platformId: 'mantle', configUrl: 'https://config.dodoex.io/configs/mantle.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/mantle.json', thegraphKey: ThegraphKeyMap.mantle, fromTokenInit: { symbol: 'WMNT', address: '0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8', decimals: 18, name: 'Wrapped Mantle', chainId: 5000, }, toTokenInit: { symbol: 'USDC', address: '0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9', decimals: 6, name: 'USD Coin', chainId: 5000, }, scanUrlDomain: 'explorer.mantle.xyz', // 计算区块间隔时间得到,不稳定 blockTime: 2000, vDODOEnable: false, providerCandidates: kMantleCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0x1388', chainName: 'Mantle', rpcUrls: ['https://rpc.mantle.xyz'], nativeCurrency: { name: 'MNT', symbol: 'MNT', decimals: 18, }, blockExplorerUrls: ['https://explorer.mantle.xyz/'], }, isTestNet: false, routeV3Enable: false, platformGasReserve: 0.01, }, // OKX x1 // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-195.json // https://www.okx.com/cn/x1/docs/getting-started/welcome/welcome-to-x1 195: { enable: true, name: 'X1 Testnet', chainId: 195, chain: 'x1', network: 'tokb', networkId: 195, platformId: 'tokb', configUrl: 'https://config.dodoex.io/configs/tokb.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/tokb.json', thegraphKey: ThegraphKeyMap.tokb, fromTokenInit: { symbol: 'USDT', address: '0x4d4907f1b2093f53D9f97064Dc0dD19687caFa9C', name: 'USDT', decimals: 18, chainId: 195, }, toTokenInit: { symbol: 'USDC', address: '0x27D1cb76E2fc214C3dfbaABA983C505f58824DC6', decimals: 18, name: 'USDC', chainId: 195, }, scanUrlDomain: 'www.oklink.com/x1-test', blockTime: 1000, vDODOEnable: false, providerCandidates: kX1Candidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, nftEnable: false, dexKeys: [], addChainParameters: { chainId: '0xc3', chainName: 'X1 Testnet', rpcUrls: ['https://testrpc.x1.tech/'], nativeCurrency: { name: 'OKB', symbol: 'OKB', decimals: 18, }, blockExplorerUrls: ['https://www.oklink.com/x1-test/'], }, isTestNet: true, routeV3Enable: false, platformGasReserve: 0.01, }, // dodochain-testnet // https://www.notion.so/dodotopia/DODOchain-testnet-53457-ongoing-dfc2c18339ab4241a0525fbc2fe41ac1 53457: { enable: true, name: 'DODOchain Testnet', chainId: 53457, chain: 'ETH', network: 'dodochain-testnet', networkId: 53457, platformId: 'dodochain-testnet', configUrl: 'https://config.dodoex.io/configs/dodochain-testnet.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/dodochain-testnet.json', thegraphKey: ThegraphKeyMap.dodochainTestnet, fromTokenInit: { symbol: 'DODO', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'DODO', chainId: 53457, }, toTokenInit: { symbol: 'WBERD', address: '0x3a64Ec3606FF7310E8fAd6FcC008e39705fB496d', decimals: 18, name: 'Wrapped Berd', chainId: 53457, }, scanUrlDomain: 'dodochain-testnet-explorer.alt.technology', blockTime: 12000, vDODOEnable: false, providerCandidates: kDODOChainTestnetCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnDODOExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xd0d1', chainName: 'DODOchain Testnet', rpcUrls: ['https://dodochain-testnet.alt.technology'], nativeCurrency: { name: 'DODO', symbol: 'DODO', decimals: 18, }, blockExplorerUrls: [ 'https://dodochain-testnet-explorer.alt.technology/', ], }, isTestNet: true, routeV3Enable: false, platformGasReserve: 0.1, }, // Bitlayer Mainnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-200901.json 200901: { enable: true, name: 'Bitlayer Mainnet', chainId: 200901, chain: 'Bitlayer', network: 'btr', networkId: 200901, platformId: 'btr', configUrl: 'https://config.dodoex.io/configs/btr.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/btr.json', thegraphKey: ThegraphKeyMap.btr, fromTokenInit: { symbol: 'BTC', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'BTC', chainId: 200901, }, toTokenInit: { symbol: 'WBTC', address: '0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F', decimals: 6, name: 'Tether USD', chainId: 200901, }, scanUrlDomain: 'www.btrscan.com', blockTime: 3000, vDODOEnable: false, providerCandidates: kBTRCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnBTRExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0x310c5', chainName: 'Bitlayer Mainnet', rpcUrls: ['https://rpc.bitlayer.org'], nativeCurrency: { name: 'BTC', symbol: 'BTC', decimals: 18, }, blockExplorerUrls: ['https://www.btrscan.com'], }, routeV3Enable: false, }, // Zircuit Testnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-48899.json 48899: { enable: true, name: 'Zircuit Testnet', chainId: 48899, chain: 'Zircuit Testnet', network: 'zircuit-testnet', networkId: 48899, platformId: 'zircuit-testnet', configUrl: 'https://config.dodoex.io/configs/zircuit-testnet.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/zircuit-testnet.json', thegraphKey: ThegraphKeyMap.zircuitTestnet, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 48899, }, toTokenInit: { symbol: 'WETH', address: '0xb375cCf52923287eC525351C2C11030FD95b856F', decimals: 18, name: 'Wrapped Ether', chainId: 48899, }, scanUrlDomain: 'explorer.zircuit.com', blockTime: 12000, vDODOEnable: false, providerCandidates: kZircuitTestnetCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnZircuitExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xbf03', chainName: 'Zircuit Testnet', rpcUrls: ['https://zircuit1.p2pify.com'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://explorer.zircuit.com'], }, isTestNet: true, routeV3Enable: false, }, // Arbitrum Sepolia // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-421614.json 421614: { enable: true, name: 'Arbitrum Sepolia', chainId: 421614, chain: 'Arbitrum Sepolia', network: 'arb-sep', networkId: 421614, platformId: 'arb-sep', configUrl: 'https://config.dodoex.io/configs/arb-sep.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/arb-sep.json', thegraphKey: ThegraphKeyMap.arbSep, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'Sepolia Ether', chainId: 421614, }, toTokenInit: { symbol: 'WETH', address: '0xfd6fFee92D25158b29315C71b0Bb4dE727530FaF', decimals: 18, name: 'Wrapped Ether', chainId: 421614, }, scanUrlDomain: 'sepolia.arbiscan.io', // https://sepolia-explorer.arbitrum.io/ blockTime: 12000, vDODOEnable: false, providerCandidates: kArbSepCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnArbitrum', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0x66eee', chainName: 'Arbitrum Sepolia', rpcUrls: ['https://sepolia-rollup.arbitrum.io/rpc'], nativeCurrency: { name: 'Sepolia Ether', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://sepolia.arbiscan.io'], }, isTestNet: true, routeV3Enable: false, }, // Zircuit Mainnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-48900.json 48900: { enable: true, name: 'Zircuit Mainnet', chainId: 48900, chain: 'Zircuit Mainnet', network: 'zircuit-mainnet', networkId: 48900, platformId: 'zircuit-mainnet', configUrl: 'https://config.dodoex.io/configs/zircuit-mainnet.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/zircuit-mainnet.json', thegraphKey: ThegraphKeyMap.zircuitMainnet, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 48900, }, toTokenInit: { symbol: 'WETH', address: '0x4200000000000000000000000000000000000006', decimals: 18, name: 'Wrapped Ether', chainId: 48900, }, scanUrlDomain: 'explorer.zircuit.com', // https://explorer.zircuit.com/stats blockTime: 2000, vDODOEnable: false, providerCandidates: kZircuitMainnetCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnZircuitExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xbf04', chainName: 'Zircuit Mainnet', rpcUrls: ['https://zircuit1-mainnet.liquify.com/'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://explorer.zircuit.com'], }, isTestNet: false, routeV3Enable: false, dPointsBannerPosition: 'above-tabs', }, // X Layer Mainnet // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-196.json 196: { enable: true, name: 'X Layer Mainnet', chainId: 196, chain: 'X Layer Mainnet', network: 'okb', networkId: 196, platformId: 'okb', configUrl: 'https://config.dodoex.io/configs/okb.json', nftConfigUrl: 'https://config.dodoex.io/nft-configs/okb.json', thegraphKey: ThegraphKeyMap.okb, fromTokenInit: { symbol: 'OKB', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'OKB', chainId: 196, }, toTokenInit: { symbol: 'WOKB', address: '0xe538905cf8410324e03a5a23c1c177a474d59b2b', decimals: 18, name: 'Wrapped OKB', chainId: 196, }, scanUrlDomain: 'www.okx.com/web3/explorer/xlayer', // https://www.okx.com/zh-hans/web3/explorer/xlayer blockTime: 3000, vDODOEnable: false, providerCandidates: kOKBCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xC4', chainName: 'X Layer mainnet', rpcUrls: ['https://rpc.xlayer.tech'], nativeCurrency: { name: 'OKB', symbol: 'OKB', decimals: 18, }, blockExplorerUrls: ['https://www.okx.com/web3/explorer/xlayer'], }, isTestNet: false, routeV3Enable: false, }, // ZERO Testnet (Sepolia) // https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-4457845.json 4457845: { enable: false, name: 'ZERO Testnet (Sepolia)', chainId: 4457845, chain: 'zero-sepolia', network: 'zero-sepolia', networkId: 4457845, platformId: 'zero-testnet', configUrl: 'https://config.dodoex.io/configs/zero-sepolia.json', thegraphKey: ThegraphKeyMap.zeroSepolia, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 4457845, }, toTokenInit: { symbol: 'WETH', address: '0x29D3bD213dA1aB8b590dbfCA53bC7F2445972611', decimals: 18, name: 'Wrapped Ether', chainId: 4457845, }, scanUrlDomain: 'explorer.zero.network', blockTime: 3000, isUnstableBlockTime: true, vDODOEnable: false, providerCandidates: kZeroSepoliaCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0x440575', chainName: 'ZERO Testnet (Sepolia)', rpcUrls: ['https://rpc.zerion.io/v1/zero-sepolia'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://explorer.zero.network'], }, isTestNet: true, routeV3Enable: false, }, // ZERO mainnet 543210: { enable: true, name: 'Zero Network', chainId: 543210, chain: '', network: 'zero-mainnet', networkId: 543210, platformId: 'zero-mainnet', configUrl: 'https://config.dodoex.io/configs/zero-sepolia.json', thegraphKey: ThegraphKeyMap.zeroMainnet, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 543210, }, toTokenInit: { symbol: 'WETH', address: '0xAc98B49576B1C892ba6BFae08fE1BB0d80Cf599c', decimals: 18, name: 'Wrapped Ether', chainId: 543210, }, scanUrlDomain: 'zerion-explorer.vercel.app', blockTime: 3000, isUnstableBlockTime: true, vDODOEnable: false, providerCandidates: kZeroMainnetCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0x849ea', chainName: 'Zero Network', rpcUrls: ['https://zero-network.calderachain.xyz/http'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://zerion-explorer.vercel.app'], }, isTestNet: false, routeV3Enable: false, }, // HashKey Chain // @see https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-177.json 177: { enable: true, name: 'HashKey Chain', chainId: 177, chain: 'hashkey', network: 'hashkey', networkId: 177, platformId: 'hashkey', configUrl: 'https://config.dodoex.io/configs/hsk.json', thegraphKey: ThegraphKeyMap.hsk, fromTokenInit: { symbol: 'HSK', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'HSK', chainId: 177, }, toTokenInit: { symbol: 'WHSK', address: '0xB210D2120d57b758EE163cFfb43e73728c471Cf1', decimals: 18, name: 'Wrapped HSK', chainId: 177, }, scanUrlDomain: 'explorer.hsk.xyz', // https://explorer.hsk.xyz/ blockTime: 2000, vDODOEnable: false, providerCandidates: kHSKCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xb1', chainName: 'HashKey Chain', rpcUrls: ['https://mainnet.hsk.xyz'], nativeCurrency: { name: 'HSK', symbol: 'HSK', decimals: 18, }, blockExplorerUrls: ['https://explorer.hsk.xyz:443'], }, isTestNet: false, routeV3Enable: false, }, // Hemi // @see https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-43111.json 43111: { enable: true, name: 'Hemi', chainId: 43111, chain: 'hemi', network: 'hemi', networkId: 43111, platformId: 'hemi', configUrl: 'https://config.dodoex.io/configs/hemi.json', thegraphKey: ThegraphKeyMap.hemi, fromTokenInit: { symbol: 'ETH', address: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', decimals: 18, name: 'ETH', chainId: 43111, }, toTokenInit: { symbol: 'WETH', address: '0x4200000000000000000000000000000000000006', decimals: 18, name: 'Wrapped ETH', chainId: 43111, }, scanUrlDomain: 'explorer-b81c3bd8.hemi.xyz', // https://explorer-b81c3bd8.hemi.xyz blockTime: 12000, vDODOEnable: false, providerCandidates: kHemiCandidates, bridgeProviderCandidates: [], gaspriceStandard: { good: kGoodPrice, great: kGreatPrice, }, viewOnScanKey: 'common.viewOnExplorer', dspPoolEnable: true, gasSelectSpeeds: { rapid: '3s', fast: '3s', medium: '6s', }, addChainParameters: { chainId: '0xa867', chainName: 'Hemi', rpcUrls: ['https://rpc.hemi.network/rpc'], nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18, }, blockExplorerUrls: ['https://explorer.hemi.xyz'], }, isTestNet: false, routeV3Enable: false, }, }; if (chainIdToChainConfig[chainId]) { return chainIdToChainConfig[chainId]; } console.error('unsupported chain: ', chainId); return { ...chainIdToChainConfig[DEFAULT_CHAIN_ID], vDODOEnable: false, dspPoolEnable: false, }; } export const getChainDexList = ( chainId: number, filterCreateMiningEnable?: boolean, ) => { const { dexKeys } = getChain(chainId); const defaultDexList = [ { key: 'dodo' as DexKey, value: dexListObj.dodo.name, icon: dexListObj.dodo.icon, }, ]; if (!dexKeys) return defaultDexList; return [ ...defaultDexList, ...dexKeys .filter((key) => { if (filterCreateMiningEnable) { return dexListObj[key].createMiningEnable; } return true; }) .map((key) => ({ key, value: dexListObj[key].name, icon: dexListObj[key].icon, })), ]; }; /** * 一天预估产生多少区块 */ export function getBlocksCountPerDay(chainId: number) { const { blockTime } = getChain(chainId); return (24 * 60 * 60 * 1000) / blockTime; } export function getBlocksCountPerYear(chainId: number) { return getBlocksCountPerDay(chainId) * 365; } /** * 找零逻辑。预留一部分平台币作为 gas fee * @param chainId * @returns */ export function getPlatformGasReserve(chainId: number) { const { platformGasReserve } = getChain(chainId); return platformGasReserve ?? 0.02; }