Node
Learn how to sign messages using Dynamic’s Node SDK for SVM chains
import { authenticatedSvmClient } from './client'; const svmClient = await authenticatedSvmClient(); const signature = await svmClient.signMessage({ message: 'Hello, World!', accountAddress: 'YourSolanaWalletAddress', externalServerKeyShares: [ { chainName: 'solana', keyShare: '0xYourKeyShare', }, ], password: 'your-password', // optional }); console.log('Message signed:', signature);
const nonce = Date.now().toString(); const message = `Sign this message to authenticate: ${nonce}`; const signature = await svmClient.signMessage({ message, accountAddress: 'YourSolanaWalletAddress', externalServerKeyShares, });
const data = { userId: 123, action: 'transfer', amount: '100' }; const message = JSON.stringify(data); const signature = await svmClient.signMessage({ message, accountAddress: 'YourSolanaWalletAddress', externalServerKeyShares });
Was this page helpful?