wallet-selector
wallet-selector copied to clipboard
Making the Modal UI Redirect Optional
Is your feature request related to a problem? Please describe. Currently, when selecting the wallet in the Modal UI the user gets redirected to the wallet automatically (at least in the case of WebWallets).
Being redirected automatically removes the capability of doing at least two things:
-
Some developers might just want to use the
verifyOwner()
feature of the wallet, for which it is not necessary to be first logged in. -
At the same time, by not setting automatically the
accountId
of the wallet, one can easily create "template transactions" to use with different accounts. This is, one could use:
wallet.signAndSendTransaction({
signerId: "<this could be a variable>",
receiverId: ...,
actions: [ ... ],
});
This is helpful for projects that want to, for example, allow users to handle multiple accounts with NFTs. (note: this idea came from actual questions in the NEAR discord during office hours)
Describe the solution you'd like It would be very nice to have an option in the modal UI that allowed us to immediately sign the user, or simply return the WalletConnector immediately.
Describe alternatives you've considered
Adding an redirectToSignUser
flag in the setupModal
arguments, which is true
by default.
Acceptance criteria The developer can select if a user should be redirected after selecting a wallet in the modal UI, or if only the wallet connector needs to be returned