@abstract-foundation/agw-react
Version:
Abstract Global Wallet React Components
26 lines • 832 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useGlobalWalletSignerAccount = useGlobalWalletSignerAccount;
const wagmi_1 = require("wagmi");
function useGlobalWalletSignerAccount(parameters = {}) {
const account = (0, wagmi_1.useAccount)(parameters);
if (!account.addresses?.[1]) {
return {
address: undefined,
addresses: undefined,
chain: undefined,
chainId: undefined,
connector: undefined,
isConnected: false,
isReconnecting: false,
isConnecting: false,
isDisconnected: true,
status: 'disconnected',
};
}
return {
...account,
address: account.addresses[1],
};
}
//# sourceMappingURL=useGlobalWalletSignerAccount.js.map