LastColdkeyHotkeyStakeBlock

Storage Map v238 → current

Block when stake was last added/removed for a coldkey -hotkey pair.

Explore chain
Queried by: developersstakers

The Big Picture

Staking operations may be rate-limited. This tracks the last block when stake changed for each coldkey-hotkey pair, enabling rate limit calculations.

Use Cases

  • Check staking cooldowns
  • Debug rate limit errors
  • Build staking timing tools

From Chain Metadata

Map (coldkey, hotkey) --> u64 the last block at which stake was added/removed.

Purpose & Usage

Purpose

Track staking activity timing for rate limiting.

Common Query Patterns

  • Query by (coldkey, hotkey)

Query Keys

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

Stored Value

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

// Query LastColdkeyHotkeyStakeBlock storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const key2 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";

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

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

Runtime Info

View Source
Pallet
SubtensorModule
Storage Kind
Map
First Version
v238
Current Version
v393