Function withdraw_reserve

Source
pub fn withdraw_reserve<T: Config<I>, I: 'static>(amount: Option<AssetOf<T, I>>)
Expand description

Withdraws reserved funds back to the caller’s free balance.

Releases funds held under the HoldReason::PrepareForCommit reason and returns them to the caller’s free balance.

§Behavior

  • If amount is None, all reserved funds under the hold reason are released.
  • If amount is Some(value), only the specified amount is released, leaving any remaining reserved funds intact.

This call decreases the balance on hold with Precision::Exact and increases the caller’s free balance by the same amount.

Returns Error::InsufficientFunds if a specific amount is provided and the held balance is less than the requested amount.

§Emits

Event::ReserveWithdrawn: Contains the amount withdrawn and the amount balance on hold.

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::withdraw_reserve.