Skip to main content

Transactions — HCS‑15 Builders

Note

  • These builders are for direct transaction construction (e.g., Standards Agent Kit, custom pipelines).
  • For most apps, prefer the higher‑level Node or Browser clients which wrap these builders.

Sources

Base AccountDirect link to Base Account

Creates a base account with ECDSA key and EVM alias suitable for HCS‑15 usage.

import { Client, PrivateKey, Hbar } from '@hashgraph/sdk';
import { buildHcs15BaseAccountCreateTx } from '@hashgraphonline/standards-sdk';

const key = PrivateKey.generateECDSA();
const tx = buildHcs15BaseAccountCreateTx({
publicKey: key.publicKey,
initialBalance: new Hbar(1),
accountMemo: 'HCS‑15 Base',
});
const receipt = await (await tx.execute(client)).getReceipt(client);

Notes

  • Uses the SDK's "ECDSA + alias" setter so an immutable EVM alias is assigned on creation.
  • Set maxAutomaticTokenAssociations if you expect many token airdrops.

Petal AccountDirect link to Petal Account

Creates a Petal (shadow) account that reuses the base account's public key and does not set an alias.

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

const tx = buildHcs15PetalAccountCreateTx({
publicKey: baseKey.publicKey,
initialBalance: 0.5,
accountMemo: 'HCS‑15 Petal',
});
const receipt = await (await tx.execute(client)).getReceipt(client);

Notes

  • Petal accounts are meant to be controlled by the same private key as the base—do not set an alias.
  • Combine with HCS‑11 to inscribe per‑Petal profiles and HCS‑10 to create per‑Petal communication topics.