Skip to main content
This guide shows you how to resolve human-readable aliases to DIDs, look up on-chain DID and account data, check alias availability before registration, and fetch indexer statistics.

Compute an alias hash

The indexer stores aliases as Keccak-256 hashes. Before querying, compute the hash of the alias string:
By default computeAliasHash uses hash-wasm (already a dependency). If you already have a Keccak-256 implementation from viem or ethers, pass it to avoid loading a second one:

Check alias availability before registration

Before registering a handle, verify that the alias is not already taken. The vault exposes an availability endpoint directly:
Use the indexer for a hash-based lookup instead if you need the full alias record:

Look up a DID

lookupDid resolves a DID hash to its on-chain record:
The DID hash is the Keccak-256 hash of the DID string. It is returned in RegistrationResult.did_hash after registration, and available in QueryOutput.did from client.query().

Look up a smart account

lookupAccount resolves a smart account address to its on-chain indexer record:

Fetch indexer statistics

fetchStats returns aggregate counts for the entire registry:

Use a custom indexer URL

All indexer functions default to /api/indexer (the vault’s indexer proxy). Pass a custom URL as the last argument to target a different deployment:

Error handling

All indexer functions throw a NetworkError if the HTTP request fails. They do not throw on a not-found result — check the found field instead.