Issuance
NFT issuer
The nft contract issues instances with arbitrary properties and optional locked assets. Instance limits are validated before anything is signed.
Try it: create a collectionCreate
Creating an NFT collection costs 100 BEE. Only
name and symbol are required. orgName, productName, maxSupply, website, authorizedIssuingAccounts and authorizedIssuingContracts are optional and can be set later in the TribalDex NFT manager.TypeScript
// Server side (alias + key)
await hive.issuer.nft.create({
from: game.accounts.minter,
name: "Hero Collection",
symbol: "HERO",
maxSupply: "10000", // optional, unlimited when omitted
website: "https://example.com", // optional
});
// Browser side (Hive Keychain, active authority)
await hive.keychainIssuer.nft.create({
username: "alice",
name: "Hero Collection",
symbol: "HERO",
});
// Read-only preflight and offline payload preview
const check = await hive.issuer.nft.checkCreate({ from: game.accounts.minter, name: "Hero Collection", symbol: "HERO" });
// { fee, balance, hasEnoughBee, symbolExists, ok, issues }
const payload = hive.keychainIssuer.nft.buildCreate({ name: "Hero Collection", symbol: "HERO" });Preflight before signing
Both paths check the BEE balance against the NFT creation fee and whether the symbol already exists. A failure throws
INSUFFICIENT_BEE or NFT_ALREADY_EXISTS before Keychain opens or a key is resolved. Pass skipChecks: true to skip the lookups.Issue
TypeScript
await hive.issuer.nft.issue({
from: game.accounts.minter,
symbol: "HERO",
account: "bob",
feeSymbol: "PAL",
properties: { level: 1, rarity: "epic" },
});Issue multiple
TypeScript
await hive.issuer.nft.issueMultiple({
from: game.accounts.minter,
instances: [
{ symbol: "HERO", account: "bob", feeSymbol: "PAL", properties: { level: 1 } },
{ symbol: "HERO", account: "carol", feeSymbol: "PAL", properties: { level: 2 } },
],
});Important
A single
issueMultiple action is capped by NFT_MAX_ISSUE_MULTIPLE_INSTANCES. Exceeding it throws before signing.Transfer
TypeScript
await hive.issuer.nft.transfer({
from: game.accounts.minter,
account: "bob",
nfts: [{ symbol: "HERO", ids: ["1", "2", "3"] }],
});
hive.issuer.nft.countInstances({ nfts: [{ symbol: "HERO", ids: ["1", "2"] }] }); // 2The Keychain equivalent lives on hive.keychainIssuer.nft and takes username instead of from.
Burn
A burn is a transfer to a destination nobody controls. It defaults to the Hive account null; pass account to send the instances somewhere else.
TypeScript
await hive.issuer.nft.burn({
from: game.accounts.minter,
symbol: "HERO",
id: ["1", "2"], // one id or several
});
// Custom burn destination
await hive.issuer.nft.burn({
from: game.accounts.minter,
symbol: "HERO",
id: "1",
account: "graveyard",
});
// Keychain equivalent
await hive.keychainIssuer.nft.burn({ username: "alice", symbol: "HERO", id: "1" });Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Backend only: configuration account alias that signs. |
| symbol | string | Yes | NFT symbol being issued. |
| account | string | Yes | Destination account or contract. |
| feeSymbol | string | Yes | Token symbol used to pay the issuance fee. |
| accountType | "user" | "contract" | No | Destination type. Defaults to "user". |
| properties | Record<string, unknown> | No | Arbitrary instance properties. |
| lockTokens | Record<string, string> | No | Tokens locked inside the instance at issuance. |
| lockNfts | { symbol, ids }[] | No | NFT instances locked inside the issued instance. |
| nfts | { symbol, ids }[] | No | Transfer only: instances to move. |
| id | string | string[] | No | Burn only: instance id(s) to burn. |
| account (burn) | string | No | Burn only: optional destination. Defaults to the Hive account "null". |
