ColdkeyMinerCollateral

Storage Map v437 → current

MAP ( netuid , coldkey ) --> total locked miner collateral

Explore chain

From Chain Metadata

MAP ( netuid, coldkey ) --> total locked miner collateral O(1) aggregate of `MinerCollateral.locked` across that coldkey's hotkeys on the subnet. Kept in sync by collateral credit / settle paths so unstake availability checks do not scan `OwnedHotkeys`.

Purpose & Usage

Common Query Patterns

  • Query by key
  • Iterate all entries

Query Keys

#NameTypeDescription
1
netuid
NetUid netuid (NetUid, hashed key component)
2
coldkey
AccountId coldkey (AccountId, hashed key component) (hex -> SS58)

Stored Value

total (AlphaBalance)

Default Value

0 0x0000000000000000

Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.

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

// Query ColdkeyMinerCollateral storage
const netuid = 1;
const coldkey = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

const result = await api.query.SubtensorModule.ColdkeyMinerCollateral.getValue(netuid, coldkey);
console.log("ColdkeyMinerCollateral:", result);

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v437
Current Version
v472