Function Signature

storeEncryptedBackupByWalletWithRetry(params: {
  accountAddress: string;
  externalServerKeyShares: any[];
  password: string;
}): Promise<void>

Description

Stores encrypted backup with automatic retry logic. This function attempts to store encrypted backup multiple times if the initial attempt fails, providing better reliability for backup operations.

Parameters

Required Parameters

  • accountAddress (string) - The wallet address to backup
  • externalServerKeyShares (any[]) - Array of external server key shares
  • password (string) - Wallet password for encryption

Returns

  • Promise<void> - Resolves when backup is stored successfully

Example

import { authenticatedSvmClient } from './client';

const svmClient = await authenticatedSvmClient();

await svmClient.storeEncryptedBackupByWalletWithRetry({
  accountAddress: 'YourSolanaWalletAddress',
  externalServerKeyShares: [
    {
      chainName: 'solana',
      keyShare: '0xYourKeyShare',
    },
  ],
  password: 'your-password'
});

console.log('Encrypted backup stored with retry');

Error Handling

try {
  await svmClient.storeEncryptedBackupByWalletWithRetry({
    accountAddress: 'YourSolanaWalletAddress',
    externalServerKeyShares,
    password: 'your-password'
  });
  console.log('Encrypted backup stored with retry successfully');
} catch (error) {
  console.error('Failed to store encrypted backup with retry:', error);
}