import { isValidEnsName } from '@unilogin/commons' ; import UniLoginSdk from '@unilogin/sdk' ; export const isEnsNameTaken = ( sdk ) => async ( name ) => { return sdk . resolveName ( name ) ; } ; export const ensNameValidators = ( sdk ) => [ { validate : isValidEnsName , errorMessage : 'Ens name is not valid' , } , { errorMessage : 'Ens name already taken' , validate : async ( name ) => ! ( await isEnsNameTaken ( sdk ) ( name ) ) , } , ] ;