UNPKG

@dynamic-labs/sdk-react-core

Version:

A React SDK for implementing wallet web3 authentication and authorization to your website.

18 lines (15 loc) 600 B
'use client' import { usePromise } from '../usePromise/usePromise.js'; const useConnectedAccountWallet = (connector, secondaryWallets) => usePromise(() => { if (!connector) { return; } return connector .getConnectedAccounts() .then((connectedAccounts) => secondaryWallets.find((secondaryWallet) => { var _a; return secondaryWallet.address.toLowerCase() === ((_a = connectedAccounts[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase()); })); }, { deps: [connector, secondaryWallets] }); export { useConnectedAccountWallet };