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

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 collection

Create

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"] }] }); // 2

The 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

NFT operation input
ParameterTypeRequiredDescription
fromstringYesBackend only: configuration account alias that signs.
symbolstringYesNFT symbol being issued.
accountstringYesDestination account or contract.
feeSymbolstringYesToken symbol used to pay the issuance fee.
accountType"user" | "contract"NoDestination type. Defaults to "user".
propertiesRecord<string, unknown>NoArbitrary instance properties.
lockTokensRecord<string, string>NoTokens locked inside the instance at issuance.
lockNfts{ symbol, ids }[]NoNFT instances locked inside the issued instance.
nfts{ symbol, ids }[]NoTransfer only: instances to move.
idstring | string[]NoBurn only: instance id(s) to burn.
account (burn)stringNoBurn only: optional destination. Defaults to the Hive account "null".