Wallet pregeneration, now even more flexible
We supported pregeneration for enclave wallets a while back.
Today, wallet pregeneration is available for in-app wallets too!
What does this mean?
This means that you can now know the in-app wallet address of a user before they register on your platform!
This allows you to perform airdrop, pre-load certain assets, and more!
The API is the same as ecosystem wallets except we don't have to include the ecosystem details:
curl -X POST 'https://embedded-wallet.thirdweb.com/api/v1/pregenerate' \
-H 'x-secret-key: YOUR_SECRET_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"strategy": "email",
"email": "user@example.com"
}'
On top of that, we also now support pregeneration via custom IDs. This means that you can know your user's address ahead of time even if you use a custom authentication methods like JWT or an auth endpoint.
Here's what that would look like:
curl -X POST 'https://embedded-wallet.thirdweb.com/api/v1/pregenerate' \
-H 'x-secret-key: YOUR_SECRET_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"strategy": "userId",
"userId": "YOUR_CUSTOM_USER_ID_HRE"
}'
For more information and background on what pregeneration is all about, check out the newly updated documentation here.