@openocean.finance/widget-sdk
Version:
OpenOcean Any-to-Any Cross-Chain-Swap SDK
17 lines • 512 B
JavaScript
import { ChainId } from '@openocean.finance/widget-types';
import { getEnsAddress, normalize } from 'viem/ens';
import { getPublicClient } from './publicClient.js';
export const getENSAddress = async (name) => {
try {
const client = await getPublicClient(ChainId.ETH);
const address = await getEnsAddress(client, {
name: normalize(name),
});
return address;
}
catch (_) {
// ignore
return;
}
};
//# sourceMappingURL=getENSAddress.js.map