Function Signature

createWalletAccount(params: {
  thresholdSignatureScheme: ThresholdSignatureScheme;
  password?: string;
}): Promise<{
  accountAddress: string;
  rawPublicKey: string;
  publicKeyHex: string;
  externalServerKeyShares: any[];
  walletId: string;
}>

Description

Creates a new EVM wallet account with the specified threshold signature scheme. Returns wallet information including the account address, public keys, and external server key shares.

Parameters

Required Parameters

  • thresholdSignatureScheme (ThresholdSignatureScheme) - The threshold signature scheme for the wallet

Optional Parameters

  • password (string) - Wallet password for additional security

Returns

  • Promise<object> - Object containing wallet information:
    • accountAddress - The wallet’s account address
    • rawPublicKey - Raw public key
    • publicKeyHex - Public key in hex format
    • externalServerKeyShares - Array of external server key shares
    • walletId - Unique wallet identifier

Example

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

const evmClient = await authenticatedEvmClient();

const wallet = await evmClient.createWalletAccount({
  thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  password: 'optional-password',
});

console.log('Wallet created:', wallet.accountAddress);

Error Handling

try {
  const wallet = await evmClient.createWalletAccount({
    thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  });
  console.log('Wallet created successfully');
} catch (error) {
  console.error('Failed to create wallet:', error);
}