Skip to main content

Submit Stake

Submit a stake to start earning rewards or claim your staked assets.

Parameter

AttributeDescription
contextMust be "STAKING" or "HARVESTING"
mainnetA boolean to use mainnet
signatureEnd User Signature
stakeIdThe stake identifier to submit
transactionThe transaction to submit

Usage example

Stake Assets

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

try {
await anvil.staking.submitStake({
context: "STAKING",
mainnet: true,
signature: SIGNATURE,
stakeId: STAKE_ID,
transaction: TRANSACTION,
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Claim Assets

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

try {
await anvil.staking.submitStake({
context: "HARVESTING",
mainnet: true,
signature: SIGNATURE,
stakeId: STAKE_ID,
transaction: TRANSACTION,
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Return informations

AttributeDescription
stringTransaction hash