Appearance
Getting all wallets
Privy enables you to list all wallets in your app.
Using the SDK
To fetch your wallets, use the Privy client's walletApi.getWallets
method. This is a paginated query.
As parameters to the method, you may pass an object with the following optional fields:
Parameter | Type | Description |
---|---|---|
cursor | string | (Optional) ID of the wallet from which start the search |
limit | number | (Optional) Max amount of wallets to fetch per page |
chainType | 'ethereum' | 'solana' | (Optional) Chain type to filter by. |
Once invoked, walletApi.getWallets
will request Privy's API to fetch the wallets. The method returns a Promise for an object containing the following:
Field | Type | Description |
---|---|---|
data | Array<WalletApiWalletResponseType> | List of wallets in the current page |
nextCursor | string | (Optional) ID of the wallet from which start the next page |
Where WalletApiWalletResponseType
is an object that contains the following properties:
Field | Type | Description |
---|---|---|
id | string | Unique ID of the wallet |
chainType | 'ethereum' | 'solana' | Chain type of the wallet |
address | string | Address of the wallet |
createdAt | Date | The creation date of the wallet |
Below is an example of fetching all Ethereum wallets for your app:
ts
const wallets = [];
let nextCursor;
do {
const result = await privy.walletApi.getWallets({chainType: 'ethereum', cursor: nextCursor});
wallets.push(...result.data);
nextCursor = result.nextCursor;
} while (nextCursor);
Using the REST API
To fetch your wallets by pages, make a GET
request to:
sh
https://api.privy.io/v1/wallets
Query
In the request query parameters, include any of the following:
Parameter | Type | Description |
---|---|---|
cursor | string | (Optional) ID of the wallet from which start the search |
limit | number | (Optional) Max amount of wallets per page |
chain_type | 'ethereum' | 'solana' | (Optional) Chain type to filter by. |
Response
In the response, Privy will send back the following if successful:
Field | Type | Description |
---|---|---|
data | Array<WalletApiWalletResponseType> | List of wallets in the current page |
next_cursor | string | (Optional) ID of the wallet from which start the next page |
Where WalletApiWalletResponseType
is an object that contains the following properties:
Field | Type | Description |
---|---|---|
id | string | Unique ID of the wallet |
chain_type | 'ethereum' | 'solana' | Chain type of the wallet |
address | string | Address of the wallet |
created_at | number | The creation date of the wallet, in milliseconds since midnight, January 1, 1970 UTC. |
Example
As an example, a sample request to fetch EVM wallets might look like the following:
bash
$ curl --request GET https://api.privy.io/v1/wallets?chain_type=ethereum&limit=1 \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>" \
-H 'Content-Type: application/json' \
A successful response will look like the following:
json
{
"data": [
{
"id": "yepf6384cu2nkup42gvrwdqh",
"address": "0x2F3eb40872143b77D54a6f6e7Cc120464C764c09",
"chain_type": "ethereum",
"authorization_threshold": 2,
"created_at": 1733923425155
}
],
"next_cursor": "u67nttpkeeti2hm9w7aoxdcc"
}