Skip to main content

Stake assets

Initiate a stake for one or multiple assets.

Connect a wallet

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

Parameter

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

Usage example

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

try {
await anvil.wallet.connect("eternl");
await anvil.staking.stakeAssets({
stakeCollectionId: YOUR_COLLECTION_ID,
assets: [{ unit: THE_ASSET_UNIT, quantity: 1 }],
seconds: TIME_TO_LOCK,
});
} catch {
console.log("YOUR ERROR HANDLING");
}

Return informations

AttributeDescription
stringTransaction id