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) #69

Emitted when a coldkey swap is scheduled - starts the arbitration countdown.

Useful for: stakersvalidatorswalletsexchanges

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

Preconditions

  • Caller is current coldkey owner
  • Destination coldkey is valid
  • No pending swap already scheduled

Effects

Postconditions

  • ColdkeySwapScheduled storage updated
  • Arbitration period countdown begins

Side Effects

  • Others can dispute during arbitration period
  • Swap executes automatically after period ends

Event Data

#NameTypeDescription
0
old_coldkey
AccountId old_coldkey (AccountId) (hex -> SS58)
1
new_coldkey
AccountId new_coldkey (AccountId) (hex -> SS58)
2
execution_block
u32 execution_block (u32)
3
swap_cost
u64 swap_cost (u64) (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 });

// 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

v161 block 3,351,936 3 args
v162 block 3,372,565 3 args
v195 block 3,791,350 3 args
v233 block 4,920,350 4 args
v252 block 5,163,656 4 args
v273 block 5,659,032 4 args
v290 block 5,947,548 4 args
v320 block 6,523,566 4 args
v334 block 6,811,690 4 args
v372 block 7,430,358 4 args
v377 Removed

Runtime Info

View Source
Pallet Index
7
Event Index
69
First Version
v161
Removed In
v377