hirosystems / connect

A library for building excellent user experiences with Stacks.
https://connect.stacks.js.org
MIT License
77 stars 40 forks source link

Ability to choose specific wallet extension popup for authentication using showConnect function #320

Closed minahil-imtiaz closed 1 year ago

minahil-imtiaz commented 1 year ago

Description: Currently, when using the showConnect function from the stacks/connect package for authentication from a Stacks-supported wallet, if multiple web wallet extensions are installed, the function will show or prompt login popups for all the wallets.

However, in my application, I need to prompt a specific wallet extension popup to open for authentication; for my use case, it is Hiro Wallet. Therefore, I need the ability to choose a specific wallet extension popup to open when using the showConnect function.

This would provide more control and flexibility for developers using the stacks/connect package.

markmhendrickson commented 1 year ago

This would be a good enhancement indeed!

In the meantime, a non-Connect solution could be to detect whether the window.HiroWalletProvider object is available in the DOM and if not, send the user to the wallet's installation page: https://wallet.hiro.so/install-web

And if it is, you can call the API you need directly e.g. getAddresses to connect the user: https://hirowallet.gitbook.io/developers/bitcoin/connect-users/get-addresses