Unlocked

Event v149 → current #18

Emitted when balance is unlocked.

View events on chain

From Chain Metadata

Some balance was unlocked.

Triggers

Preconditions

  • Account has locked balance
  • Unlock conditions met

Effects

Postconditions

  • Balance available for transfer again

Event Data

#NameTypeDescription
0
who
AccountId Who account address (hex -> SS58)
1
amount
u64 Amount in RAO (÷10⁹ for TAO) (RAO -> TAO (/ 10^9))

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 Unlocked events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Balances") &&
      event.method === "Unlocked"
    )
    .forEach(({ event }) => {
      console.log("Unlocked:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
5
Event Index
18
First Version
v149
Current Version
v393