Stake assets
Initiate a stake for one or multiple assets.
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 |
utxos | Array of utxos |
changeAddress | Wallet 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
Attribute | Description |
---|---|
string | Transaction |