interbtc-api

@interlay/interbtc-api / Exports / NominationAPI

Interface: NominationAPI

Implemented by

Table of contents

Methods

Methods

depositCollateral

depositCollateral(vaultAccountId, amount): ExtrinsicData

Parameters

Name Type Description
vaultAccountId AccountId Vault to nominate collateral to
amount MonetaryAmount<CollateralCurrencyExt> Amount to deposit, as a Monetary.js object or ForeignAsset

Returns

ExtrinsicData

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

Defined in

src/parachain/nomination.ts:47


getActiveNominatorRewards

getActiveNominatorRewards(nominatorId): Promise<NominationData[]>

Parameters

Name Type Description
nominatorId AccountId Id of user who nominated to one or more vaults

Returns

Promise<NominationData[]>

The rewards a currently active nominator has accumulated

Defined in

src/parachain/nomination.ts:124


getFilteredNominations

getFilteredNominations(vaultAccountId?, collateralCurrency?, nominatorId?): Promise<Nomination[]>

Parameters

Name Type Description
vaultAccountId? AccountId Id of vault who is opted in to nomination
collateralCurrency? CollateralCurrencyExt -
nominatorId? AccountId Id of user who nominated to one or more vaults

Returns

Promise<Nomination[]>

Remarks

At least one of the parameters must be specified

Defined in

src/parachain/nomination.ts:102


getNominatorReward

getNominatorReward(vaultId, collateralCurrency, rewardCurrency, nominatorId): Promise<MonetaryAmount<Currency>>

Parameters

Name Type Description
vaultId AccountId -
collateralCurrency CollateralCurrencyExt The currency towards whose issuance the nomination was made
rewardCurrency Currency The reward currency, e.g. kBTC, KINT, interBTC, INTR
nominatorId AccountId Id of user who nominated to one or more vaults

Returns

Promise<MonetaryAmount<Currency>>

The rewards a (possibly inactive) nominator has accumulated

Defined in

src/parachain/nomination.ts:132


getNonces

getNonces(): Promise<Map<InterbtcPrimitivesVaultId, number>>

Returns

Promise<Map<InterbtcPrimitivesVaultId, number>>

A map (vaultId => nonce), representing the nonces for each reward pool with the given currency

Defined in

src/parachain/nomination.ts:141


getTotalNomination

getTotalNomination(vaultAccountId?, collateralCurrency?, nominatorId?): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type Description
vaultAccountId? AccountId Id of vault who is opted in to nomination
collateralCurrency? CollateralCurrencyExt The collateral currency of the nominations
nominatorId? AccountId Id of user who nominated to one or more vaults

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

The total nominated amount, filtered using the given parameters

Remarks

At least one of the parameters must be specified

Defined in

src/parachain/nomination.ts:114


isNominationEnabled

isNominationEnabled(): Promise<boolean>

Returns

Promise<boolean>

A boolean value representing whether the vault nomination feature is enabled

Defined in

src/parachain/nomination.ts:77


isVaultOptedIn

isVaultOptedIn(accountId, collateralCurrency): Promise<boolean>

Parameters

Name Type
accountId AccountId
collateralCurrency CollateralCurrencyExt

Returns

Promise<boolean>

A boolean value

Defined in

src/parachain/nomination.ts:95


list

list(): Promise<Nomination[]>

Returns

Promise<Nomination[]>

All nominations for the wrapped currency set in the API

Defined in

src/parachain/nomination.ts:81


listNominatorRewards

listNominatorRewards(): Promise<NominationData[]>

Returns

Promise<NominationData[]>

The rewards a nominator has accumulated, in wrapped token (e.g. interBTC, kBTC)

Defined in

src/parachain/nomination.ts:86


listVaults

listVaults(): Promise<InterbtcPrimitivesVaultId[]>

Returns

Promise<InterbtcPrimitivesVaultId[]>

A list of all vaults that opted in to the nomination feature.

Defined in

src/parachain/nomination.ts:90


optIn

optIn(collateralCurrency): ExtrinsicData

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt Currency to accept as nomination

Returns

ExtrinsicData

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

Remarks

Function callable by vaults to opt in to the nomination feature

Defined in

src/parachain/nomination.ts:62


optOut

optOut(collateralCurrency): ExtrinsicData

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt Currency to stop accepting as nomination

Returns

ExtrinsicData

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

Remarks

Function callable by vaults to opt out of the nomination feature

Defined in

src/parachain/nomination.ts:68


setNominationEnabled

setNominationEnabled(enabled): ExtrinsicData

Parameters

Name Type
enabled boolean

Returns

ExtrinsicData

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

Remarks

Testnet utility function

Defined in

src/parachain/nomination.ts:73


withdrawCollateral

withdrawCollateral(vaultAccountId, amount): Promise<ExtrinsicData>

Parameters

Name Type Description
vaultAccountId AccountId Vault that collateral was nominated to
amount MonetaryAmount<CollateralCurrencyExt> Amount to withdraw, as a Monetary.js object or ForeignAsset

Returns

Promise<ExtrinsicData>

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

Defined in

src/parachain/nomination.ts:53