/**
 * Chain icon URLs for display in the DApp.
 * Sources: Trust Wallet assets, chain-138.json, and public CDNs.
 */
const TW = 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains';
const ETH_DIAMOND = 'https://raw.githubusercontent.com/ethereum/ethereum.org/main/static/images/eth-diamond-black.png';

export const CHAIN_ICON_URLS: Record<number, string> = {
  1: `${TW}/ethereum/info/logo.png`,
  10: `${TW}/optimism/info/logo.png`,
  25: `${TW}/cronos/info/logo.png`,
  56: `${TW}/smartchain/info/logo.png`,
  100: `${TW}/xdai/info/logo.png`,
  137: `${TW}/polygon/info/logo.png`,
  138: ETH_DIAMOND, // Chain 138 (DBIS) - from chain-138.json
  42161: `${TW}/arbitrum/info/logo.png`,
  43114: `${TW}/avalanchec/info/logo.png`,
  8453: `${TW}/base/info/logo.png`,
};

export function getChainIconUrl(chainId: number): string | undefined {
  return CHAIN_ICON_URLS[chainId];
}
