get https://api.northstake.dk/v1/validators/withdrawals
Retrieves a paginated list of validator withdrawals. 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 = {
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.validators.getValidatorWithdrawals(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}
Amount: ${withdrawal.amount}
`)
}