4. Unstaking
Table of Contents
Overview
Determining Unstaking Limits
const staker = new EthereumStaker({ network: 'hoodi' })
await staker.init()
const { maxUnstake } = await staker.getStake({
delegatorAddress: userAddress,
validatorAddress
})
console.log(maxUnstake) // '1' - 1 ETH
if (amountToUnstake > maxUnstake) {
// The user is trying to unstake more than they can
throw new Error('Unstaking amount exceeds the limit')
}Sending the Unstake Transaction
Fetching the Unstake Queue
Preparing the Withdrawal Transaction
Sending the Withdrawal Transaction
Next Steps
Last updated
Was this helpful?