pub trait RewardApi<Block: BlockT, AccountId, VaultId, CurrencyId, Balance, BlockNumber, UnsignedFixedPoint>: Core<Block>where
    AccountId: Codec,
    VaultId: Codec,
    CurrencyId: Codec,
    Balance: Codec,
    BlockNumber: Codec,
    UnsignedFixedPoint: Codec,{
    // Provided methods
    fn compute_escrow_reward(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        account_id: AccountId,
        currency_id: CurrencyId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn compute_farming_reward(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        account_id: AccountId,
        pool_currency_id: CurrencyId,
        reward_currency_id: CurrencyId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn compute_vault_reward(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault_id: VaultId,
        currency_id: CurrencyId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn estimate_escrow_reward_rate(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        account_id: AccountId,
        amount: Option<Balance>,
        lock_time: Option<BlockNumber>
    ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError> { ... }
    fn estimate_farming_reward(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        account_id: AccountId,
        pool_currency_id: CurrencyId,
        reward_currency_id: CurrencyId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn estimate_vault_reward_rate(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault_id: VaultId
    ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError> { ... }
}

Provided Methods§

source

fn compute_escrow_reward( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, currency_id: CurrencyId ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>

Calculate the number of escrow rewards accrued

source

fn compute_farming_reward( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, pool_currency_id: CurrencyId, reward_currency_id: CurrencyId ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>

Calculate the number of farming rewards accrued

source

fn compute_vault_reward( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vault_id: VaultId, currency_id: CurrencyId ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>

Calculate the number of vault rewards accrued

source

fn estimate_escrow_reward_rate( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, amount: Option<Balance>, lock_time: Option<BlockNumber> ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError>

Estimate staking reward rate for a one year period

source

fn estimate_farming_reward( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, pool_currency_id: CurrencyId, reward_currency_id: CurrencyId ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>

Estimate farming rewards for remaining incentives

source

fn estimate_vault_reward_rate( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vault_id: VaultId ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError>

Estimate vault reward rate for a one year period

Trait Implementations§

source§

impl<Block: BlockT, AccountId, VaultId, CurrencyId, Balance, BlockNumber, UnsignedFixedPoint> RuntimeApiInfo for dyn RewardApi<Block, AccountId, VaultId, CurrencyId, Balance, BlockNumber, UnsignedFixedPoint>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§