-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix: signing with walletConnect not working when switching chains in ethers/ethers5 #3727
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5c76ab9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
providerType: 'WALLET_CONNECT' | ||
}) | ||
|
||
expect(mockWalletConnectProvider.setDefaultChain).toHaveBeenCalledWith('eip155:1') |
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.
We don't need to set setDefaultChain
because it's done after we switch chain in universal provider. Talked with Gancho about this.
@@ -543,7 +543,7 @@ export class EthersAdapter extends AdapterBlueprint { | |||
public override async switchNetwork(params: AdapterBlueprint.SwitchNetworkParams): Promise<void> { | |||
const { caipNetwork, provider, providerType } = params | |||
|
|||
if (providerType === 'AUTH' || providerType === 'WALLET_CONNECT') { | |||
if (providerType === 'AUTH') { |
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.
don't you need to change the parent class implementation too? I remember it handled wc cases as well
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.
I want to keep it as is because solana adapter uses it and works fine
can we add an e2e given it's a wc connection ? 🙏 |
@@ -543,7 +543,7 @@ export class EthersAdapter extends AdapterBlueprint { | |||
public override async switchNetwork(params: AdapterBlueprint.SwitchNetworkParams): Promise<void> { | |||
const { caipNetwork, provider, providerType } = params | |||
|
|||
if (providerType === 'AUTH' || providerType === 'WALLET_CONNECT') { | |||
if (providerType === 'AUTH') { |
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.
Is this because we are doing switch network in universal provider adapter for WC option?
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.
yeah
Description
Fixed an issue where signing was not working when switching chains using WalletConnect with ethers/ethers5 adapters.
The reason is because we never called
wallet_switchEthereumChain
on the provider when switching chain.Type of change
Associated Issues
For Linear issues: Closes APKT-2102
Showcase (Optional)
Checklist