# suix_resolveNameServiceAddress{deprecated} - Sui

> Example code for the suix_queryTransactionBlocks JSON-RPC method. Complete guide on how to use suix_queryTransactionBlocks JSON-RPC in GetBlock Web3 documentation.

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.

> **Warning:** This method is deprecated

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| name | string | Yes | The SuiNS name to resolve (e.g., "example.sui") |

## Request Example

#### cURL

```bash
curl -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"]
}'
```

#### JavaScript (Axios)

#### example.js

```javascript
const 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));
```

#### Python

#### example.py

```python
import 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())
```

#### Rust

#### example.rs

```rust
use 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

| Parameter | Type | Description |
| --- | --- | --- |
| result | string | Resolved 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 Code | Description |
| --- | --- |
| -32602 | Invalid params - malformed name |
| -32603 | Internal error - node issues |
| null result | Name not registered or expired |

## SDK Integration

#### Sui TypeScript SDK

#### example.ts

```typescript
import { 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);
```

#### Sui Rust SDK

#### example.rs

```rust
use 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(())
}
```
