interbtc-api

@interlay/interbtc-api / Exports / DefaultRewardsAPI

Class: DefaultRewardsAPI

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DefaultRewardsAPI(api, wrappedCurrency): DefaultRewardsAPI

Parameters

Name Type
api ApiPromise
wrappedCurrency Currency

Returns

DefaultRewardsAPI

Defined in

src/parachain/rewards.ts:42

Properties

api

api: ApiPromise

Defined in

src/parachain/rewards.ts:42


wrappedCurrency

Private wrappedCurrency: Currency

Defined in

src/parachain/rewards.ts:42

Methods

computeCollateralInStakingPool

computeCollateralInStakingPool(vaultId, nominatorId): Promise<MonetaryAmount<CollateralCurrencyExt>>

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId The account ID of the staking pool nominee
nominatorId AccountId The account ID of the staking pool nominator

Returns

Promise<MonetaryAmount<CollateralCurrencyExt>>

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

Implementation of

RewardsAPI.computeCollateralInStakingPool

Defined in

src/parachain/rewards.ts:50


getStakingPoolNonce

getStakingPoolNonce(collateralCurrency, vaultAccountId): Promise<number>

Parameters

Name Type Description
collateralCurrency CollateralCurrencyExt The staked currency
vaultAccountId AccountId The account ID of the staking pool nominee

Returns

Promise<number>

The current nonce of the staking pool

Implementation of

RewardsAPI.getStakingPoolNonce

Defined in

src/parachain/rewards.ts:44


withdrawRewards

withdrawRewards(vaultId, nonce?): Promise<ExtrinsicData>

Parameters

Name Type Description
vaultId InterbtcPrimitivesVaultId VaultId object
nonce? number Staking pool nonce

Returns

Promise<ExtrinsicData>

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

Remarks

Withdraw all rewards from the current account in the vaultId staking pool.

Implementation of

RewardsAPI.withdrawRewards

Defined in

src/parachain/rewards.ts:70