mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-17 15:33:10 +00:00
fix: check that eth_requestAccounts returns an array
This commit is contained in:
parent
d8ca7d0e07
commit
12d56f9ad4
@ -27,7 +27,11 @@ export const createViemClientFromWindow = async (): Promise<RpcClient> => {
|
||||
);
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user