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

19 lines 758 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findProofAndAmount = exports.EMPTY_PROOF = void 0; const find_index_and_leaf_js_1 = require("../common/utils/find-index-and-leaf.js"); exports.EMPTY_PROOF = { proof: [], shares: 0n }; const findProofAndAmount = (tree, nodeOperatorId) => { if (!tree) return exports.EMPTY_PROOF; const [index, leaf] = (0, find_index_and_leaf_js_1.findIndexAndLeaf)(tree, (leaf) => leaf[0] === nodeOperatorId); if (index !== undefined && leaf) { return { proof: tree.getProof(index), shares: leaf[1], }; } return exports.EMPTY_PROOF; }; exports.findProofAndAmount = findProofAndAmount; //# sourceMappingURL=find-proof.js.map