Package org.web3j.ens

Class EnsResolver


  • public class EnsResolver
    extends java.lang.Object
    Resolution logic for contract addresses.
    • Field Detail

      • DEFAULT_SYNC_THRESHOLD

        public static final long DEFAULT_SYNC_THRESHOLD
        See Also:
        Constant Field Values
      • REVERSE_NAME_SUFFIX

        public static final java.lang.String REVERSE_NAME_SUFFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • EnsResolver

        public EnsResolver​(Web3j web3j,
                           long syncThreshold,
                           int addressLength)
        Parameters:
        web3j -
        syncThreshold -
        addressLength -
      • EnsResolver

        public EnsResolver​(Web3j web3j,
                           long syncThreshold)
        Parameters:
        web3j -
        syncThreshold -
      • EnsResolver

        public EnsResolver​(Web3j web3j)
        Parameters:
        web3j -
    • Method Detail

      • setSyncThreshold

        public void setSyncThreshold​(long syncThreshold)
        Parameters:
        syncThreshold -
      • getSyncThreshold

        public long getSyncThreshold()
        Returns:
      • obtainPublicResolver

        protected PublicResolver obtainPublicResolver​(java.lang.String ensName)
        Provides an access to a valid public resolver in order to access other API methods.
        Parameters:
        ensName - our user input ENS name
        Returns:
        PublicResolver
      • resolve

        public java.lang.String resolve​(java.lang.String contractId)
        Parameters:
        contractId -
        Returns:
      • reverseResolve

        public java.lang.String reverseResolve​(java.lang.String address)
        Reverse name resolution as documented in the specification.
        Parameters:
        address - an ethereum address, example: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
        Returns:
        a EnsName registered for provided address
      • isValidEnsName

        public static boolean isValidEnsName​(java.lang.String input)
        Parameters:
        input -
        Returns:
      • isValidEnsName

        public static boolean isValidEnsName​(java.lang.String input,
                                             int addressLength)
        Parameters:
        input -
        addressLength -
        Returns: