import { ChainId } from '@openocean.finance/widget-types' import { getEnsAddress, normalize } from 'viem/ens' import { getPublicClient } from './publicClient.js' export const getENSAddress = async ( name: string ): Promise => { try { const client = await getPublicClient(ChainId.ETH) const address = await getEnsAddress(client, { name: normalize(name), }) return address as string | undefined } catch (_) { // ignore return } }