Skip to main content

HCS‑20 API Reference

Sources

ImportDirect link to Import

import * as HCS20 from '@hashgraphonline/standards-sdk';

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

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 */ }

Source

IndexerDirect link to Indexer

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
}

Source

Builders (tx)Direct link to Builders (tx)

// 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;

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.