UNPKG

@iexec/dataprotector

Version:

This product enables users to confidentially store data–such as mail address, documents, personal information ...

13 lines 459 B
import { ValidationError } from 'yup'; import { isEnsTest } from './validators.js'; export const resolveENS = async (iexec, address) => { if (address && isEnsTest(address)) { const resolved = await iexec.ens.resolveName(address); if (!resolved) { throw new ValidationError(`ENS name is not valid: ${address}`); } return resolved.toLowerCase(); } return address; }; //# sourceMappingURL=resolveENS.js.map