Overview
Learn how the agw-react package works and how to use it to interact with the Abstract Global Wallet.
The agw-react
package provides a set of hooks and components that allow users to sign in and send
transactions using Abstract Global Wallet. It is built on top of the wagmi library.
Once the user connect’s their wallet by calling useLoginWithAbstract (within the context of an AbstractWalletProvider), you can continue to use any of the wagmi and TanStack Query hooks as you would with any other wallet, as well as all of the viem functionality.
How it works
Both wagmi and TanStack Query wrap your application in a provider component that allows you to use the hooks and components they provide anywhere in your application.
The agw-react
package similarly provides the AbstractWalletProvider component,
which under the hood wraps your application in the following providers:
- The TanStack QueryClientProvider: to manage your application’s state using queries and mutations, e.g. to check if a wallet is connected, read data from the blockchain, and send transactions.
- The wagmi WagmiProvider: configured to use the Abstract network with Abstract Global Wallet as a wallet connection option.
Learn more about the wagmi and TanStack Query libraries using the resources below:
Was this page helpful?