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

13 lines 625 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertEthToShares = exports.convertSharesToEth = void 0; const PRECISION = 10n ** 27n; const convertSharesToEth = (shares, { totalPooledEther, totalShares }) => { return (shares * totalPooledEther * PRECISION) / (totalShares * PRECISION); }; exports.convertSharesToEth = convertSharesToEth; const convertEthToShares = (eth, { totalPooledEther, totalShares }) => { return (eth * totalShares * PRECISION) / (totalPooledEther * PRECISION); }; exports.convertEthToShares = convertEthToShares; //# sourceMappingURL=convert-shares.js.map