pub trait VaultRegistryApi<Block: BlockT, VaultId, Balance, UnsignedFixedPoint, CurrencyId, AccountId>: Core<Block>where
    VaultId: Codec,
    Balance: Codec,
    UnsignedFixedPoint: Codec,
    CurrencyId: Codec,
    AccountId: Codec,{
    // Provided methods
    fn get_vault_collateral(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault_id: VaultId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn get_vaults_by_account_id(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        account_id: AccountId
    ) -> Result<Result<Vec<VaultId>, DispatchError>, ApiError> { ... }
    fn get_vault_total_collateral(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault_id: VaultId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn get_vaults_with_issuable_tokens(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash
    ) -> Result<Result<Vec<(VaultId, BalanceWrapper<Balance>)>, DispatchError>, ApiError> { ... }
    fn get_vaults_with_redeemable_tokens(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash
    ) -> Result<Result<Vec<(VaultId, BalanceWrapper<Balance>)>, DispatchError>, ApiError> { ... }
    fn get_issuable_tokens_from_vault(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault: VaultId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn get_collateralization_from_vault(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault: VaultId,
        only_issued: bool
    ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError> { ... }
    fn get_collateralization_from_vault_and_collateral(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault: VaultId,
        collateral: BalanceWrapper<Balance>,
        only_issued: bool
    ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError> { ... }
    fn get_required_collateral_for_wrapped(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        amount_btc: BalanceWrapper<Balance>,
        currency_id: CurrencyId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
    fn get_required_collateral_for_vault(
        &self,
        __runtime_api_at_param__: <Block as BlockT>::Hash,
        vault_id: VaultId
    ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError> { ... }
}

Provided Methods§

source

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

Get the vault’s collateral (excluding nomination)

source

fn get_vaults_by_account_id( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId ) -> Result<Result<Vec<VaultId>, DispatchError>, ApiError>

Get all the vaultIds registered by a vault’s accountId

source

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

Get the vault’s collateral (including nomination)

source

fn get_vaults_with_issuable_tokens( &self, __runtime_api_at_param__: <Block as BlockT>::Hash ) -> Result<Result<Vec<(VaultId, BalanceWrapper<Balance>)>, DispatchError>, ApiError>

Get all vaults with non-zero issuable tokens, ordered in descending order of this amount

source

fn get_vaults_with_redeemable_tokens( &self, __runtime_api_at_param__: <Block as BlockT>::Hash ) -> Result<Result<Vec<(VaultId, BalanceWrapper<Balance>)>, DispatchError>, ApiError>

Get all vaults with non-zero redeemable tokens, ordered in descending order of this amount

source

fn get_issuable_tokens_from_vault( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vault: VaultId ) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>

Get the amount of tokens a vault can issue

source

fn get_collateralization_from_vault( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vault: VaultId, only_issued: bool ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError>

Get the collateralization rate of a vault

source

fn get_collateralization_from_vault_and_collateral( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, vault: VaultId, collateral: BalanceWrapper<Balance>, only_issued: bool ) -> Result<Result<UnsignedFixedPoint, DispatchError>, ApiError>

Get the collateralization rate of a vault and collateral

source

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

Get the minimum amount of collateral required for the given amount of btc with the current threshold and exchange rate

source

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

Get the amount of collateral required for the given vault to be at the current SecureCollateralThreshold with the current exchange rate

Trait Implementations§

source§

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

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§