Skip to main content

Stake assets

Initiate a stake for one or multiple assets.

Parameter

AttributeDescription
stakeCollectionIdYour collection Id given by anvil
assetsThe array of assets for estimation
secondsThe period of time for which the assets are locked
utxosArray of utxos
changeAddressWallet change address

Usage example

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

try {
await anvil.staking.stakeAssets({
stakeCollectionId: YOUR_COLLECTION_ID,
assets: [{ unit: ASSET_UNIT, quantity: 1 }],
seconds: TIME_TO_LOCK,
utxos: [UTXOS],
changeAddress: WALLET_ADDRESS,
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Return informations

AttributeDescription
stringTransaction