Skip to content
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

add query param support #973

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

krisz4
Copy link

@krisz4 krisz4 commented Oct 13, 2023

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
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

This pull request makes the following changes:

Adds

  • Add url query parameter handling to the ModalConnectWallet component

@krisz4 krisz4 marked this pull request as draft October 18, 2023 08:42
@krisz4 krisz4 marked this pull request as ready for review November 1, 2023 15:51
@impelcrypto impelcrypto requested review from impelcrypto, gluneau and bobo-k2 and removed request for impelcrypto November 2, 2023 10:17
@impelcrypto
Copy link
Member

impelcrypto commented Nov 2, 2023

@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
Copy link
Member

@krisz4 Could you fix the build error?

@krisz4
Copy link
Author

krisz4 commented Nov 6, 2023

@impelcrypto Added the requested changes

@gluneau
Copy link
Contributor

gluneau commented Nov 7, 2023

@krisz4 Can you allow us in?
image

@krisz4
Copy link
Author

krisz4 commented Nov 12, 2023

@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

@impelcrypto
Copy link
Member

@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

@krisz4
Copy link
Author

krisz4 commented Nov 15, 2023

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

@impelcrypto
Copy link
Member

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

@krisz4
Copy link
Author

krisz4 commented Nov 16, 2023

@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?

y26oj6.mp4

@impelcrypto
Copy link
Member

impelcrypto commented Nov 17, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants