Transactions
terminate-lease
Terminate an ended lease and take subnet ownership (beneficiary only).
Ends the lease and transfers full subnet ownership to the beneficiary:
contributor dividends stop and the subnet becomes an ordinary owned
subnet. Only the lease's beneficiary can call it, and only after the
lease's end block has passed — earlier attempts fail, and perpetual leases
(no end block) can never be terminated this way. Check the lease's end
block with the lease read before calling.
| Signer | Pallet | Wraps |
|---|---|---|
coldkey | SubtensorModule | SubtensorModule.terminate_lease |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
lease_id | integer | yes | Lease to terminate (see the leases read). |
hotkey_ss58 | string | no | Beneficiary hotkey recorded as the subnet's owner hotkey; defaults to the wallet's hotkey. |
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 terminate-lease \
--lease-id <int> --dry-run
btcli tx terminate-lease \
--lease-id <int> -w my_coldkeyPython
import bittensor as sub
from bittensor.wallet import Wallet
wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.TerminateLease(lease_id=0)
async with sub.Client("finney") as client:
plan = await client.plan(intent, wallet) # fee, effects, policy — no submission
result = await client.execute(intent, wallet)
if not result.success:
print(result.error.code, result.error.remediation)Or build it by op name, as an agent would:
await client.execute_tool("terminate_lease", {...}, wallet)