Transactions

clear-coldkey-swap-announcement

Cancel a pending coldkey swap announcement (after the reannouncement delay).

View as Markdown

Withdraws this coldkey's own pending swap announcement so the swap can no longer be executed — use it if you announced to the wrong key or changed your mind. Only clearable once the current block reaches the swap's execute block plus the reannouncement delay — i.e. roughly the announcement delay (~5 days) PLUS the reannouncement delay (~1 day) after announcing — so it cannot be used to rapidly cycle announcements. Nothing moves; a fresh announce_coldkey_swap can be made afterwards. If the announcement was made by an attacker, dispute_coldkey_swap is the right call instead.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)SubtensorModuleSubtensorModule.clear_coldkey_swap_announcement

Parameters

This operation takes no parameters.

Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58 address, an address-book or proxy-book name, or a local wallet/hotkey name.

CLI

Preview with --dry-run (shows fee, effects, and policy result without submitting), then submit:

btcli tx clear-coldkey-swap-announcement --dry-run
btcli tx clear-coldkey-swap-announcement -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.ClearColdkeySwapAnnouncement()

sub = bt.Subtensor()
plan = sub.plan(intent, wallet)   # fee, effects, policy — no submission
result = sub.execute(intent, wallet)
if not result.success:
    print(result.error.code, result.error.remediation)

(bt.Subtensor is also the async client — async with bt.Subtensor() as client: — see The client.) Or build the intent by op name, as an agent would:

result = sub.execute_tool("clear_coldkey_swap_announcement", {...}, wallet)

On-chain implementation

SubtensorModule.clear_coldkey_swap_announcementpallets/subtensor/src/macros/dispatches.rs#L2186:

#[pallet::call_index(133)]
#[pallet::weight(<T as crate::pallet::Config>::WeightInfo::clear_coldkey_swap_announcement())]
pub fn clear_coldkey_swap_announcement(origin: OriginFor<T>) -> DispatchResult {
    let who = ensure_signed(origin)?;
    let now = <frame_system::Pallet<T>>::block_number();

    let Some((when, _)) = ColdkeySwapAnnouncements::<T>::get(who.clone()) else {
        return Err(Error::<T>::ColdkeySwapAnnouncementNotFound.into());
    };
    let delay = ColdkeySwapReannouncementDelay::<T>::get();
    let min_when = when.saturating_add(delay);
    ensure!(now >= min_when, Error::<T>::ColdkeySwapClearTooEarly);

    ColdkeySwapAnnouncements::<T>::remove(&who);

    Self::deposit_event(Event::ColdkeySwapCleared { who });
    Ok(())
}

Every file is browsable under /code exactly as built into the runtime, or as plain text under /code/raw/<path> (index: /code/index.json).