HCS‑20 API Reference
Sources
- Module folder: GitHub
- base-client.ts: GitHub
- sdk.ts: GitHub
- browser.ts: GitHub
- points-indexer.ts: GitHub
- tx.ts: GitHub
- types.ts: GitHub
- errors.ts: GitHub
ImportDirect link to Import
- TypeScript
- Go
import * as HCS20 from '@hashgraphonline/standards-sdk';
NewClient(config ClientConfig) (*Client, error)
Client.Deploy / Mint / Transfer / Burn / Register
Client.GetBalance / GetTokenInfo
BuildHCS20DeployTx(DeployTxParams) (*hedera.TopicMessageSubmitTransaction, error)
BuildHCS20MintTx(MintTxParams) ...
BuildHCS20BurnTx(BurnTxParams) ...
BuildHCS20TransferTx(TransferTxParams) ...
BuildHCS20RegisterTx(RegisterTxParams) ...
BuildHCS20SubmitMessageTx(SubmitMessageTxParams) ...
Barrel ExportsDirect link to Barrel Exports
- types (all canonical types)
- errors
HCS20Error,PointsDeploymentError,PointsMintError,PointsTransferError,PointsBurnError,PointsValidationError,PointsNotFoundError,TopicRegistrationError,InsufficientBalanceError,SupplyLimitExceededError,MintLimitExceededError,InvalidMessageFormatError,InvalidAccountFormatError,InvalidTickFormatError,InvalidNumberFormatError
- base-client
HCS20BaseClient
- browser
BrowserHCS20Client
- sdk
HCS20Client
- points-indexer
HCS20PointsIndexer(helper to compute balances from topic messages)
- tx
buildHcs20SubmitMessageTx,buildHcs20DeployTx,buildHcs20MintTx,buildHcs20TransferTx,buildHcs20BurnTx,buildHcs20RegisterTx
ClientsDirect link to Clients
- TypeScript
- Go
class HCS20BaseClient { /* shared config/mirror/logger */ }
class HCS20Client extends HCS20BaseClient { /* Node: createPublicTopic, createRegistryTopic, deployPoints, mintPoints, transferPoints, burnPoints, registerTopic */ }
class BrowserHCS20Client extends HCS20BaseClient { /* Browser: createRegistryTopic, deployPoints, mintPoints, transferPoints, burnPoints, registerTopic */ }
// See standards-sdk-go for full Go API types and methods
Source
IndexerDirect link to Indexer
- TypeScript
- Go
class HCS20PointsIndexer {
constructor(network: import('@hashgraphonline/standards-sdk').NetworkType, logger?: import('@hashgraphonline/standards-sdk').Logger, mirrorNodeUrl?: string)
startIndexing(options?: { publicTopicId?: string; registryTopicId?: string; includePublicTopic?: boolean; includeRegistryTopic?: boolean; privateTopics?: string[]; pollInterval?: number }): Promise<void>
indexOnce(options?: { publicTopicId?: string; registryTopicId?: string; includePublicTopic?: boolean; includeRegistryTopic?: boolean; privateTopics?: string[] }): Promise<void>
getState(): import('@hashgraphonline/standards-sdk').PointsState
getPointsInfo(tick: string): import('@hashgraphonline/standards-sdk').PointsInfo | undefined
getBalance(tick: string, accountId: string): string
stopIndexing(): void
}
// See standards-sdk-go for full Go API types and methods
Source
Builders (tx)Direct link to Builders (tx)
- TypeScript
- Go
// Example signature pattern
function buildHcs20SubmitMessageTx(params: { topicId: string; payload: object | string; transactionMemo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
function buildHcs20DeployTx(params: { topicId: string; name: string; tick: string; max: string; lim?: string; metadata?: string; memo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
function buildHcs20MintTx(params: { topicId: string; tick: string; amt: string; to: string; memo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
function buildHcs20TransferTx(params: { topicId: string; tick: string; amt: string; from: string; to: string; memo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
function buildHcs20BurnTx(params: { topicId: string; tick: string; amt: string; from: string; memo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
function buildHcs20RegisterTx(params: { registryTopicId: string; name: string; topicId: string; isPrivate: boolean; metadata?: string; memo?: string }): import('@hashgraph/sdk').TopicMessageSubmitTransaction;
// See standards-sdk-go for full Go API types and methods
Notes
- See the source for exact builder names and types under
src/hcs-20/tx.ts. - The indexer is optional; you can compute balances ad‑hoc if preferred.