From 74331fd2c302d1e33dfb61ef9b0585fffae29145 Mon Sep 17 00:00:00 2001 From: Yeferson Licet <111311418+y3fers0n@users.noreply.github.com> Date: Thu, 2 May 2024 20:28:07 -0300 Subject: [PATCH] fix: Verify chainId only if present in domain (#523) --- src/ethereum_provider.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ethereum_provider.js b/src/ethereum_provider.js index f782c7dd..9679e58e 100644 --- a/src/ethereum_provider.js +++ b/src/ethereum_provider.js @@ -315,7 +315,10 @@ class TrustWeb3Provider extends BaseProvider { const { chainId } = message.domain || {}; - if (!chainId || Number(chainId) !== Number(this.chainId)) { + if ( + typeof chainId !== "undefined" && + Number(chainId) !== Number(this.chainId) + ) { throw new Error( "Provided chainId does not match the currently active chain" );