> ## 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.

# createWalletAccount

> Creates a new SVM wallet account with the specified threshold signature scheme

## Function Signature

```typescript theme={"system"}
createWalletAccount(params: {
  thresholdSignatureScheme: ThresholdSignatureScheme;
  password?: string;
  onError?: (error: Error) => void;
  backUpToDynamic?: boolean;
}): Promise<{
  walletMetadata: WalletMetadata;
  rawPublicKey: string;
  externalServerKeyShares: ServerKeyShare[];
  externalKeySharesWithBackupStatus: Array<{
    share: ServerKeyShare;
    backedUpToClientKeyShareService: boolean;
  }>;
}>
```

## Description

Creates a new SVM wallet account with the specified threshold signature scheme. Returns a [`walletMetadata`](/node/reference/types/wallet-metadata) object alongside the sensitive `externalServerKeyShares`. **Persist both** — `walletMetadata` in your cache and `externalServerKeyShares` in a secrets vault. The SDK is stateless and you must pass `walletMetadata` to every subsequent operation.

## Parameters

### Required Parameters

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

### Optional Parameters

* **`password`** (`string`) - Password to protect the wallet's key shares. **Required when `backUpToDynamic` is `true`.**
* **`onError`** (`(error: Error) => void`) - Error callback function for handling creation errors
* **`backUpToDynamic`** (`boolean`) - Whether to back up the first key share to Dynamic (defaults to false). **When `true`, a `password` must be provided.**

## Returns

* **`Promise<object>`** - Object containing wallet information:
  * `walletMetadata` ([`WalletMetadata`](/node/reference/types/wallet-metadata)) - Non-sensitive identity + backup-pointer metadata. The wallet's address is at `walletMetadata.accountAddress`. Persist this in your cache.
  * `rawPublicKey` - Raw public key
  * `externalServerKeyShares` ([`ServerKeyShare[]`](/node/reference/types/server-key-share)) - Sensitive plaintext shares for MPC operations. Store these in a secrets vault.
  * `externalKeySharesWithBackupStatus` - Array of key shares with their backup status. Each entry contains:
    * `share` - The key share (`ServerKeyShare`)
    * `backedUpToClientKeyShareService` - Whether this share was backed up to Dynamic's client share service

## Example

```typescript theme={"system"}
import { authenticatedSvmClient } from './client';
import { ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';

const svmClient = await authenticatedSvmClient();

const { walletMetadata, externalServerKeyShares, externalKeySharesWithBackupStatus } =
  await svmClient.createWalletAccount({
    thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
    password: 'your-password',
    backUpToDynamic: true,
  });

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

// Persist the metadata in your cache and the shares in your secrets vault.
await redis.set(`wallet:${walletMetadata.accountAddress}`, JSON.stringify(walletMetadata));
await vault.write(`wallet:${walletMetadata.accountAddress}/shares`, externalServerKeyShares);
```

## Related

* [`WalletMetadata`](/node/reference/types/wallet-metadata) - The metadata object passed to every operation
* [`importPrivateKey()`](/node/reference/svm/import-private-key) - Import existing private key
* [`fetchWalletMetadata()`](/node/reference/svm/fetch-wallet-metadata) - Recover identity metadata when the cache is lost
* [Storage Best Practices](/node/wallets/server-wallets/storage-best-practices) - Where to cache metadata vs. vault shares
