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
storeEncryptedBackupByWallet(params: {
accountAddress: string;
externalServerKeyShares: any[];
password: string;
}): Promise<string[]>
Description
Stores encrypted backup for a wallet using external server key shares. This function creates encrypted backups that can be used for wallet recovery.
Parameters
Required Parameters
accountAddress (string) - The wallet address to store backup for (must include 0x prefix)
externalServerKeyShares (any[]) - Array of external server key shares
password (string) - Password for encrypting the backup
Returns
Promise<string[]> - Array of backup IDs
Example
import { authenticatedEvmClient } from './client';
const evmClient = await authenticatedEvmClient();
const backupIds = await evmClient.storeEncryptedBackupByWallet({
accountAddress: '0xYourWalletAddress',
externalServerKeyShares: [
{
chainName: 'base-sepolia',
keyShare: '0x1234567890',
},
],
password: 'your-backup-password',
});
console.log('Backup IDs:', backupIds);
interface KeyShare {
chainName: string;
keyShare: string;
}
const externalServerKeyShares: KeyShare[] = [
{
chainName: 'base-sepolia', // or your specific chain
keyShare: '0x1234567890', // the actual key share
},
];
Error Handling
try {
const backupIds = await evmClient.storeEncryptedBackupByWallet({
accountAddress: '0xYourWalletAddress',
externalServerKeyShares,
password: 'your-backup-password',
});
console.log('Encrypted backup stored successfully');
} catch (error) {
console.error('Failed to store encrypted backup:', error);
}