@exromany/lido-csm-sdk
Version:
[](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [](h
13 lines • 625 B
JavaScript
;
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