Skip to content
TAO$188.31
BTC0.002929
MCap$2.21B
Vol$86.07M

API reference / Accounts

Pending coldkey swaps: every coldkey swap the chain holds as pending, by coldkey

GET/api/v2/coldkey-swaps/pending
Status
Beta
Auth
API key or OAuth access token
Scope
data:read
Rate limit
plan

One row per coldkey with a pending swap at the chain's state head (SubtensorModule ColdkeySwapAnnouncements, runtime v385 on, and ColdkeySwapScheduled, v273-v377), with its dispute (ColdkeySwapDisputes). mechanism announcement: the owner announced only the hash of the new coldkey (new_coldkey_hash); the key itself is known when the swap runs (then GET /key-swaps?key= lists it). scheduled: the new key (new_coldkey); none is live since v385's migration. Old announcements linger until they are run, cleared or reset by root: a long-past execute_from_height is a stale entry, not a swap about to run, and some carried over by v385's migration have execute_from_height below announced_height. The swap's cost is not stored per swap: the runtime charges KeySwapCost (0.1 TAO at v478) once, at the first announcement (recycled). Keys are {ss58, hex}. Keyset-paged by coldkey through meta.page.next_cursor. Cached as the head. Errors: INVALID_LIMIT, INVALID_CURSOR, UNKNOWN_PARAMETER; SOURCE_TIMEOUT (503), SOURCE_NOT_READY (503: this deployment's data source is not configured or does not serve pending coldkey swaps yet), SERVICE_UNAVAILABLE (503).

Beta: this route may change with one release's notice in the v2 changelog; additive changes need none (x-stability: beta).

Query parameters

limitquery· integer · default 100 · 1 to 500

Rows per page, 1..500 (default 100). Anything else is a 400 INVALID_LIMIT.

cursorquery· string · up to 400 characters

meta.page.next_cursor of the previous page (altered or foreign: 400 INVALID_CURSOR).

Response

data is a list of objects with these fields. Amounts are integer strings in their base unit, and null means unknown, never zero (see Units and formats). meta.at names the block the answer was read at.

One row per coldkey with a pending swap, by coldkey (its bytes, ascending); [] when none.

coldkeyobject

The coldkey swapping away (the storage key).

2 fields in coldkey
ss58string

The account, SS58 (prefix 42).

Format: SS58 address
hexstring

The same 32-byte account id, 0x + 64 lower-case hex (the public key).

Format: 32-byte hex: 0x and 64 hex digits
mechanismstring

How the swap is pending: announcement (SubtensorModule.ColdkeySwapAnnouncements, runtime v385 on: the owner announced the hash of the new coldkey, and the swap runs when the owner calls it with the key, from execute_from_height) or scheduled (ColdkeySwapScheduled, v273-v377: the scheduler runs it at execute_from_height; none is live since v385's migration turned the future ones into announcements). The vocabulary is open: render an unknown value generically (its keys and heights).

execute_from_heightinteger · unit block · can be null

announcement: the first block the swap may run (the stored when: the announcement block + ColdkeySwapAnnouncementDelay, 36,000 blocks, about 5 days, at runtime v478; for a schedule v385's migration carried over, its execution block minus that delay, so it can be below announced_height). scheduled: the block the scheduler runs the swap. An announcement stays until it is run, cleared or reset by root, so a long-past execute_from_height means a stale announcement, not a swap about to run. Null when the stored value cannot be read.

new_coldkeyobject · can be null

scheduled only: the new coldkey. Null on an announcement: the chain holds only its hash until the swap runs (then GET /key-swaps?key= lists the executed swap with both keys).

2 fields in new_coldkey
ss58string

The account, SS58 (prefix 42).

Format: SS58 address
hexstring

The same 32-byte account id, 0x + 64 lower-case hex (the public key).

Format: 32-byte hex: 0x and 64 hex digits
new_coldkey_hashstring · can be null

announcement only: the BlakeTwo256 hash of the new coldkey's 32 bytes, as announced (0x + 64 hex). Null on a scheduled swap.

Format: 32-byte hex: 0x and 64 hex digits
announced_heightinteger · unit block

The block the entry was last written: the announcement (or its latest re-announcement), the schedule, or v385's migration for a schedule it carried over.

announced_timestring (date-time) · can be null

announced_height's time, RFC 3339 UTC; null if the block is not indexed.

Format: date and time, ISO 8601 in UTC
disputed_heightinteger · unit block · can be null

SubtensorModule.ColdkeySwapDisputes: the block the swap was disputed (it cannot run until root resets it); null when it is not disputed.

Response headers

10 headers: ETag, Cache-Control, CDN-Cache-Control, X-BTAI-Stale, X-BTAI-Stale-As-Of, RateLimit-Policy, RateLimit, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
ETag

Strong validator of this answer. Send it back as If-None-Match: an unchanged answer is a 304 Not Modified without a body. A settled answer's validator leaves the chain head out, so it stays valid as the head moves.

Cache-Control

One of three classes: settled public, max-age=3600, stale-while-revalidate=86400 (pinned to a block that cannot move), slow public, max-age=300, stale-while-revalidate=600 (state that moves in minutes or days) or tip public, max-age=6, stale-while-revalidate=12 (follows the chain head); the label routes are cached until the next nightly copy (public, max-age=<seconds>, stale-while-revalidate=60). Never immutable. no-store on an earlier answer served because the data source failed (X-BTAI-Stale).

CDN-Cache-Control

The same class for shared caches (RFC 9213; browsers ignore it): settled 24 h, slow 300 s, tip 6 s, each with stale-while-revalidate and stale-if-error; no-store with X-BTAI-Stale.

X-BTAI-Stale

Present only when the data source failed to answer (it timed out or was unavailable) and an earlier answer to the same request is served instead of a 503 (stale if error, RFC 5861). Then if-error, with X-BTAI-Stale-As-Of, Age (its seconds since then) and Warning: 110 - "Response is Stale", and Cache-Control: no-store: the answer is never kept as fresh, and a later request reads again. Prices and quotes are never served this way.

X-BTAI-Stale-As-Of

With X-BTAI-Stale: when the earlier answer served was produced, an RFC 3339 UTC time (2026-10-21T12:00:00Z).

RateLimit-Policy

The tier's request quota of the current window (IETF draft), e.g. "tier";q=600.

RateLimit

Requests left in the current window and the seconds until it resets (IETF draft), e.g. "tier";r=597;t=42.

X-RateLimit-Limit

The tier's request quota of the current window.

X-RateLimit-Remaining

Requests left in the current window.

X-RateLimit-Reset

When the current window resets, Unix seconds.

Status codes

200 · 304 · 400 · 401 · 402 · 403 · 404 · 429 · 500 · 502 · 503

304 Not Modified: the If-None-Match validator still matches; no body.

Error codes

The codes this endpoint can return. Each links to what it means and what to do.

From the API's published specification, version 1.165.0.