pub struct BalancesCallApi<'api> { /* private fields */ }Implementations§
Source§impl<'api> BalancesCallApi<'api>
impl<'api> BalancesCallApi<'api>
Sourcepub fn transfer_allow_death(
&self,
dest: MultiAddress<AccountId, u32>,
value: u128,
) -> Result<WrappedCall>
pub fn transfer_allow_death( &self, dest: MultiAddress<AccountId, u32>, value: u128, ) -> Result<WrappedCall>
Transfer some liquid free balance to another account.
transfer_allow_death will set the FreeBalance of the sender and receiver.
If the sender’s account is below the existential deposit as a result
of the transfer, the account will be reaped.
The dispatch origin for this call must be Signed by the transactor.
Sourcepub fn force_transfer(
&self,
source: MultiAddress<AccountId, u32>,
dest: MultiAddress<AccountId, u32>,
value: u128,
) -> Result<WrappedCall>
pub fn force_transfer( &self, source: MultiAddress<AccountId, u32>, dest: MultiAddress<AccountId, u32>, value: u128, ) -> Result<WrappedCall>
Exactly as transfer_allow_death, except the origin must be root and the source account
may be specified.
Sourcepub fn transfer_keep_alive(
&self,
dest: MultiAddress<AccountId, u32>,
value: u128,
) -> Result<WrappedCall>
pub fn transfer_keep_alive( &self, dest: MultiAddress<AccountId, u32>, value: u128, ) -> Result<WrappedCall>
Same as the transfer_allow_death call, but with a check that the transfer will not
kill the origin account.
99% of the time you want transfer_allow_death instead.
Sourcepub fn transfer_all(
&self,
dest: MultiAddress<AccountId, u32>,
keep_alive: bool,
) -> Result<WrappedCall>
pub fn transfer_all( &self, dest: MultiAddress<AccountId, u32>, keep_alive: bool, ) -> Result<WrappedCall>
Transfer the entire transferable balance from the caller account.
NOTE: This function only attempts to transfer transferable balances. This means that
any locked, reserved, or existential deposits (when keep_alive is true), will not be
transferred by this function. To ensure that this function results in a killed account,
you might need to prepare the account by removing any reference counters, storage
deposits, etc…
The dispatch origin of this call must be Signed.
dest: The recipient of the transfer.keep_alive: A boolean to determine if thetransfer_alloperation should send all of the funds the account has, causing the sender account to be killed (false), or transfer everything except at least the existential deposit, which will guarantee to keep the sender account alive (true).
Sourcepub fn force_unreserve(
&self,
who: MultiAddress<AccountId, u32>,
amount: u128,
) -> Result<WrappedCall>
pub fn force_unreserve( &self, who: MultiAddress<AccountId, u32>, amount: u128, ) -> Result<WrappedCall>
Unreserve some balance from a user by force.
Can only be called by ROOT.
Sourcepub fn upgrade_accounts(&self, who: Vec<AccountId>) -> Result<WrappedCall>
pub fn upgrade_accounts(&self, who: Vec<AccountId>) -> Result<WrappedCall>
Upgrade a specified account.
origin: Must beSigned.who: The account to be upgraded.
This will waive the transaction fee if at least all but 10% of the accounts needed to be upgraded. (We let some not have to be upgraded just in order to allow for the possibility of churn).
Sourcepub fn force_set_balance(
&self,
who: MultiAddress<AccountId, u32>,
new_free: u128,
) -> Result<WrappedCall>
pub fn force_set_balance( &self, who: MultiAddress<AccountId, u32>, new_free: u128, ) -> Result<WrappedCall>
Set the regular balance of a given account.
The dispatch origin for this call is root.
Sourcepub fn force_adjust_total_issuance(
&self,
direction: AdjustmentDirection,
delta: u128,
) -> Result<WrappedCall>
pub fn force_adjust_total_issuance( &self, direction: AdjustmentDirection, delta: u128, ) -> Result<WrappedCall>
Adjust the total issuance in a saturating way.
Can only be called by root and always needs a positive delta.
§Example
Sourcepub fn burn(&self, value: u128, keep_alive: bool) -> Result<WrappedCall>
pub fn burn(&self, value: u128, keep_alive: bool) -> Result<WrappedCall>
Burn the specified liquid free balance from the origin account.
If the origin’s account ends up below the existential deposit as a result
of the burn and keep_alive is false, the account will be reaped.
Unlike sending funds to a burn address, which merely makes the funds inaccessible,
this burn operation will reduce total issuance by the amount burned.
Sourcepub fn transfer_with_memo(
&self,
dest: MultiAddress<AccountId, u32>,
value: u128,
memo: Option<Memo>,
) -> Result<WrappedCall>
pub fn transfer_with_memo( &self, dest: MultiAddress<AccountId, u32>, value: u128, memo: Option<Memo>, ) -> Result<WrappedCall>
Transfer some liquid free balance to another account.
transfer will set the FreeBalance of the sender and receiver.
If the sender’s account is below the existential deposit as a result
of the transfer, the account will be reaped.
The dispatch origin for this call must be Signed by the transactor.
§Complexity
- Dependent on arguments but not critical, given proper implementations for input config types. See related functions below.
- It contains a limited number of reads and writes internally and no complex computation.
Related functions:
ensure_can_withdrawis always called internally but has a bounded complexity.- Transferring balances to accounts that did not exist before will cause
T::OnNewAccount::on_new_accountto be called. - Removing enough funds from an account will trigger
T::DustRemoval::on_unbalanced. transfer_keep_aliveworks the same way astransfer, but has an additional check that the transfer will not kill the origin account.
Trait Implementations§
Source§impl<'api> Clone for BalancesCallApi<'api>
impl<'api> Clone for BalancesCallApi<'api>
Source§fn clone(&self) -> BalancesCallApi<'api>
fn clone(&self) -> BalancesCallApi<'api>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'api> Freeze for BalancesCallApi<'api>
impl<'api> !RefUnwindSafe for BalancesCallApi<'api>
impl<'api> Send for BalancesCallApi<'api>
impl<'api> Sync for BalancesCallApi<'api>
impl<'api> Unpin for BalancesCallApi<'api>
impl<'api> UnsafeUnpin for BalancesCallApi<'api>
impl<'api> !UnwindSafe for BalancesCallApi<'api>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moreSource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.