v0.0.18
This release introduces some significant SDK changes, including a few breaking changes. Please review the notes below and update your code accordingly.
Breaking Changes
SSVKeys, KeyShares
-
Removed multi-version support.
Old version:
const ssvKeys = new SSVKeys(SSVKeys.VERSION.V3);
New format:
import { SSVKeys, KeyShares } from 'ssv-keys'; const ssvKeys = new SSVKeys(); const keyShares = new KeyShares();
-
Replaced
operatorIds
andoperatorKeys
with a single array of objects:const operators = [{ id, publicKey },...];
-
Replaced
getPrivateKeyFromKeystoreData
method byextractKeys
which returns validator privateKey and publicKey.const { privateKey, publicKey } = await ssvKeys.extractKeys(keystore, keystorePassword);
-
Replaced
ssvKeys.keyShares.setData
tokeyShares.update
Old version:
await ssvKeys.keyShares.setData({ operators });
New format:
const keyShares = new KeyShares(); keyShares.update({ operators, publicKey });
-
Changed
buildShares
function params:Old version:
const encryptedShares = await ssvKeys.buildShares(privateKey, operatorIds, operators);
New format:
const encryptedShares = await ssvKeys.buildShares(privateKey, operators);
-
Changed
buildPayload
interface and params:Old version:
const payload = await ssvKeys.buildPayload({ publicKey, operatorIds, encryptedShares });
New format:
const payload = keyShares.buildPayload({ publicKey, operators, encryptedShares });
-
Added
buildSharesFromBytes
to extract shares from a single string:const shares = keyShares.buildSharesFromBytes(payload.shares, operators.length);