Hook to get a wallet client instance of the approved signer of the connected Abstract Global Wallet.
Use the useGlobalWalletSignerClient hook to get a wallet client
instance that can perform actions from the underlying EOA
approved to sign transactions for the Abstract Global Wallet smart contract.
This hook is different from useAbstractClient, which
performs actions (e.g. sending a transaction) from the Abstract Global Wallet smart contract itself, not the EOA approved to sign transactions for it.
It uses wagmi’s useWalletClient hook under the hood, returning
a wallet client instance with the account set as the approved EOA of the Abstract Global Wallet.
import{ useGlobalWalletSignerClient }from"@abstract-foundation/agw-react";exportdefaultfunctionApp(){const{ data: client, isLoading, error }=useGlobalWalletSignerClient();// Use the client to perform actions such as sending transactions or deploying contractsasyncfunctionsubmitTx(){if(!client)return;const hash =await client.sendTransaction({ to:"0x8e729E23CDc8bC21c37a73DA4bA9ebdddA3C8B6d", data:"0x69",});}// ... rest of your component ...}
fetching: Is true whenever the queryFn is executing, which includes initial
pending as well as background refetches. - paused: The query wanted to fetch,
but has been paused. - idle: The query is not fetching. See Network Mode for
more information.
cancelRefetch: When set to true, a
currently running request will be cancelled before a new request is made. When
set to false, no refetch will be made if there is already a request running. Defaults to true.
pending: if there’s no cached data and no query attempt was finished yet.
error: if the query attempt resulted in an error. The corresponding error
property has the error received from the attempted fetch.
success: if the query has received a response with no errors and is ready to display its data.
The corresponding data property on the query is the data received from the
successful fetch or if the query’s enabled property is set to successful fetch
or if the query’s enabled property is set to false and has not been fetched
yet data is the first initialData supplied to the query on initialization.