LastHotkeySwapOnNetuid
Storage Map v276 → v490 · 1 shape changeBlock of last hotkey swap on a subnet .
Explore chainThe Big Picture
Hotkey swaps on subnets are rate-limited. This tracks when the last swap occurred, enabling cooldown calculations and preventing spam swaps.
Use Cases
- Check swap cooldowns
- Plan hotkey operations
- Debug rate limit errors
From Chain Metadata
DMap ( netuid, coldkey ) --> blocknumber | last hotkey swap on network.
Purpose & Usage
Purpose
Track hotkey swap timing for rate limiting.
Common Query Patterns
- Query by (hotkey, netuid)
Migration Notes
key type changed from (u16, AccountId) to (NetUid, AccountId)
Update decoders: SCALE encoding is positional, so any signature change (added, removed, or type-changed fields, or storage shape changes) shifts byte offsets and existing decoders will misparse this item. Re-derive types from the new metadata.
Query Keys
Stored Value
Value in RAO (÷10⁹ for TAO)
RAO -> TAO (/ 10^9)
Default Value
Absent keys read as this value — querying a key that has never been written returns this default, not an error or empty result.
Relationships
Modified By
Related Events
Code Examples
// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
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 LastHotkeySwapOnNetuid storage
const key1 = undefined as any /* NetUid — replace with real value */;
const key2 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const result = await api.query.SubtensorModule.LastHotkeySwapOnNetuid.getValue(key1, key2);
console.log("LastHotkeySwapOnNetuid:", result);On-Chain Activity
Fewer than 10K writes
#222 most written storage item
Modified by both user extrinsics and runtime hooks
As of block 9,385,000
Version History
- key :
(u16, AccountId)→(NetUid, AccountId)
Runtime Info
View Source- Pallet
- SubtensorModule
- Storage Kind
- Map
- First Version
- v276
- Current Version
- v490