Stakes
Retrieve the stakes associated with the wallet.
Connect a wallet
To utilize those functions, it is necessary to connect a wallet beforehand.
Parameter
Attribute | Description |
---|---|
stakeCollectionId | Your 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.
Attribute | Description |
---|---|
id | Unique internal stake identifier |
stakeCollectionId | Identifier for the associated stake collection |
transactionId | Unique internal transaction identifier |
keyhash | Owner's keyhash |
address | The stake script address |
policyScript | The policy script associated with the script address |
startAt | Timestamp when the stake commenced |
endAt | Timestamp when the stake concluded |
status | Current status of the stake |
claimed | Indicates whether the stake has been claimed |
deleted | Indicates whether the stake has been deleted |
claimId | Identifier for the claim, if the stake has been claimed |
assets | List of assets staked |
harvest | Details of the last harvest |
result | Current stake result |
result.total | Array of rewards grouped by unit |
result.breakdown | Breakdown of rewards generated for each unit |
result.mint | Array of minted assets resulting from the stake |