Usage
1.1 initialize the SDK
Default :
Initialize the SDK without constructor arguments (Uses default RPCs from the SDK, Users may face latency due to public RPC)
Example:
Custom :
Initialize the SDK with constructor arguments
Parameters:
RPC URLS
(string): RPC url for blockchains where the SDK is taken in use.Types:
Example:
Supported Name Service:
ENS
SpaceId
UnstoppableDomains
DotBit
Zkns
ICNS
StargazeDomains
Bonfida
SuiNs
AptosNs
SeiNS
1.2 Resolve Domain Name
The resolveName
method allows you to resolve a domain name from a wallet address on a specified domain naming service. It returns a Promise that resolves with the domain name or rejects with an error if the resolution fails.
Parameters:
walletAddress
(0x${string}): The wallet address you want to resolve.NameService
(SupportedNs): The name of the domain naming service on which the resolution should occur (e.g., ENS, UnstoppableDomains, DotBit, etc.).
Example:
1.3 Resolve Address
The resolveAddress
method allows you to resolve a wallet address from a given domain name. It returns a Promise that resolves with the wallet address or rejects with an error if the resolution fails.
Parameters:
domainName
(string): The domain name you want to resolve to a wallet address.nameService
(optional): The name service provider
Example 1 : Without providing Name Service
Example 2: Providing Name Service
1.4 Fetch records for a specified domain name
The getRecords
method allows you to fetch the records of a domain name. It returns a Promise that resolves with the content or rejects with an error if the resolution fails.
Parameter:
domainName
(string): The domain name you want to fetch content.nameService
(optional): The name service provider.