-
Notifications
You must be signed in to change notification settings - Fork 568
[Docs] Update pregenerate wallets API endpoint and request format #7791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joaquim-verges
merged 1 commit into
main
from
_Docs_Update_pregenerate_wallets_API_endpoint_and_request_format
Aug 6, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ export const metadata = createMetadata({ | |
icon: "wallets", | ||
}, | ||
title: "Pregenerate Wallets | thirdweb", | ||
description: "Create wallets before users sign up with thirdweb’s wallet pregeneration. Pre-fund with tokens, NFTs, or game assets to enable smooth onboarding and asset claiming.", | ||
description: "Create wallets before users sign up with thirdweb's wallet pregeneration. Pre-fund with tokens, NFTs, or game assets to enable smooth onboarding and asset claiming.", | ||
}); | ||
|
||
# Pregenerate Wallets | ||
|
@@ -35,35 +35,48 @@ You can distribute assets to wallets before users claim them, enabling: | |
|
||
To pregenerate an in-app or ecosystem wallet wallet, you can make a `POST` request to the following endpoint: | ||
|
||
``` | ||
https://in-app-wallet.thirdweb.com/api/v1/pregenerate | ||
```http | ||
POST https://api.thirdweb.com/v1/wallets/user/pregenerate | ||
Content-Type: application/json | ||
x-secret-key: <your-secret-key> | ||
x-ecosystem-id: <your-ecosystem-id> (optional) | ||
x-ecosystem-partner-id: <your-ecosystem-partner-id> (optional) | ||
|
||
{ | ||
"type": "email", | ||
"email": "[email protected]" | ||
} | ||
``` | ||
|
||
## Request Body | ||
|
||
The request body should be a JSON object with the following parameters: | ||
|
||
- `strategy`: The strategy for wallet generation | ||
- `email` or `phone` or `userId`: The user identifier associated with the wallet to be generated | ||
- `type`: The type of wallet identifier to pregenerate a wallet for: | ||
- Email based: `email`, `google`, `facebook`, `discord` | ||
- Phone based: `phone` | ||
- Wallet based: `signer` | ||
- User ID based: `custom_jwt` or `custom_auth_endpoint` | ||
- `email` or `phone` or `userId` or `walletAddress`: The user identifier associated with the wallet to be generated | ||
|
||
### Email based wallets | ||
|
||
``` | ||
{ strategy: "email", email: "[email protected]" } | ||
{ type: "email", email: "[email protected]" } | ||
``` | ||
|
||
When the user logs in with any method associated with that email (including google, facebook, discord auth), they will get access to the same pregenerated wallet. | ||
|
||
### Phone based wallets | ||
|
||
``` | ||
{ strategy: "phone", phone: "+1321123321" } | ||
{ type: "phone", phone: "+1321123321" } | ||
``` | ||
|
||
### Custom user id based wallets | ||
|
||
``` | ||
{ strategy: "custom_auth_endpoint", userId: "some_user_id" } | ||
{ type: "custom_auth_endpoint", userId: "some_user_id" } | ||
``` | ||
|
||
{/* TODO: update link when custom auth documentation has been updated */} | ||
|
@@ -83,13 +96,13 @@ You need to include the following headers: | |
Here's an example curl command to pregenerate a thirdweb wallet for the user `[email protected]`: | ||
|
||
```bash | ||
curl -X POST 'https://in-app-wallet.thirdweb.com/api/v1/pregenerate' \ | ||
curl -X POST 'https://api.thirdweb.com/v1/wallets/user/pregenerate' \ | ||
-H 'x-ecosystem-id: ecosystem.example-eco-123' \ | ||
-H 'x-ecosystem-partner-id: 1415d24e-c7b0-4fce-846e-740841ef2c32' \ | ||
-H 'x-secret-key: 9f8e7d6c5b4a3f2e1d0c9b8a7ffge434b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7' \ | ||
-H 'x-secret-key: <your-project-secret-key>' \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{ | ||
"strategy": "email", | ||
"type": "email", | ||
"email": "[email protected]" | ||
}' | ||
``` | ||
|
@@ -107,9 +120,10 @@ A successful API call returns a JSON object in the following format: | |
|
||
```json | ||
{ | ||
"wallet": { | ||
"result": { | ||
"address": "string", | ||
"createdAt": "string", | ||
"profile": "object[]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation of the {
"result": {
"address": "string",
"createdAt": "string",
"profile": "object[]"
}
} Spotted by Diamond |
||
} | ||
} | ||
``` | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an inconsistency in the parameter naming for custom user ID based wallets. In the request body description (line 60), the parameter is referred to as
user
, but in the example JSON (line 70), it's shown asuserId
. These should be aligned to provide clear documentation. Consider standardizing on one parameter name throughout the documentation.Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.