CollateralLocked
Event v437 → v440, v441 → current #144Miner collateral was staked and locked (at registration or via
View events on chainFrom Chain Metadata
Miner collateral was staked and locked (at registration or via `add_collateral`). Appended at the end of the enum to avoid shifting existing event indices.
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | netuid | NetUid | netuid: Subnet ID (u16, 0-65535) |
| 1 | hotkey | AccountId | hotkey: Account address (32 bytes, SS58-encoded) (hex -> SS58) |
| 2 | locked | AlphaBalance | locked: Alpha amount in alpha-RAO (÷10⁹ for alpha) |
| 3 | total_locked | AlphaBalance | total_locked: Alpha amount in alpha-RAO (÷10⁹ for alpha) |
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 CollateralLocked events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.CollateralLocked.get(block.hash);
for (const evt of events) {
console.log("CollateralLocked:", evt.payload);
}
});Version History
v437 block 8,679,056 4 args
v441 block 8,765,683 4 args Current
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 144
- First Version
- v437
- Current Version
- v472