Function Signature

reshare(params: {
  chainName: string;
  accountAddress: string;
  oldThresholdSignatureScheme: ThresholdSignatureScheme;
  newThresholdSignatureScheme: ThresholdSignatureScheme;
  password: string;
}): Promise<any[]>

Description

Reshares wallet with a new threshold signature scheme. This function allows you to change the security model of a wallet by redistributing key shares according to a new threshold scheme.

Parameters

Required Parameters

  • chainName (string) - The chain name (e.g., ‘solana’)
  • accountAddress (string) - The wallet address to reshare
  • oldThresholdSignatureScheme (ThresholdSignatureScheme) - The current threshold signature scheme
  • newThresholdSignatureScheme (ThresholdSignatureScheme) - The new threshold signature scheme
  • password (string) - Wallet password for security

Returns

  • Promise<any[]> - Array of new key shares

Example

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

const svmClient = await authenticatedSvmClient();

const newShares = await svmClient.reshare({
  chainName: 'solana',
  accountAddress: 'YourSolanaWalletAddress',
  oldThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  newThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
  password: 'your-password'
});

console.log('New shares:', newShares);

Available Threshold Signature Schemes

  • TWO_OF_TWO - Requires both server and Dynamic’s infrastructure to sign
  • TWO_OF_THREE - Requires 2 out of 3 shares to sign
  • THREE_OF_FIVE - Requires 3 out of 5 shares to sign

Error Handling

try {
  const newShares = await svmClient.reshare({
    chainName: 'solana',
    accountAddress: 'YourSolanaWalletAddress',
    oldThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
    newThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
    password: 'your-password'
  });
  console.log('Wallet reshared successfully');
} catch (error) {
  console.error('Failed to reshare wallet:', error);
}