HCS‑6 API Reference
Sources
- Module folder: GitHub
- base-client.ts: GitHub
- sdk.ts: GitHub
- browser.ts: GitHub
- tx.ts: GitHub
- types.ts: GitHub
Import PathsDirect link to Import Paths
- TypeScript
- Go
- Python
import {
HCS6Client,
HCS6BrowserClient,
HCS6Operation,
HCS6RegistryType,
type HCS6ClientConfig,
type SDKHCS6ClientConfig,
type HCS6CreateRegistryOptions,
type HCS6RegisterEntryOptions,
type HCS6QueryRegistryOptions,
type HCS6TopicRegistry,
type HCS6RegisterOptions,
type HCS6CreateHashinalOptions,
type HCS6CreateHashinalResponse,
type HCS6MintOptions,
type HCS6InscribeAndMintOptions,
type HCS6MintResponse,
buildHcs6CreateRegistryTx,
buildHcs6RegisterEntryTx,
} from '@hashgraphonline/standards-sdk';
import (
"github.com/hashgraph-online/standards-sdk-go/pkg/hcs6"
)
from standards_sdk_py.hcs6 import Hcs6Client
# Equivalent Python usage — see Python SDK docs for details
TypesDirect link to Types
- TypeScript
- Go
- Python
See GitHub for all message and option interfaces, including HCS6Message, HCS6RegisterMessage, and registry/query option shapes.
type ClientConfig struct {
OperatorAccountID string
OperatorPrivateKey string
Network string
MirrorBaseURL string
MirrorAPIKey string
}
type CreateRegistryOptions struct {
TTL int64
UseOperatorAsAdmin bool
UseOperatorAsSubmit bool
AdminKey string
SubmitKey string
}
type RegisterEntryOptions struct {
TargetTopicID string
Memo string
AnalyticsMemo string
}
type QueryRegistryOptions struct {
Limit int
Order string
Skip int64
}
type TopicRegistry struct {
TopicID string
RegistryType RegistryType
TTL int64
Entries []RegistryEntry
LatestEntry *RegistryEntry
}
type RegistryEntry struct {
TopicID string
Sequence int64
Timestamp string
Payer string
Message Message
ConsensusTimestamp string
RegistryType RegistryType
}
from standards_sdk_py.hcs6 import Hcs6Client
# Equivalent Python usage — see Python SDK docs for details
EnumsDirect link to Enums
- TypeScript
- Go
- Python
enum HCS6Operation { REGISTER = 0 }
enum HCS6RegistryType { INDEXED = 0, NON_INDEXED = 1 }
const (
OperationRegister RegistryOperation = 0
)
const (
RegistryTypeIndexed RegistryType = 0
RegistryTypeNonIndexed RegistryType = 1
)
from standards_sdk_py.hcs6 import Hcs6Client
# Equivalent Python usage — see Python SDK docs for details
Server Client (HCS6Client)Direct link to Server Client (HCS6Client)
- TypeScript
- Go
- Python
constructor(config: SDKHCS6ClientConfig)
getKeyType(): 'ed25519' | 'ecdsa'
close(): void
// Messages
submitMessage(topicId: string, payload: HCS6Message): Promise<import('@hashgraph/sdk').TransactionReceipt>
submitMessageWithKey(topicId: string, payload: HCS6Message, submitKey?: string | import('@hashgraph/sdk').PrivateKey): Promise<import('@hashgraph/sdk').TransactionReceipt>
// Registry
createRegistry(options?: { ttl?: number; submitKey?: string | boolean | import('@hashgraph/sdk').PrivateKey }): Promise<{ success: boolean; topicId?: string; transactionId?: string; error?: string }>
registerEntryWithKey(registryTopicId: string, options: HCS6RegisterEntryOptions, submitKey?: string | import('@hashgraph/sdk').PrivateKey): Promise<{ success: boolean; receipt?: import('@hashgraph/sdk').TransactionReceipt; sequenceNumber?: number; error?: string }>
// Hashinal helpers
createHashinal(options: HCS6CreateHashinalOptions): Promise<HCS6CreateHashinalResponse>
mint(options: HCS6MintOptions): Promise<HCS6MintResponse>
inscribeAndMint(options: HCS6InscribeAndMintOptions): Promise<HCS6MintResponse>
func NewClient(config ClientConfig) (*Client, error)
func (c *Client) CreateRegistry(ctx context.Context, options CreateRegistryOptions) (CreateRegistryResult, error)
func (c *Client) RegisterEntry(ctx context.Context, topicID string, options RegisterEntryOptions) (OperationResult, error)
func (c *Client) GetRegistry(ctx context.Context, topicID string, options QueryRegistryOptions) (TopicRegistry, error)
from standards_sdk_py.hcs6 import Hcs6Client
# Equivalent Python usage — see Python SDK docs for details
Browser Client (HCS6BrowserClient)Direct link to Browser Client (HCS6BrowserClient)
Wallet‑signed counterpart supporting the same flows.
Source
Builders (tx.ts)Direct link to Builders (tx.ts)
- TypeScript
- Go
- Python
function buildHcs6CreateRegistryTx(params: { ttl: number; adminKey?: any; submitKey?: any; memoOverride?: string; operatorPublicKey?: import('@hashgraph/sdk').PublicKey }): import('@hashgraph/sdk').TopicCreateTransaction;
function buildHcs6RegisterEntryTx(params: { registryTopicId: string; targetTopicId: string; memo?: string; analyticsMemo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
func BuildCreateRegistryTx(params CreateRegistryTxParams) *hedera.TopicCreateTransaction
func BuildRegisterEntryTx(params RegisterEntryTxParams) (*hedera.TopicMessageSubmitTransaction, error)
from standards_sdk_py.hcs6 import Hcs6Client
# Equivalent Python usage — see Python SDK docs for details
NotesDirect link to Notes
- Registry memo uses
hcs-6:<type>:<ttl>(helpers provided intypes.ts). - The client can resolve
supplyKeyand enforce correct curve for signing.
ExampleDirect link to Example
- TypeScript
- Go
- Python
const c = new HCS6Client({ network: 'testnet', operatorId, operatorKey });
const reg = await c.createRegistry({ ttl: 86400 });
await c.registerEntryWithKey(reg.topicId!, { targetTopicId: '0.0.1234' });
client, _ := hcs6.NewClient(hcs6.ClientConfig{
Network: "testnet",
OperatorAccountID: os.Getenv("HEDERA_ACCOUNT_ID"),
OperatorPrivateKey: os.Getenv("HEDERA_PRIVATE_KEY"),
})
reg, _ := client.CreateRegistry(context.Background(), hcs6.CreateRegistryOptions{
TTL: 86400,
UseOperatorAsSubmit: true,
})
client.RegisterEntry(context.Background(), reg.TopicID, hcs6.RegisterEntryOptions{
TargetTopicID: "0.0.1234",
})
import os
client = Hcs6Client(network="testnet", operator_id=os.environ["HEDERA_ACCOUNT_ID"], operator_private_key=os.environ["HEDERA_PRIVATE_KEY"])
reg = client.create_registry(ttl=86400, use_operator_as_submit=True)
client.register_entry(reg.topic_id, target_topic_id="0.0.1234")