interbtc-api

@interlay/interbtc-api / Exports / DefaultVaultsAPI

Class: DefaultVaultsAPI

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DefaultVaultsAPI(api, electrsAPI, wrappedCurrency, governanceCurrency, tokensAPI, oracleAPI, feeAPI, rewardsAPI, systemAPI, transactionAPI): DefaultVaultsAPI

Parameters

Name Type
api ApiPromise
electrsAPI ElectrsAPI
wrappedCurrency Currency
governanceCurrency Currency
tokensAPI TokensAPI
oracleAPI OracleAPI
feeAPI FeeAPI
rewardsAPI RewardsAPI
systemAPI SystemAPI
transactionAPI TransactionAPI

Returns

DefaultVaultsAPI

Defined in

src/parachain/vaults.ts:421

Properties

api

Private api: ApiPromise

Defined in

src/parachain/vaults.ts:422


electrsAPI

Private electrsAPI: ElectrsAPI

Defined in

src/parachain/vaults.ts:423


feeAPI

Private feeAPI: FeeAPI

Defined in

src/parachain/vaults.ts:428


governanceCurrency

Private governanceCurrency: Currency

Defined in

src/parachain/vaults.ts:425


oracleAPI

Private oracleAPI: OracleAPI

Defined in

src/parachain/vaults.ts:427


rewardsAPI

Private rewardsAPI: RewardsAPI

Defined in

src/parachain/vaults.ts:429


systemAPI

Private systemAPI: SystemAPI

Defined in

src/parachain/vaults.ts:430


tokensAPI

Private tokensAPI: TokensAPI

Defined in

src/parachain/vaults.ts:426


transactionAPI

Private transactionAPI: TransactionAPI

Defined in

src/parachain/vaults.ts:431


wrappedCurrency

Private wrappedCurrency: Currency

Defined in

src/parachain/vaults.ts:424

Methods

backingCollateralProportion

backingCollateralProportion(vaultAccountId, nominatorId, collateralCurrency): Promise<Big>

Parameters

Name Type
vaultAccountId AccountId
nominatorId AccountId
collateralCurrency CollateralCurrencyExt

Returns

Promise<Big>

Defined in

src/parachain/vaults.ts:606


buildAcceptNewIssuesExtrinsic

buildAcceptNewIssuesExtrinsic(collateralCurrency, acceptNewIssues): SubmittableExtrinsic<"promise", ISubmittableResult>

Build accept new issues extrinsic without sending it.

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt the collateral currency for which to change the accepting status,
acceptNewIssues boolean Boolean denoting whether issuing should be enabled or not

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

An accept new issues submittable extrinsic.

Implementation of

VaultsAPI.buildAcceptNewIssuesExtrinsic

Defined in

src/parachain/vaults.ts:1009


buildDepositCollateralExtrinsic

buildDepositCollateralExtrinsic(amount): SubmittableExtrinsic<"promise", ISubmittableResult>

Build deposit collateral extrinsic (transaction) without sending it.

Parameters

Name Type Description
amount MonetaryAmount<CollateralCurrencyExt> The amount of extra collateral to lock

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

A deposit collateral submittable extrinsic.

Implementation of

VaultsAPI.buildDepositCollateralExtrinsic

Defined in

src/parachain/vaults.ts:513


buildRegisterPublicKeyExtrinsic

buildRegisterPublicKeyExtrinsic(publicKey): SubmittableExtrinsic<"promise", ISubmittableResult>

Build extrinsic to register a public key.

This extrinsic can be used together with a register vault extrinsic (see: buildRegisterVaultExtrinsic) to register the first vault for the logged in account id.

Registering the public key should only be done once per account id when it is not associated with a running vault, yet.

Parameters

Name Type Description
publicKey string The BTC public key of the vault to derive deposit keys with the On-Chain Key Derivation Scheme.

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

A register vault submittable extrinsic.

Implementation of

VaultsAPI.buildRegisterPublicKeyExtrinsic

Defined in

src/parachain/vaults.ts:463


buildRegisterVaultExtrinsic

buildRegisterVaultExtrinsic(collateralAmount): SubmittableExtrinsic<"promise", ISubmittableResult>

Build extrinsic to register a new vault.

Parameters

Name Type Description
collateralAmount MonetaryAmount<CollateralCurrencyExt> The collateral amount to register the vault with - in the new collateral currency.

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

A register vault submittable extrinsic.

Implementation of

VaultsAPI.buildRegisterVaultExtrinsic

Defined in

src/parachain/vaults.ts:455


buildWithdrawAllCollateralExtrinsic

buildWithdrawAllCollateralExtrinsic(collateralCurrency): Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

Build withdraw collateral extrinsic (transaction) without sending it.

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt The collateral currency for which to withdraw all

Returns

Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

A withdraw collateral submittable extrinsic as promise.

Implementation of

VaultsAPI.buildWithdrawAllCollateralExtrinsic

Defined in

src/parachain/vaults.ts:490


buildWithdrawCollateralExtrinsic

buildWithdrawCollateralExtrinsic(amount): Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

Build withdraw collateral extrinsic (transaction) without sending it.

Parameters

Name Type Description
amount MonetaryAmount<CollateralCurrencyExt> The amount of collateral to withdraw

Returns

Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

A withdraw collateral submittable extrinsic as promise.

Implementation of

VaultsAPI.buildWithdrawCollateralExtrinsic

Defined in

src/parachain/vaults.ts:467


calculateCapacity

calculateCapacity(collateral): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
collateral MonetaryAmount<CollateralCurrencyExt> Amount of collateral to calculate issuable capacity for

Returns

Promise<MonetaryAmount<Currency>>

Issuable amount by the vault, given the collateral amount

Implementation of

VaultsAPI.calculateCapacity

Defined in

src/parachain/vaults.ts:812


computeBackingCollateral

computeBackingCollateral(vaultId, nonce?): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId Vault ID object
nonce? number Nonce of the staking pool

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

The entire collateral backing a vault’s issued tokens.

Implementation of

VaultsAPI.computeBackingCollateral

Defined in

src/parachain/vaults.ts:593


computeReward

computeReward(vaultAccountId, collateralCurrency, rewardCurrency): Promise<MonetaryAmount<Currency>>

Compute the total reward, including the staking (local) pool and the rewards (global) pool

Parameters

Name Type Description
vaultAccountId AccountId The vault ID whose reward pool to check
collateralCurrency CollateralCurrencyExt -
rewardCurrency Currency The reward currency, e.g. kBTC, KINT, interBTC, INTR

Returns

Promise<MonetaryAmount<Currency>>

A Monetary.js amount object, representing the total reward in the given currency

Implementation of

VaultsAPI.computeReward

Defined in

src/parachain/vaults.ts:645


depositCollateral

depositCollateral(amount): ExtrinsicData

Parameters

Name Type Description
amount MonetaryAmount<CollateralCurrencyExt> The amount of extra collateral to lock

Returns

ExtrinsicData

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Implementation of

VaultsAPI.depositCollateral

Defined in

src/parachain/vaults.ts:530


get

get(vaultAccountId, collateralCurrency): Promise<VaultExt>

Get a vault by account ID and collateral currency. Rejects if no vault exists.

Parameters

Name Type Description
vaultAccountId AccountId The ID of the vault to fetch
collateralCurrency CollateralCurrencyExt Collateral used by vault

Returns

Promise<VaultExt>

A vault object, rejects if no vault with the given ID and currency pair exists

Implementation of

VaultsAPI.get

Defined in

src/parachain/vaults.ts:555


getAPY

getAPY(vaultAccountId, collateralCurrency): Promise<Big>

Get the total APY for a vault based on the income in wrapped and collateral tokens divided by the locked collateral.

Parameters

Name Type Description
vaultAccountId AccountId The vault account ID
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<Big>

the APY as a percentage string

Note

this does not account for interest compounding

Implementation of

VaultsAPI.getAPY

Defined in

src/parachain/vaults.ts:957


getBlockRewardAPY

getBlockRewardAPY(vaultAccountId, collateralCurrency): Promise<Big>

Gets the estimated APY for just the block rewards (in governance tokens).

Parameters

Name Type
vaultAccountId AccountId
collateralCurrency CollateralCurrencyExt

Returns

Promise<Big>

the APY as a percentage

Implementation of

VaultsAPI.getBlockRewardAPY

Defined in

src/parachain/vaults.ts:632


getCollateral

getCollateral(vaultAccountId, collateralCurrency): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type Description
vaultAccountId AccountId -
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

The collateral of a vault, taking slashes into account.

Implementation of

VaultsAPI.getCollateral

Defined in

src/parachain/vaults.ts:566


getCollateralizationFromVault

getCollateralizationFromVault(vaultId, onlyIssued?): Promise<Big>

Parameters

Name Type Default value
vaultId InterbtcPrimitivesVaultId undefined
onlyIssued boolean false

Returns

Promise<Big>

Defined in

src/parachain/vaults.ts:743


getCollateralizationFromVaultAndCollateral

getCollateralizationFromVaultAndCollateral(vaultId, newCollateral, onlyIssued): Promise<Big>

Parameters

Name Type
vaultId InterbtcPrimitivesVaultId
newCollateral MonetaryAmount<CollateralCurrencyExt>
onlyIssued boolean

Returns

Promise<Big>

Defined in

src/parachain/vaults.ts:748


getExchangeRateForLiquidation

getExchangeRateForLiquidation(vaultAccountId, collateralCurrency): Promise<undefined | Big>

Get the target exchange rate at which a vault will be forced to liquidate, given its current locked collateral and issued as well as to be issued tokens.

Parameters

Name Type Description
vaultAccountId AccountId The vault’s account ID
collateralCurrency CollateralCurrencyExt The collateral currency for the vault with the account id above

Returns

Promise<undefined | Big>

The theoretical collateral per wrapped currency rate below which the vault would be liquidated. Returns undefined if a value cannot be calculated, eg. if the vault has no issued tokens.

Implementation of

VaultsAPI.getExchangeRateForLiquidation

Defined in

src/parachain/vaults.ts:1023


getGovernanceReward

getGovernanceReward(vaultAccountId, vaultCollateral, governanceCurrency): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
vaultAccountId AccountId The vault ID whose reward pool to check
vaultCollateral CollateralCurrencyExt Collateral used by the vault
governanceCurrency Currency The fee reward currency

Returns

Promise<MonetaryAmount<Currency>>

The total reward collected by the vault

Implementation of

VaultsAPI.getGovernanceReward

Defined in

src/parachain/vaults.ts:666


getIssuableTokensFromVault

getIssuableTokensFromVault(vaultAccountId, collateralCurrency): Promise<MonetaryAmount<Currency>>

Returns issuable amount for a given vault

Parameters

Name Type Description
vaultAccountId AccountId The vault account ID
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<MonetaryAmount<Currency>>

The issuable amount of a vault

Implementation of

VaultsAPI.getIssuableTokensFromVault

Defined in

src/parachain/vaults.ts:827


getIssuedAmount

getIssuedAmount(vaultAccountId, collateralCurrency): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
vaultAccountId AccountId The vault account ID
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or `ForeignAsset

Returns

Promise<MonetaryAmount<Currency>>

The amount of wrapped tokens issued by the given vault

Implementation of

VaultsAPI.getIssuedAmount

Defined in

src/parachain/vaults.ts:788


getLiquidationCollateralThreshold

getLiquidationCollateralThreshold(collateralCurrency): Promise<Big>

Parameters

Name Type
collateralCurrency CollateralCurrencyExt

Returns

Promise<Big>

The lower bound for vault collateralization. If a Vault’s collateral rate drops below this, automatic liquidation (forced Redeem) is triggered.

Implementation of

VaultsAPI.getLiquidationCollateralThreshold

Defined in

src/parachain/vaults.ts:933


getLiquidationVault

getLiquidationVault(collateralCurrency): Promise<SystemVaultExt>

Parameters

Name Type
collateralCurrency CollateralCurrencyExt

Returns

Promise<SystemVaultExt>

A vault object representing the liquidation vault

Implementation of

VaultsAPI.getLiquidationVault

Defined in

src/parachain/vaults.ts:686


getMaxNominationRatio

getMaxNominationRatio(collateralCurrency): Promise<Big>

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt The collateral currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<Big>

The maximum collateral a vault can accept as nomination, as a ratio of its own collateral

Implementation of

VaultsAPI.getMaxNominationRatio

Defined in

src/parachain/vaults.ts:585


getMinimumCollateral

getMinimumCollateral(collateralCurrency): Promise<MonetaryAmount<CollateralCurrencyExt>>

Get the minimum secured collateral amount required to activate a vault

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

the minimum collateral to register a vault

Implementation of

VaultsAPI.getMinimumCollateral

Defined in

src/parachain/vaults.ts:576


getOrNull

getOrNull(vaultAccountId, collateralCurrency): Promise<null | VaultExt>

Get a vault by account ID and collateral currency. Does not reject if the vault does not exist, but returns null instead.

Parameters

Name Type Description
vaultAccountId AccountId The ID of the vault to fetch
collateralCurrency CollateralCurrencyExt Collateral used by vault

Returns

Promise<null | VaultExt>

A vault object, or null if no vault with the given ID and currency pair exists

Implementation of

VaultsAPI.getOrNull

Defined in

src/parachain/vaults.ts:542


getPremiumRedeemThreshold

getPremiumRedeemThreshold(collateralCurrency): Promise<Big>

Parameters

Name Type
collateralCurrency CollateralCurrencyExt

Returns

Promise<Big>

The collateral rate at which users receive a premium allocated from the Vault’s collateral, when performing a redeem with this Vault.

Implementation of

VaultsAPI.getPremiumRedeemThreshold

Defined in

src/parachain/vaults.ts:942


getPremiumRedeemVaults

getPremiumRedeemVaults(): Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Returns

Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Vaults below the premium redeem threshold, sorted in descending order of their redeemable tokens

Implementation of

VaultsAPI.getPremiumRedeemVaults

Defined in

src/parachain/vaults.ts:863


getPunishmentFee

getPunishmentFee(): Promise<Big>

Returns

Promise<Big>

Fee that a Vault has to pay, as a percentage, if it fails to execute redeem or replace requests (for redeem, on top of the slashed wrapped-token-to-collateral value of the request). The fee is paid in collateral currency based on the wrapped token amount at the current exchange rate.

Implementation of

VaultsAPI.getPunishmentFee

Defined in

src/parachain/vaults.ts:966


getRegisterVaultEvent

getRegisterVaultEvent(): AugmentedEvent<ApiTypes, AnyTuple>

Returns

AugmentedEvent<ApiTypes, AnyTuple>

Defined in

src/parachain/vaults.ts:451


getRequiredCollateralForVault

getRequiredCollateralForVault(vaultAccountId, currency): Promise<MonetaryAmount<CollateralCurrencyExt>>

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

Parameters

Name Type Description
vaultAccountId AccountId The vault account ID
currency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

The required collateral the vault needs to deposit to stay above the threshold limit

Implementation of

VaultsAPI.getRequiredCollateralForVault

Defined in

src/parachain/vaults.ts:770


getRequiredCollateralForWrapped

getRequiredCollateralForWrapped(wrappedAmount, currency): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type
wrappedAmount MonetaryAmount<Currency>
currency CollateralCurrencyExt

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

Defined in

src/parachain/vaults.ts:779


getSecureCollateralThreshold

getSecureCollateralThreshold(collateralCurrency): Promise<Big>

Get the global secure collateral threshold.

Parameters

Name Type
collateralCurrency CollateralCurrencyExt

Returns

Promise<Big>

The global over-collateralization rate for collateral locked by Vaults, necessary for issuing wrapped tokens

Implementation of

VaultsAPI.getSecureCollateralThreshold

Defined in

src/parachain/vaults.ts:951


getStakingCapacity

getStakingCapacity(vaultAccountId, collateralCurrency): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type Description
vaultAccountId AccountId The vault account ID
collateralCurrency CollateralCurrencyExt The currency specification, a Monetary.js object or ForeignAsset

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

Staking capacity, as a collateral currency (e.g. DOT)

Implementation of

VaultsAPI.getStakingCapacity

Defined in

src/parachain/vaults.ts:674


getSystemCollateralization

getSystemCollateralization(): Promise<undefined | Big>

Returns

Promise<undefined | Big>

Defined in

src/parachain/vaults.ts:765


getTotalIssuableAmount

getTotalIssuableAmount(): Promise<MonetaryAmount<Currency>>

Returns

Promise<MonetaryAmount<Currency>>

The total amount of wrapped tokens that can be issued, considering the collateral locked by the vaults

Implementation of

VaultsAPI.getTotalIssuableAmount

Defined in

src/parachain/vaults.ts:801


getTotalIssuedAmount

getTotalIssuedAmount(): Promise<MonetaryAmount<Currency>>

Returns

Promise<MonetaryAmount<Currency>>

The total amount of wrapped tokens issued by the vaults

Implementation of

VaultsAPI.getTotalIssuedAmount

Defined in

src/parachain/vaults.ts:796


getVaultCollateralization

getVaultCollateralization(vaultAccountId, collateralCurrency, newCollateral?, onlyIssued?): Promise<undefined | Big>

Get the collateralization of a single vault measured by dividing the value of issued (wrapped) tokens by the value of total locked collateral.

Parameters

Name Type Default value Description
vaultAccountId AccountId undefined the vault account id
collateralCurrency CollateralCurrencyExt undefined Collateral used by vault
newCollateral? MonetaryAmount<CollateralCurrencyExt> undefined use this instead of the vault’s actual collateral
onlyIssued boolean false optional, defaults to false. Specifies whether the collateralization should only include the issued tokens, leaving out unsettled (“to-be-issued”) tokens

Returns

Promise<undefined | Big>

the vault collateralization

Remarks

Undefined collateralization is handled as infinite collateralization in the UI. If no tokens have been issued, the collateralFunds / issuedFunds ratio divides by zero, which means collateralization is infinite.

Implementation of

VaultsAPI.getVaultCollateralization

Defined in

src/parachain/vaults.ts:713


getVaultsEligibleForRedeeming

getVaultsEligibleForRedeeming(): Promise<VaultExt[]>

Returns

Promise<VaultExt[]>

Defined in

src/parachain/vaults.ts:898


getVaultsWithIssuableTokens

getVaultsWithIssuableTokens(): Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Returns

Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Vaults with issuable tokens, not sorted in any particular order.

Remarks

The result is not sorted as an attempt to randomize the assignment of requests to vaults.

Implementation of

VaultsAPI.getVaultsWithIssuableTokens

Defined in

src/parachain/vaults.ts:876


getVaultsWithRedeemableTokens

getVaultsWithRedeemableTokens(): Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Returns

Promise<Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>>>

Vaults with redeemable tokens, sorted in descending order.

Implementation of

VaultsAPI.getVaultsWithRedeemableTokens

Defined in

src/parachain/vaults.ts:912


getWrappedCurrency

getWrappedCurrency(): Currency

Returns

Currency

The wrapped currency issued by the vaults

Implementation of

VaultsAPI.getWrappedCurrency

Defined in

src/parachain/vaults.ts:434


getWrappedReward

getWrappedReward(vaultAccountId, collateralCurrency): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
vaultAccountId AccountId The vault ID whose reward pool to check
collateralCurrency CollateralCurrencyExt Collateral used by the vault

Returns

Promise<MonetaryAmount<Currency>>

The total reward collected by the vault

Implementation of

VaultsAPI.getWrappedReward

Defined in

src/parachain/vaults.ts:659


isBelowPremiumThreshold

isBelowPremiumThreshold(vaultId): Promise<boolean>

Parameters

Name Type
vaultId InterbtcPrimitivesVaultId

Returns

Promise<boolean>

Defined in

src/parachain/vaults.ts:705


isNoTokensIssuedError

isNoTokensIssuedError(e): boolean

Parameters

Name Type
e string

Returns

boolean

Defined in

src/parachain/vaults.ts:701


isVaultEligibleForRedeem

isVaultEligibleForRedeem(vault, activeBlockNumber): boolean

Parameters

Name Type
vault VaultExt
activeBlockNumber number

Returns

boolean

Defined in

src/parachain/vaults.ts:889


isVaultFlaggedForTheft

isVaultFlaggedForTheft(vaultId, btcTxId): Promise<boolean>

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId The vault ID
btcTxId string ID of the Bitcoin transaction to check

Returns

Promise<boolean>

A bollean value

Implementation of

VaultsAPI.isVaultFlaggedForTheft

Defined in

src/parachain/vaults.ts:926


list

list(atBlock?): Promise<VaultExt[]>

Parameters

Name Type
atBlock? BlockHash

Returns

Promise<VaultExt[]>

An array containing the vaults with non-zero backing collateral

Implementation of

VaultsAPI.list

Defined in

src/parachain/vaults.ts:535


parseVault

parseVault(vault): Promise<VaultExt>

Parameters

Name Type
vault VaultRegistryVault

Returns

Promise<VaultExt>

Defined in

src/parachain/vaults.ts:981


parseVaultStatus

parseVaultStatus(status): VaultStatusExt

Parameters

Name Type
status VaultRegistryVaultStatus

Returns

VaultStatusExt

Defined in

src/parachain/vaults.ts:971


registerNewCollateralVault

registerNewCollateralVault(collateralAmount): ExtrinsicData

Registers a new vault for the current account ID with a new collateral amount. Only applicable if the connected account ID already has a running vault with a different collateral currency.

Rejects with an Error if unable to register.

Parameters

Name Type Description
collateralAmount MonetaryAmount<CollateralCurrencyExt> The collateral amount to register the vault with - in the new collateral currency

Returns

ExtrinsicData

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Implementation of

VaultsAPI.registerNewCollateralVault

Defined in

src/parachain/vaults.ts:438


selectRandomVaultIssue

selectRandomVaultIssue(amount): Promise<InterbtcPrimitivesVaultId>

Parameters

Name Type Description
amount MonetaryAmount<Currency> Wrapped tokens amount to issue

Returns

Promise<InterbtcPrimitivesVaultId>

A vault that has sufficient collateral to issue the given amount

Implementation of

VaultsAPI.selectRandomVaultIssue

Defined in

src/parachain/vaults.ts:842


selectRandomVaultRedeem

selectRandomVaultRedeem(amount): Promise<InterbtcPrimitivesVaultId>

Parameters

Name Type Description
amount MonetaryAmount<Currency> Wrapped tokens amount to redeem

Returns

Promise<InterbtcPrimitivesVaultId>

A vault that has issued sufficient wrapped tokens to redeem the given amount

Implementation of

VaultsAPI.selectRandomVaultRedeem

Defined in

src/parachain/vaults.ts:852


toggleIssueRequests

toggleIssueRequests(vaultId, acceptNewIssues): Promise<ExtrinsicData>

Enables or disables issue requests for given vault

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId The vault ID whose issuing will be toggled
acceptNewIssues boolean Boolean denoting whether issuing should be enabled or not

Returns

Promise<ExtrinsicData>

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Implementation of

VaultsAPI.toggleIssueRequests

Defined in

src/parachain/vaults.ts:1017


withdrawAllCollateral

withdrawAllCollateral(collateralCurrency): Promise<ExtrinsicData>

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt The collateral currency for which to withdraw all

Returns

Promise<ExtrinsicData>

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Implementation of

VaultsAPI.withdrawAllCollateral

Defined in

src/parachain/vaults.ts:508


withdrawCollateral

withdrawCollateral(amount): Promise<ExtrinsicData>

Parameters

Name Type Description
amount MonetaryAmount<CollateralCurrencyExt> The amount of collateral to withdraw

Returns

Promise<ExtrinsicData>

A submittable extrinsic and an event that is emitted when extrinsic is submitted.

Implementation of

VaultsAPI.withdrawCollateral

Defined in

src/parachain/vaults.ts:485