From abstract-skills
Integrate Abstract Global Wallet (AGW) into React apps with email/social/passkey login, smart contract wallets, session keys, gas sponsorship, and provider integrations for Abstract Ethereum L2.
How this skill is triggered — by the user, by Claude, or both
Slash command
/abstract-skills:abstract-global-walletThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
AGW is Abstract's cross-application smart contract wallet. Users sign up once (email, social, passkey) and use it across all Abstract apps. **Recommended over standard wallet connections for new Abstract apps** — see the decision table below for when to consider alternatives.
AGW is Abstract's cross-application smart contract wallet. Users sign up once (email, social, passkey) and use it across all Abstract apps. Recommended over standard wallet connections for new Abstract apps — see the decision table below for when to consider alternatives.
For AI agent wallet access (not end-user facing), see the using-agw-mcp skill instead.
npx @abstract-foundation/create-abstract-app@latest my-app
This scaffolds a React app with AGW pre-configured.
npm install @abstract-foundation/agw-react @abstract-foundation/agw-client wagmi [email protected] @tanstack/react-query
viem must be 2.x. Using viem 1.x causes compatibility errors.
import { AbstractWalletProvider } from "@abstract-foundation/agw-react";
import { abstractTestnet } from "viem/chains"; // or abstract for mainnet
export default function App() {
return (
<AbstractWalletProvider chain={abstractTestnet}>
{/* Your app */}
</AbstractWalletProvider>
);
}
import { useLoginWithAbstract } from "@abstract-foundation/agw-react";
export default function LoginButton() {
const { login, logout } = useLoginWithAbstract();
return <button onClick={login}>Login with Abstract</button>;
}
import { useAbstractClient } from "@abstract-foundation/agw-react";
export default function SendTx() {
const { data: abstractClient } = useAbstractClient();
async function send() {
if (!abstractClient) return;
const hash = await abstractClient.sendTransaction({
to: "0x...",
data: "0x...",
});
}
return <button onClick={send}>Send</button>;
}
import { useWriteContractSponsored } from "@abstract-foundation/agw-react";
import { getGeneralPaymasterInput } from "viem/zksync";
export default function SponsoredMint() {
const { writeContractSponsored, isPending } = useWriteContractSponsored();
return (
<button
disabled={isPending}
onClick={() =>
writeContractSponsored({
abi: contractAbi,
address: "0xContractAddress",
functionName: "mint",
args: ["0xRecipient", BigInt(1)],
paymaster: "0xPaymasterAddress",
paymasterInput: getGeneralPaymasterInput({ innerInput: "0x" }),
})
}
>
Mint (Gas Free)
</button>
);
}
| Use Case | AGW | Standard (MetaMask/EOA) |
|---|---|---|
| New Abstract app | Yes | No |
| Cross-app wallet identity | Yes | No |
| Email/social login | Yes | No |
| Session keys (gasless UX) | Yes | No |
| Gas sponsorship | Yes | Paymaster only |
| Existing wallet user base | Consider both | Yes |
| Use Case | Session Keys | Direct Approval |
|---|---|---|
| Games / frequent actions | Yes | No |
| One-time transactions | No | Yes |
| No-popup UX | Yes | No |
| High-value transactions | No | Yes |
| Testnet | Yes | Yes |
| Mainnet | Requires security review | Yes |
| Feature | Where to look |
|---|---|
| React hooks API | references/react-hooks.md |
| Session keys (create, use, revoke) | references/session-keys.md |
| Third-party wallet providers | references/wallet-providers.md |
| Package | Purpose |
|---|---|
@abstract-foundation/agw-react | React hooks + AbstractWalletProvider. Built on Wagmi. |
@abstract-foundation/agw-client | Wallet actions + session key utilities. Built on Viem. |
abstract or abstractTestnet — AbstractWalletProvider throws on unsupported chainslocalStorage; use encrypted browser storage or server-side KMSapprove/setApprovalForAll in session policies must include constraints restricting to a specific contract address, or the registry will rejectnpx claudepluginhub abstract-foundation/abstract-skillsBuilds Stellar dApp frontends with React/Next.js/Node.js: wallet connection, transaction building/signing, Soroban contract invocation, and smart accounts with passkeys.
Provides AI agents read access to Abstract chain data and balances via AGW MCP server (txns soon). Guides setup of agw-mcp for Claude Code and MCP agent workflows.
Selects optimal Circle wallet type (developer-controlled, user-controlled, modular) for onchain apps by comparing custody, auth methods, account types (EOA/SCA/MSCA), and blockchain support. Guides implementation for wallet integrations.