/** * Yield / Portal-style EVM network slugs → EIP-155 CAIP-2. */ const YIELD_EVM_SLUG_TO_CAIP2: Record = { // Common friendly names (subset of typical integrations) ethereum: 'eip155:1', eth: 'eip155:1', mainnet: 'eip155:1', polygon: 'eip155:137', matic: 'eip155:137', arbitrum: 'eip155:42161', optimism: 'eip155:10', base: 'eip155:8453', blast: 'eip155:81457', scroll: 'eip155:534352', mantle: 'eip155:5000', mode: 'eip155:34443', opbnb: 'eip155:204', // Testnets and alternate slugs (e.g. *-sepolia) mapped to EIP-155 CAIP-2 'ethereum-sepolia': 'eip155:11155111', 'ethereum-goerli': 'eip155:5', 'ethereum-holesky': 'eip155:17000', 'ethereum-hoodi': 'eip155:560048', binance: 'eip155:56', bsc: 'eip155:56', 'avalanche-c': 'eip155:43114', 'avalanche-c-atomic': 'eip155:43114', gnosis: 'eip155:100', zksync: 'eip155:324', linea: 'eip155:59144', celo: 'eip155:42220', fantom: 'eip155:250', harmony: 'eip155:1666600000', moonriver: 'eip155:1285', okc: 'eip155:66', viction: 'eip155:88', core: 'eip155:1116', cronos: 'eip155:25', evmos: 'eip155:9001', unichain: 'eip155:130', sonic: 'eip155:146', } /** Resolve a Yield transaction `network` string to EIP-155 CAIP-2 when known. */ export function resolveYieldNetworkToCaip2( network: string, ): string | undefined { if (typeof network !== 'string' || network === '') return undefined if (network.startsWith('eip155:')) return network if (network.toLowerCase().startsWith('solana')) return undefined return YIELD_EVM_SLUG_TO_CAIP2[network.toLowerCase()] } export function isYieldEvmNetwork(network: string): boolean { return resolveYieldNetworkToCaip2(network) !== undefined }