BalanceSet

Event v101 → v148, v149 → current #3

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

View events on chain

From Chain Metadata

A balance was set by root.

Migration Notes

v148 v149 Breaking

removed field reserved (was u64)

Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.

Triggers

Preconditions

  • Caller has root/sudo privileges

Effects

Storage Modified

Postconditions

  • Account balance set to specified amount

Side Effects

  • Administrative operation
  • May affect total issuance

Event Data

#NameTypeDescription
0
who
AccountId who: Account address (32 bytes, SS58-encoded) (hex -> SS58)
1
free
u64 T::Balancefree: Balance in chain native currency (RAO for TAO; ÷10⁹)

Code Examples

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);
  }
});

Version History

v101 block 1 3 args
v149 block 3,014,339 2 args Current

Runtime Info

Pallet Index
5
Event Index
3
First Version
v101
Current Version
v411