Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SSVKeys

Hierarchy

  • SSVKeys

Index

Constructors

Properties

web3: default = ...
OPERATOR_FORMAT_BASE64: string = 'base64'

Methods

  • abiEncode(encryptedShares: EncryptShare[], field: string): string[]
  • Encode with Web3 eth abi method any fields of shares array required for transaction.

    Parameters

    • encryptedShares: EncryptShare[]
    • field: string

    Returns string[]

  • buildPayload(privateKey: string, encryptedShares: EncryptShare[]): Promise<any[]>
  • Having keystore private key build final transaction payload for list of operators.

    Example:

    const privateKey = await ssvKeys.getPrivateKeyFromKeystoreFile(keystoreFilePath, keystorePassword); const encryptedShares = await ssvKeys.encryptShares(operatorsPublicKeys, shares); await ssvKeys.buildPayload(privateKey, encryptedShares)

    Parameters

    • privateKey: string
    • encryptedShares: EncryptShare[]

    Returns Promise<any[]>

  • createThreshold(privateKey: string): Promise<ISharesKeyPairs>
  • Build threshold using private key for number of participants and failed participants. TODO: make it possible to choose how many fails can be in threshold

    Parameters

    • privateKey: string

    Returns Promise<ISharesKeyPairs>

  • encryptShares(operatorsPublicKeys: string[], shares: IShares[], operatorFormat?: string): Promise<EncryptShare[]>
  • Encrypt operators shares using operators public keys.

    Parameters

    • operatorsPublicKeys: string[]
    • shares: IShares[]
    • operatorFormat: string = SSVKeys.OPERATOR_FORMAT_BASE64

    Returns Promise<EncryptShare[]>

  • getPrivateKeyFromKeystoreData(data: string, password: string): Promise<string>
  • Extract private key from keystore data using keystore password. Generally can be used in browsers when the keystore data has been provided by browser.

    Parameters

    • data: string
    • password: string

    Returns Promise<string>

Generated using TypeDoc