HiveXPH SDKhivexph-sdk
NPM
Developer toolkit for Hive Custom JSON and Hive Engine transactions.

Tokens

Create a token

Creating a token costs a non-refundable BEE fee, so the SDK verifies the balance and the symbol before anything is signed.

Try it: create a token

Usage

Token name, token symbol, decimal precision and max supply are the only required values. The website is optional and can be added or changed later in the TribalDex Token Manager.

TypeScript
// Browser — Keychain signs with the active authority
await hive.keychainIssuer.token.create({
  username: "alice",
  symbol: "MYTOKEN",
  name: "My Token",
  precision: 3,
  maxSupply: "1000000",
  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",
});

// Offline payload preview — no network, no checks
hive.keychainIssuer.token.buildCreate({
  symbol: "MYTOKEN", name: "My Token", precision: 3, maxSupply: "1000000",
});

Preflight checks

create() compares the signing account's BEE balance against the sidechain creation fee and checks whether the symbol already exists. A failing check throws INSUFFICIENT_BEE or TOKEN_ALREADY_EXISTS before Keychain opens or a private key is resolved.

TypeScript
const check = await hive.keychainIssuer.token.checkCreate({ username: "alice", symbol: "MYTOKEN" });
// { fee: "100", balance: "8.454", hasEnoughBee: false, symbolExists: false, ok: false, issues: [...] }

Important

Pass skipChecks: true only when you have already verified the balance and the symbol yourself — the creation fee is never refunded.

Parameters

ParameterTypeRequiredDescription
symbolstringYesUppercase letters, max 10.
namestringYesMax 50 characters.
precisionnumberYes0 to 8 decimals.
maxSupplystringYes1 to 9007199254740991.
urlstringNoOptional website, editable later.
skipChecksbooleanNoSkip the BEE and symbol preflight.