Transactions

transfer-all

Transfer the entire transferable balance to a destination address.

View as Markdown

Drains the signing coldkey's transferable balance to the destination in one irreversible call — equivalent to transfer with all as the amount. Staked or otherwise reserved funds are not included; unstake first to move those. A spend-cap policy treats this as an unbounded spend and blocks it until the cap is raised. With keep_alive (the default) the existential deposit stays behind; disable it to empty and reap the account.

SignerOriginPalletWraps
coldkeysigned account (pallet role may apply)BalancesBalances.transfer_all

Parameters

ParameterTypeRequiredDescription
dest_ss58stringyesAccount the funds are sent to.
keep_alivebooleannoRefuse to drop the sender below the existential deposit. Disable it only when you intend to empty the account, which lets the chain reap it.

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 transfer-all \
  --dest <ss58|name> --dry-run
btcli tx transfer-all \
  --dest <ss58|name> -w my_coldkey

Python

import bittensor as bt
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = bt.TransferAll(dest_ss58="5F...")

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("transfer_all", {...}, wallet)

On-chain implementation

Balances.transfer_all is implemented by Substrate's pallet_balances, outside this repository's pallets.

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