Package org.web3j.ens
Class EnsResolver
java.lang.Object
org.web3j.ens.EnsResolver
Resolution logic for contract addresses. According to https://eips.ethereum.org/EIPS/eip-2544
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnsResolver
(Web3j web3j) EnsResolver
(Web3j web3j, long syncThreshold) EnsResolver
(Web3j web3j, long syncThreshold, int addressLength) -
Method Summary
Modifier and TypeMethodDescriptionprotected okhttp3.Request
buildRequest
(String url, String sender, String data) protected String
ccipReadFetch
(List<String> urls, String sender, String data) long
static boolean
isValidEnsName
(String input) static boolean
isValidEnsName
(String input, int addressLength) protected OffchainResolverContract
obtainOffchainResolver
(String ensName) Provides an access to a valid offchain resolver in order to access other API methods.protected PublicResolver
obtainPublicResolver
(String ensName) Deprecated.Returns the address of the resolver for the specified node.protected String
resolveOffchain
(String lookupData, OffchainResolverContract resolver, int lookupCounter) reverseResolve
(String address) Reverse name resolution as documented in the specification.void
setHttpClient
(okhttp3.OkHttpClient client) void
setSyncThreshold
(long syncThreshold)
-
Field Details
-
DEFAULT_SYNC_THRESHOLD
public static final long DEFAULT_SYNC_THRESHOLD- See Also:
-
LOOKUP_LIMIT
public static final int LOOKUP_LIMIT- See Also:
-
REVERSE_NAME_SUFFIX
- See Also:
-
-
Constructor Details
-
EnsResolver
-
EnsResolver
-
EnsResolver
-
-
Method Details
-
setSyncThreshold
public void setSyncThreshold(long syncThreshold) -
getSyncThreshold
public long getSyncThreshold() -
obtainPublicResolver
Deprecated.Use
obtainOffchainResolver(String)
instead.Provides an access to a valid public resolver in order to access other API methods.- Parameters:
ensName
- our user input ENS name- Returns:
- PublicResolver
-
obtainOffchainResolver
Provides an access to a valid offchain resolver in order to access other API methods.- Parameters:
ensName
- our user input ENS name- Returns:
- OffchainResolver
-
resolve
Returns the address of the resolver for the specified node.- Parameters:
ensName
- The specified node.- Returns:
- address of the resolver.
-
resolveOffchain
protected String resolveOffchain(String lookupData, OffchainResolverContract resolver, int lookupCounter) throws Exception - Throws:
Exception
-
ccipReadFetch
-
buildRequest
protected okhttp3.Request buildRequest(String url, String sender, String data) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
reverseResolve
Reverse name resolution as documented in the specification.- Parameters:
address
- an ethereum address, example: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"- Returns:
- a EnsName registered for provided address
-
isValidEnsName
-
isValidEnsName
-
setHttpClient
public void setHttpClient(okhttp3.OkHttpClient client)
-
obtainOffchainResolver(String)
instead.