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.
- TypeScript
- Go
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.
import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs12"
tx, err := hcs12.BuildCreateRegistryTopicTx(hcs12.CreateRegistryTopicTxParams{
RegistryType: hcs12.RegistryTypeAssembly,
TTL: 3600,
AdminKey: operatorPublicKey,
SubmitKey: operatorPublicKey,
})
if err != nil {
log.Fatal(err)
}
response, _ := tx.Execute(hederaClient)
Submit MessageDirect link to Submit Message
Generic message submit helper when you already constructed a valid payload.
- TypeScript
- Go
import { buildHcs12SubmitMessageTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs12SubmitMessageTx({
topicId: '0.0.500',
payload: { /* HCS-12 JSON payload */ },
transactionMemo: 'optional',
});
tx, err := hcs12.BuildSubmitMessageTx(
"0.0.500",
map[string]any{"p": "hcs-12", "op": "register", "name": "Demo"},
"optional",
)
if err != nil {
log.Fatal(err)
}
Assembly OperationsDirect link to Assembly Operations
Register AssemblyDirect link to Register Assembly
- TypeScript
- Go
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);
tx, err := hcs12.BuildSubmitMessageTx(
"0.0.500",
map[string]any{
"p": "hcs-12", "op": "register",
"name": "Demo", "version": "1.0.0",
},
"",
)
Add BlockDirect link to Add Block
- TypeScript
- Go
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);
tx, err := hcs12.BuildSubmitMessageTx(
"0.0.500",
map[string]any{
"p": "hcs-12", "op": "add-block",
"block_t_id": "0.0.501",
"attributes": map[string]any{"text": "Hello"},
},
"",
)