@interlay/interbtc-api / Exports / DefaultNominationAPI
• new DefaultNominationAPI(api
, wrappedCurrency
, vaultsAPI
, rewardsAPI
): DefaultNominationAPI
Name | Type |
---|---|
api |
ApiPromise |
wrappedCurrency |
Currency |
vaultsAPI |
VaultsAPI |
rewardsAPI |
RewardsAPI |
src/parachain/nomination.ts:145
• Private
api: ApiPromise
src/parachain/nomination.ts:146
• Private
rewardsAPI: RewardsAPI
src/parachain/nomination.ts:149
• Private
vaultsAPI: VaultsAPI
src/parachain/nomination.ts:148
• Private
wrappedCurrency: Currency
src/parachain/nomination.ts:147
▸ depositCollateral(vaultAccountId
, amount
): ExtrinsicData
Name | Type | Description |
---|---|---|
vaultAccountId |
AccountId |
Vault to nominate collateral to |
amount |
MonetaryAmount <CollateralCurrencyExt > |
Amount to deposit, as a Monetary.js object or ForeignAsset |
A submittable extrinsic and an event that is emitted when extrinsic is submitted.
NominationAPI.depositCollateral
src/parachain/nomination.ts:163
▸ getActiveNominatorRewards(nominatorId
): Promise
<NominationData
[]>
Name | Type | Description |
---|---|---|
nominatorId |
AccountId |
Id of user who nominated to one or more vaults |
Promise
<NominationData
[]>
The rewards a currently active nominator has accumulated
NominationAPI.getActiveNominatorRewards
src/parachain/nomination.ts:304
▸ getFilteredNominations(vaultId?
, collateralCurrency?
, nominatorId?
): Promise
<Nomination
[]>
Name | Type | Description |
---|---|---|
vaultId? |
AccountId |
Id of vault who is opted in to nomination |
collateralCurrency? |
CollateralCurrencyExt |
- |
nominatorId? |
AccountId |
Id of user who nominated to one or more vaults |
Promise
<Nomination
[]>
Remarks
At least one of the parameters must be specified
NominationAPI.getFilteredNominations
src/parachain/nomination.ts:323
▸ getNominationStatus(vaultId
, collateralCurrency
, nominatorId
): Promise
<NominationStatus
>
Name | Type |
---|---|
vaultId |
AccountId |
collateralCurrency |
CollateralCurrencyExt |
nominatorId |
AccountId |
Promise
<NominationStatus
>
src/parachain/nomination.ts:366
▸ getNominatorReward(vaultId
, collateralCurrency
, rewardCurrency
): Promise
<MonetaryAmount
<Currency
>>
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 |
Promise
<MonetaryAmount
<Currency
>>
The rewards a (possibly inactive) nominator has accumulated
NominationAPI.getNominatorReward
src/parachain/nomination.ts:311
▸ getNonces(): Promise
<Map
<InterbtcPrimitivesVaultId
, number
>>
Promise
<Map
<InterbtcPrimitivesVaultId
, number
>>
A map (vaultId => nonce), representing the nonces for each reward pool with the given currency
src/parachain/nomination.ts:240
▸ getTotalNomination(vaultId?
, collateralCurrency?
, nominatorId?
): Promise
<MonetaryAmount
<CollateralCurrencyExt
>>
Name | Type | Description |
---|---|---|
vaultId? |
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 |
Promise
<MonetaryAmount
<CollateralCurrencyExt
>>
The total nominated amount, filtered using the given parameters
Remarks
At least one of the parameters must be specified
NominationAPI.getTotalNomination
src/parachain/nomination.ts:384
▸ isNominationEnabled(): Promise
<boolean
>
Promise
<boolean
>
A boolean value representing whether the vault nomination feature is enabled
NominationAPI.isNominationEnabled
src/parachain/nomination.ts:235
▸ isVaultOptedIn(accountId
, collateralCurrency
): Promise
<boolean
>
Name | Type |
---|---|
accountId |
AccountId |
collateralCurrency |
CollateralCurrencyExt |
Promise
<boolean
>
A boolean value
src/parachain/nomination.ts:425
▸ list(): Promise
<Nomination
[]>
Promise
<Nomination
[]>
All nominations for the wrapped currency set in the API
src/parachain/nomination.ts:319
▸ listAllNominations(): Promise
<RawNomination
[]>
Promise
<RawNomination
[]>
src/parachain/nomination.ts:253
▸ listNominatorRewards(): Promise
<NominationData
[]>
Promise
<NominationData
[]>
The rewards a nominator has accumulated, in wrapped token (e.g. interBTC, kBTC)
NominationAPI.listNominatorRewards
src/parachain/nomination.ts:285
▸ listVaults(): Promise
<InterbtcPrimitivesVaultId
[]>
Promise
<InterbtcPrimitivesVaultId
[]>
A list of all vaults that opted in to the nomination feature.
src/parachain/nomination.ts:420
▸ optIn(collateralCurrency
): ExtrinsicData
Name | Type | Description |
---|---|---|
collateralCurrency |
CollateralCurrencyExt |
Currency to accept as nomination |
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
src/parachain/nomination.ts:218
▸ optOut(collateralCurrency
): ExtrinsicData
Name | Type | Description |
---|---|---|
collateralCurrency |
CollateralCurrencyExt |
Currency to stop accepting as nomination |
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
src/parachain/nomination.ts:224
▸ setNominationEnabled(enabled
): ExtrinsicData
Name | Type |
---|---|
enabled |
boolean |
A submittable extrinsic and an event that is emitted when extrinsic is submitted.
Remarks
Testnet utility function
NominationAPI.setNominationEnabled
src/parachain/nomination.ts:230
▸ withdrawCollateral(vaultAccountId
, amount
, nonce?
): Promise
<ExtrinsicData
>
Name | Type | Description |
---|---|---|
vaultAccountId |
AccountId |
Vault that collateral was nominated to |
amount |
MonetaryAmount <CollateralCurrencyExt > |
Amount to withdraw, as a Monetary.js object or ForeignAsset |
nonce? |
number |
- |
Promise
<ExtrinsicData
>
A submittable extrinsic and an event that is emitted when extrinsic is submitted.
NominationAPI.withdrawCollateral
src/parachain/nomination.ts:202
▸ buildDepositCollateralExtrinsic(api
, vaultAccountId
, amount
, wrappedCurrency
): SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
Name | Type |
---|---|
api |
ApiPromise |
vaultAccountId |
AccountId |
amount |
MonetaryAmount <CollateralCurrencyExt > |
wrappedCurrency |
Currency |
SubmittableExtrinsic
<"promise"
, ISubmittableResult
>
src/parachain/nomination.ts:152
▸ buildWithdrawAllCollateralExtrinsic(api
, rewardsAPI
, vaultAccountId
, collateralCurrency
, wrappedCurrency
, nonce?
): Promise
<SubmittableExtrinsic
<"promise"
, ISubmittableResult
>>
Name | Type |
---|---|
api |
ApiPromise |
rewardsAPI |
RewardsAPI |
vaultAccountId |
AccountId |
collateralCurrency |
Currency |
wrappedCurrency |
Currency |
nonce? |
number |
Promise
<SubmittableExtrinsic
<"promise"
, ISubmittableResult
>>
src/parachain/nomination.ts:188
▸ buildWithdrawCollateralExtrinsic(api
, rewardsAPI
, vaultAccountId
, amount
, wrappedCurrency
, nonce?
): Promise
<SubmittableExtrinsic
<"promise"
, ISubmittableResult
>>
Name | Type |
---|---|
api |
ApiPromise |
rewardsAPI |
RewardsAPI |
vaultAccountId |
AccountId |
amount |
MonetaryAmount <CollateralCurrencyExt > |
wrappedCurrency |
Currency |
nonce? |
number |
Promise
<SubmittableExtrinsic
<"promise"
, ISubmittableResult
>>