> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnimbus.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Register Sui Name System

> Learn how to register Sui Name System

Register your custom domain on the Sui Name System using @mysten/suins.

## Usage

```javascript theme={null}
// Register Suins
const result = await agent.registerSns("yourname", 1, "SUI");
```

## Parameters

| Parameter | Type   | Required | Description                                     |
| --------- | ------ | -------- | ----------------------------------------------- |
| name      | string | Yes      | The name to be registered                       |
| years     | number | Yes      | Number of years to register                     |
| payToken  | string | Yes      | The token used for registration (SUI, NS, USDC) |

## Example Prompts

### Natural Language Prompts

```javascript theme={null}
// with or without the .sui suffix
"Register the domain name mydomain for 1 year"
```

### LangChain Tool Prompts

```javascript theme={null}
// Register domain 1 year
{
 "name": "mydomain",
 "years": 1,
 "payToken": "SUI"
}
```

## Example Implementation

```javascript theme={null}
import { SuiAgentKit } from "@getnimbus/sui-agent-kit";

async function registerSns(agent: SuiAgentKit) {
  try {
    const result = await agent.registerSns("mydomain", 1, "SUI");
    console.log("Register successful:", result);
  } catch (error) {
    console.error("Register failed:", error);
  }
}
```

## Implementation Details

* Registers via mysten/suins
* Holds the new NFT domain in the generated wallet
* Transfers the domain from the generated wallet to yours

## Response Format

```javascript theme={null}
// Successful response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "success",
}

// Error response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "failed",
}
```

## Error Handling

```javascript theme={null}
try {
  const result = await agent.registerSns("mydomain", 1, "SUI");
} catch (error) {
  if (error.message.includes("Insufficient balance")) {
    // Handle insufficient balance
  } else {
    // Handle other transaction failures
  }
}
```

## Best Practices

1. Check domain is not used

* Check if the domain is available on SuiNS
* Use our tool to resolve the domain name

2. Balance Check

* Ensure sufficient funds for payment
* Supported tokens: SUI, NS, USDC

3. Security

* Verify transaction details
* Double-check amounts
* Keep private keys secure

4. User Experience

* Show transaction progress
