Function Signature

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

Description

Reshares a wallet with a new threshold signature scheme. This function allows changing the threshold configuration of an existing wallet, such as from 2-of-2 to 2-of-3.

Parameters

Required Parameters

  • chainName (string) - The name of the blockchain chain (e.g., ‘base-sepolia’)
  • accountAddress (string) - The wallet address to reshare (must include 0x prefix)
  • oldThresholdSignatureScheme (ThresholdSignatureScheme) - The current threshold signature scheme
  • newThresholdSignatureScheme (ThresholdSignatureScheme) - The new threshold signature scheme
  • password (string) - Wallet password for authentication

Returns

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

Example

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

const evmClient = await authenticatedEvmClient();

const newShares = await evmClient.reshare({
  chainName: 'base-sepolia',
  accountAddress: '0xYourWalletAddress',
  oldThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  newThresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
  password: 'your-wallet-password',
});

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

Available Threshold Schemes

  • TWO_OF_TWO - Requires both shares to sign
  • TWO_OF_THREE - Requires any two of three shares to sign
  • THREE_OF_FIVE - Requires any three of five shares to sign

Error Handling

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