Function Signature

verifyMessageSignature(params: {
  accountAddress: string;
  message: string;
  signature: string;
}): Promise<boolean>

Description

Verifies that a message was signed by the specified Solana wallet address. Performs message recovery and address comparison to validate the signature.

Parameters

Required Parameters

  • accountAddress (string) - The wallet address that signed the message
  • message (string) - The original message that was signed
  • signature (string) - The signature to verify

Returns

  • Promise<boolean> - true if the signature is valid, false otherwise

Example

import { authenticatedSvmClient } from './client';

const svmClient = await authenticatedSvmClient();

const isValid = await svmClient.verifyMessageSignature({
  accountAddress: 'YourSolanaWalletAddress',
  message: 'Hello, World!',
  signature: 'example-signature',
});

console.log('Signature valid:', isValid);

Error Handling

try {
  const isValid = await svmClient.verifyMessageSignature({
    accountAddress: 'YourSolanaWalletAddress',
    message: 'Hello, World!',
    signature: 'YourSignature',
  });
  console.log('Verification result:', isValid);
} catch (error) {
  console.error('Failed to verify signature:', error);
}