Retrieve a wallet address
Retrieve your user wallet without a backend
Last updated
Retrieve your user wallet without a backend
Last updated
With Cometh Connect, you can retrieve the walletAddress of your user without interacting with a backend.
To do so, you'll need to let your user sign with one of the passkeys that was used to create a wallet. With the signature, we'll be able to retrieve and send back the wallet address linked to the user.
This is the code needed to implement that feature.
import { retrieveAccountAddressFromPasskey } from "@cometh/connect-sdk-4337";
const apiKey = process.env.COMETH_API_KEY;
const walletAddress = await retrieveAccountAddressFromPasskey(apiKey);
The user will have to select the passkey and sign a message in order to retrieve the wallet address.
He will then be able to connect to the wallet.