We are building an app that utilizes the Anza Wallet Adapter. For our specific use case, we get the user to choose a specific wallet address that will be linked to their account. The intended functionality is as follows:

  1. User goes through sign-up process, connects their wallet (with wallet adapter), and then signs a message with that specific wallet.

  2. The wallet they signed a message with gets linked to their account in our DB.

  3. The user should only be able to use the wallet they linked to their account while using our app.

Right now, the way we facilitate this functionality is by checking if the connected wallet address matches the address in our DB. If it doesn't, we ask the user to select the specific wallet they originally linked.

To improve UX, I was curious if there is a way to force wallet adapter to only allow the user to connect to a specific wallet address?

For example: if a user has 3 total wallets within their Phantom browser extension and they linked wallet #2 during the sign-up process - clicking the Wallet Adapter "Select Wallet" button and choosing "Phantom" should automatically try to connect to wallet #2, even if the user had wallet #1 or #3 selected within Phantom before connecting their browser extension to our app.

By default, it doesn't seem to support this functionality so I was curious if this sort of functionality is possible and if anyone has done this before.

Thanks in advance!

  • Not sure I follow, but what do you mean by "connect to a specific wallet address"? Did you perhaps mean your program ID?
    – Jimii
    Commented May 1 at 22:36
  • Hey @Jimii - my apologies, I realized I should have elaborated a bit more on my question. I have gone ahead and edited my original post and added further context. Hopefully my question makes more sense now.
    – Kraz
    Commented May 2 at 0:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.