[−][src]Trait eq_balances::EqCurrency
An extension to Substrate standard Currency, adapting it to work in Equilibrium substrate
Required methods
fn total_balance(currency: Currency, who: &AccountId) -> Balance
Returns balance value if balance is positive or zero if negative
fn debt(currency: Currency, who: &AccountId) -> Balance
Returns balance value if balance is negative or zero if negative
fn can_slash(currency: Currency, who: &AccountId, value: Balance) -> bool
fn currency_total_issuance(currency: Currency) -> Balance
Gets total issuance of given currency
fn currency_minimum_balance(currency: Currency) -> Balance
Returns ExistentialDeposit
for given currency
fn burn(currency: Currency, amount: Balance) -> PositiveImbalance<Balance>
Unimplemented
fn issue(currency: Currency, amount: Balance) -> NegativeImbalance<Balance>
Unimplemented. Use deposit
instead
fn free_balance(currency: Currency, who: &AccountId) -> Balance
Same as total_balance
fn ensure_can_withdraw(
currency: Currency,
who: &AccountId,
amount: Balance,
reasons: WithdrawReasons,
new_balance: Balance
) -> DispatchResult
currency: Currency,
who: &AccountId,
amount: Balance,
reasons: WithdrawReasons,
new_balance: Balance
) -> DispatchResult
Used to ensure that user's balance in specified currency can be
decreased for amount
fn currency_transfer(
currency: Currency,
transactor: &AccountId,
dest: &AccountId,
value: Balance,
existence_requirement: ExistenceRequirement,
transfer_reason: TransferReason,
ensure_can_change: bool
) -> DispatchResult
currency: Currency,
transactor: &AccountId,
dest: &AccountId,
value: Balance,
existence_requirement: ExistenceRequirement,
transfer_reason: TransferReason,
ensure_can_change: bool
) -> DispatchResult
Operates transfers inside pallet functions
transactor
- account sending currencydest
- account receiving currencyvalue
- amount transferredexistence_requirement
- currently unusedensure_can_change
- flag for ensuring transfer can be performed withcan_change_balance
fn slash(
currency: Currency,
who: &AccountId,
value: Balance
) -> (NegativeImbalance<Balance>, Balance)
currency: Currency,
who: &AccountId,
value: Balance
) -> (NegativeImbalance<Balance>, Balance)
fn deposit_into_existing(
currency: Currency,
who: &AccountId,
value: Balance
) -> Result<PositiveImbalance<Balance>, DispatchError>
currency: Currency,
who: &AccountId,
value: Balance
) -> Result<PositiveImbalance<Balance>, DispatchError>
Adds given amount of currency to account's balance
fn deposit_creating(
currency: Currency,
who: &AccountId,
value: Balance,
ensure_can_change: bool
) -> PositiveImbalance<Balance>
currency: Currency,
who: &AccountId,
value: Balance,
ensure_can_change: bool
) -> PositiveImbalance<Balance>
Performs a deposit creating balance storage for account if it does not exist
fn withdraw(
currency: Currency,
who: &AccountId,
value: Balance,
reasons: WithdrawReasons,
liveness: ExistenceRequirement,
ensure_can_change: bool
) -> Result<NegativeImbalance<Balance>, DispatchError>
currency: Currency,
who: &AccountId,
value: Balance,
reasons: WithdrawReasons,
liveness: ExistenceRequirement,
ensure_can_change: bool
) -> Result<NegativeImbalance<Balance>, DispatchError>
Decreases who
account balance for specified amount of currency
ensure_can_change
- flag for ensuring transfer can be performed withcan_change_balance
fn make_free_balance_be(
currency: Currency,
who: &AccountId,
value: Balance
) -> SignedImbalance<Balance, PositiveImbalance<Balance>>
currency: Currency,
who: &AccountId,
value: Balance
) -> SignedImbalance<Balance, PositiveImbalance<Balance>>
Force the new free balance of a target account to some new value
Provided methods
fn resolve_creating(
currency: Currency,
who: &AccountId,
value: NegativeImbalance<Balance>
)
currency: Currency,
who: &AccountId,
value: NegativeImbalance<Balance>
)
Similar to deposit_creating
, only accepts a NegativeImbalance
and returns
nothing on success
Implementors
impl<T: Trait> EqCurrency<<T as Trait>::AccountId, <T as Trait>::Balance> for Module<T>
[src]
fn total_balance(currency: Currency, who: &T::AccountId) -> T::Balance
[src]
fn debt(currency: Currency, who: &T::AccountId) -> T::Balance
[src]
fn can_slash(
_currency: Currency,
_who: &T::AccountId,
_value: T::Balance
) -> bool
[src]
_currency: Currency,
_who: &T::AccountId,
_value: T::Balance
) -> bool
fn currency_total_issuance(currency: Currency) -> T::Balance
[src]
fn currency_minimum_balance(_currency: Currency) -> T::Balance
[src]
fn burn(
_currency: Currency,
_amount: T::Balance
) -> PositiveImbalance<T::Balance>
[src]
_currency: Currency,
_amount: T::Balance
) -> PositiveImbalance<T::Balance>
fn issue(
_currency: Currency,
_amount: T::Balance
) -> NegativeImbalance<T::Balance>
[src]
_currency: Currency,
_amount: T::Balance
) -> NegativeImbalance<T::Balance>
fn free_balance(currency: Currency, who: &T::AccountId) -> T::Balance
[src]
fn ensure_can_withdraw(
currency: Currency,
who: &T::AccountId,
amount: T::Balance,
reasons: WithdrawReasons,
_new_balance: T::Balance
) -> DispatchResult
[src]
currency: Currency,
who: &T::AccountId,
amount: T::Balance,
reasons: WithdrawReasons,
_new_balance: T::Balance
) -> DispatchResult
fn currency_transfer(
currency: Currency,
transactor: &T::AccountId,
dest: &T::AccountId,
value: T::Balance,
_existence_requirement: ExistenceRequirement,
transfer_reason: TransferReason,
ensure_can_change: bool
) -> DispatchResult
[src]
currency: Currency,
transactor: &T::AccountId,
dest: &T::AccountId,
value: T::Balance,
_existence_requirement: ExistenceRequirement,
transfer_reason: TransferReason,
ensure_can_change: bool
) -> DispatchResult
fn slash(
_currency: Currency,
_who: &T::AccountId,
_value: T::Balance
) -> (NegativeImbalance<T::Balance>, T::Balance)
[src]
_currency: Currency,
_who: &T::AccountId,
_value: T::Balance
) -> (NegativeImbalance<T::Balance>, T::Balance)
fn deposit_into_existing(
currency: Currency,
who: &T::AccountId,
value: T::Balance
) -> Result<PositiveImbalance<T::Balance>, DispatchError>
[src]
currency: Currency,
who: &T::AccountId,
value: T::Balance
) -> Result<PositiveImbalance<T::Balance>, DispatchError>
fn deposit_creating(
currency: Currency,
who: &T::AccountId,
value: T::Balance,
ensure_can_change: bool
) -> PositiveImbalance<T::Balance>
[src]
currency: Currency,
who: &T::AccountId,
value: T::Balance,
ensure_can_change: bool
) -> PositiveImbalance<T::Balance>
fn withdraw(
currency: Currency,
who: &T::AccountId,
value: T::Balance,
reasons: WithdrawReasons,
_liveness: ExistenceRequirement,
ensure_can_change: bool
) -> Result<NegativeImbalance<T::Balance>, DispatchError>
[src]
currency: Currency,
who: &T::AccountId,
value: T::Balance,
reasons: WithdrawReasons,
_liveness: ExistenceRequirement,
ensure_can_change: bool
) -> Result<NegativeImbalance<T::Balance>, DispatchError>
fn make_free_balance_be(
currency: Currency,
who: &T::AccountId,
value: T::Balance
) -> SignedImbalance<T::Balance, PositiveImbalance<T::Balance>>
[src]
currency: Currency,
who: &T::AccountId,
value: T::Balance
) -> SignedImbalance<T::Balance, PositiveImbalance<T::Balance>>