API Reference
This page summarizes the public HCS-27 surfaces exposed by the Standards SDK family after the draft-alignment work.
Import PathsDirect link to Import Paths
- TypeScript
- Go
- Python
import {
HCS27Client,
type HCS27CheckpointMetadata,
type HCS27CheckpointMessage,
type HCS27CheckpointRecord,
type HCS27CreateCheckpointTopicOptions,
type HCS27CreateCheckpointTopicResult,
type HCS27PublishCheckpointResult,
type HCS27InclusionProof,
type HCS27ConsistencyProof,
type HCS27TopicMemo,
} from '@hashgraphonline/standards-sdk';
import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs27"
from standards_sdk_py.hcs27 import (
AsyncHCS27Client,
HCS27Client,
Hcs27CheckpointMetadata,
Hcs27CheckpointMessage,
Hcs27CheckpointRecord,
Hcs27ConsistencyProof,
Hcs27CreateCheckpointTopicOptions,
Hcs27CreateCheckpointTopicResult,
Hcs27InclusionProof,
Hcs27PublishCheckpointResult,
Hcs27TopicMemo,
)
Client ConstructionDirect link to Client Construction
- TypeScript
- Go
- Python
new HCS27Client({
operatorId,
operatorKey,
network: 'testnet' | 'mainnet',
client,
keyType,
mirrorNode,
cdnEndpoint,
logger,
});
clientlets you inject an existing@hashgraph/sdkclient.cdnEndpointcontrols HCS-1 reference resolution for overflow metadata.
hcs27.NewClient(hcs27.ClientConfig{
OperatorAccountID: "...",
OperatorPrivateKey: "...",
Network: "testnet",
MirrorBaseURL: "",
MirrorAPIKey: "",
InscriberAuthURL: "",
InscriberAPIURL: "",
HederaClient: nil,
})
HCS27Client(
operator_id="0.0.123456",
operator_key="302e...",
hedera_client=hedera_client,
network="testnet",
mirror_base_url="https://testnet-public.mirrornode.hedera.com/api/v1",
cdn_base_url="https://your-inscription-cdn.example",
inscriber_base_url="https://your-inscriber-api.example",
mirror_client=mirror_client,
)
AsyncHCS27Client(
operator_id="0.0.123456",
operator_key="302e...",
hedera_client=hedera_client,
network="testnet",
mirror_base_url="https://testnet-public.mirrornode.hedera.com/api/v1",
cdn_base_url="https://your-inscription-cdn.example",
inscriber_base_url="https://your-inscriber-api.example",
mirror_client=mirror_client,
)
hedera_clientlets you reuse an existinghedera-sdk-pyclient.cdn_base_urlcontrols overflow metadata resolution.- Both camelCase and snake_case method aliases are exposed on the sync client.
Core TypesDirect link to Core Types
- TypeScript
- Go
- Python
interface HCS27CheckpointMetadata {
type: 'ans-checkpoint-v1';
stream: { registry: string; log_id: string };
log: { alg: string; leaf: string; merkle: string };
root: { treeSize: string; rootHashB64u: string };
prev?: { treeSize: string; rootHashB64u: string };
sig?: { alg: string; kid: string; b64u: string };
}
interface HCS27CheckpointMessage {
p: 'hcs-27';
op: 'register';
metadata: HCS27CheckpointMetadata | string;
metadata_digest?: { alg: 'sha-256'; b64u: string };
m?: string;
}
type StreamID struct {
Registry string `json:"registry"`
LogID string `json:"log_id"`
}
type LogProfile struct {
Algorithm string `json:"alg"`
Leaf string `json:"leaf"`
Merkle string `json:"merkle"`
}
type RootCommitment struct {
TreeSize string `json:"treeSize"`
RootHashB64u string `json:"rootHashB64u"`
}
type PreviousCommitment struct {
TreeSize string `json:"treeSize"`
RootHashB64u string `json:"rootHashB64u"`
}
type Signature struct {
Algorithm string `json:"alg"`
KeyID string `json:"kid"`
Signature string `json:"b64u"`
}
type CheckpointMetadata struct {
Type string
Stream StreamID
Log *LogProfile
Root RootCommitment
Previous *PreviousCommitment
Signature *Signature
}
type CheckpointMessage struct {
Protocol string
Operation string
Metadata json.RawMessage
MetadataDigest *MetadataDigest
Memo string
}
class Hcs27CheckpointMetadata(BaseModel):
type: Literal["ans-checkpoint-v1"]
stream: Hcs27StreamId
log: Hcs27LogProfile
root: Hcs27RootCommitment
prev: Hcs27PreviousCommitment | None = None
sig: Hcs27Signature | None = None
class Hcs27CheckpointMessage(BaseModel):
p: Literal["hcs-27"]
op: Literal["register"]
metadata: dict[str, object] | str
metadata_digest: Hcs27MetadataDigest | None = None
m: str | None = None
Main Client MethodsDirect link to Main Client Methods
- TypeScript
- Go
- Python
createCheckpointTopic(options?): Promise<HCS27CreateCheckpointTopicResult>
publishCheckpoint(topicId, metadata, messageMemo?, transactionMemo?): Promise<HCS27PublishCheckpointResult>
registerTopicSubmitKey(topicId, submitKey): void
getCheckpoints(topicId): Promise<HCS27CheckpointRecord[]>
resolveHCS1Reference(reference): Promise<Buffer>
validateCheckpointMessage(message, resolver?): Promise<HCS27CheckpointMetadata>
validateCheckpointChain(records): void
buildTopicMemo(ttl?): string
parseTopicMemo(memo): HCS27TopicMemo | null
buildTransactionMemo(): string
emptyRoot(): Buffer
hashLeaf(...)
hashNode(...)
merkleRootFromEntries(entries): string
merkleRootFromCanonicalEntries(entries): string
verifyInclusionProof(proof): boolean
verifyConsistencyProof(proof): boolean
client.CreateCheckpointTopic(ctx, options)
client.PublishCheckpoint(ctx, topicID, metadata, messageMemo, transactionMemo)
client.GetCheckpoints(ctx, topicID, options)
client.ResolveHCS1Reference(ctx, hcs1Reference)
hcs27.ValidateCheckpointChain(records)
hcs27.BuildTopicMemo(ttlSeconds)
hcs27.ParseTopicMemo(memo)
hcs27.BuildTransactionMemo()
hcs27.EmptyRoot()
hcs27.HashLeaf(canonicalEntry)
hcs27.HashNode(left, right)
hcs27.MerkleRootFromEntries(entries)
hcs27.MerkleRootFromCanonicalEntries(entries)
hcs27.VerifyInclusionProofObject(proof)
hcs27.VerifyConsistencyProofObject(proof)
client.create_checkpoint_topic(options)
client.publish_checkpoint(topic_id, metadata, message_memo=None, transaction_memo=None)
client.get_checkpoints(topic_id)
client.resolveHCS1Reference(reference)
client.validate_checkpoint_message(message)
client.validate_checkpoint_chain(records)
client.build_topic_memo({"ttl": 3600})
client.parse_topic_memo(memo)
client.build_transaction_memo()
client.empty_root()
client.hash_leaf(...)
client.hash_node(...)
client.merkle_root_from_entries({"entries": [...]})
client.merkle_root_from_canonical_entries({"entries": [...]})
client.verify_inclusion_proof({"proof": ...})
client.verify_consistency_proof({"proof": ...})