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
Attribute | Description |
---|---|
stakeCollectionId | Your collection Id given by anvil |
assets | The array of assets for estimation |
seconds | The 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
Attribute | Description |
---|---|
string | Transaction id |