All pallets

Balances docs

Look up any call, event, or storage item with code examples. Runtime v472 · Block #9,197,056

Developer documentation for the Balances pallet of the Subtensor blockchain, part of the Bittensor decentralized AI network. This page is designed for developers integrating with the chain: look up any call, event, or storage item, copy code examples in TypeScript, Python, or Rust, and filter by your role. For in-depth explanations, version history, and relationships between items, see the Reference section.

Balances

Transfer some liquid free balance to another account.

Index: 5 54 items

Calls 9

transfer_allow_death

call details

Transfers TAO allowing sender account to be reaped.

Parameters

NameTypeFormatDescription
destMultiAddress—dest: Account address as a lookup source (typically resolves to AccountId)
valueCompact<TaoBalance>TaoBalancevalue: Balance in chain native currency (RAO for TAO; ÷10⁹)
// ----------------------------------------------------------------------
// HEADS UP: 2 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build transfer_allow_death call (typed, named args)
const dest = undefined as any /* MultiAddress — replace with real value */;
const value = undefined as any /* TaoBalance — replace with real value */;

const tx = api.tx.Balances.transfer_allow_death({
  dest,
  value,
});

force_transfer

call details

Transfers TAO between accounts (root only, can specify source).

Parameters

NameTypeFormatDescription
sourceMultiAddress—source: Account address as a lookup source (typically resolves to AccountId)
destMultiAddress—dest: Account address as a lookup source (typically resolves to AccountId)
valueCompact<TaoBalance>TaoBalancevalue: Balance in chain native currency (RAO for TAO; ÷10⁹)
Emits: Transfer
Modifies: Account
// ----------------------------------------------------------------------
// HEADS UP: 3 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build force_transfer call (typed, named args)
const source = undefined as any /* MultiAddress — replace with real value */;
const dest = undefined as any /* MultiAddress — replace with real value */;
const value = undefined as any /* TaoBalance — replace with real value */;

const tx = api.tx.Balances.force_transfer({
  source,
  dest,
  value,
});

transfer_keep_alive

call details

Transfers TAO while ensuring sender account stays alive.

Parameters

NameTypeFormatDescription
destMultiAddress—dest: Account address as a lookup source (typically resolves to AccountId)
valueCompact<TaoBalance>TaoBalancevalue: Balance in chain native currency (RAO for TAO; ÷10⁹)
Modifies: Account
// ----------------------------------------------------------------------
// HEADS UP: 2 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build transfer_keep_alive call (typed, named args)
const dest = undefined as any /* MultiAddress — replace with real value */;
const value = undefined as any /* TaoBalance — replace with real value */;

const tx = api.tx.Balances.transfer_keep_alive({
  dest,
  value,
});

transfer_all

call details

Transfers entire free balance to recipient.

Parameters

NameTypeFormatDescription
destMultiAddress—dest: Account address as a lookup source (typically resolves to AccountId)
keep_aliveboolBoolean (true/false)keep_alive (bool)
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build transfer_all call (typed, named args)
const dest = undefined as any /* MultiAddress — replace with real value */;
const keep_alive = true;

const tx = api.tx.Balances.transfer_all({
  dest,
  keep_alive,
});

force_unreserve

call details

Unreserves balance from an account (root only).

Parameters

NameTypeFormatDescription
whoMultiAddress—who: Account address as a lookup source (typically resolves to AccountId)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
Emits: Unreserved
Modifies: Account
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build force_unreserve call (typed, named args)
const who = undefined as any /* MultiAddress — replace with real value */;
const amount = 1_000_000_000n;

const tx = api.tx.Balances.force_unreserve({
  who,
  amount,
});

upgrade_accounts

call details

Upgrades legacy accounts to the new balance format.

Parameters

NameTypeFormatDescription
whoVec<AccountId>Array of SS58 Addresswho: list of Account address (32 bytes, SS58-encoded)
Emits: Upgraded
Modifies: Account
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build upgrade_accounts call (typed, named args)
const who = [] as [];

const tx = api.tx.Balances.upgrade_accounts({
  who,
});

force_set_balance

call details

Sets an account balance to a specific value (root only).

Parameters

NameTypeFormatDescription
whoMultiAddress—who: Account address as a lookup source (typically resolves to AccountId)
new_freeCompact<TaoBalance>TaoBalancenew_free: Balance in chain native currency (RAO for TAO; ÷10⁹)
Emits: BalanceSet
// ----------------------------------------------------------------------
// HEADS UP: 2 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build force_set_balance call (typed, named args)
const who = undefined as any /* MultiAddress — replace with real value */;
const new_free = undefined as any /* TaoBalance — replace with real value */;

const tx = api.tx.Balances.force_set_balance({
  who,
  new_free,
});

force_adjust_total_issuance

call details

Adjusts TotalIssuance up or down (root only).

Parameters

NameTypeFormatDescription
directionAdjustmentDirection—direction (AdjustmentDirection)
deltaCompact<TaoBalance>TaoBalancedelta: Balance in chain native currency (RAO for TAO; ÷10⁹)
Modifies: TotalIssuance
// ----------------------------------------------------------------------
// HEADS UP: 2 args below have a complex type with no usable default.
// Look for `undefined as any` and replace them with real values
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build force_adjust_total_issuance call (typed, named args)
const direction = undefined as any /* AdjustmentDirection — replace with real value */;
const delta = undefined as any /* TaoBalance — replace with real value */;

const tx = api.tx.Balances.force_adjust_total_issuance({
  direction,
  delta,
});

burn

call details

Burns TAO from the caller, permanently reducing total issuance.

Parameters

NameTypeFormatDescription
valueCompact<TaoBalance>TaoBalancevalue: Balance in chain native currency (RAO for TAO; ÷10⁹)
keep_aliveboolBoolean (true/false)keep_alive (bool)
Emits: Burned
Modifies: TotalIssuance
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build burn call (typed, named args)
const value = undefined as any /* TaoBalance — replace with real value */;
const keep_alive = true;

const tx = api.tx.Balances.burn({
  value,
  keep_alive,
});

Events 22

Endowed

event details

Emitted when an account is created with some free balance.

When it fires

  • Account did not exist or had zero balance
  • Balance meets existential deposit

Fields

NameTypeFormatDescription
accountAccountIdSS58 Addressaccount: Account address (32 bytes, SS58-encoded)
free_balanceTaoBalance—free_balance: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Endowed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Endowed.get(block.hash);
  for (const evt of events) {
    console.log("Endowed:", evt.payload);
  }
});

DustLost

event details

Emitted when an account's remaining balance is below existential deposit.

When it fires

  • Account balance fell below existential deposit
  • Balance was non-zero

Fields

NameTypeFormatDescription
accountAccountIdSS58 Addressaccount: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to DustLost events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.DustLost.get(block.hash);
  for (const evt of events) {
    console.log("DustLost:", evt.payload);
  }
});

Transfer

event details

Emitted when tokens are transferred between accounts.

When it fires

  • Sender has sufficient balance
  • Transfer won't kill sender (or transfer_allow_death used)
  • Recipient will meet existential deposit

Fields

NameTypeFormatDescription
fromAccountIdSS58 AddressSender account
toAccountIdSS58 AddressRecipient account
amountTaoBalance—Transfer amount (RAO)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Transfer events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Transfer.get(block.hash);
  for (const evt of events) {
    console.log("Transfer:", evt.payload);
  }
});

BalanceSet

event details

Emitted when an account's balance is set by root.

When it fires

  • Caller has root/sudo privileges

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
freeTaoBalance—free: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to BalanceSet events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.BalanceSet.get(block.hash);
  for (const evt of events) {
    console.log("BalanceSet:", evt.payload);
  }
});

Reserved

event details

Emitted when balance is moved from free to reserved.

When it fires

  • Account has sufficient free balance
  • Reserve operation requested

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Reserved events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Reserved.get(block.hash);
  for (const evt of events) {
    console.log("Reserved:", evt.payload);
  }
});

Unreserved

event details

Emitted when balance is moved from reserved to free.

When it fires

  • Account has sufficient reserved balance
  • Unreserve operation requested

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
Emitted by: force_unreserve
Modifies: Account
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Unreserved events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Unreserved.get(block.hash);
  for (const evt of events) {
    console.log("Unreserved:", evt.payload);
  }
});

ReserveRepatriated

event details

Emitted when reserved balance is moved from one account to another.

When it fires

  • Source account has sufficient reserved balance
  • Repatriation operation authorized

Fields

NameTypeFormatDescription
fromAccountIdSS58 Addressfrom: Account address (32 bytes, SS58-encoded)
toAccountIdSS58 Addressto: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
destination_statusBalanceStatus—destination_status (BalanceStatus)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to ReserveRepatriated events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.ReserveRepatriated.get(block.hash);
  for (const evt of events) {
    console.log("ReserveRepatriated:", evt.payload);
  }
});

Deposit

event details

Emitted when tokens are deposited into an account.

When it fires

  • Deposit operation executed

Fields

NameTypeFormatDescription
whoAccountIdSS58 AddressAccount receiving deposit
amountTaoBalance—Deposit amount (RAO)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Deposit events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Deposit.get(block.hash);
  for (const evt of events) {
    console.log("Deposit:", evt.payload);
  }
});

Withdraw

event details

Emitted when tokens are withdrawn from an account.

When it fires

  • Account has sufficient balance
  • Withdrawal operation executed

Fields

NameTypeFormatDescription
whoAccountIdSS58 AddressAccount funds withdrawn from
amountTaoBalance—Withdrawal amount (RAO)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Withdraw events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Withdraw.get(block.hash);
  for (const evt of events) {
    console.log("Withdraw:", evt.payload);
  }
});

Slashed

event details

Emitted when tokens are removed as punishment.

When it fires

  • Account has balance to slash
  • Slash condition triggered

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Slashed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Slashed.get(block.hash);
  for (const evt of events) {
    console.log("Slashed:", evt.payload);
  }
});

Minted

event details

Emitted when new tokens are minted into an account.

When it fires

  • Minting operation authorized

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Minted events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Minted.get(block.hash);
  for (const evt of events) {
    console.log("Minted:", evt.payload);
  }
});

Burned

event details

Emitted when tokens are permanently burned.

When it fires

  • Account has tokens to burn
  • Burn operation executed

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
Emitted by: burn
Modifies: TotalIssuance
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Burned events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Burned.get(block.hash);
  for (const evt of events) {
    console.log("Burned:", evt.payload);
  }
});

Suspended

event details

Emitted when balance is suspended from an account (can be restored later).

When it fires

  • Account has sufficient balance
  • Suspension operation authorized

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Suspended events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Suspended.get(block.hash);
  for (const evt of events) {
    console.log("Suspended:", evt.payload);
  }
});

Restored

event details

Emitted when suspended balance is restored to an account.

When it fires

  • Account has suspended balance
  • Restore operation authorized

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Restored events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Restored.get(block.hash);
  for (const evt of events) {
    console.log("Restored:", evt.payload);
  }
});

Upgraded

event details

Emitted when an account is upgraded to a new balance format.

When it fires

  • Account exists
  • Upgrade operation triggered

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
Emitted by: upgrade_accounts
Modifies: Account
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Upgraded events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Upgraded.get(block.hash);
  for (const evt of events) {
    console.log("Upgraded:", evt.payload);
  }
});

Issued

event details

Emitted when total issuance is increased.

When it fires

  • Issuance increase authorized

Fields

NameTypeFormatDescription
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Issued events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Issued.get(block.hash);
  for (const evt of events) {
    console.log("Issued:", evt.payload);
  }
});

Rescinded

event details

Emitted when total issuance is decreased.

When it fires

  • Issuance decrease authorized

Fields

NameTypeFormatDescription
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Rescinded events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Rescinded.get(block.hash);
  for (const evt of events) {
    console.log("Rescinded:", evt.payload);
  }
});

Locked

event details

Emitted when balance is locked.

When it fires

  • Account has balance to lock
  • Lock operation requested

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Locked events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Locked.get(block.hash);
  for (const evt of events) {
    console.log("Locked:", evt.payload);
  }
});

Unlocked

event details

Emitted when balance is unlocked.

When it fires

  • Account has locked balance
  • Unlock conditions met

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Unlocked events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Unlocked.get(block.hash);
  for (const evt of events) {
    console.log("Unlocked:", evt.payload);
  }
});

Frozen

event details

Emitted when balance is frozen.

When it fires

  • Account has balance to freeze
  • Freeze operation authorized

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Frozen events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Frozen.get(block.hash);
  for (const evt of events) {
    console.log("Frozen:", evt.payload);
  }
});

Thawed

event details

Emitted when frozen balance is thawed.

When it fires

  • Account has frozen balance
  • Thaw operation authorized

Fields

NameTypeFormatDescription
whoAccountIdSS58 Addresswho: Account address (32 bytes, SS58-encoded)
amountTaoBalance—amount: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to Thawed events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.Thawed.get(block.hash);
  for (const evt of events) {
    console.log("Thawed:", evt.payload);
  }
});

TotalIssuanceForced

event details

Emitted when total issuance is forcefully changed.

When it fires

  • Caller has root/sudo privileges

Fields

NameTypeFormatDescription
oldTaoBalance—old: Balance in chain native currency (RAO for TAO; ÷10⁹)
newTaoBalance—new: Balance in chain native currency (RAO for TAO; ÷10⁹)
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Subscribe to TotalIssuanceForced events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.Balances.TotalIssuanceForced.get(block.hash);
  for (const evt of events) {
    console.log("TotalIssuanceForced:", evt.payload);
  }
});

Storage 7

Account

storage details

Account balance data including free, reserved, and frozen amounts.

Modifier: Default Keys: 1 Returns: AccountData

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Account storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.Balances.Account.getValue(key1);
console.log("Account:", result);

Freezes

storage details

Frozen balance entries for accounts.

Modifier: Default Keys: 1 Returns: BoundedVec

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Freezes storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.Balances.Freezes.getValue(key1);
console.log("Freezes:", result);

Holds

storage details

Held balance entries with reason identifiers.

Modifier: Default Keys: 1 Returns: BoundedVec

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Holds storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.Balances.Holds.getValue(key1);
console.log("Holds:", result);

InactiveIssuance

storage details

Total amount of tokens that are inactive (not in circulation).

Modifier: Default Keys: 0 Returns: TaoBalance
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query InactiveIssuance storage (no keys - plain value)
const result = await api.query.Balances.InactiveIssuance.getValue();
console.log("InactiveIssuance:", result);

Locks

storage details

Locks on an account's balance.

Modifier: Default Keys: 1 Returns: WeakBoundedVec

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Locks storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.Balances.Locks.getValue(key1);
console.log("Locks:", result);

Reserves

storage details

Named reserves on an account's balance.

Modifier: Default Keys: 1 Returns: BoundedVec

Keys

NameTypeFormatDescription
key1AccountIdSS58 Address—
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query Reserves storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.Balances.Reserves.getValue(key1);
console.log("Reserves:", result);

TotalIssuance

storage details

Total tokens in circulation.

Modifier: Default Keys: 0 Returns: TaoBalance
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query TotalIssuance storage (no keys - plain value)
const result = await api.query.Balances.TotalIssuance.getValue();
console.log("TotalIssuance:", result);

Constants 4

ExistentialDeposit

constant details

Minimum balance required to keep an account alive.

Type: TaoBalance
Value: "500"
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query ExistentialDeposit constant
const value = await api.constants.Balances.ExistentialDeposit();
console.log("ExistentialDeposit:", value);
// Balance: divide by 10^9 for TAO
const tao = value / 1_000_000_000n;

MaxFreezes

constant details

Maximum number of freezes on a single account.

Type: u32
Value: 50
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaxFreezes constant
const value = await api.constants.Balances.MaxFreezes();
console.log("MaxFreezes:", value);

MaxLocks

constant details

Maximum number of locks on a single account.

Type: u32
Value: 50
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaxLocks constant
const value = await api.constants.Balances.MaxLocks();
console.log("MaxLocks:", value);

MaxReserves

constant details

Maximum number of named reserves on a single account.

Type: u32
Value: 50
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Query MaxReserves constant
const value = await api.constants.Balances.MaxReserves();
console.log("MaxReserves:", value);

Errors 12

VestingBalance

error details #0

Vesting balance is too high to send the requested value.

Common Causes

  • Trying to transfer more than unlocked vesting balance
  • Vesting schedule has not released enough tokens yet
  • Attempting to send locked vesting tokens

How to Fix

Wait for more tokens to vest (unlock),Check your vesting schedule for unlock timeline,Only transfer up to your free (non-vesting) balance

LiquidityRestrictions

error details #1

Account liquidity restrictions prevent this withdrawal.

Common Causes

  • Funds are locked for staking
  • Funds are reserved for another purpose
  • Vesting schedule prevents withdrawal

How to Fix

Check Balances.Locks for locked amounts,Check Balances.Reserves for reserved amounts,Wait for locks to expire or unlock them first

InsufficientBalance

error details #2

Your account doesn't have enough free balance for this transfer.

Common Causes

  • Transfer amount exceeds available balance
  • Not accounting for existential deposit
  • Funds are locked or reserved

How to Fix

Check System.Account for your free balance,Reduce transfer amount,Check Balances.Locks for any locked funds

ExistentialDeposit

error details #3

The transfer would leave the sender's account below the existential deposit (minimum balance).

Common Causes

  • Trying to transfer almost all balance
  • Not leaving enough for existential deposit
  • Existential deposit on Bittensor is very small but non-zero

How to Fix

Leave at least the existential deposit in your account,Use transfer_allow_death if you want to empty the account,Check Balances.ExistentialDeposit constant for minimum

Expendability

error details #4

The transfer or payment would kill the account.

Common Causes

  • Operation would reduce balance below existential deposit
  • Using transfer_keep_alive but balance would go too low
  • Account has references that prevent it from being killed

How to Fix

Use transfer_allow_death if you want to allow account reaping,Ensure enough balance remains after the operation,Check if account has references preventing deletion

ExistingVestingSchedule

error details #5

A vesting schedule already exists for this account.

Common Causes

  • Trying to create a new vesting schedule when one exists
  • Account already has locked vesting tokens

How to Fix

Not reachable on this chain: no vesting pallet is installed, so no schedule can be created

DeadAccount

error details #6

The beneficiary account must pre-exist before receiving funds.

Common Causes

  • Target account has never been created
  • Target account was reaped (balance went to zero)
  • Sending to an address that has no on-chain presence

How to Fix

Ensure recipient account exists first,Send enough to cover the existential deposit,Create the account with an initial transfer before this operation

TooManyReserves

error details #7

The number of named reserves on this account exceeds MaxReserves.

Common Causes

  • Too many simultaneous reserve operations
  • MaxReserves limit reached

How to Fix

Unreserve some existing reserves first,Check Balances.Reserves for current count,Consolidate operations to reduce reserve count

TooManyHolds

error details #8

The number of holds on this account exceeds the maximum allowed.

Common Causes

  • Too many simultaneous holds on the account
  • Reached VariantCountOf<RuntimeHoldReason> limit

How to Fix

Release some existing holds first,Check Balances.Holds for current hold count,Consolidate operations to reduce hold count

TooManyFreezes

error details #9

The number of freezes on this account exceeds the maximum allowed.

Common Causes

  • Too many simultaneous freeze locks on the account
  • MaxFreezes limit reached

How to Fix

Remove some existing freezes first,Check Balances.Freezes for current freeze count,Consolidate operations to reduce freeze count

IssuanceDeactivated

error details #10

The issuance cannot be modified because it is already deactivated.

Common Causes

  • Trying to adjust deactivated issuance
  • Issuance operations on inactive balance

How to Fix

Check Balances.InactiveIssuance status,Reactivate issuance before modification if needed

DeltaZero

error details #11

The balance adjustment amount cannot be zero.

Common Causes

  • Passing zero as the adjustment delta
  • Attempting to adjust total issuance by zero

How to Fix

Provide a non-zero delta value,Check your calculation is producing a positive amount