Skip to content

v0.0.18

Compare
Choose a tag to compare
@meshin-dev meshin-dev released this 18 May 14:30
· 92 commits to main since this release
2fbaedf

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 and operatorKeys with a single array of objects:

    const operators = [{ id, publicKey },...];
    
  • Replaced getPrivateKeyFromKeystoreData method by extractKeys which returns validator privateKey and publicKey.

    const { privateKey, publicKey } = await ssvKeys.extractKeys(keystore, keystorePassword);
    
  • Replaced ssvKeys.keyShares.setData to keyShares.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);