NameService.ReverseLookupName
Reverse lookup name through sui.rpc.v2.NameService/ReverseLookupName on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.NameService/ReverseLookupName. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: ReverseLookupNameRequest
| Field | Type | Description |
|---|---|---|
address | string | Required. The address to perform a reverse lookup for. |
Response: ReverseLookupNameResponse
| Field | Type | Description |
|---|---|---|
record | NameRecord | The record for the SuiNS name linked to the requested address |
NameRecord
| Field | Type | Description |
|---|---|---|
id | string | Id of this record. Note that records are stored on chain as dynamic fields of the type Field<Domain,NameRecord>. |
name | string | The SuiNS name of this record |
registration_nft_id | string | The ID of the RegistrationNFT assigned to this record. The owner of the corresponding RegistrationNFT has the rights to be able to change and adjust the target_address of this domain. It is possible that the ID changes if the record expires and is purchased by someone else. |
expiration_timestamp | google.protobuf.Timestamp | Timestamp when the record expires. This is either the expiration of the record itself or the expiration of this record's parent if this is a leaf record. |
target_address | string | The target address that this name points to |
data | map<string, string> | Additional data which may be stored in a record |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"address": "0x0000000000000000000000000000000000000000000000000000000000000002"
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.NameService/ReverseLookupNameServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { data } = await client.defaultNameServiceName({
address: '0x0000000000000000000000000000000000000000000000000000000000000002'
})
console.log(data.name)Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per call. See credits and billing for the full table.
JSON-RPC equivalent
Replaces suix_resolveNameServiceNames. The JSON-RPC to gRPC migration guide has before and after code for the common calls.
Related
- NameService overview and the gRPC gateway
- NameService.LookupName
- Proto definition on GitHub