getBurnAmountForUnstake
Description:
Returns the amount of osToken that must be burned to unstake. Omit assets for a full exit (all underlying tokens); pass a target assets to burn only what that withdrawal needs — it returns 0n when the amount is already within the max withdraw.
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| vaultAddress | string | Yes | The address of the vault |
| userAddress | string | Yes | The user address |
| assets | bigint | No | Target withdrawal amount, omit for a full exit |
Returns:
type Output = bigint
Example:
sdk.osToken.getBurnAmountForUnstake({
userAddress: '0x...',
vaultAddress: '0x...',
})