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.
- TypeScript
- Go
- Python
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
maxAutomaticTokenAssociationsif you expect many token airdrops.
import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs15"
key, _ := hedera.PrivateKeyGenerateEcdsa()
tx, err := hcs15.BuildBaseAccountCreateTx(hcs15.BaseAccountCreateTxParams{
PublicKey: key.PublicKey(),
InitialBalance: 1.0, // HBAR
AccountMemo: "HCS-15 Base",
})
if err != nil {
log.Fatal(err)
}
response, _ := tx.Execute(hederaClient)
receipt, _ := response.GetReceipt(hederaClient)
key = hedera.private_key_generate_ecdsa()
tx = hcs15.build_base_account_create_tx(public_key=public_key, initial_balance=1.0,"HCS-15 Base")
response = tx.execute(hederaClient)
receipt = response.get_receipt(hederaClient)
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.
- TypeScript
- Go
- Python
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);
tx, err := hcs15.BuildPetalAccountCreateTx(hcs15.PetalAccountCreateTxParams{
PublicKey: baseKey.PublicKey(),
InitialBalance: 0.5,
AccountMemo: "HCS-15 Petal",
})
if err != nil {
log.Fatal(err)
}
response, _ := tx.Execute(hederaClient)
receipt, _ := response.GetReceipt(hederaClient)
tx = hcs15.build_petal_account_create_tx(public_key=baseKey.PublicKey(), initial_balance=0.5, account_memo="HCS-15 Petal")
response = tx.execute(hederaClient)
receipt = response.get_receipt(hederaClient)
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.