Function Signature

decryptKeyShare(params: {
  keyShare: string;
  password: string;
}): Promise<any>

Description

Decrypts an encrypted key share using the provided password. This function is used to recover key shares that were previously encrypted.

Parameters

Required Parameters

  • keyShare (string) - The encrypted key share string
  • password (string) - Password for decrypting the key share

Returns

  • Promise<any> - The decrypted key share object

Example

import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();

const decryptedShare = await evmClient.decryptKeyShare({
  keyShare: 'encrypted-key-share-string',
  password: 'your-encryption-password',
});

console.log('Decrypted share:', decryptedShare);

Error Handling

try {
  const decryptedShare = await evmClient.decryptKeyShare({
    keyShare: 'encrypted-key-share-string',
    password: 'your-encryption-password',
  });
  console.log('Key share decrypted successfully');
} catch (error) {
  console.error('Failed to decrypt key share:', error);
}