Skip to main content

TypeScript: Registry

RegistryClient is the on-chain half of .nota files. It wraps the NotaRegistry contract: you register a resource once, the contract stores ownership and proof hash, and later anyone can resolve aliases or fetch records without needing the original file. Access it via ntm.registry.

Write methods

All writes require the Notareum instance to be configured with a signer.

registerResource

Registers a new resource, returning the transaction hash:
Resource ID is derived on-chain from (resourceType, chainId, keccak256(identifier)). Aliases must be globally unique; re-using an existing alias reverts with AliasAlreadyTaken.

revokeResource

Only the current owner can revoke. Revocation does not delete the record; it flags isRevoked = true, which wallets and explorers should treat as a terminal state:

addResourceType / removeResourceType

Governance-only. Add custom resource types beyond the initial six (ADDRESS, TRANSACTION, CONTRACT, IPFS, NFT, METADATA):

Read methods

getResource

Fetches the full ResourceInfo record:
ResourceInfo includes owner, resourceType, chainId, proofHash, alias, verificationLevel, registeredAt, lastUpdatedAt, and isRevoked.

resolveAlias

Resolves a human-readable alias to the bytes32 resource ID it points to:

isValidResourceType / getResourceTypeName

Introspection helpers over the governance-managed resource type registry:

Utility: computeResourceId

Computes a resource ID locally, off-chain, without any RPC call. Identical to the on-chain derivation, so you can predict the ID before sending a transaction:

Full example

See also