Transactions — HCS‑20 Builders
Note
- These builders are for direct transaction construction (e.g., with the Standards Agent Kit or custom pipelines).
- For most applications, prefer the higher‑level client (Node/Go) or browser client (wallet).
Sources
DeployDirect link to Deploy
- TypeScript
- Go
import { buildHcs20DeployTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs20DeployTx({
topicId: '0.0.100',
name: 'Loyalty Points',
tick: 'loyal',
max: '1000000000',
lim: '10000',
metadata: 'ipfs://…',
memo: 'deploy',
});
import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs20"
tx, err := hcs20.BuildHCS20DeployTx(hcs20.DeployTxParams{
TopicID: "0.0.100",
Name: "Loyalty Points",
Tick: "loyal",
Max: "1000000000",
Lim: "10000",
Metadata: "ipfs://…",
Memo: "deploy",
})
if err != nil {
log.Fatal(err)
}
MintDirect link to Mint
- TypeScript
- Go
import { buildHcs20MintTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs20MintTx({
topicId: '0.0.100',
tick: 'loyal',
amt: '100',
to: '0.0.12345',
memo: 'reward',
});
tx, err := hcs20.BuildHCS20MintTx(hcs20.MintTxParams{
TopicID: "0.0.100",
Tick: "loyal",
Amt: "100",
To: "0.0.12345",
Memo: "reward",
})
TransferDirect link to Transfer
- TypeScript
- Go
import { buildHcs20TransferTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs20TransferTx({
topicId: '0.0.100',
tick: 'loyal',
amt: '10',
from: '0.0.111',
to: '0.0.222',
memo: 'tip',
});
tx, err := hcs20.BuildHCS20TransferTx(hcs20.TransferTxParams{
TopicID: "0.0.100",
Tick: "loyal",
Amt: "10",
From: "0.0.111",
To: "0.0.222",
Memo: "tip",
})
BurnDirect link to Burn
- TypeScript
- Go
import { buildHcs20BurnTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs20BurnTx({
topicId: '0.0.100',
tick: 'loyal',
amt: '5',
from: '0.0.111',
memo: 'cleanup',
});
tx, err := hcs20.BuildHCS20BurnTx(hcs20.BurnTxParams{
TopicID: "0.0.100",
Tick: "loyal",
Amt: "5",
From: "0.0.111",
Memo: "cleanup",
})
Register (Directory)Direct link to Register (Directory)
- TypeScript
- Go
import { buildHcs20RegisterTx } from '@hashgraphonline/standards-sdk';
const tx = buildHcs20RegisterTx({
registryTopicId: '0.0.999',
name: 'Loyalty Points',
topicId: '0.0.100',
isPrivate: false,
metadata: 'ipfs://…',
memo: 'register',
});
tx, err := hcs20.BuildHCS20RegisterTx(hcs20.RegisterTxParams{
RegistryTopicID: "0.0.999",
Name: "Loyalty Points",
TopicID: "0.0.100",
IsPrivate: false,
Metadata: "ipfs://…",
Memo: "register",
})
ExecutionDirect link to Execution
- TypeScript
- Go
- Node:
await tx.execute(client).then(r => r.getReceipt(client)) - Browser:
await (await tx.freezeWithSigner(signer)).executeWithSigner(signer)thengetReceiptWithSigner
response, err := tx.Execute(hederaClient)
if err != nil {
log.Fatal(err)
}
receipt, err := response.GetReceipt(hederaClient)