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§
sourcefn get_vault_collateral(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
vault_id: VaultId
) -> Result<Result<BalanceWrapper<Balance>, DispatchError>, ApiError>
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)
sourcefn 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_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
sourcefn get_vault_total_collateral(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
vault_id: VaultId
) -> Result<Result<BalanceWrapper<Balance>, 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>
Get the vault’s collateral (including nomination)
sourcefn 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_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
sourcefn get_vaults_with_redeemable_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>
Get all vaults with non-zero redeemable tokens, ordered in descending order of this amount
sourcefn get_issuable_tokens_from_vault(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
vault: VaultId
) -> Result<Result<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>
Get the amount of tokens a vault can issue
sourcefn 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( &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
sourcefn 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_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
sourcefn 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_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
sourcefn get_required_collateral_for_vault(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
vault_id: VaultId
) -> 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>
Get the amount of collateral required for the given vault to be at the current SecureCollateralThreshold with the current exchange rate