keystore: {
    decrypt: ((keystore: Keystore, password: string) => Promise<KeystoreAccount>);
    encrypt: ((privateKey: Uint8Array, password: string) => Promise<Keystore>);
    isValid: ((keystore: Keystore) => boolean);
    useExperimentalCryptography: ((experimentalCryptography: boolean) => void);
} = ...

Exports the keystore functions for encryption, decryption, and validation.

Type declaration

  • decrypt: ((keystore: Keystore, password: string) => Promise<KeystoreAccount>)
      • (keystore, password): Promise<KeystoreAccount>
      • Decrypts a keystore to obtain the private key using the given password.

        Parameters

        • keystore: Keystore

          The keystore containing the encrypted private key.

        • password: string

          The password used to decrypt the keystore.

        Returns Promise<KeystoreAccount>

        A Promise that resolves to the decrypted KeystoreAccount or rejects if the keystore or password is invalid.

  • encrypt: ((privateKey: Uint8Array, password: string) => Promise<Keystore>)
      • (privateKey, password): Promise<Keystore>
      • Encrypts a given private key into a keystore format using the specified password.

        Parameters

        • privateKey: Uint8Array

          The private key to be encrypted.

        • password: string

          The password used for the encryption.

        Returns Promise<Keystore>

        A Promise that resolves to the encrypted keystore.

  • isValid: ((keystore: Keystore) => boolean)
      • (keystore): boolean
      • Validates if the provided keystore adheres to the expected format and structure.

        Parameters

        • keystore: Keystore

          The keystore to be validated.

        Returns boolean

        A boolean indicating whether the keystore is valid or not.

  • useExperimentalCryptography: ((experimentalCryptography: boolean) => void)
      • (experimentalCryptography): void
      • Sets the keystore cryptography to experimental mode.

        Parameters

        • experimentalCryptography: boolean

          A boolean indicating whether the keystore cryptography is experimental or not.

        Returns void