> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abs.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# getLinkedAgw

> Function to get the linked Abstract Global Wallet for an Ethereum Mainnet address.

The `getLinkedAgw` function is available when extending a [Viem Client](https://viem.sh/docs/clients/custom.html) with `linkableWalletActions`. It can be used to check if an Ethereum Mainnet address has linked an Abstract Global Wallet.

## Usage

```tsx theme={null}
import { linkableWalletActions } from "@abstract-foundation/agw-client";
import { createWalletClient, custom } from "viem";
import { sepolia } from "viem/chains";

export default function CheckLinkedWallet() {
  async function checkLinkedWallet() {
    // Initialize a Viem Wallet client: (https://viem.sh/docs/clients/wallet)
    // And extend it with linkableWalletActions
    const client = createWalletClient({
      chain: sepolia,
      transport: custom(window.ethereum!),
    }).extend(linkableWalletActions());

    // Check if an address has a linked AGW
    const { agw } = await client.getLinkedAgw();

    if (agw) {
      console.log("Linked AGW:", agw);
    } else {
      console.log("No linked AGW found");
    }
  }

  return <button onClick={checkLinkedWallet}>Check Linked AGW</button>;
}
```

## Parameters

<ResponseField name="address" type="Address">
  The Ethereum Mainnet address to check for a linked AGW. If not provided, defaults to the connected account's address.
</ResponseField>

## Returns

<ResponseField name="agw" type="Address | undefined">
  The address of the linked Abstract Global Wallet, or `undefined` if no AGW is linked.
</ResponseField>
