Create an internal webhook URL
In order for users to selectively share their wallets with your application, a webhook will need to be created to process POST
requests coming from the user.
When wallets are shared with your application, you'll get the following POST
payload:
Copy {
"wallets": string[];
"signer": string;
"signature": string;
}
All signatures will be signed by 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
To check the validity of the webhook requests, run the following code:
Copy const address = await recoverMessageAddress({
message: JSON.stringify(selectedWallets),
signature: attestation.signature as `0x${string}`
});
The address
should match the signer
.
Retrieve a custom share URL for your app
Go to where you will be prompted to enter the webhook URL that you just created.
Once you enter a URL, a unique share link can be created that you can send to your users.
Send users to the URL
They will be prompted to select which wallets they want to share. When they click "Share" the data will be sent to your webhook URL.
Users can verify that they are sharing data to the right place but double checking the blue "Sharing with" label as seen below.