From 775c381a37b699fabe0c8881d980f9c0963b71b2 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 14 Nov 2023 12:28:48 +0000 Subject: [PATCH] Fix chainId in enforce network --- package.json | 2 +- src/core/network.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 074ce02..1a53786 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/metaport", - "version": "2.0.1", + "version": "2.0.2", "description": "SKALE Metaport Widget", "keywords": [ "skale", diff --git a/src/core/network.ts b/src/core/network.ts index 7461f8b..588f2dd 100644 --- a/src/core/network.ts +++ b/src/core/network.ts @@ -153,7 +153,7 @@ export async function enforceNetwork( skaleNetwork: SkaleNetwork, chainName: string ): Promise { - const currentChainId = walletClient.chain.id + const currentChainId = await walletClient.getChainId() const { chainId } = await provider.getNetwork() log( `Current chainId: ${currentChainId}, required chainId: ${chainId}, required network: ${chainName} `