ColdkeySwapAnnouncementDelaySet
Event v385 → v402, v411 → v422, v423 → v440, v441 → current #82Emitted when governance changes how long a coldkey swap announcement must wait.
View events on chainUseful for: analyticsdeveloperswallets
The Big Picture
The waiting period is a live parameter, not a constant. InitialColdkeySwapAnnouncementDelay is only the genesis default.
Why This Matters
Any interface that tells a user how long their rotation will take must read the current storage value. A hardcoded figure goes stale the first time this event fires.
Example Scenario
Your wallet shows "your swap will be executable in 5 days" from a hardcoded constant. This event fires with a different value and the estimate is wrong from that block on.
Use Cases
- Track changes to the key-rotation waiting period
- Invalidate a cached delay value
How to Use This Event
- → Read ColdkeySwapAnnouncementDelay from storage rather than caching a constant
From Chain Metadata
The coldkey swap announcement delay has been set.
Triggers
Preconditions
- Root or sudo origin
Effects
Postconditions
- ColdkeySwapAnnouncementDelay holds the new block count
Side Effects
- Announcements made after this point use the new delay; existing announcements keep the executable block they were given
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | arg0 → delay_blocks | u32 BlockNumberFor<T> | New value written to SubtensorModule.ColdkeySwapAnnouncementDelay, in blocks. It is the wait applied to announcements made from here on; announcements already pending keep the executable block they were given. |
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);
// Subscribe to ColdkeySwapAnnouncementDelaySet events
client.finalizedBlock$.subscribe(async (block) => {
const events = await api.event.SubtensorModule.ColdkeySwapAnnouncementDelaySet.get(block.hash);
for (const evt of events) {
console.log("ColdkeySwapAnnouncementDelaySet:", evt.payload);
}
});Version History
v385 block 7,782,670 1 args
v411 block 8,283,784 1 args
v423 block 8,486,593 1 args
v441 block 8,765,683 1 args Current
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 82
- First Version
- v385
- Current Version
- v472