get https://api.northstake.dk/v1/managedUsers//validators/withdrawals
Retrieves a paginated list of validator withdrawals for a specific managed user. The endpoint supports filtering by start and end date, page number, and limit. Additionally, it allows filtering by validator indices.
import { NorthstakeApi } from '@northstake/northstakeapi'
const api = new NorthstakeApi('apiKey', 'privateKey')
// Optional query parameters
const params = {
userId: '1234', //required
start_date: '2024-01-01', // Optional: Filter by start date
end_date: '2024-03-20', // Optional: Filter by end date
page: 1, // Optional: Default is 1
limit: 10, // Optional: Default is 100
validator_indices: '123,456,789', // Optional: Comma-separated validator indices
}
const { body } = await api.managedUsersValidators.getValidatorWithdrawalsForUser(params)
console.log(`Total withdrawals: ${body.total}`)
console.log(`Current page: ${body.currentPage} of ${body.pages}`)
for (const withdrawal of body.withdrawals) {
console.log(`
Asset: ${withdrawal.asset}
Validator Index: ${withdrawal.validator_index}
Public Key: ${withdrawal.validator_public_key}
Withdrawal Time: ${withdrawal.withdrawal_time}
Withdrawal Address: ${withdrawal.withdrawal_address}
Epoch: ${withdrawal.epoch}
Slot: ${withdrawal.slot}
Withdrawal Index: ${withdrawal.withdrawal_index}
`)
}