Skip to main content
Use executeStake to deposit tokens into a staking pool.

Usage

import { executeStake } from '@avnu/avnu-sdk';
import { parseUnits } from 'ethers';

const result = await executeStake({
  provider: account, // Starknet Account
  poolAddress: '0x0362dc7da60bfddc8e3146028dfd94941c6e22403c98b5947104e637543b475d', // avnu $STRK delegation pool
  amount: parseUnits('100', 18), // Amount to stake (in wei)
});

console.log('Transaction Hash:', result.transactionHash);

Parameters

provider
AccountInterface
required
The Starknet account executing the transaction.
poolAddress
string
required
The address of the staking pool contract.
amount
bigint
required
The amount of tokens to stake (in smallest unit, e.g., wei).
paymaster
object
Optional paymaster configuration for gasless staking.