Read data from your custom domain on the Sui Name System using @mysten/suins.

Usage

// Register Suins
const result = await agent.getSnsNameRecord("yourname");

Parameters

ParameterTypeRequiredDescription
namestringYesThe name of domain

Example Prompts

Natural Language Prompts

// with or without the .sui suffix
"Check for this domain suins customdomain"
"Check for this domain suins customdomain.sui"

LangChain Tool Prompts

// Register domain 1 year
{
 "name": "customdomain",
}

Example Implementation

import { SuiAgentKit } from "@getnimbus/sui-agent-kit";

async function getSnsNameRecord(agent: SuiAgentKit) {
  try {
    const result = await agent.getSnsNameRecord("customdomain");
    console.log("Domain's data:", result);
  } catch (error) {
    console.error("Get domain's data failed:", error);
  }
}

Implementation Details

  • Uses mysten/suins for resolve domain’s data

Response Format

// Successful response
{
  name: 'nimbus.sui',
  nftId: '0xcefcd5c8ca143ba86566d5face2fffc1361d24d19deeb94a8576e83319731609',
  targetAddress: '0x692853c81afc8f847147c8a8b4368dc894697fc12b929ef3071482d27339815e',
  expirationTimestampMs: '1740448978459',
  data: {},
  avatar: undefined,
  contentHash: undefined,
  walrusSiteId: undefined,
  humanReadableExpirationTimestampMs: '2025-02-25'
}

// Error response
{
  null
}