astar-apps icon indicating copy to clipboard operation
astar-apps copied to clipboard

add query param support

Open krisz4 opened this issue 2 years ago • 10 comments

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 %2C for encoding the comma in URLs).
  • evmWallets: Filters the list of EVM wallets in the same way as nativeWallets.
  • multisigWallets: If set to null or 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 avatar Oct 13 '23 08:10 krisz4

@krisz4 Thanks for making PR.

  1. Could you edit the summary? It's a bit difficult to check
  2. Please prepare a staging URL for this PR (ref).

impelcrypto avatar Nov 02 '23 10:11 impelcrypto

@krisz4 Could you fix the build error?

impelcrypto avatar Nov 03 '23 12:11 impelcrypto

@impelcrypto Added the requested changes

krisz4 avatar Nov 06 '23 21:11 krisz4

@krisz4 Can you allow us in? image

gluneau avatar Nov 07 '23 13:11 gluneau

@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 avatar Nov 12 '23 22:11 krisz4

@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 avatar Nov 14 '23 09:11 impelcrypto

@impelcrypto Added some fixes to the PR. Can you check again?

krisz4 avatar Nov 15 '23 11:11 krisz4

@krisz4 I got the same error https://gyazo.com/fa7da5c82a6347bb5784b91eead4afec

impelcrypto avatar Nov 16 '23 06:11 impelcrypto

@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 avatar Nov 16 '23 16:11 krisz4

@krisz4

  1. connect to MetaMask
  2. open http://localhost:8080/astar/assets?selectedWallet=talisman&selectedWalletType=native

Demo: https://www.loom.com/share/71106e9a88d54844bc34bde97776a26c

impelcrypto avatar Nov 17 '23 03:11 impelcrypto

Closed as stale

bobo-k2 avatar May 21 '24 08:05 bobo-k2