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 636 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.splitKeys = void 0; const viem_1 = require("viem"); const keys_js_1 = require("../constants/keys.js"); const splitKeys = (value, _count, bytesLength = keys_js_1.PUBKEY_LENGTH_BYTES) => { if (!(0, viem_1.isHex)(value)) { throw new Error('is not a hex-like string'); } const count = _count ?? Math.ceil((0, viem_1.size)(value) / bytesLength); return Array.from({ length: count }, (_, i) => (0, viem_1.slice)(value, i * bytesLength, (i + 1) * bytesLength)); }; exports.splitKeys = splitKeys; //# sourceMappingURL=split-keys.js.map