TotalHotkeySharesV2

Storage Map v401 → current New

DMAP ( hot, netuid ) --> total_alpha_shares | Returns the number of alpha shares for a hotkey on a subnet , stores SafeFloat.

Explore chain

From Chain Metadata

DMAP ( hot, netuid ) --> total_alpha_shares | Returns the number of alpha shares for a hotkey on a subnet, stores SafeFloat.

Purpose & Usage

Purpose

Stores chain state data.

Common Query Patterns

  • Single value query for aggregate data

Query Keys

#NameTypeDescription
1
key1
AccountId key1 (AccountId) (hex -> SS58)
2
key2
u16 key2 (u16)

Stored Value

value (SafeFloat)

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

// Query TotalHotkeySharesV2 storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const key2 = 0;

const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("TotalHotkeySharesV2")](
  key1,
  key2
);

console.log("TotalHotkeySharesV2:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v401
Current Version
v401