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

14 lines 525 B
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