Issuance
Token issuer
The tokens contract exposes three operations. Backend calls take an alias; Keychain calls take a username. Both emit the same contract action.
Try it: create a tokenCreate a token
Creating a token costs BEE and every symbol on Hive Engine is unique, so create() always runs two checks first: the signing account's BEE balance against the sidechain creation fee, and whether the symbol already exists. A failing check throws INSUFFICIENT_BEE or TOKEN_ALREADY_EXISTS before Keychain opens or a private key is resolved — the non-refundable fee is never spent on a creation that cannot succeed.
Only token name, token symbol, decimal precision and max supply are required to create a token. Website is optional and can be added or updated later in TribalDex Token Manager.
// Browser — Keychain signs with the active authority
await hive.keychainIssuer.token.create({
username: "alice",
symbol: "MYTOKEN", // uppercase letters, max 10
name: "My Token", // max 50 letters, digits and spaces
precision: 3, // 0 to 8
maxSupply: "1000000", // always a string
url: "https://mytoken.gg", // optional
});
// Backend — the configuration alias signs
await hive.issuer.token.create({
from: hive.accounts.treasury,
symbol: "MYTOKEN",
name: "My Token",
precision: 3,
maxSupply: "1000000",
});
// Read-only: what the checks see, without creating anything
const check = await hive.keychainIssuer.token.checkCreate({ username: "alice", symbol: "MYTOKEN" });
// { fee: "100", balance: "8.45434186", hasEnoughBee: false, symbolExists: false, ok: false, issues: [...] }
// Offline payload preview — no network, no checks
hive.keychainIssuer.token.buildCreate({ symbol: "MYTOKEN", name: "My Token", precision: 3, maxSupply: "1000000" });Important
skipChecks: true only when you have already verified the balance and the symbol yourself. Without the checks a doomed creation still costs the BEE fee.Backend API
await hive.issuer.token.issue({ from: hive.accounts.treasury, symbol: "MYTOKEN", account: "bob", quantity: "10" });
await hive.issuer.token.transfer({ from: hive.accounts.treasury, symbol: "MYTOKEN", account: "bob", quantity: "5" });
// Burn = transfer to the burn destination. Defaults to the Hive account "null".
await hive.issuer.token.burn({ from: hive.accounts.treasury, symbol: "MYTOKEN", quantity: "1" });
// Custom burn destination
await hive.issuer.token.burn({ from: hive.accounts.treasury, symbol: "MYTOKEN", quantity: "1", account: "graveyard" });
// Offline previews
hive.issuer.token.buildIssue({ from: hive.accounts.treasury, symbol: "MYTOKEN", account: "bob", quantity: "10" });Keychain API
await hive.keychainIssuer.token.issue({
username: "alice",
symbol: "MYTOKEN",
account: "bob",
quantity: "10",
});
// Build only — inspect before prompting the user
const action = hive.keychainIssuer.token.buildBurn({ symbol: "MYTOKEN", quantity: "1" });
// -> tokens.transfer to "null" (pass account: "graveyard" to override)Keychain calls never accept an alias and never read an environment variable — the browser account signs itself.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Backend only: configuration account alias that signs. |
| username | string | Yes | Keychain only: Hive account signing in the extension. |
| symbol | string | Yes | Hive Engine token symbol. |
| account | string | Yes | Destination account (mint and transfer). |
| account (burn) | string | No | Optional burn destination. Defaults to the Hive account "null". |
| quantity | string | Yes | Amount as a string — never a float. |
| memo | string | No | Optional memo attached to the contract payload. |
| id | string | No | Overrides the ssc-mainnet-hive custom_json id. |
Create parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Token symbol. Should be uppercase, maximum 10 characters, and must not exist yet. |
| name | string | Yes | Token name. Maximum of 50 characters are allowed. |
| precision | number | Yes | Decimal precision. Must be between 0 and 8. |
| maxSupply | string | Yes | Max supply. Must be between 1 and 9007199254740991. |
| url | string | No | Optional website, maximum 255 characters. It can be updated later in TribalDex Token Manager. |
| skipChecks | boolean | No | Skips the BEE balance and existing symbol preflight. Off by default. |
