From 12d56f9ad45c0754621c503695d3fa95451f2a94 Mon Sep 17 00:00:00 2001 From: Arseniy Klempner Date: Fri, 21 Nov 2025 10:36:35 -0800 Subject: [PATCH] fix: check that eth_requestAccounts returns an array --- packages/rln/src/utils/rpcClient.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/rln/src/utils/rpcClient.ts b/packages/rln/src/utils/rpcClient.ts index 585adf1a9d..faf11537cc 100644 --- a/packages/rln/src/utils/rpcClient.ts +++ b/packages/rln/src/utils/rpcClient.ts @@ -27,7 +27,11 @@ export const createViemClientFromWindow = async (): Promise => { ); } - const [account] = await ethereum.request({ method: "eth_requestAccounts" }); + const accounts = await ethereum.request({ method: "eth_requestAccounts" }); + if (!Array.isArray(accounts)) { + throw Error("Failed to get accounts"); + } + const account = accounts[0] as Address; const rpcClient: RpcClient = createWalletClient({ account: account as Address,