Function Signature
Description
Verifies that the suppliedpassword correctly decrypts the wallet’s backup. Throws if the password is wrong or the cached metadata is stale (couldn’t recover a share to verify against).
If the wallet does not require a password for the current operation, the call returns silently without verifying.
Parameters
Required Parameters
accountAddress(string) - The wallet address (must include0xprefix). Must matchwalletMetadata.accountAddress.walletMetadata(WalletMetadata) - The cached metadata for this wallet. Must includeexternalServerKeySharesBackupInfo.
Optional Parameters
password(string) - The password to verify. If the wallet is password-encrypted and no password is provided, throws"Password is required for operation but not provided".
Returns
Promise<void>- Resolves if the password is correct (or no password was needed). Throws otherwise.
Example
Error Handling
The error message distinguishes wrong-password from stale-metadata to help diagnose:Related
WalletMetadata- The metadata object passed to every operationrequiresPasswordForOperation()- Check whether a password is requiredupdatePassword()- Rotate the wallet’s password