Skip to main content

API Reference

ExportTypeDescription
HCS21ClientclassNode.js client that inscribes manifests/registry metadata, creates adapter registry topics, publishes declarations, and streams messages via mirror nodes.
HCS21BrowserClientclassBrowser/WalletConnect client that can create registry-of-registries layers, publish adapter declarations, and stream messages directly from a user-controlled wallet.
HCS21BaseClientclassShared base with buildDeclaration, validateDeclaration, and fetchDeclarations.
AdapterDeclarationtypeJSON payload that travels over HCS-21 (p, op, adapter_id, entity, package, manifest, optional manifest_sequence, config, state_model?, signature?).
AdapterManifesttypeImmutable adapter manifest schema for metadata, runtime requirements, capabilities, and consensus bindings (stored via HCS-1 topic or another hashed content store such as IPFS, Arweave, OCI, HTTPS+SRI).
RegistryMetadataRecordtypeOptional registry metadata document (HCS-1 topic or other hashed store) referenced in topic memos (meta slot).
ManifestPointertypeResult from inscribeMetadata with pointer, topicId, sequenceNumber, optional manifestSequence, inscription jobId/transactionId, plus totalCostHbar and costBreakdown derived from the executed transaction.
VersionPointerResolutiontypeResult from resolveVersionPointer with the latest declarationTopicId, metadata, and sequence number.
AdapterDeclarationEnvelopetypeParsed message returned by fetchDeclarations (includes payer, consensusTimestamp, sequenceNumber).
HCS21TopicTypeconstTopic types for memos (ADAPTER_REGISTRY, REGISTRY_OF_REGISTRIES, ADAPTER_CATEGORY).
buildHcs21CreateRegistryTxfunctionBuilds a TopicCreateTransaction with the HCS-21 memo format.
buildHcs21MessageTxfunctionWraps an AdapterDeclaration into a TopicMessageSubmitTransaction.
createRegistryTopicmethodCreates the HCS-21 adapter declaration topic (hcs-21:0:<ttl>:0:<meta>).
createRegistryDiscoveryTopicmethodCreates the HCS-2 indexed registry-of-registries topic (hcs-21:0:<ttl>:1:<meta>).
createAdapterCategoryTopicmethodCreates the HCS-21 adapter-category topic (hcs-21:0:<ttl>:2:<meta>).
createAdapterVersionPointerTopicmethodCreates the HCS-2 non-indexed pointer topic (hcs-2:1:<ttl>) that tracks the live declaration topic for an adapter or registry layer.
publishVersionPointermethodPosts the active HCS-21 topic ID into a version pointer (hcs-2 message with t_id).
registerCategoryTopicmethodRegisters an adapter category topic inside the discovery topic.
publishCategoryEntrymethodAdds an adapter entry (m = "adapter:<namespace>/<name>") pointing to its version pointer topic.
resolveVersionPointermethodReads the latest message from a version pointer (hcs-2:1) to discover the active declaration topic.

Typings

The module ships TypeScript typings. Example:

import type {
AdapterDeclaration,
AdapterManifest,
} 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.