import type { EthereumNetworkSymbol } from '@trezor/network-ethereum-types'; import { DEFAULT_ACCOUNT_SYNC_INTERVAL, type Explorer, type SuiteCommonNetworkConfig, asDisplayOrderKey, asProtocol, } from '@trezor/network-module-suite-common-types'; import { asNetworkSymbol } from '@trezor/network-module-types'; const syncIntervalBySymbol: Readonly> = { eth: DEFAULT_ACCOUNT_SYNC_INTERVAL, pol: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, bsc: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, arb: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, base: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, op: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, rhc: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, hype: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, avax: DEFAULT_ACCOUNT_SYNC_INTERVAL / 1.5, etc: DEFAULT_ACCOUNT_SYNC_INTERVAL, tsep: DEFAULT_ACCOUNT_SYNC_INTERVAL, thod: DEFAULT_ACCOUNT_SYNC_INTERVAL, arc: DEFAULT_ACCOUNT_SYNC_INTERVAL, tarc: DEFAULT_ACCOUNT_SYNC_INTERVAL, }; const getExplorerUrls = (baseUrl: string): Explorer => ({ base: baseUrl, tx: `${baseUrl}/tx/`, address: `${baseUrl}/address/`, nft: `${baseUrl}/nft/`, }); type NetworkConfig = SuiteCommonNetworkConfig & { readonly chainId: number; readonly networkType: 'ethereum'; }; const ethSymbol = asNetworkSymbol('eth'); export const networkConfigBySymbol = { eth: { color: '#454a75', displayOrder: asDisplayOrderKey('a1'), protocols: [asProtocol('ethereum'), asProtocol('eth')], displaySymbol: 'ETH', name: 'Ethereum', networkType: 'ethereum', chainId: 1, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://etherscan.io'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'staking', 'eip1559', 'mev-protection', 'graph', 'claim-rewards', ], backendOptions: [{ type: 'blockbook' }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, legacy: { // ledger (legacy) accountType: 'legacy', bip43Path: "m/44'/60'/0'/i", isDebugOnlyAccountType: true, }, }, coingeckoId: 'ethereum', tradeCryptoId: 'ethereum', fiatRateCryptoId: 'ethereum', caipId: 'eip155:1', yieldXyzId: 'ethereum', }, pol: { color: '#7b3fe4', displayOrder: asDisplayOrderKey('a2'), protocols: [asProtocol('polygon'), asProtocol('matic'), asProtocol('pol')], displaySymbol: 'POL', displaySymbolName: 'Polygon', name: 'Polygon PoS', networkType: 'ethereum', chainId: 137, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://polygonscan.com'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'eip1559', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'polygon-pos', tradeCryptoId: 'polygon-ecosystem-token', fiatRateCryptoId: 'polygon-ecosystem-token', caipId: 'eip155:137', yieldXyzId: 'polygon', }, bsc: { color: '#f0b90b', displayOrder: asDisplayOrderKey('a3'), protocols: [asProtocol('binance'), asProtocol('bnb'), asProtocol('bsc')], displaySymbol: 'BNB', displaySymbolName: 'BNB', name: 'BNB Smart Chain', networkType: 'ethereum', chainId: 56, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://bscscan.com'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'mev-protection', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'binance-smart-chain', tradeCryptoId: 'binancecoin', fiatRateCryptoId: 'binancecoin', caipId: 'eip155:56', yieldXyzId: 'binance', }, arb: { color: '#213147', displayOrder: asDisplayOrderKey('a4'), protocols: [ asProtocol('arbitrum'), asProtocol('arbitrum-one'), asProtocol('arb'), asProtocol('arbitrum-ethereum'), ], settlementLayer: ethSymbol, displaySymbol: 'ETH', displaySymbolName: 'Arbitrum One Ethereum', name: 'Arbitrum One', networkType: 'ethereum', chainId: 42161, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://arbiscan.io'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'mev-protection', 'eip1559', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'arbitrum-one', tradeCryptoId: 'arbitrum-one--0x0000000000000000000000000000000000000000', fiatRateCryptoId: 'ethereum', caipId: 'eip155:42161', yieldXyzId: 'arbitrum', }, base: { color: '#0052ff', displayOrder: asDisplayOrderKey('a5'), protocols: [asProtocol('base')], settlementLayer: ethSymbol, displaySymbol: 'ETH', displaySymbolName: 'Base Ethereum', name: 'Base', networkType: 'ethereum', chainId: 8453, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://basescan.org'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'eip1559', 'mev-protection', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'base', tradeCryptoId: 'base--0x0000000000000000000000000000000000000000', fiatRateCryptoId: 'ethereum', caipId: 'eip155:8453', nativeTokenReserve: '0.0002', yieldXyzId: 'base', }, op: { color: '#ff0720', displayOrder: asDisplayOrderKey('a6'), protocols: [asProtocol('optimism'), asProtocol('op')], settlementLayer: ethSymbol, displaySymbol: 'ETH', displaySymbolName: 'Optimism Ethereum', name: 'Optimism', networkType: 'ethereum', chainId: 10, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://optimistic.etherscan.io'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'eip1559', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'optimistic-ethereum', tradeCryptoId: 'optimistic-ethereum--0x0000000000000000000000000000000000000000', fiatRateCryptoId: 'ethereum', caipId: 'eip155:10', nativeTokenReserve: '0.0002', yieldXyzId: 'optimism', }, rhc: { color: '#ccff00', displayOrder: asDisplayOrderKey('a7'), protocols: [asProtocol('robinhood'), asProtocol('robinhood-chain'), asProtocol('rhc')], settlementLayer: ethSymbol, displaySymbol: 'ETH', displaySymbolName: 'Robinhood Ethereum', name: 'Robinhood Chain', networkType: 'ethereum', chainId: 4663, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://robinscan.io'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'eip1559', 'mev-protection', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'robinhood', tradeCryptoId: 'robinhood--0x0000000000000000000000000000000000000000', fiatRateCryptoId: 'ethereum', caipId: 'eip155:4663', nativeTokenReserve: '0.0002', yieldXyzId: null, }, hype: { color: '#97fce4', displayOrder: asDisplayOrderKey('a8'), protocols: [asProtocol('hyperliquid'), asProtocol('hyperevm'), asProtocol('hype')], displaySymbol: 'HYPE', name: 'HyperEVM', displaySymbolName: 'Hyperliquid', networkType: 'ethereum', chainId: 999, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://hyperevmscan.io'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'eip1559', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'hyperevm', tradeCryptoId: 'hyperliquid', fiatRateCryptoId: 'hyperliquid', caipId: 'eip155:999', yieldXyzId: null, }, avax: { color: '#e84142', displayOrder: asDisplayOrderKey('a9'), protocols: [asProtocol('avalanche'), asProtocol('avax')], displaySymbol: 'AVAX', displaySymbolName: 'Avalanche', name: 'Avalanche C-Chain', networkType: 'ethereum', chainId: 43114, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://snowscan.xyz'), features: [ 'rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions', 'eip1559', 'graph', ], backendOptions: [{ type: 'blockbook', isExternalBackend: true }, { type: 'evm-rpc' }], accountTypes: { ledger: { // ledger (live), #1 acc is same as Trezor, so it is skipped accountType: 'ledger', bip43Path: "m/44'/60'/i'/0/0", isDebugOnlyAccountType: true, }, }, coingeckoId: 'avalanche', tradeCryptoId: 'avalanche-2', fiatRateCryptoId: 'avalanche-2', caipId: 'eip155:43114', yieldXyzId: 'avalanche-c', }, etc: { color: '#60c67e', displayOrder: asDisplayOrderKey('aD'), protocols: [asProtocol('ethclassic'), asProtocol('etc')], displaySymbol: 'ETC', name: 'Ethereum Classic', networkType: 'ethereum', chainId: 61, bip43Path: "m/44'/61'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://etc.trezor.io'), features: ['sign-verify', 'tokens', 'coin-definitions', 'graph'], backendOptions: [{ type: 'blockbook' }, { type: 'evm-rpc' }], accountTypes: {}, coingeckoId: 'ethereum-classic', tradeCryptoId: 'ethereum-classic', fiatRateCryptoId: 'ethereum-classic', yieldXyzId: null, }, arc: { color: '#2775ca', displayOrder: asDisplayOrderKey('aNV'), protocols: [asProtocol('arc')], displaySymbol: 'USDC', displaySymbolName: 'USDC', name: 'Arc', networkType: 'ethereum', chainId: 5042, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: false, explorer: getExplorerUrls('https://explorer.arc.io'), features: ['rbf', 'sign-verify', 'tokens', 'eip1559'], backendOptions: [{ type: 'evm-rpc', isExternalBackend: true }], accountTypes: {}, // Arc's native asset is USDC, so the balance prices against the USDC market; the platform // id only matters for tokens, which are not verified against a definitions list here. coingeckoId: 'arc', tradeCryptoId: 'arc--0x0000000000000000000000000000000000000000', fiatRateCryptoId: 'usd-coin', caipId: 'eip155:5042', yieldXyzId: null, }, tsep: { color: '#454a75', displayOrder: asDisplayOrderKey('aM'), protocols: [asProtocol('tsep')], displaySymbol: 'tETH', name: 'Ethereum Sepolia', networkType: 'ethereum', bip43Path: "m/44'/60'/0'/0/i", chainId: 11155111, decimals: 18, testnet: true, explorer: getExplorerUrls('https://sepolia.etherscan.io'), features: ['rbf', 'sign-verify', 'tokens', 'nfts', 'eip1559', 'graph'], backendOptions: [{ type: 'blockbook' }, { type: 'evm-rpc' }], accountTypes: { legacy: { accountType: 'legacy', bip43Path: "m/44'/1'/0'/0/i", isDebugOnlyAccountType: true, }, }, coingeckoId: 'sepolia-test-ethereum', // fake, coingecko does not have testnets tradeCryptoId: 'sepolia-test-ethereum', // fake, coingecko does not have testnets fiatRateCryptoId: 'sepolia-test-ethereum', yieldXyzId: 'ethereum-sepolia', }, thod: { color: '#454a75', displayOrder: asDisplayOrderKey('aN'), protocols: [asProtocol('thod')], displaySymbol: 'tETH', name: 'Ethereum Hoodi', networkType: 'ethereum', bip43Path: "m/44'/60'/0'/0/i", chainId: 560048, decimals: 18, testnet: true, explorer: getExplorerUrls('https://hoodi.etherscan.io'), features: ['rbf', 'sign-verify', 'tokens', 'staking', 'nfts', 'eip1559', 'graph'], backendOptions: [{ type: 'blockbook' }, { type: 'evm-rpc' }], accountTypes: { legacy: { accountType: 'legacy', bip43Path: "m/44'/1'/0'/0/i", isDebugOnlyAccountType: true, }, }, coingeckoId: 'hoodi-test-ethereum', // fake, coingecko does not have testnets tradeCryptoId: 'hoodi-test-ethereum', // fake, coingecko does not have testnets fiatRateCryptoId: 'hoodi-test-ethereum', yieldXyzId: 'ethereum-hoodi', }, tarc: { color: '#2775ca', displayOrder: asDisplayOrderKey('aNk'), protocols: [asProtocol('tarc')], displaySymbol: 'tUSDC', name: 'Arc Testnet', networkType: 'ethereum', chainId: 5042002, bip43Path: "m/44'/60'/0'/0/i", decimals: 18, testnet: true, explorer: getExplorerUrls('https://testnet.arcscan.app'), features: ['rbf', 'sign-verify', 'tokens', 'eip1559'], backendOptions: [{ type: 'evm-rpc', isExternalBackend: true }], accountTypes: {}, isDebugOnlyNetwork: true, coingeckoId: undefined, tradeCryptoId: undefined, yieldXyzId: null, }, } satisfies Readonly>; export const getNetworkConfig = (symbol: EthereumNetworkSymbol): SuiteCommonNetworkConfig => networkConfigBySymbol[symbol]; export const getAccountSyncInterval = (symbol: EthereumNetworkSymbol): number => syncIntervalBySymbol[symbol];