ColdkeySwapCleared

Event v385 → v402, v411 → v422, v423 → v424, v432 → v440, v441 → current #127

Emitted when a coldkey abandons its own pending swap announcement.

View events on chain
Useful for: stakersdelegatorswalletsanalytics

The Big Picture

Not every announced swap is meant to go through. This is the exit that returns a coldkey to normal operation without rotating it, and it is the reason an announcement count and a ColdkeySwapped count do not have to agree.

Why This Matters

If you are counting rotations, an announcement that ends here never became a swap. Counting announcements as rotations overstates them.

Example Scenario

You announce a swap, then decide against it. You cannot clear immediately: the clear is only allowed once the announcement is past its executable block plus the reannouncement delay. Calling earlier fails with ColdkeySwapClearTooEarly.

Common Questions

Does clearing unfreeze my account?
Yes, provided there is no dispute. The freeze is driven by the presence of an announcement, so removing it restores normal calls. A disputed coldkey stays blocked until root resets it.

Use Cases

  • Detect that an account has come out of its frozen state
  • Distinguish an abandoned rotation from a completed one
  • Resume automation that was paused on ColdkeySwapAnnounced

How to Use This Event

  • → Treat this as a terminal state for the announcement, same as ColdkeySwapped
  • → Re-enable per-account automation on this event

From Chain Metadata

A coldkey swap announcement has been cleared.

Triggers

Preconditions

  • Caller is the coldkey with the announcement
  • An announcement exists in ColdkeySwapAnnouncements
  • Current block is at least the executable block plus ColdkeySwapReannouncementDelay

Effects

Postconditions

  • ColdkeySwapAnnouncements is cleared for this coldkey
  • The account is unfrozen and normal calls work again

Side Effects

  • ColdkeySwapDisputes is NOT cleared by this call; only reset_coldkey_swap clears a dispute
  • The key swap cost already charged at announcement is not refunded

Event Data

#NameTypeDescription
0
who
AccountId who: Account address (32 bytes, SS58-encoded) (hex -> SS58)

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 ColdkeySwapCleared events
client.finalizedBlock$.subscribe(async (block) => {
  const events = await api.event.SubtensorModule.ColdkeySwapCleared.get(block.hash);
  for (const evt of events) {
    console.log("ColdkeySwapCleared:", 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
v432 block 8,636,190 1 args
v441 block 8,765,683 1 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
127
First Version
v385
Current Version
v472