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,