onflow / fcl-discovery

https://fcl-discovery.onflow.org
Apache License 2.0
11 stars 18 forks source link

[FEATURE] Filter wallets by supported features #158

Closed JeffreyDoyle closed 4 months ago

JeffreyDoyle commented 1 year ago

Issue to be solved

Certain wallets on Flow may choose to support certain optional wallet features. For example, providing support for account linking, or supporting the DEEPLINK/RPC service method (https://github.com/onflow/fcl-js/pull/1747/files#diff-d7f75c4a943e17a937a1362fa655a65ad173eac49bc45dd0864541abcccc9ee2R505).

Application developers may wish filter wallet selection in their app to wallets that support certain optional FCL features. This way, their users get the optimal user experience for the application.

Suggest A Solution

Add additional metadata about each wallet provider included in FCL Discovery which can be filtered upon. Wallet providers returned via FCL discovery (FE or API) should be able to be filtered by which features they support.

We should still continue to provide a way for the user to bypass this filter, and gain access to their wallet. In the FE, there should be a separate bypass screen where all wallets on FCL Discovery can be viewed and selected, and on the API there should be a separate set of all wallets returned that the application can optionally render if the user decides to bypass the filter.

chasefleming commented 1 year ago

Filtering already happens by supported strategies. The react native library should be sending DEEPLINK/RPC as a supported strategy and then the filtering will happen in Discovery if the service doesn’t support it.

lmcmz commented 1 year ago

@chasefleming Is it possible to filter the wallet supports account linking feature now ? Now we have filter for strategy, but do we have some other custom filters ? For example, we only wanna list wallet which adding support for hybrid custody.

chasefleming commented 1 year ago

There is not currently a by feature filter. That would have to be added. Although I hesitate to start filtering by feature in Discovery. That could get out of hand quick. Other options would be to:

jribbink commented 1 year ago

Just chiming in here on the React Native piece as well. React Native applications will interface with the wallet through an HTTP/POST service, just like web applications do (i.e. there is no separate service type for React Native). The current plan is to remove the DEEPLINK/RPC service due to architectural constraints surrounding data passed through URL query parameters -> all React Native wallets will be backchannel.

However, they will expect a view of either VIEW/MOBILE_BROWSER/VIEW/DEEPLINK to be returned from this service and will not support VIEW/FRAME, VIEW/TAB, etc. (web views).

So like @chasefleming said, it kind of leaves 3 options:

chasefleming commented 1 year ago

A few of us chatted off of Github and conclusion we came to was that it would be nice if an app could specify suggested features a wallet would have for a user using their app. Then those recommended features would be listed on Discovery to show a user to help in their decision of picking a wallet. We would also show the wallets in a section of wallets that meet the suggested feature list, but we wouldn't filter out other wallets.

As a goal in helping users (and new users to web3) to pick a wallet, we could also do a v2 iteration of this where we have more information on each wallet when clicked to help inform a user about what features a wallet has and to help pick them that will suit their needs. There could also be feature filters in v2.

Features that were discussed as filterable were: