add query param support
Pull Request Summary
Describe what changes this pull request makes to the repository: The recent update to our system introduces a customizable wallet connection flow that enhances our ability to integrate smoothly with various platforms.
Now, you can fine-tune the assets path URL with new parameters to streamline the wallet selection:
https://astar-portal-dun.vercel.app/astar/assets?nativeWallets=gridlock&evmWallets=gridlockEvm%2Cmetamask&multisigWallets=null
Here’s what each parameter does:
-
nativeWallets: Narrows down the list of native wallets to only those specified. Accepts a single entry or a list separated by commas (use%2Cfor encoding the comma in URLs). -
evmWallets: Filters the list of EVM wallets in the same way asnativeWallets. -
multisigWallets: If set tonullor falsy value, it will hide this category from the display.
If you don't use a parameter, the full array of wallets will be displayed without any filter.
For a more streamlined experience that skips the standard selection, you can directly connect to a wallet using:
https://astar-portal-dun.vercel.app/astar/assets?selectedWallet=gridlock&selectedWalletType=native
-
selectedWallet: This should be a string matching one of the wallets in the SupportWallet list. -
selectedWalletType: Choose between 'native' or 'evm'.
By including both parameters, the system will bypass the usual selection process and connect directly to the specified wallet. It’s essential to provide both to ensure the process works seamlessly.
Check list
- [ ] contains breaking changes
- [x] adds new feature
- [x] modifies existing feature (bug fix or improvements)
- [ ] relies on other tasks
- [ ] documentation changes
- [x] tested on mobile devices
This pull request makes the following changes:
Adds
- Add url query parameter handling to the ModalConnectWallet component
@krisz4 Thanks for making PR.
- Could you edit the summary? It's a bit difficult to check
- Please prepare a staging URL for this PR (ref).
@krisz4 Could you fix the build error?
@impelcrypto Added the requested changes
@krisz4 Can you allow us in?
@gluneau Sorry updated the url. I get a 404 error when trying to open the link. Doesn't seem related to the PR. If I try to open any url other than the base url https://astar-portal-dun.vercel.app I get this error. E.g. https://astar-portal-dun.vercel.app/astar/assets same 404 error. Any idea why this happens? Doesn't happen when tested locally, just on vercel deploy
@krisz4
If you don't use a parameter, the full array of wallets will be displayed without any filter. For a more streamlined experience that skips the standard selection, you can directly connect to a wallet using: https://astar-portal-dun.vercel.app/astar/assets?selectedWallet=gridlock&selectedWalletType=native
I think this only works for selectedWalletType=evm.
I got a bug with this URL.
http://localhost:8080/astar/assets?selectedWallet=talisman&selectedWalletType=native
GIF: https://gyazo.com/6f803a3867ced9f3d96af7ef87af7506
@impelcrypto Added some fixes to the PR. Can you check again?
@krisz4 I got the same error https://gyazo.com/fa7da5c82a6347bb5784b91eead4afec
@impelcrypto Can't reproduce on a fresh build. Is there any cached/preset value I should be aware of? How can I reproduce this issue?
https://github.com/AstarNetwork/astar-apps/assets/50493714/2e78c1fb-9301-4f53-a544-9deb48a59fb8
@krisz4
- connect to MetaMask
- open http://localhost:8080/astar/assets?selectedWallet=talisman&selectedWalletType=native
Demo: https://www.loom.com/share/71106e9a88d54844bc34bde97776a26c
Closed as stale