Skip to main content

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.

Gets the Wallet client exposed by the AbstractWalletProvider context. Use this client to perform actions from the connected Abstract Global Wallet, for example deployContract, sendTransaction, writeContract, etc.

Import

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

Usage

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

export default function Example() {
  const { data: abstractClient, isLoading, error } = useAbstractClient();

  // Use the client to perform actions such as sending transactions or deploying contracts
  async function submitTx() {
    if (!abstractClient) return;

    const hash = await abstractClient.sendTransaction({
      to: "0x8e729E23CDc8bC21c37a73DA4bA9ebdddA3C8B6d",
      data: "0x69",
    });
  }

  // ... rest of your component ...
}

Returns

Returns a UseQueryResult<AbstractClient, Error>.