near / near-api-js

JavaScript library to interact with NEAR Protocol via RPC API
https://near.github.io/near-api-js
MIT License
394 stars 244 forks source link

WalletConnection should return redirect links instead of redirect the whole page. #1010

Open DevSlashRichie opened 2 years ago

DevSlashRichie commented 2 years ago

Is your feature request related to a problem? Please describe. I want to be able to use the link in an iframe or popup instead of redirecting the complete webapp.

Describe the solution you'd like Allowing WalletConnection to have methods that return the redirect URI instead of ultimately returning the web page.

Describe alternatives you've considered Embedding the whole near-api-js connect into its own code space and running that into a popup.

Additional context https://github.com/near/near-api-js/blob/37ca2222e7afda3b77929d695b9d84bba21b418e/packages/near-api-js/src/wallet-account.ts#L199

denbite commented 9 months ago

the idea of having methods for generating a Wallet URL without redirecting looks also reasonable to me and was implemented in https://github.com/near/near-api-js/pull/1260