DotNames Docs
  • Introduction
    • Terminology
    • Frequently Asked Questions
  • Overview
    • Setup Wallet
    • DotShm
    • DotOmni
    • DotSei
    • DotZeta
    • DotTaiko
  • Developer Guide - API
    • DotTaiko
    • DotSei
  • Developer Guide - SDK
    • DotSei
      • Manual Setup
      • Usage
      • Error Handling
      • Example
    • DotTaiko
      • Manual Setup
      • Usage
  • Links
  • Brand Assets
Powered by GitBook
On this page
  • 1.1 Resolve domain name
  • Parameter:
  • Example:
  • 1.2 Resolve wallet address
  • Parameter:
  • Example:
  1. Developer Guide - SDK
  2. DotSei

Usage

1.1 Resolve domain name

The name method allows you to resolve a domain name. It returns a Promise that resolves with the domain name or rejects with an error if the resolution fails.

Parameter:

  • domainName (string.sei): The domain name you want to resolve.

Example:

import { getCosmWasmClient } from "@sei-js/core";
import DotSei from "@dotnames/dotseijs"

const client = await getCosmWasmClient("https://sei-rpc.polkachu.com/");
const dotSei = new DotSei({
  client,
  networkId: "pacific-1",
});

const domainName = "---Enter domain name to resolve---";
const owner = await dotSei.name(domainName).getAddress();
console.log("Owner of given domain name:- ", owner)

1.2 Resolve wallet address

The getName method allows you to resolve the address. It returns a Promise that resolves with the wallet address or rejects with an error if the resolution fails.

Parameter:

  • walletAddress (sei${string}): The wallet address you want to resolve.

Example:

import { getCosmWasmClient } from "@sei-js/core";
import DotSei from "@dotnames/dotseijs"

const client = await getCosmWasmClient("https://sei-rpc.polkachu.com/");
const dotSei = new DotSei({
  client,
  networkId: "pacific-1",
});

const walletAddress = "---Enter Wallet Address---";
const domainName = await dotSei.getName(walletAddress);
console.log("Domain name for given address:- ", domainName);
PreviousManual SetupNextError Handling

Last updated 9 months ago