@exromany/lido-csm-sdk
Version:
[](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [](h
15 lines • 530 B
JavaScript
import { findIndexAndLeaf } from '../common/utils/find-index-and-leaf.js';
export const EMPTY_PROOF = { proof: [], shares: 0n };
export const findProofAndAmount = (tree, nodeOperatorId) => {
if (!tree)
return EMPTY_PROOF;
const [index, leaf] = findIndexAndLeaf(tree, (leaf) => leaf[0] === nodeOperatorId);
if (index !== undefined && leaf) {
return {
proof: tree.getProof(index),
shares: leaf[1],
};
}
return EMPTY_PROOF;
};
//# sourceMappingURL=find-proof.js.map