Skip to main content

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

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',
});

MintDirect link to Mint

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

const tx = buildHcs20MintTx({
topicId: '0.0.100',
tick: 'loyal',
amt: '100',
to: '0.0.12345',
memo: 'reward',
});

TransferDirect link to Transfer

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',
});

BurnDirect link to Burn

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

const tx = buildHcs20BurnTx({
topicId: '0.0.100',
tick: 'loyal',
amt: '5',
from: '0.0.111',
memo: 'cleanup',
});

Register (Directory)Direct link to Register (Directory)

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',
});

ExecutionDirect link to Execution

  • Node: await tx.execute(client).then(r => r.getReceipt(client))
  • Browser: await (await tx.freezeWithSigner(signer)).executeWithSigner(signer) then getReceiptWithSigner