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

verifyPassword(params: {
  accountAddress: string;
  walletMetadata: WalletMetadata;
  password?: string;
}): Promise<void>

Description

Verifies that the supplied password correctly decrypts the wallet’s backup. Throws if the password is wrong or the cached metadata is stale.

Parameters

Required Parameters

  • accountAddress (string) - The wallet address. Must match walletMetadata.accountAddress.
  • walletMetadata (WalletMetadata) - The cached metadata for this wallet. Must include externalServerKeySharesBackupInfo.

Optional Parameters

  • password (string) - The password to verify.

Returns

  • Promise<void> - Resolves if the password is correct (or no password was needed).

Example

import { authenticatedSvmClient } from './client';

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

await svmClient.verifyPassword({
  accountAddress,
  walletMetadata,
  password: 'user-password',
});