From 1e723d2cac6f8216e8d516b0bb57f29f3d209017 Mon Sep 17 00:00:00 2001 From: Aleksandar Cakalic Date: Mon, 6 Oct 2025 10:43:46 +0200 Subject: [PATCH] fix: fix bug in `isValidSession` --- src/connectors/argent/argentMobile/modal/adapter.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/connectors/argent/argentMobile/modal/adapter.ts b/src/connectors/argent/argentMobile/modal/adapter.ts index ccc8fc8e..9c8535d8 100644 --- a/src/connectors/argent/argentMobile/modal/adapter.ts +++ b/src/connectors/argent/argentMobile/modal/adapter.ts @@ -12,7 +12,7 @@ import { } from "@walletconnect/utils" import { EventEmitter } from "events" -import { ProviderInterface } from "starknet" +import type { ProviderInterface } from "starknet" import type { EthereumRpcConfig } from "./starknet/adapter" export interface NamespaceAdapterOptions { @@ -63,7 +63,7 @@ export abstract class NamespaceAdapter { requiredNamespaces, }: SessionTypes.Struct) => { const chain = this.formatChainId(this.chainId) - if (requiredNamespaces) { + if (requiredNamespaces && Object.keys(requiredNamespaces).length > 0) { return !!requiredNamespaces[this.namespace]?.chains?.includes(chain) } return !!namespaces?.[this.namespace]?.accounts.some((account) => @@ -97,8 +97,7 @@ export abstract class NamespaceAdapter { protected setChainId(chain: string) { if (this.isCompatibleChainId(chain)) { - const chainId = this.parseChainId(chain) - this.chainId = chainId + this.chainId = this.parseChainId(chain) this.eventEmitter.emit("chainChanged", this.chainId) } }