Skip to main content

Usage

This page covers the core operations available across the SDK and CLI.


Role & Asset Management

Stablecoin Studio provides fine-grained control over who can perform sensitive operations.

RoleResponsibility
AdminCan upgrade contracts and assign roles
CashierAuthorized to mint and burn tokens
ComplianceCan freeze accounts and wipe fraudulent funds
RescueCan recover assets sent to the contract by mistake

SDK Quick Reference

The @hashgraph/stablecoin-sdk is the primary tool for custom integrations.

MethodDescription
Stablecoin.get(id)Connects to an existing token
Stablecoin.create(args)Deploys a new stablecoin
mint(amount)Creates new supply to treasury
burn(amount)Destroys supply from treasury
wipe(amount, account)Force-removes tokens from a user
freeze(account)Prevents an account from moving tokens
unfreeze(account)Restores movement for a frozen account
grantKyc(account)Flags an account as KYC verified
revokeKyc(account)Removes KYC verification
pause() / unpause()Halts/resumes all token operations
rescue(token, amount)Recovers assets sent to the contract
grantRole(role, account)Assigns a role to an account
getCapabilities()Returns permissions for the current operator

SDK Code Example

const coin = await Stablecoin.get("0.0.xxxx");
if ((await coin.getCapabilities()).canMint) {
await coin.mint(1000);
}

CLI Commands

CommandDescription
stablecoin createStep-by-step wizard to deploy
stablecoin listShows all tokens you manage
stablecoin manageSub-menu for mint/burn/wipe

Role Assignment Example

await stablecoin.assignRole({
role: StablecoinRole.CASHIER,
account: "0.0.XXXX"
});