suix_resolveNameServiceNames{deprecated} - Sui

This method performs reverse resolution to find all SuiNS names associated with a given SUI address. This is the inverse of suix_resolveNameServiceAddress and is useful for displaying human-readable names in user interfaces and transaction histories.

This method is deprecated

Parameters

ParameterTypeRequiredDescription
addressSuiAddressYesThe SUI address to resolve
cursorObjectIDNoPagination cursor
limituintNoMaximum items per page

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_resolveNameServiceNames",
  "params": [
    "0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2",
    null,
    10
  ]
}'

request.js

javascriptconst axios = require('axios');

const payload = {
  jsonrpc: '2.0',
  id: 'getblock.io',
  method: 'suix_resolveNameServiceNames',
  params: ['0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2', null, 10]
};

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

request.py

pythonimport requests

payload = {
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "suix_resolveNameServiceNames",
    "params": [
        "0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2",
        None,
        10
    ]
}

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

request.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_resolveNameServiceNames",
        "params": ["0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2", null, 10]
    });
    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": {
    "data": ["alice.sui", "alice-main.sui"],
    "nextCursor": null,
    "hasNextPage": false
  },
  "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
dataarrayArray of SuiNS name strings
nextCursorstringCursor for pagination
hasNextPagebooleanMore names available

Use Cases

  • Display user-friendly names in UIs
  • Show names in transaction histories
  • Build profile pages with all owned names
  • Verify name ownership

Error Handling

Error CodeDescription
-32602Invalid params - malformed address
-32603Internal error - node issues

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 names = await client.resolveNameServiceNames({
  address: '0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2'
});
console.log(names);

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 = "0x5cd6fa76ed1d18f05f15e35075252ddec4fb83621d55952d9172fcfcb72feae2".parse()?;
    let names = sui.read_api().resolve_name_service_names(address, None, None).await?;
    println!("{:?}", names);
    Ok(())
}