Function Signature

requiresPasswordForOperation(params: {
  accountAddress: string;
  walletOperation: WalletOperation;
}): Promise<boolean>

Description

Checks whether a specific wallet operation requires a password for the given wallet address. This is useful for determining if password verification is needed before performing operations.

Parameters

Required Parameters

  • accountAddress (string) - The wallet address to check (must include 0x prefix)
  • walletOperation (WalletOperation) - The wallet operation to check

Returns

  • Promise<boolean> - true if password is required, false otherwise

Example

import { authenticatedEvmClient } from './client';
import { WalletOperation } from '@dynamic-labs-wallet/node';

const evmClient = await authenticatedEvmClient();

const requiresPassword = await evmClient.requiresPasswordForOperation({
  accountAddress: '0xYourWalletAddress',
  walletOperation: WalletOperation.SIGN_MESSAGE,
});

console.log('Requires password for signing:', requiresPassword);

Available Wallet Operations

  • SIGN_MESSAGE - Message signing operations
  • SIGN_TRANSACTION - Transaction signing operations
  • EXPORT_PRIVATE_KEY - Private key export operations

Error Handling

try {
  const requiresPassword = await evmClient.requiresPasswordForOperation({
    accountAddress: '0xYourWalletAddress',
    walletOperation: WalletOperation.SIGN_MESSAGE,
  });
  console.log('Password requirement checked');
} catch (error) {
  console.error('Failed to check password requirement:', error);
}