The NameService provides methods for resolving SuiNS names to addresses and vice versa.
Resolves a SuiNS name to its record, including the associated address.
Request:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The SuiNS name to look up (e.g., example.sui) |
Response:
| Field | Type | Description |
|---|---|---|
record | NameRecord | The name record including the resolved address |
grpcurl \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-import-path proto \
-proto sui/rpc/v2/name_service.proto \
-d '{"name": "example.sui"}' \
sui-mainnet.g.alchemy.com:443 \
sui.rpc.v2.NameService/LookupNameResolves an address to its SuiNS name.
Request:
| Field | Type | Required | Description |
|---|---|---|---|
address | string | Yes | The address to reverse-lookup |
Response:
| Field | Type | Description |
|---|---|---|
record | NameRecord | The name record for the address |
grpcurl \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-import-path proto \
-proto sui/rpc/v2/name_service.proto \
-d '{"address": "0xYOUR_ADDRESS"}' \
sui-mainnet.g.alchemy.com:443 \
sui.rpc.v2.NameService/ReverseLookupName