UNPKG

@exromany/lido-csm-sdk

Version:

[![GitHub license](https://img.shields.io/github/license/lidofinance/lido-csm-sdk?color=limegreen)](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [![Version npm](https://img.shields.io/npm/v/@lidofinance/lido-csm-sdk?label=version)](h

15 lines 530 B
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