release_deposit

Call v154 → current #6

Release a deposit from a past safe-mode activation/extension.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

After safe-mode ends and ReleaseDelay passes, depositors can reclaim their funds. The delay gives governance time to assess whether activations were legitimate.

Use Cases

  • Reclaim deposit after safe-mode concludes
  • Recover funds from legitimate activation

From Chain Metadata

Permissionlessly release a deposit for an account that entered safe-mode at a given historical block. The call can be completely disabled by setting [`Config::ReleaseDelay`] to `None`. This cannot be called while safe-mode is entered and not until [`Config::ReleaseDelay`] blocks have passed since safe-mode was entered. Emits a [`Event::DepositReleased`] event on success. Errors with [`Error::Entered`] if the safe-mode is entered. Errors with [`Error::CannotReleaseYet`] if [`Config::ReleaseDelay`] block have not passed since safe-mode was entered. Errors with [`Error::NoDeposit`] if the payee has no reserved currency at the block specified.

Input Parameters

#NameTypeDescription
0
account
AccountId account: Account address (32 bytes, SS58-encoded) (hex -> SS58)
1
block
u32 BlockNumberFor<T>block: Block number

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Safe-mode is not currently entered
  • ReleaseDelay blocks have passed since the activation block
  • Account has a deposit at the specified block

Effects

Events Emitted

Storage Modified

Postconditions

  • Deposit unreserved and returned to account
  • DepositReleased event emitted

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);

// Build release_deposit call (typed, named args)
const account = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const block = 0;

const tx = api.tx.SafeMode.release_deposit({
  account,
  block,
});

Runtime Info

Pallet Index
20
Call Index
6
First Version
v154
Current Version
v411