interbtc-api

@interlay/interbtc-api / Exports / IssueAPI

Interface: IssueAPI

Implemented by

Table of contents

Methods

Methods

buildCancelIssueExtrinsic

buildCancelIssueExtrinsic(issueId): SubmittableExtrinsic<"promise", ISubmittableResult>

Build a cancel issue extrinsic (transaction) without sending it.

Parameters

Name Type Description
issueId string The ID returned by the issue request transaction

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

A cancel issue submittable extrinsic.

Defined in

src/parachain/issue.ts:123


buildExecuteIssueExtrinsic

buildExecuteIssueExtrinsic(issueId, btcTxId): Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

Build an issue execution extrinsic (transaction) without sending it.

Parameters

Name Type Description
issueId string The ID returned by the issue request transaction
btcTxId string Bitcoin transaction ID

Returns

Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

An execute issue submittable extrinsic.

Defined in

src/parachain/issue.ts:102


buildRequestIssueExtrinsic

buildRequestIssueExtrinsic(vaultId, amount, griefingCollateralCurrency?): SubmittableExtrinsic<"promise", ISubmittableResult>

Build an issue request extrinsic (transaction) without sending it.

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId The vault ID of the vault to issue with.
amount MonetaryAmount<Currency> wrapped token amount to issue.
griefingCollateralCurrency? CurrencyExt (optional) Currency in which griefing collateral will be locked.

Returns

SubmittableExtrinsic<"promise", ISubmittableResult>

An execute issue submittable extrinsic.

Defined in

src/parachain/issue.ts:55


cancel

cancel(issueId): ExtrinsicData

Create an issue cancellation transaction. After the issue period has elapsed, the issuance request can be cancelled. As a result, the griefing collateral of the requester will be slashed and sent to the vault that had prepared to issue.

Parameters

Name Type Description
issueId string The ID returned by the issue request transaction

Returns

ExtrinsicData

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

Defined in

src/parachain/issue.ts:132


execute

execute(requestId, btcTxId): Promise<ExtrinsicData>

Create an issue execution transaction

Parameters

Name Type Description
requestId string -
btcTxId string Bitcoin transaction ID

Returns

Promise<ExtrinsicData>

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

Remarks

If txId is not set, the merkleProof and rawTx must both be set.

Defined in

src/parachain/issue.ts:115


getDustValue

getDustValue(): Promise<MonetaryAmount<Currency>>

Returns

Promise<MonetaryAmount<Currency>>

The minimum amount of wrapped tokens that is accepted for issue requests; any lower values would risk the bitcoin client to reject the payment

Defined in

src/parachain/issue.ts:166


getFeeRate

getFeeRate(): Promise<Big>

Returns

Promise<Big>

The fee charged for issuing. For instance, “0.005” stands for 0.5%

Defined in

src/parachain/issue.ts:170


getFeesToPay

getFeesToPay(amount): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
amount MonetaryAmount<Currency> The amount, in BTC, for which to compute the issue fees

Returns

Promise<MonetaryAmount<Currency>>

The fees, in BTC

Defined in

src/parachain/issue.ts:175


getIssuePeriod

getIssuePeriod(): Promise<number>

Returns

Promise<number>

The time difference in number of blocks between an issue request is created and required completion time by a user. The issue period has an upper limit to prevent griefing of vault collateral.

Defined in

src/parachain/issue.ts:147


getRequestById

getRequestById(issueId): Promise<Issue>

Parameters

Name Type Description
issueId string | H256 The ID of the issue request to fetch

Returns

Promise<Issue>

An issue request object

Defined in

src/parachain/issue.ts:156


getRequestLimits

getRequestLimits(vaults?): Promise<IssueLimits>

Gets the threshold for issuing with a single vault, and the maximum total issue request size. Additionally passes the list of vaults for caching.

Parameters

Name Type Description
vaults? Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>> (optional) A list of the vaults available to issue from. If not provided, will fetch from the parachain (incurring an extra request).

Returns

Promise<IssueLimits>

An object of type {singleVault, maxTotal, vaultsCache}

Defined in

src/parachain/issue.ts:45


getRequestsByIds

getRequestsByIds(issueIds): Promise<Issue[]>

Parameters

Name Type
issueIds (string | H256)[]

Returns

Promise<Issue[]>

The issue request objects

Defined in

src/parachain/issue.ts:161


getVaultIssuableAmount

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

Parameters

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

Returns

Promise<MonetaryAmount<Currency>>

The amount of wrapped tokens issuable by this vault

Defined in

src/parachain/issue.ts:181


list

list(): Promise<Issue[]>

Returns

Promise<Issue[]>

An array containing the issue requests

Defined in

src/parachain/issue.ts:151


request

request(amount, vaultAccountId?, collateralCurrency?, atomic?, availableVaults?, griefingCollateralCurrency?): Promise<ExtrinsicData>

Request issuing wrapped tokens (e.g. interBTC, kBTC).

Parameters

Name Type Description
amount MonetaryAmount<Currency> wrapped token amount to issue.
vaultAccountId? AccountId -
collateralCurrency? CollateralCurrencyExt (optional) Collateral currency for backing wrapped tokens
atomic? boolean (optional) Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. Defaults to false.
availableVaults? Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>> (optional) A list of all vaults usable for issue. If not provided, will fetch from the parachain.
griefingCollateralCurrency? CurrencyExt (optional) Currency in which griefing collateral will be locked.

Returns

Promise<ExtrinsicData>

An extrinsic with event.

Defined in

src/parachain/issue.ts:72


requestAdvanced

requestAdvanced(amountsPerVault, atomic, griefingCollateralCurrency?): ExtrinsicData

Create a batch of aggregated issue transactions (to one or more vaults).

Parameters

Name Type Description
amountsPerVault Map<InterbtcPrimitivesVaultId, MonetaryAmount<Currency>> A mapping of vaults to issue from, and wrapped token amounts to issue using each vault
atomic boolean Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it.
griefingCollateralCurrency? CurrencyExt (optional) Currency in which griefing collateral will be locked.

Returns

ExtrinsicData

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

Defined in

src/parachain/issue.ts:89


setIssuePeriod

setIssuePeriod(blocks): ExtrinsicData

Parameters

Name Type Description
blocks number The time difference in number of blocks between an issue request is created and required completion time by a user. The issue period has an upper limit to prevent griefing of vault collateral.

Returns

ExtrinsicData

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

Remarks

Testnet utility function

Defined in

src/parachain/issue.ts:140