Struct tidechain_runtime::constants::currency::Adapter
source · pub struct Adapter<AccountId> { /* private fields */ }Trait Implementations§
source§impl Inspect<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
impl Inspect<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
§type AssetId = CurrencyId
type AssetId = CurrencyId
Means of identifying one asset class from another.
source§fn total_issuance(asset: Self::AssetId) -> Self::Balance
fn total_issuance(asset: Self::AssetId) -> Self::Balance
The total amount of issuance in the system.
source§fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance
Get the
asset balance of who.source§fn minimum_balance(asset: Self::AssetId) -> Self::Balance
fn minimum_balance(asset: Self::AssetId) -> Self::Balance
The minimum balance any single account may have.
source§fn reducible_balance(
asset: Self::AssetId,
who: &AccountId,
keep_alive: bool
) -> Self::Balance
fn reducible_balance(
asset: Self::AssetId,
who: &AccountId,
keep_alive: bool
) -> Self::Balance
Get the maximum amount of
asset that who can withdraw/transfer successfully.source§fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
mint: bool
) -> DepositConsequence
fn can_deposit(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
mint: bool
) -> DepositConsequence
source§fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
fn can_withdraw(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> WithdrawConsequence<Self::Balance>
Returns
Failed if the asset balance of who may not be decreased by amount, otherwise
the consequence. Read moresource§fn asset_exists(asset: Self::AssetId) -> bool
fn asset_exists(asset: Self::AssetId) -> bool
Returns
true if an asset exists.source§impl InspectHold<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
impl InspectHold<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
source§impl Mutate<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
impl Mutate<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
source§fn mint_into(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> DispatchResult
fn mint_into(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> DispatchResult
source§fn burn_from(
asset: Self::AssetId,
who: &AccountId,
amount: Balance
) -> Result<Balance, DispatchError>
fn burn_from(
asset: Self::AssetId,
who: &AccountId,
amount: Balance
) -> Result<Balance, DispatchError>
source§fn slash(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
fn slash(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance
) -> Result<Self::Balance, DispatchError>
Attempt to reduce the
asset balance of who by as much as possible up to amount, and
possibly slightly more due to minimum_balance requirements. If no decrease is possible then
an Err is returned and nothing is changed. If successful, the amount of tokens reduced is
returned. Read moresource§impl MutateHold<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
impl MutateHold<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>
source§fn hold(
asset: CurrencyId,
who: &AccountId,
amount: Self::Balance
) -> DispatchResult
fn hold(
asset: CurrencyId,
who: &AccountId,
amount: Self::Balance
) -> DispatchResult
Hold some funds in an account.
source§fn release(
asset: CurrencyId,
who: &AccountId,
amount: Balance,
best_effort: bool
) -> Result<Balance, DispatchError>
fn release(
asset: CurrencyId,
who: &AccountId,
amount: Balance,
best_effort: bool
) -> Result<Balance, DispatchError>
Release some funds in an account from being on hold. Read more
source§fn transfer_held(
asset: CurrencyId,
source: &AccountId,
dest: &AccountId,
amount: Balance,
best_effort: bool,
on_hold: bool
) -> Result<Balance, DispatchError>
fn transfer_held(
asset: CurrencyId,
source: &AccountId,
dest: &AccountId,
amount: Balance,
best_effort: bool,
on_hold: bool
) -> Result<Balance, DispatchError>
Transfer held funds into a destination account. Read more
source§impl Transfer<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>where
Assets: Transfer<AccountId>,
impl Transfer<<<MultiSignature as Verify>::Signer as IdentifyAccount>::AccountId> for Adapter<AccountId>where
Assets: Transfer<AccountId>,
source§fn transfer(
asset: Self::AssetId,
source: &AccountId,
dest: &AccountId,
amount: Self::Balance,
keep_alive: bool
) -> Result<Balance, DispatchError>
fn transfer(
asset: Self::AssetId,
source: &AccountId,
dest: &AccountId,
amount: Self::Balance,
keep_alive: bool
) -> Result<Balance, DispatchError>
Transfer funds from one account into another.
source§fn deactivate(_: Self::AssetId, _: Self::Balance)
fn deactivate(_: Self::AssetId, _: Self::Balance)
Reduce the active issuance by some amount.
source§fn reactivate(_: Self::AssetId, _: Self::Balance)
fn reactivate(_: Self::AssetId, _: Self::Balance)
Increase the active issuance by some amount, up to the outstanding amount reduced.
Auto Trait Implementations§
impl<AccountId> RefUnwindSafe for Adapter<AccountId>where
AccountId: RefUnwindSafe,
impl<AccountId> Send for Adapter<AccountId>where
AccountId: Send,
impl<AccountId> Sync for Adapter<AccountId>where
AccountId: Sync,
impl<AccountId> Unpin for Adapter<AccountId>where
AccountId: Unpin,
impl<AccountId> UnwindSafe for Adapter<AccountId>where
AccountId: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moresource§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, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
source§impl<T> Pointable for T
impl<T> Pointable 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>,
Consume self to return an equivalent value of
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
The counterpart to
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.