suix_resolveNameServiceAddress{deprecated} - Sui

This method resolves a SuiNS (Sui Name Service) name to its corresponding SUI address. SuiNS provides human-readable names like example.sui that map to SUI addresses, similar to ENS on Ethereum. This method enables wallet applications and dApps to accept user-friendly names instead of hex addresses.

This method is deprecated

Parameters

ParameterTypeRequiredDescription
namestringYesThe SuiNS name to resolve (e.g., "example.sui")

Request Example

bashcurl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "suix_resolveNameServiceAddress",
  "params": ["example.sui"]
}'

example.js

javascriptconst axios = require('axios');

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'suix_resolveNameServiceAddress',
  params: ['example.sui']
};

axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', payload)
.then(response => console.log(response.data));

example.py

pythonimport requests

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "suix_resolveNameServiceAddress",
    "params": ["example.sui"]
}

response = requests.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/", json=payload)
print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let payload = json!({
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "method": "suix_resolveNameServiceAddress",
        "params": ["example.sui"]
    });
    let response = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .json(&payload).send().await?;
    println!("{}", response.text().await?);
    Ok(())
}

Response Example

json{
  "jsonrpc": "2.0",
  "result": "0x6710024f81dd33ab6833482ee8034e779a48e6ef635c7f856df4905022458bfb",
  "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
resultstringResolved SUI address or null

Use Cases

  • Enable human-readable addresses in wallets
  • Validate SuiNS name ownership
  • Simplify payment interfaces
  • Build address book features

Error Handling

Error CodeDescription
-32602Invalid params - malformed name
-32603Internal error - node issues
null resultName not registered or expired

SDK Integration

example.ts

typescriptimport { SuiClient } from '@mysten/sui/client';

const client = new SuiClient({ url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' });
const address = await client.resolveNameServiceAddress({ name: 'example.sui' });
console.log(address);

example.rs

rustuse sui_sdk::SuiClientBuilder;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let sui = SuiClientBuilder::default().build("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;
    let address = sui.read_api().resolve_name_service_address("example.sui").await?;
    println!("{:?}", address);
    Ok(())
}