Package org.web3j.ens
Class EnsResolver
- java.lang.Object
-
- org.web3j.ens.EnsResolver
-
public class EnsResolver extends java.lang.Object
Resolution logic for contract addresses.
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_SYNC_THRESHOLD
static java.lang.String
REVERSE_NAME_SUFFIX
-
Constructor Summary
Constructors Constructor Description EnsResolver(Web3j web3j)
EnsResolver(Web3j web3j, long syncThreshold)
EnsResolver(Web3j web3j, long syncThreshold, int addressLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getSyncThreshold()
static boolean
isValidEnsName(java.lang.String input)
static boolean
isValidEnsName(java.lang.String input, int addressLength)
protected PublicResolver
obtainPublicResolver(java.lang.String ensName)
Provides an access to a valid public resolver in order to access other API methods.java.lang.String
resolve(java.lang.String contractId)
java.lang.String
reverseResolve(java.lang.String address)
Reverse name resolution as documented in the specification.void
setSyncThreshold(long syncThreshold)
-
-
-
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:
-
-