Transactions — HCS‑7
These helpers produce signed-ready Hedera transaction objects. They are useful when you need to integrate HCS‑7 messages into other toolchains (agent schedulers, custom wallets, etc.) without instantiating the full client.
Sources
Create RegistryDirect link to Create Registry
- TypeScript
- Go
- Python
import { buildHcs7CreateRegistryTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs7CreateRegistryTx({
ttl: 86_400,
submitKey: operatorPublicKey,
adminKey: operatorPublicKey,
operatorPublicKey,
});
- Memo is auto-set to
hcs-7:indexed:{ttl}. - Pass
submitKey: true/adminKey: trueto reuse the operator key. - Returns a
TopicCreateTransactionyou can sign with the Hedera SDK.
import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs7"
tx := hcs7.BuildCreateRegistryTx(hcs7.CreateRegistryTxParams{
TTL: 86400,
SubmitKey: operatorPublicKey, // hedera.Key
AdminKey: operatorPublicKey,
})
- Memo is auto-set to
hcs-7:indexed:<ttl>. - Returns a
*hedera.TopicCreateTransaction.
tx = hcs7.build_create_registry_tx(ttl=86400, submit_key=operatorPublicKey,
Submit MessageDirect link to Submit Message
- TypeScript
- Go
- Python
import { buildHcs7SubmitMessageTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs7SubmitMessageTx({
topicId: '0.0.10058300',
message: {
op: 'register-config',
t: 'evm',
c: { /* ... */ },
},
transactionMemo: 'hcs7-config',
});
Wraps an arbitrary HCS‑7 payload with p: 'hcs-7' before serializing and attaching it to the topic message.
tx, err := hcs7.BuildSubmitMessageTx(
"0.0.10058300",
hcs7.Message{
Op: hcs7.OperationRegisterConfig,
Type: hcs7.ConfigTypeEVM,
Config: hcs7.EvmConfigPayload{
ContractAddress: "0x1d67aaf7...",
Abi: hcs7.AbiDefinition{
Name: "minted",
Inputs: []hcs7.AbiIO{},
Outputs: []hcs7.AbiIO{{Type: "uint64"}},
StateMutability: "view",
Type: "function",
},
},
Memo: "LaunchPage minted",
},
"hcs7-config",
)
Wraps the HCS‑7 payload with p: "hcs-7" before serializing.
tx = hcs7.build_submit_message_tx("0.0.10058300", op=hcs7.OPERATION_REGISTER_CONFIG, type=hcs7.CONFIG_TYPE_E_V_M, config={"contract_address": "0x1d67aaf7...", "abi": hcs7.AbiDefinition{ Name: "minted", "inputs": []hcs7.AbiIO{}, Outputs: []{"type": "uint64"}}, StateMutability: "view", Type: "function", }, }, memo="LaunchPage minted", "hcs7-config")
EVM Config MessageDirect link to EVM Config Message
- TypeScript
- Go
- Python
import { buildHcs7EvmMessageTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs7EvmMessageTx({
topicId: '0.0.10058300',
config: {
contractAddress: '0x1d67aaf7f7e8d806bbeba24c4dea24808e1158b8',
abi: {
name: 'minted',
inputs: [],
outputs: [{ name: '', type: 'uint64' }],
stateMutability: 'view',
type: 'function',
},
m: 'LaunchPage minted',
},
transactionMemo: 'hcs7-evm',
});
// In Go, use BuildSubmitMessageTx with ConfigTypeEVM
tx, err := hcs7.BuildSubmitMessageTx(
"0.0.10058300",
hcs7.Message{
Op: hcs7.OperationRegisterConfig,
Type: hcs7.ConfigTypeEVM,
Config: hcs7.EvmConfigPayload{
ContractAddress: "0x1d67aaf7f7e8d806bbeba24c4dea24808e1158b8",
Abi: hcs7.AbiDefinition{
Name: "minted",
Inputs: []hcs7.AbiIO{},
Outputs: []hcs7.AbiIO{{Type: "uint64"}},
StateMutability: "view",
Type: "function",
},
},
Memo: "LaunchPage minted",
},
"hcs7-evm",
)
# In Go, use BuildSubmitMessageTx with ConfigTypeEVM
tx = hcs7.build_submit_message_tx("0.0.10058300", op=hcs7.OPERATION_REGISTER_CONFIG, type=hcs7.CONFIG_TYPE_E_V_M, config={"contract_address": "0x1d67aaf7f7e8d806bbeba24c4dea24808e1158b8", "abi": hcs7.AbiDefinition{ Name: "minted", "inputs": []hcs7.AbiIO{}, Outputs: []{"type": "uint64"}}, StateMutability: "view", Type: "function", }, }, memo="LaunchPage minted", "hcs7-evm")
Produces the canonical register-config payload for EVM readers:
{
"p": "hcs-7",
"op": "register-config",
"t": "evm",
"c": { "contractAddress": "…", "abi": { … } },
"m": "LaunchPage minted"
}
WASM Config MessageDirect link to WASM Config Message
- TypeScript
- Go
- Python
import { buildHcs7WasmMessageTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs7WasmMessageTx({
topicId: '0.0.10058300',
config: {
wasmTopicId: '0.0.5269810',
inputType: {
stateData: {
minted: 'number',
tokensRemaining: 'number',
},
},
outputType: {
type: 'string',
format: 'topic-id',
},
m: 'mint router',
},
transactionMemo: 'hcs7-wasm',
});
// In Go, use BuildSubmitMessageTx with ConfigTypeWASM
tx, err := hcs7.BuildSubmitMessageTx(
"0.0.10058300",
hcs7.Message{
Op: hcs7.OperationRegisterConfig,
Type: hcs7.ConfigTypeWASM,
Config: hcs7.WasmConfigPayload{
WasmTopicID: "0.0.5269810",
InputType: map[string]any{
"stateData": map[string]any{
"minted": "number",
"tokensRemaining": "number",
},
},
OutputType: map[string]any{
"type": "string",
"format": "topic-id",
},
},
Memo: "mint router",
},
"hcs7-wasm",
)
# In Go, use BuildSubmitMessageTx with ConfigTypeWASM
tx = hcs7.build_submit_message_tx("0.0.10058300", op=hcs7.OPERATION_REGISTER_CONFIG, type=hcs7.CONFIG_TYPE_W_A_S_M, config={"wasm_topic_id": "0.0.5269810", "input_type": map[string]any{ "stateData": map[string]any{ "minted": "number", "tokensRemaining": "number"}, }, OutputType: map[string]any{ "type": "string", "format": "topic-id", }, }, memo="mint router", "hcs7-wasm")
Signing + SendingDirect link to Signing + Sending
Each builder returns a Hedera SDK transaction object. Use the standard pattern to sign and submit:
- TypeScript
- Go
- Python
const client = Client.forTestnet().setOperator(operatorId, operatorKey);
await tx.freezeWith(client);
await tx.sign(operatorKey);
const receipt = await tx.execute(client).then(res => res.getReceipt(client));
hederaClient, _ := hedera.ClientForTestnet()
hederaClient.SetOperator(operatorID, operatorKey)
frozen, _ := tx.FreezeWith(hederaClient)
frozen.Sign(operatorKey)
response, _ := frozen.Execute(hederaClient)
receipt, _ := response.GetReceipt(hederaClient)
hederaClient = hedera.client_for_testnet()
hederaClient.set_operator(operatorID, operatorKey)
frozen = tx.freeze_with(hederaClient)
frozen.sign(operatorKey)
response = frozen.execute(hederaClient)
receipt = response.get_receipt(hederaClient)
For multi-sig workflows, sign with multiple keys before calling .Execute().