Trait traits::loans::LoansApi

source ·
pub trait LoansApi<CurrencyId, AccountId, Amount> {
    // Required methods
    fn do_mint(
        supplier: &AccountId,
        amount: &Amount
    ) -> Result<(), DispatchError>;
    fn do_borrow(
        borrower: &AccountId,
        borrow: &Amount
    ) -> Result<(), DispatchError>;
    fn do_deposit_collateral(
        supplier: &AccountId,
        lend_tokens: &Amount
    ) -> Result<(), DispatchError>;
    fn do_withdraw_collateral(
        supplier: &AccountId,
        voucher: &Amount
    ) -> Result<(), DispatchError>;
    fn do_repay_borrow(
        borrower: &AccountId,
        borrow: &Amount
    ) -> Result<(), DispatchError>;
    fn do_redeem(
        supplier: &AccountId,
        amount: &Amount,
        voucher: &Amount
    ) -> Result<(), DispatchError>;
    fn recompute_underlying_amount(
        lend_tokens: &Amount
    ) -> Result<Amount, DispatchError>;
    fn underlying_id(
        lend_token_id: CurrencyId
    ) -> Result<CurrencyId, DispatchError>;
    fn recompute_collateral_amount(
        underlying: &Amount
    ) -> Result<Amount, DispatchError>;
}

Required Methods§

source

fn do_mint(supplier: &AccountId, amount: &Amount) -> Result<(), DispatchError>

source

fn do_borrow(borrower: &AccountId, borrow: &Amount) -> Result<(), DispatchError>

source

fn do_deposit_collateral( supplier: &AccountId, lend_tokens: &Amount ) -> Result<(), DispatchError>

source

fn do_withdraw_collateral( supplier: &AccountId, voucher: &Amount ) -> Result<(), DispatchError>

source

fn do_repay_borrow( borrower: &AccountId, borrow: &Amount ) -> Result<(), DispatchError>

source

fn do_redeem( supplier: &AccountId, amount: &Amount, voucher: &Amount ) -> Result<(), DispatchError>

source

fn recompute_underlying_amount( lend_tokens: &Amount ) -> Result<Amount, DispatchError>

source

fn underlying_id(lend_token_id: CurrencyId) -> Result<CurrencyId, DispatchError>

source

fn recompute_collateral_amount( underlying: &Amount ) -> Result<Amount, DispatchError>

Implementors§