Skip to main content

Stakes

Retrieve the stakes associated with the wallet.

Connect a wallet

To utilize those functions, it is necessary to connect a wallet beforehand.

Parameter

AttributeDescription
stakeCollectionIdYour collection Id given by anvil

Usage example

import { anvil } from "@ada-anvil/sdk-client";

try {
await anvil.wallet.connect("eternl");
await anvil.staking.getStakes({ stakeCollectionId: YOUR_COLLECTION_ID });
} catch {
console.log("YOUR ERROR HANDLING");
}

Return informations

Caution

The total sum of breakdowns may not match the total amount due to the presence of bonuses that are not tied to individual assets but rather depend on combinations or patterns.

AttributeDescription
idUnique internal stake identifier
stakeCollectionIdIdentifier for the associated stake collection
transactionIdUnique internal transaction identifier
keyhashOwner's keyhash
addressThe stake script address
policyScriptThe policy script associated with the script address
startAtTimestamp when the stake commenced
endAtTimestamp when the stake concluded
statusCurrent status of the stake
claimedIndicates whether the stake has been claimed
deletedIndicates whether the stake has been deleted
claimIdIdentifier for the claim, if the stake has been claimed
assetsList of assets staked
harvestDetails of the last harvest
resultCurrent stake result
result.totalArray of rewards grouped by unit
result.breakdownBreakdown of rewards generated for each unit
result.mintArray of minted assets resulting from the stake