From 7aedb4129f5d6d38d1df5823f7eeb625068a2756 Mon Sep 17 00:00:00 2001 From: Samuele Agostinelli Date: Mon, 18 Nov 2024 14:18:29 -0500 Subject: [PATCH] network switching issues fix (#191) --- packages/checkout/src/views/Swap/index.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/checkout/src/views/Swap/index.tsx b/packages/checkout/src/views/Swap/index.tsx index b900cf05..0f05ae97 100644 --- a/packages/checkout/src/views/Swap/index.tsx +++ b/packages/checkout/src/views/Swap/index.tsx @@ -117,6 +117,11 @@ export const Swap = () => { return swapTransactions } + const walletClientChainId = await walletClient.getChainId() + if (walletClientChainId !== chainId) { + await walletClient.switchChain({ id: chainId }) + } + const txHash = await sendTransactions({ connector, walletClient,