@exromany/lido-csm-sdk
Version:
[](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [](h
18 lines • 506 B
JavaScript
export const filterBatches = (allBatches) => {
const result = [];
let nextIndex = 0n;
for (const batch of allBatches) {
if (!nextIndex || nextIndex >= batch.batchIndex) {
result.push(transformBatch(batch));
nextIndex = batch.nextBatchIndex;
}
}
return result;
};
const transformBatch = (batch) => {
return {
nodeOperatorId: batch.nodeOperatorId,
keysCount: batch.keysCount,
};
};
//# sourceMappingURL=filter-batches.js.map