Skip to main content

Transactions — HCS‑12

Note

  • Prefer high‑level clients where possible; use builders for custom flows and agent‑kit integrations.

Sources

Create RegistryDirect link to Create Registry

Registry types: action | assembly | hashlinks.

import { buildHcs12CreateRegistryTopicTx } from '@hashgraphonline/standards-sdk';

const tx = buildHcs12CreateRegistryTopicTx({
registry: 'assembly',
ttl: 3600,
adminKey: true,
submitKey: true,
});
await (await tx.execute(client)).getReceipt(client);

Memo defaults to hcs-12:1:<ttl>:<typeEnum>; type map is action=0, assembly=2, hashlinks=3.

Submit MessageDirect link to Submit Message

Generic message submit helper when you already constructed a valid payload.

import { buildHcs12SubmitMessageTx } from '@hashgraphonline/standards-sdk';

const tx = buildHcs12SubmitMessageTx({
topicId: '0.0.500',
payload: { /* HCS-12 JSON payload */ },
transactionMemo: 'optional',
});

Assembly OperationsDirect link to Assembly Operations

Register AssemblyDirect link to Register Assembly

import { buildHcs12RegisterAssemblyTx } from '@hashgraphonline/standards-sdk';

const tx = buildHcs12RegisterAssemblyTx({
assemblyTopicId: '0.0.500',
registration: { p: 'hcs-12', op: 'register', name: 'Demo', version: '1.0.0' },
});
await (await tx.execute(client)).getReceipt(client);

Add BlockDirect link to Add Block

import { buildHcs12AddBlockToAssemblyTx } from '@hashgraphonline/standards-sdk';

const tx = buildHcs12AddBlockToAssemblyTx({
assemblyTopicId: '0.0.500',
operation: {
p: 'hcs-12',
op: 'add-block',
block_t_id: '0.0.501',
attributes: { text: 'Hello' },
},
});
await (await tx.execute(client)).getReceipt(client);