anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.44k stars 906 forks source link

Feature: disable auto-detect for wallets #989

Closed dogebonker closed 6 days ago

dogebonker commented 1 week ago

Is your feature request related to a problem? Please describe. In my dapp I want to strictly disallow users to connect certain wallets, it's not possible if I just use the default package without modifications.

Describe the solution you'd like Would it be possible to add a flag to <WalletProvider /> so that we would only show wallets which are passed as a wallet prop?

mcintyre94 commented 6 days ago

I don't think this is really possible with wallet-standard wallets, because nothing stops a wallet being injected with an arbitrary name/icon etc and impersonating one of the wallets you whitelisted. There's no way for your app to verify any of the fields of the Wallet type.

Whereas with adapters only the wallets you included would be detected, so this was the behaviour you'd get.

We wouldn't ship a version of wallet-adapter, or an option, which removes wallet-standard wallets. Our messaging to wallets is that this is the API to use, and newer wallets like Backpack don't have an adapter because they've never needed one.

I also don't think we'd want to ship an option to eg filter by wallet names, because that could mislead apps into thinking it's more effective than it can be with wallet-standard wallets.

glitch-txs commented 6 days ago

I don't think this is really possible with wallet-standard wallets, because nothing stops a wallet being injected with an arbitrary name/icon etc and impersonating one of the wallets you whitelisted. There's no way for your app to verify any of the fields of the Wallet type.

in EIP-6963 we added uuid and rdns for this reason partially.