Use the useGlobalWalletSignerAccount hook to retrieve the account approved to sign transactions for the connected Abstract Global Wallet. This is helpful if you need to acces the underlying EOA approved to sign transactions for the Abstract Global Wallet smart contract.

It uses the useAccount hook from wagmi under the hood.

Import

import { useGlobalWalletSignerAccount } from "@abstract-foundation/agw-react";

Usage

import { useGlobalWalletSignerAccount } from "@abstract-foundation/agw-react";

export default function App() {
  const { address, status } = useGlobalWalletSignerAccount();

  if (status === "disconnected") return <div>Disconnected</div>;

  if (status === "connecting" || status === "reconnecting") {
    return <div>Connecting...</div>;
  }

  return (
    <div>
      Connected to EOA: {address}
      Status: {status}
    </div>
  );
}

Returns

Returns a UseAccountReturnType<Config>.