Privy enables your app to easily create server-side wallets on any EVM network or Solana.

If the wallet is for a user, use wallet pregeneration instead to associate the wallet with user’s login methods.

To create a wallet with the NodeJS SDK, use the create method from the Privy client’s walletApi class:

createWallet: (input: WalletApiCreateRequestType) => Promise<WalletApiCreateResponseType>

Usage

const {id, address, chainType} = await privy.walletApi.create({chainType: 'ethereum'});

Parameters

The create method accepts as a parameter an input object with the following fields:

chainType
'ethereum' | 'solana'
required

Chain type of the wallet to create.

policyIds
string[]

List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.

idempotencyKey
string

Idempotency key to identify a unique request.

owner
{'publicKey': string}

The P-256 public key that will be the owner of the wallet. If you provide this, do not specify an owner_id as it will be generated automatically.

ownerId
string

The key quorum ID of the owner of the wallet. If you provide this, do not specify an owner.

additionalSigners
{'signerId': string}[]

List of key quorum IDs that should be allowed to approve transactions for the wallet.

Returns

id
string

Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.

address
string

Address of the created wallet.

chainType
'ethereum' | 'solana'

Chain type of the created wallet.

policyIds
string[]

List of policy IDs for policies that are enforced on the wallet.

ownerId
string | null

The key quorum ID of the owner of the wallet.

additionalSigners
{signerId: string}[]

The key quorum IDs of the additional signers for the wallet.

Your app can provision a smart account with the wallet as a signer by following this guide.