-
Notifications
You must be signed in to change notification settings - Fork 203
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
feat: show WalletConnect chain dropdown #1447
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Screen.Recording.2024-01-19.at.15.00.35.movPossible race condition with |
</p> | ||
<NetworkListbox | ||
label={''} | ||
placeholder="Select a chain" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we can set this inside NetworkListbox
if value
is undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetworkListbox
is also used on the tx panel for "From: Network" and "To: Network" so I won't set it inside
unless we think Select a chain
can be globally used :/
although the ones on tx panel will never have an undefined value as it is
const options = getSupportedNetworks(undefined, true) | ||
.map(chainId => { | ||
const wagmiChain = getWagmiChain(chainId) | ||
const targetChainKey = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to have an object:
const chainIdToWalletConnectKey: { [key in ChainId]: string } = {
ChainId.Ethereum: 'mainnet',
. . .
}
and then we could just do:
const targetChainKey = chainIdToWalletConnectKey[chainId]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
const walletConnectChain = searchParams?.get('walletConnectChain') | ||
|
||
const chain = (() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need try catch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops i was testing something else and didn't remove it
closing this in favour of #1452 |
Upon selection, this dropdown adds the query param
walletConnectChain
so that users can successfully connect their wallet using WalletConnect.Tested with Safe.
Closes #1153