diff --git a/AGENTS.md b/AGENTS.md index ad363b2b0..11445bf6f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK |base-account/framework-integrations/wagmi:base-pay,basenames,batch-transactions,other-use-cases,setup,sign-in-with-base,sub-accounts |base-account/guides:accept-payments,accept-recurring-payments,authenticate-users,migration-guide,sign-and-verify-typed-data |base-account/guides/tips:inspect-txn-simulation,popup-tips -|base-account/improve-ux:batch-transactions,magic-spend,spend-permissions,sub-accounts +|base-account/improve-ux:batch-transactions,spend-permissions,sub-accounts |base-account/improve-ux/sponsor-gas:erc20-paymasters,paymasters |base-account/more:base-gasless-campaign,telemetry |base-account/more/troubleshooting/usage-details:gas-usage,popups,simulations,unsupported-calls,wallet-library-support diff --git a/docs/base-account/contribute/contribute-to-base-account-docs.mdx b/docs/base-account/contribute/contribute-to-base-account-docs.mdx index 83370baa5..74405bf8e 100644 --- a/docs/base-account/contribute/contribute-to-base-account-docs.mdx +++ b/docs/base-account/contribute/contribute-to-base-account-docs.mdx @@ -61,7 +61,6 @@ When adding new content, determine the appropriate section based on the followin - Paymasters and gas sponsorship - Sub Accounts - Spend Permissions - - Magic Spend - Name guides clearly with action-oriented titles (e.g., "Accept Payments" rather than "Payments Guide") #### Framework Integrations diff --git a/docs/base-account/improve-ux/magic-spend.mdx b/docs/base-account/improve-ux/magic-spend.mdx deleted file mode 100644 index 7607ebe07..000000000 --- a/docs/base-account/improve-ux/magic-spend.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "Use Coinbase Balances Onchain" -description: "How to use Coinbase balances onchain with Base Account" ---- - -With MagicSpend, Base Account users can use their Coinbase balances onchain. This means users can easily start using onchain apps without needing to onramp funds into their wallet. - -This also means that apps might not have all the balance information typically available to them by reading onchain data. Base Account indicates that this is the case by responding to [`wallet_getCapabilities` RPC calls](https://eip5792.xyz/reference/getCapabilities) with the `auxiliaryFunds` capability for each chain Base Account users can use their Coinbase balances on. - -If your app supports Base Account, it should not assume it knows the full balances available to a user if the `auxiliaryFunds` capability is present on a given chain. For example, if your app disables a transaction button if it sees that the wallet has insufficient funds, your app should take `auxiliaryFunds` into account and enable the button if the account has `auxiliaryFunds` on the chain the user is transacting on. - -## Why it matters - -MagicSpend makes onboarding smoother by letting users pay gas or send funds even when their onchain wallet balance is **zero**. Your interface should therefore _never_ disable an action just because the onchain balance is insufficient. - - -1. Ensure you have the user’s `address` stored in your component state (from your wallet connection flow). - -2. Drop the component below into your UI. It will check whether MagicSpend (`auxiliaryFunds`) is available for that address on Base and if not, disable the send button accordingly. - -```tsx title="SendButton.tsx" -import { useEffect, useState } from "react"; -import { createBaseAccountSDK, base } from "@base-org/account"; - -const sdk = createBaseAccountSDK({ - appName: "Magic Spend Demo", - appLogoUrl: "https://base.org/logo.png", - appChainIds: [base.constants.CHAIN_IDS.base], -}); - -const provider = sdk.getProvider(); - -interface Props { - address?: string; // wallet address from your app state -} - -export function SendButton({ address }: Props) { - const [hasAuxFunds, setHasAuxFunds] = useState(null); - - useEffect(() => { - if (!address) return; // Wallet not connected yet - - (async () => { - try { - const capabilities = await provider.request({ - method: "wallet_getCapabilities", - params: [address], - }); - const supported = - capabilities?.[base.constants.CHAIN_IDS.base]?.auxiliaryFunds - ?.supported ?? false; - setHasAuxFunds(supported); - } catch (err) { - console.error("wallet_getCapabilities failed", err); - setHasAuxFunds(false); - } - })(); - }, [address]); - - const disabled = hasAuxFunds !== true; - - return ( - - ); -} -``` - -### What the code does - -1. Receives the current `address` from your own wallet logic. -2. Calls `wallet_getCapabilities` whenever the address changes. -3. Reads `auxiliaryFunds.supported` for the Base chain (`8453`). -4. Enables the button when MagicSpend is available; otherwise shows “Insufficient Balance”. - -## Base Pay integrates Magic Spend by default - -Thanks to [Magic Spend](/base-account/improve-ux/magic-spend), [Base Pay](/base-account/guides/accept-payments) allows users to pay with their USDC balance on Coinbase by default. - -
- Pay with Coinbase on Base Account -
---- - -## Next steps - -- Handle loading/error states if you need fine-grained UX -- Combine this check with your existing onchain balance logic for fallback flows - diff --git a/docs/base-account/llms-full.txt b/docs/base-account/llms-full.txt index 945264e43..3165bba51 100644 --- a/docs/base-account/llms-full.txt +++ b/docs/base-account/llms-full.txt @@ -41,7 +41,6 @@ const { status } = await getPaymentStatus({ id }) - [Spend Permissions](https://docs.base.org/base-account/improve-ux/spend-permissions.md) — Spending - [Verify Social Accounts](https://docs.base.org/base-account/guides/verify-social-accounts.md) — Base Verify - [Sub‑Accounts](https://docs.base.org/base-account/improve-ux/sub-accounts.md) — App‑scoped accounts -- [MagicSpend](https://docs.base.org/base-account/improve-ux/magic-spend.md) — Coinbase balance spend - [Sign & Verify Data](https://docs.base.org/base-account/guides/sign-and-verify-typed-data.md) — Signatures ### Framework Integrations @@ -63,6 +62,7 @@ const { status } = await getPaymentStatus({ id }) - [SDK: getProvider](https://docs.base.org/base-account/reference/core/getProvider.md) - [Provider RPC Methods](https://docs.base.org/base-account/reference/core/provider-rpc-methods/request-overview.md) - [Capabilities](https://docs.base.org/base-account/reference/core/capabilities/overview.md) +- [Capability: auxiliaryFunds](https://docs.base.org/base-account/reference/core/capabilities/auxiliaryFunds.md) — Reference only, currently disabled - [UI Elements](https://docs.base.org/base-account/reference/ui-elements/brand-guidelines.md) - [Onchain Contracts](https://docs.base.org/base-account/reference/onchain-contracts/smart-wallet.md) diff --git a/docs/base-account/llms.txt b/docs/base-account/llms.txt index 3ec15fc8a..66805cc1a 100644 --- a/docs/base-account/llms.txt +++ b/docs/base-account/llms.txt @@ -2,7 +2,7 @@ ## Base Account Documentation -> Base Account is a passkey-secured, ERC-4337 smart wallet with one‑tap payments, social verification, spend permissions, and sub‑accounts—built for seamless multi‑chain apps. +> Base Account is a passkey-secured, ERC-4337 smart wallet with one‑tap payments, social verification, sponsored gas, spend permissions, and sub‑accounts—built for seamless multi‑chain apps. ## Introduction - [What is Base Account?](https://docs.base.org/base-account/overview/what-is-base-account.md) — Core concepts and benefits @@ -28,6 +28,7 @@ ## Reference - [Account SDK: createBaseAccount](https://docs.base.org/base-account/reference/core/createBaseAccount.md) — Initialize SDK and provider +- [Capabilities: auxiliaryFunds](https://docs.base.org/base-account/reference/core/capabilities/auxiliaryFunds.md) — Auxiliary funds capability reference, currently disabled - [Provider RPC: wallet_sendCalls](https://docs.base.org/base-account/reference/core/provider-rpc-methods/wallet_sendCalls.md) — Batch and sponsored calls ## More diff --git a/docs/base-account/reference/core/capabilities/auxiliaryFunds.mdx b/docs/base-account/reference/core/capabilities/auxiliaryFunds.mdx index 874997f01..c86cc84ba 100644 --- a/docs/base-account/reference/core/capabilities/auxiliaryFunds.mdx +++ b/docs/base-account/reference/core/capabilities/auxiliaryFunds.mdx @@ -9,6 +9,10 @@ Defined in [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) The auxiliaryFunds capability allows wallets to indicate they have access to funds beyond what can be directly verified on-chain by the wallet's address. This enables more flexible transaction execution and improved user experiences. + +Magic Spend is currently disabled. Keep this page as reference for the `auxiliaryFunds` capability shape and integration patterns, but do not rely on this capability being available in production right now. + + This capability is not yet finalized and may change in future iterations. diff --git a/docs/base-account/reference/core/capabilities/overview.mdx b/docs/base-account/reference/core/capabilities/overview.mdx index 4a5acb33b..8c127f6ee 100644 --- a/docs/base-account/reference/core/capabilities/overview.mdx +++ b/docs/base-account/reference/core/capabilities/overview.mdx @@ -27,7 +27,7 @@ const baseCapabilities = capabilities["0x2105"]; // Base mainnet chain ID | Capability | Method | Description | |-----------|---------|-------------| | [signInWithEthereum](/base-account/reference/core/capabilities/signInWithEthereum) | `wallet_connect` | SIWE authentication | -| [auxiliaryFunds](/base-account/reference/core/capabilities/auxiliaryFunds) | `wallet_sendCalls` | MagicSpend - use Coinbase balances onchain | +| [auxiliaryFunds](/base-account/reference/core/capabilities/auxiliaryFunds) | `wallet_sendCalls` | Access to funds beyond the visible on-chain balance (currently disabled) | | [atomic](/base-account/reference/core/capabilities/atomic) | `wallet_sendCalls` | Atomic batch transactions | | [paymasterService](/base-account/reference/core/capabilities/paymasterService) | `wallet_sendCalls` | Gasless transactions | | [flowControl](/base-account/reference/core/capabilities/flowControl) | `wallet_sendCalls` | Flow control | @@ -198,7 +198,7 @@ async function getWalletCapabilities(address: string) { For detailed information on each capability: - [signInWithEthereum](/base-account/reference/core/capabilities/signInWithEthereum) - SIWE authentication -- [auxiliaryFunds](/base-account/reference/core/capabilities/auxiliaryFunds) - MagicSpend integration +- [auxiliaryFunds](/base-account/reference/core/capabilities/auxiliaryFunds) - Auxiliary funding support - [atomic](/base-account/reference/core/capabilities/atomic) - Atomic batch transactions - [paymasterService](/base-account/reference/core/capabilities/paymasterService) - Gasless transactions diff --git a/docs/base-account/reference/core/provider-rpc-methods/wallet_getCapabilities.mdx b/docs/base-account/reference/core/provider-rpc-methods/wallet_getCapabilities.mdx index 5db8d3d62..7c9ea47a9 100644 --- a/docs/base-account/reference/core/provider-rpc-methods/wallet_getCapabilities.mdx +++ b/docs/base-account/reference/core/provider-rpc-methods/wallet_getCapabilities.mdx @@ -27,7 +27,7 @@ Capabilities object for a specific chain (e.g., "0x2105" for Base Mainnet). -Indicates wallet access to funds beyond on-chain balance verification (MagicSpend). +Indicates wallet access to funds beyond on-chain balance verification. This capability is currently disabled. diff --git a/docs/docs.json b/docs/docs.json index 0edb33579..ea7de30f3 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -235,7 +235,6 @@ "base-account/improve-ux/sub-accounts", "base-account/improve-ux/spend-permissions", "base-account/guides/verify-social-accounts", - "base-account/improve-ux/magic-spend", "base-account/guides/sign-and-verify-typed-data", "base-account/improve-ux/sponsor-gas/erc20-paymasters" ] @@ -1971,7 +1970,11 @@ }, { "source": "/smart-wallet/guides/magic-spend", - "destination": "/base-account/improve-ux/magic-spend" + "destination": "/base-account/reference/core/capabilities/auxiliaryFunds" + }, + { + "source": "/base-account/improve-ux/magic-spend", + "destination": "/base-account/reference/core/capabilities/auxiliaryFunds" }, { "source": "/smart-wallet/guides/batch-transactions", diff --git a/docs/llms-full.txt b/docs/llms-full.txt index 0b82a1de1..7cd9ece95 100644 --- a/docs/llms-full.txt +++ b/docs/llms-full.txt @@ -68,7 +68,7 @@ export function Providers(props: { children: React.ReactNode }) { } ``` -Base Account (smart wallet + pay helper) +Base Account (smart wallet + pay helper + capabilities) ```bash npm install @base-org/account diff --git a/docs/llms.txt b/docs/llms.txt index 8f97498e7..efdc0b3c8 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -6,7 +6,7 @@ - [Get Started](./get-started/llms.txt) — Orientation, products, use cases, and quickstarts - [Base Chain](./base-chain/llms.txt) — Deploy/connect, network info, tools, node ops, security -- [Base Account](./base-account/llms.txt) — Passkey smart wallet, payments, social verification, sponsored gas, sub‑accounts +- [Base Account](./base-account/llms.txt) — Passkey smart wallet, payments, social verification, spend permissions, sponsored gas, sub‑accounts - [AI Agents](./ai-agents/llms.txt) — Build onchain AI agents: wallets, payments, identity, frameworks - [Mini Apps](./mini-apps/llms.txt) — MiniKit, manifests, features, growth, troubleshooting - [OnchainKit](./onchainkit/llms.txt) — React SDK: provider, components, APIs, utilities, templates