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.
POST
When wallets are shared with your application, you'll get the following POST payload:
{ "wallets": string[]; "signer": string; "signature": string; }
All signatures will be signed by 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
To check the validity of the webhook requests, run the following code:
const address = await recoverMessageAddress({ message: JSON.stringify(selectedWallets), signature: attestation.signature as `0x${string}` });
The address should match the signer .
address
signer
Go to https://clusters.xyz/sharearrow-up-right where you will be prompted to enter the webhook URL that you just created.
Your webhook URL may look something like this: https://api.myapp.com/webhook/share
https://api.myapp.com/webhook/share
Once you enter a URL, a unique share link can be created that you can send to your users.
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.
Last updated 9 months ago