BalanceSet

Event Re-added 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.

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 (hex -> SS58)
1
free
u64 free (u64)

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Subscribe to BalanceSet events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Balances") &&
      event.method === "BalanceSet"
    )
    .forEach(({ event }) => {
      console.log("BalanceSet:", event.data.toHuman());
    });
});

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
v393