From f5b0bf48a3ac36eb0e3e16417ff34b0524c8fa6d Mon Sep 17 00:00:00 2001 From: titix Date: Tue, 17 Sep 2024 17:07:40 -0300 Subject: [PATCH] fix: add network hexadecimal chain id --- src/components/AddNetworkButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AddNetworkButton.tsx b/src/components/AddNetworkButton.tsx index bf46c21..0b60d2d 100644 --- a/src/components/AddNetworkButton.tsx +++ b/src/components/AddNetworkButton.tsx @@ -27,7 +27,7 @@ export const AddNetworkButton = () => { try { await addNetwork({ - chainId: chain as string, + chainId: '0x' + Number(chain)?.toString(16), chainName: chainData?.metadata.name, rpcUrls: chainData?.metadata.publicRpcs[0], name: chainData?.baseToken.name, @@ -39,6 +39,7 @@ export const AddNetworkButton = () => { } catch (error) { console.error('Failed to add network:', error); alert(t('CHAIN.addNetworkFailed')); + setIsNetworkAdded(false); } };