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