From my server
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:
Usage
Parameters
The create
method accepts as a parameter an input
object with the following fields:
Chain type of the wallet to create.
List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.
Idempotency key to identify a unique request.
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.
The key quorum ID of the owner of the wallet. If you provide this, do not specify an owner.
List of key quorum IDs that should be allowed to approve transactions for the wallet.
Returns
Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet.
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.
To create a wallet with the NodeJS SDK, use the create
method from the Privy client’s walletApi
class:
Usage
Parameters
The create
method accepts as a parameter an input
object with the following fields:
Chain type of the wallet to create.
List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.
Idempotency key to identify a unique request.
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.
The key quorum ID of the owner of the wallet. If you provide this, do not specify an owner.
List of key quorum IDs that should be allowed to approve transactions for the wallet.
Returns
Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet.
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.
To create a new wallet, make a POST
request to
Body
In the request body, include the following fields.
Chain type of the wallet to create.
List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.
Idempotency key to identify a unique request.
The P-256 public key of the owner of the wallet. If you provide this, do not specify an owner_id as it will be generated automatically.
The key quorum ID of the owner of the wallet. If you provide this, do not specify an owner.
The key quorum IDs to add as additional signers for the wallet.
Response
In the response, Privy will send back the following if successful:
Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet.
The key quorum IDs of the additional signers for the wallet.
The creation date of the wallet, in milliseconds since midnight, January 1, 1970 UTC.
Example
A sample request might look like the following:
A successful response will look like the following: