Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt

Use this file to discover all available pages before exploring further.

Function Signature

isPasswordEncrypted(params: {
  accountAddress: string;
  walletMetadata: WalletMetadata;
  backupInfo?: KeyShareBackupInfo;
}): Promise<boolean>

Description

Checks whether a wallet’s backup is password-encrypted. This is read off the walletMetadata.externalServerKeySharesBackupInfo.passwordEncrypted flag.

Parameters

Required Parameters

  • accountAddress (string) - The wallet address (must include 0x prefix). Must match walletMetadata.accountAddress.
  • walletMetadata (WalletMetadata) - The cached metadata for this wallet

Optional Parameters

  • backupInfo (KeyShareBackupInfo) - Pre-resolved backup info; if omitted the SDK reads it from walletMetadata.

Returns

  • Promise<boolean> - true if the wallet’s backup is password-encrypted, false otherwise

Example

import { authenticatedEvmClient } from './client';

const evmClient = await authenticatedEvmClient();
const walletMetadata = JSON.parse(await redis.get(`wallet:${accountAddress}`));

const isEncrypted = await evmClient.isPasswordEncrypted({
  accountAddress,
  walletMetadata,
});

console.log('Is password encrypted:', isEncrypted);