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

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

Description

Checks whether a specific wallet operation requires a password. Useful for branching UI before prompting the user.

Parameters

Required Parameters

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

Optional Parameters

  • walletOperation (WalletOperation) - The wallet operation to check
  • backupInfo (KeyShareBackupInfo) - Pre-resolved backup info

Returns

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

Example

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

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

const requiresPassword = await svmClient.requiresPasswordForOperation({
  accountAddress,
  walletMetadata,
  walletOperation: WalletOperation.SIGN_MESSAGE,
});