AlphaMapLastKey

Storage Plain v334 → current

Last key used for Alpha storage map iteration.

Explore chain
Queried by: developers

The Big Picture

The Alpha storage map can be very large. This marker helps with pagination and efficient iteration over all alpha stake positions.

Use Cases

  • Resume Alpha map iteration from last position
  • Build paginated Alpha queries

Purpose & Usage

Purpose

Supports efficient iteration over the Alpha storage map.

Common Query Patterns

  • Single value query
  • Used internally for pagination

Stored Value

value (Option)

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 AlphaMapLastKey storage (no keys - plain value)
const result = await api.query
  [stringCamelCase("SubtensorModule")]
  [stringCamelCase("AlphaMapLastKey")]();
console.log("AlphaMapLastKey:", result.toHuman());

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Plain
First Version
v334
Current Version
v393