This event was removed in v377
This event is no longer emitted in the current runtime. Existed from v161 to v377. Shown here for historical reference.
ColdkeySwapScheduled
Event Removed v161 → v161, v162 → v165, v195 → v219, v233 → v247, v252 → v265, v273 → v277, v290 → v315, v320 → v326, v334 → v367, v372 → v377 (removed) #69Emitted when a coldkey swap is scheduled - starts the arbitration countdown.
The Big Picture
Scheduling a swap starts a security timer. During the arbitration period, you (or anyone who notices something wrong) can cancel the swap. This protects against attackers who briefly gain access to your key - they can't instantly drain everything.
Why This Matters
This event starts the clock on your migration. From now until the arbitration period ends, you can cancel if needed. If everything looks good, just wait - the swap will execute automatically. Set a reminder to verify ColdkeySwapped fires.
Example Scenario
You decide to migrate to a new coldkey. You call schedule_coldkey_swap and ColdkeySwapScheduled fires, showing destination coldkey and execution block (~3 days out). You mark your calendar. If all looks good in 3 days, ColdkeySwapped will fire automatically.
Common Questions
- Can I cancel after scheduling?
- Yes, during the arbitration period you can cancel. After that, it executes automatically.
- How long is the arbitration period?
- Check ColdkeySwapScheduleDuration constant - typically around 3 days.
Use Cases
- Initiate key migration to new wallet
- Start security rotation process
- Prepare for hardware wallet upgrade
- Detect unauthorized swap attempts
From Chain Metadata
A coldkey swap has been scheduled
Triggers
Emitted by
Preconditions
- Caller is current coldkey owner
- Destination coldkey is valid
- No pending swap already scheduled
Effects
Storage Modified
Postconditions
- ColdkeySwapScheduled storage updated
- Arbitration period countdown begins
Side Effects
- Others can dispute during arbitration period
- Swap executes automatically after period ends
Event Data
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 });
// Subscribe to ColdkeySwapScheduled events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("SubtensorModule") &&
event.method === "ColdkeySwapScheduled"
)
.forEach(({ event }) => {
console.log("ColdkeySwapScheduled:", event.data.toHuman());
});
});Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 69
- First Version
- v161
- Removed In
- v377