-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide standard login flow for multiple contracts #1045
Comments
Hi, @petersalomonsen thank you for raising this issue. As you stated above the wallet selector supports Supporting sign-in with multiple contracts by triggering the current
|
Hi @kujtimprenkuSQA , In NearSocial/VM#156, which will be released on BOS these days, we use multiple keystores to overcome the limitation of It is true that the wallet selector does not manage local access keys, but it is possible to manage usage of multiple walletConnections and keystores from the Wallet selector implementations. I believe it should be possible for the wallet selector provide the feature of managing multiple connections, through a single API method. So maybe add an additional method to the wallet selector API for adding local function access keys for additional contracts? |
Is your feature request related to a problem? Please describe.
From a web application like NEAR BOS I often need to interact with multiple contracts. For example I want to interact with DevHUB, which use it's own contract in addition to the common
near.social
contract.Today the wallet selector only supports signing into one contract, but you can still use
walletConnection.requestSignIn
from near-api-js and point to a different key store, so that you can store access keys for multiple smart contracts in the same web app. This method is only supported by browser wallets, as it requires a wallet url to redirect to, but for other wallets can even create anAddKey
transaction and store it in a separate keystore.This approach works in this pull request to NearSocialVM.
The downside is that if you need to create an
AddKey
transaction, the wallets does not always offer a clear message to the user on what's going on. HERE wallet gives you the standard login experience with the messagean application is requesting limited access to your account
, but Meteor just shows anAddKey
transaction which is not very clear.Describe the solution you'd like
The wallet selector should provide a way to always use the standard login flow when signing into an additional contract. Instead of having to check for what the wallet supports in the VM, there should be call to the wallet selector for signing in to an additional contract.
Describe alternatives you've considered
I have implemented the pull request to NearSocialVM as referred above, and I also did some initial proof of concept in the wallet selector some time ago in this draft Pull Request. Even though it's possible to get quite far without changes in the Wallet Selector, the issue of providing the standard login flow for all wallets is blocked without changes in the Wallet Selector.
Acceptance criteria
As a minimum it should be possible to trigger the login flow of the currently selected wallet for a
BrowserLocalStorageKeyStore
that you provide from the web app. This way it is possible for the consuming web app to manage wallet connections to additional contracts.The text was updated successfully, but these errors were encountered: