- NodeJS
- NodeJS (server-auth)
- Java
- REST API
- Rust
To fetch all your application’s wallets, use the Privy client’s
walletApi.getWallets method. This is a paginated query.Report incorrect code
Copy
Ask AI
getWallets: ({cursor?: string, limit?: number, chainType?: 'ethereum' | 'solana'}) => Promise<{data: WalletApiWalletResponseType[], nextCursor?: string}>
Usage
Report incorrect code
Copy
Ask AI
// Will iterate automatically until all wallets are fetched
for await (const wallet of privy.wallets().list({chain_type: 'ethereum'})) {
// Do something with the wallet
}
Parameters and Returns
Check out the API reference for more details.The
@privy-io/server-auth library is deprecated. We recommend integrating @privy-io/node for
the latest features and support.walletApi.getWallets method. This is a paginated query.Report incorrect code
Copy
Ask AI
getWallets: ({cursor?: string, limit?: number, chainType?: 'ethereum' | 'solana'}) => Promise<{data: WalletApiWalletResponseType[], nextCursor?: string}>
Usage
Report incorrect code
Copy
Ask AI
const wallets = [];
let nextCursor;
do {
const result = await privy.walletApi.getWallets({chainType: 'ethereum', cursor: nextCursor});
wallets.push(...result.data);
nextCursor = result.nextCursor;
} while (nextCursor);
const wallet = wallets.find((wallet) => wallet.address === desiredAddress);
Parameters
ThegetWallets method optionally accepts an object with the following fields:ID of the wallet from which start the search
Max amount of wallets to fetch per page
Chain type to filter by.
Returns
List of wallets in the current page
Cursor to use for fetching the next page of results, if any
To fetch all of your application’s wallets, use the
list method.Report incorrect code
Copy
Ask AI
try {
WalletListRequest request = WalletListRequest.builder()
.chainType(WalletChainType.ETHEREUM)
.build();
WalletListResponse response = privyClient.wallets().list(request);
if (response.wallets().isPresent()) {
List<Wallet> wallets = response.wallets().get().data();
}
} catch (APIException e) {
String errorBody = e.bodyAsString();
System.err.println(errorBody);
} catch (Exception e) {
System.err.println(e.getMessage());
}
Parameters
TheWalletListRequest object accepts the following parameters, all of which are optional:The chain type to filter by.
The user ID to filter by.
The cursor to use for fetching the next page of results, if any.
The maximum number of wallets to fetch per page.
Defaults to
100.Returns
TheWalletListResponse object contains an optional object() field, present if the
wallets were retrieved successfully.The retrieved list of wallets. Each of the elements in the list under
.data() is a Wallet object.Show child attributes
Show child attributes
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, as Unix time.
To fetch your wallets by pages, make a A successful response will look like the following:
GET request to:Report incorrect code
Copy
Ask AI
https://api.privy.io/v1/wallets
Query
In the request query parameters, include any of the following:ID of the wallet from which start the search
Max amount of wallets per page
Chain type to filter by.
Response
In the response, Privy will send back the following if successful:List of wallets in the current page
Hide child attributes
Hide child attributes
Unique ID of the wallet
Address of the wallet
Chain type of the wallet
List of policy IDs associated with 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.
ID of the wallet from which start the next page
Example
As an example, a sample request to fetch EVM wallets might look like the following:Report incorrect code
Copy
Ask AI
$ 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' \
Report incorrect code
Copy
Ask AI
{
"data": [
{
"id": "yepf6384cu2nkup42gvrwdqh",
"address": "0x2F3eb40872143b77D54a6f6e7Cc120464C764c09",
"chain_type": "ethereum",
"authorization_threshold": 2,
"owner_id": null,
"additional_signers": [],
"created_at": 1733923425155
}
],
"next_cursor": "u67nttpkeeti2hm9w7aoxdcc"
}
To fetch all your application’s wallets, use the
list method on the wallets() interface of the Privy client. This is a paginated query that requires manual pagination.Usage
Report incorrect code
Copy
Ask AI
use privy_rs::{PrivyClient, generated::types::*};
let client = PrivyClient::new(app_id, app_secret)?;
// Manual pagination through all wallets
let mut all_wallets = Vec::new();
let mut cursor = None;
loop {
let response = client.wallets().list(&WalletListQuery {
chain_type: Some(WalletChainType::Ethereum),
user_id: None,
limit: Some(50), // Fetch 50 at a time
cursor: cursor.clone(),
}).await?;
all_wallets.extend(response.data);
if let Some(next_cursor) = response.next_cursor {
cursor = Some(next_cursor);
} else {
break; // No more pages
}
}
for wallet in all_wallets {
println!("Wallet {}: {}", wallet.id, wallet.address);
}
Parameters and Returns
See the Rust SDK documentation for detailed parameter and return types, including embedded examples:For REST API details, see the API reference.Helper Function Example
Report incorrect code
Copy
Ask AI
use privy_rs::{PrivyClient, generated::types::*};
async fn fetch_all_wallets_by_chain(
client: &PrivyClient,
chain_type: WalletChainType,
) -> Result<Vec<Wallet>, Box<dyn std::error::Error>> {
let mut all_wallets = Vec::new();
let mut cursor = None;
loop {
let response = client
.wallets()
.list(&WalletListQuery {
chain_type: Some(chain_type.clone()),
user_id: None,
limit: Some(50), // Fetch 50 at a time
cursor: cursor.clone(),
})
.await?;
all_wallets.extend(response.data);
if let Some(next_cursor) = response.next_cursor {
cursor = Some(next_cursor);
} else {
break; // No more pages
}
}
Ok(all_wallets)
}

