Skip to content

Commit

Permalink
fix: ChainId is wrong while switching the network (#4690)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR authored Apr 22, 2024
1 parent bcf4331 commit ac12784
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/composables/useChangeNetwork.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import networks from '@snapshot-labs/snapshot.js/src/networks.json';
import { sleep } from '@snapshot-labs/snapshot.js/src/utils';
import { hexlify } from '@ethersproject/bytes';

export function useChangeNetwork() {
const changingNetwork = ref(false);
Expand All @@ -11,7 +10,7 @@ export function useChangeNetwork() {
method: 'wallet_switchEthereumChain',
params: [
{
chainId: hexlify(Number(networks[network].chainId))
chainId: `0x${Number(networks[network].chainId).toString(16)}`
}
]
});
Expand Down

0 comments on commit ac12784

Please sign in to comment.