Skip to main content

API Reference

ExportTypeDescription
HCS21ClientclassNode.js client that inscribes metadata, creates registry topics, publishes declarations, and streams messages via mirror nodes.
HCS21BrowserClientclassBrowser/WalletConnect client for submitting declarations from end-user wallets.
HCS21BaseClientclassShared base with buildDeclaration, validateDeclaration, and fetchDeclarations.
PackageDeclarationtypeJSON payload that travels over HCS-21 (p, op, registry, t_id, n, d, a, tags, metadata).
PackageMetadataRecordtypeOptional HCS-1 manifest for extended data (fields such as schema, t_id, description, website, artifacts, etc.).
PackageMetadataPointertypeResult from inscribeMetadata with pointer, topicId, and sequenceNumber.
PackageDeclarationEnvelopetypeParsed message returned by fetchDeclarations (includes payer, consensusTimestamp, sequenceNumber).
HCS21_REGISTRY_NAMESPACESconstArray of supported registry namespaces (npm, pypi, oci, composer, etc.).
buildHcs21CreateRegistryTxfunctionBuilds a TopicCreateTransaction with the correct HCS-21 memo.
buildHcs21MessageTxfunctionWraps a PackageDeclaration into a TopicMessageSubmitTransaction.

Typings

The module ships TypeScript typings. Example:

import type {
PackageDeclaration,
PackageMetadataRecord,
} from '@hashgraphonline/standards-sdk';

These types keep declarations within the 1 KB payload limit and aligned with the HCS-21 specification documented under /docs/standards/hcs-21.