Compute an alias hash
The indexer stores aliases as Keccak-256 hashes. Before querying, compute the hash of the alias string: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:Look up a DID
lookupDid resolves a DID hash to its on-chain record:
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 aNetworkError if the HTTP request fails. They do not throw on a not-found result — check the found field instead.