Connect
Cometh ConnectCometh MarketplaceCometh Checkout
  • Demo
  • 🚀QUICKSTART
    • What is Connect
    • Getting started
    • Supported Networks
    • Connect 4337
  • ⚒️FEATURES
    • Create a wallet
    • Send transactions
    • Sign/Verify a message
    • Retrieve a wallet Address
    • Import a Safe wallet
    • Handle wallet owners
  • 🔌Integrations
    • Ethers
    • Wagmi - Viem
      • Viem
      • Wagmi
      • Wagmi + Rainbowkit
      • Wagmi + Web3modal
    • Unity
    • React issues
      • Vite
      • Create React App
  • 📖RESOURCES
    • FAQ
    • Advanced features
      • Add a new device
      • Recover users wallets
    • General concepts
      • Biometric signers
      • Multiple devices
      • Account Recovery
      • Gasless transaction
Powered by GitBook
On this page
  1. FEATURES

Retrieve a wallet Address

Retrieve your user wallet without a backend

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 passkey 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 { ConnectAdaptor, ComethWallet } from "@cometh/connect-sdk";

const walletAdaptor = new ConnectAdaptor({
  chainId: YOUR_CHAIN_ID,
  apiKey: API_KEY,
});

const walletAddress = await adaptor.retrieveWalletAddressFromSigner()

const wallet = new ComethWallet({
  authAdapter: walletAdaptor,
  apiKey: API_KEY,
});

await wallet.connect(walletAddress);

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.

Last updated 1 year ago

⚒️