Trait orml_traits::currency::MultiLockableCurrency[][src]

pub trait MultiLockableCurrency<AccountId>: MultiCurrency<AccountId> {
    type Moment;
    fn set_lock(
        lock_id: LockIdentifier,
        currency_id: Self::CurrencyId,
        who: &AccountId,
        amount: Self::Balance
    ) -> DispatchResult;
fn extend_lock(
        lock_id: LockIdentifier,
        currency_id: Self::CurrencyId,
        who: &AccountId,
        amount: Self::Balance
    ) -> DispatchResult;
fn remove_lock(
        lock_id: LockIdentifier,
        currency_id: Self::CurrencyId,
        who: &AccountId
    ) -> DispatchResult; }

A fungible multi-currency system whose accounts can have liquidity restrictions.

Associated Types

type Moment[src]

The quantity used to denote time; usually just a BlockNumber.

Loading content...

Required methods

fn set_lock(
    lock_id: LockIdentifier,
    currency_id: Self::CurrencyId,
    who: &AccountId,
    amount: Self::Balance
) -> DispatchResult
[src]

Create a new balance lock on account who.

If the new lock is valid (i.e. not already expired), it will push the struct to the Locks vec in storage. Note that you can lock more funds than a user has.

If the lock lock_id already exists, this will update it.

fn extend_lock(
    lock_id: LockIdentifier,
    currency_id: Self::CurrencyId,
    who: &AccountId,
    amount: Self::Balance
) -> DispatchResult
[src]

Changes a balance lock (selected by lock_id) so that it becomes less liquid in all parameters or creates a new one if it does not exist.

Calling extend_lock on an existing lock lock_id differs from set_lock in that it applies the most severe constraints of the two, while set_lock replaces the lock with the new parameters. As in, extend_lock will set:

  • maximum amount

fn remove_lock(
    lock_id: LockIdentifier,
    currency_id: Self::CurrencyId,
    who: &AccountId
) -> DispatchResult
[src]

Remove an existing lock.

Loading content...

Implementors

Loading content...