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

10 lines 481 B
import { isHex, size, slice } from 'viem'; import { PUBKEY_LENGTH_BYTES } from '../constants/keys.js'; export const splitKeys = (value, _count, bytesLength = PUBKEY_LENGTH_BYTES) => { if (!isHex(value)) { throw new Error('is not a hex-like string'); } const count = _count ?? Math.ceil(size(value) / bytesLength); return Array.from({ length: count }, (_, i) => slice(value, i * bytesLength, (i + 1) * bytesLength)); }; //# sourceMappingURL=split-keys.js.map