Skip to main content

claimExitQueue

Description:

Withdraws exited assets from the queue.

Arguments:

NameTypeRequiredDescription
positionsstringYespostions from sdk.vault.getExitQueuePositions
userAddressstringYesThe user address
vaultAddressstringYesThe address of the vault

Example:

const exitQueue = await sdk.vault.getExitQueuePositions({
vaultAddress: '0x...',
userAddress: '0x...',
})

if (!exitQueue.withdrawable) {
// The exit queue has not yet accumulated funds for withdrawal
return
}

if (!exitQueue.data.length) {
// No withdrawal positions
return
}

const params = {
positions: exitQueue.data,
vaultAddress: '0x...',
userAddress: '0x...',
}

// Send transaction
const hash = await sdk.vault.claimExitQueue(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.vault.claimExitQueue.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.vault.claimExitQueue.estimateGas(params)