Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Base Docs Index
IMPORTANT: Prefer retrieval-led reasoning. Read relevant docs before generating code.
Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainKit, MiniKit.
[Docs]|root:./docs
|ai-agents:index,trading
|ai-agents/core-concepts:agent-apps,agent-frameworks,identity-verification-auth,payments-and-transactions,wallets
|base-account/basenames:basename-transfer,basenames-faq,basenames-onchainkit-tutorial,basenames-wagmi-tutorial
|base-account/contribute:contribute-to-base-account-docs,security-and-bug-bounty
|base-account/framework-integrations:cdp,rainbowkit,reown,thirdweb
|base-account/framework-integrations/privy:authentication,setup,spend-permissions,sub-accounts,wallet-actions
|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/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
|base-account/overview:what-is-base-account
|base-account/quickstart:ai-tools-available-for-devs,mobile-integration,web-react,web
|base-account/reference/base-pay:charge,getOrCreateSubscriptionOwnerWallet,getPaymentStatus,getStatus,pay,prepareCharge,prepareRevoke,revoke,subscribe,subscriptions-overview
|base-account/reference/core:createBaseAccount,generateKeyPair,getCryptoKeyAccount,getKeypair,getProvider,sdk-utilities
|base-account/reference/core/capabilities:atomic,auxiliaryFunds,dataSuffix,datacallback,flowControl,overview,paymasterService,signInWithEthereum
|base-account/reference/core/provider-rpc-methods:coinbase_fetchPermission,coinbase_fetchPermissions,eth_accounts,eth_blockNumber,eth_chainId,eth_coinbase,eth_estimateGas,eth_feeHistory,eth_gasPrice,eth_getBalance,eth_getBlockByHash,eth_getBlockByNumber,eth_getBlockTransactionCountByHash,eth_getBlockTransactionCountByNumber,eth_getCode,eth_getLogs,eth_getProof,eth_getStorageAt,eth_getTransactionByBlockHashAndIndex,eth_getTransactionByBlockNumberAndIndex,eth_getTransactionByHash,eth_getTransactionCount,eth_getTransactionReceipt,eth_getUncleCountByBlockHash,eth_getUncleCountByBlockNumber,eth_requestAccounts,eth_sendRawTransaction,eth_sendTransaction,eth_signTypedData_v4,personal_sign,request-overview,sdk-overview,standard-rpc-methods,wallet_addEthereumChain,wallet_addSubAccount,wallet_connect,wallet_getCallsStatus,wallet_getCapabilities,wallet_getSubAccounts,wallet_sendCalls,wallet_switchEthereumChain,wallet_watchAsset,web3_clientVersion
|base-account/reference/onchain-contracts:basenames,smart-wallet,spend-permissions
|base-account/reference/prolink-utilities:createProlinkUrl,decodeProlink,encodeProlink
|base-account/reference/spend-permission-utilities:fetchPermission,fetchPermissions,getPermissionStatus,prepareRevokeCallData,prepareSpendCallData,requestRevoke,requestSpendPermission
|base-account/reference/ui-elements:base-pay-button,brand-guidelines,sign-in-with-base-button
|base-chain/builder-codes:app-developers,bridge-developers,builder-codes,wallet-developers
|base-chain/flashblocks:api-reference,apps,docs,node-providers
|base-chain/network-information:base-contracts,block-building,bridges,configuration-changelog,diffs-ethereum-base,ecosystem-contracts,network-fees,transaction-finality,troubleshooting-transactions
|base-chain/node-operators:performance-tuning,run-a-base-node,snapshots,troubleshooting
|base-chain/quickstart:base-solana-bridge,connecting-to-base,deploy-on-base,why-base
|base-chain/reference:json-rpc-api
|base-chain/security:avoid-malicious-flags,bug-bounty,report-vulnerability,security-council
|base-chain/tools:account-abstraction,base-products,block-explorers,cross-chain,data-indexers,network-faucets,node-providers,onboarding,onchain-registry-api,onramps,oracles,tokens-in-wallet
|get-started:base-mentorship-program,base-services-hub,base,build-app,concepts,country-leads-and-ambassadors,deploy-smart-contracts,docs-llms,docs-mcp,get-funded,launch-token,learning-resources,prompt-library
|mini-apps/core-concepts:authentication,base-account,context,embeds-and-previews,manifest,navigation,notifications
|mini-apps/featured-guidelines:design-guidelines,notification-guidelines,overview,product-guidelines,technical-guidelines
|mini-apps/growth:build-viral-mini-apps,optimize-onboarding,rewards
|mini-apps/introduction:overview
|mini-apps/quality-and-publishing:overview,quality-bar,submission-guidelines
|mini-apps/quickstart:build-checklist,building-for-the-base-app,create-new-miniapp,migrate-existing-apps,template
|mini-apps/resources:design-resources,templates
|mini-apps/technical-guides:accept-payments,building-chat-agents,dynamic-embeds,neynar-notifications,sharing-and-social-graph,sign-manifest
|mini-apps/troubleshooting:base-app-compatibility,common-issues,error-handling,how-search-works,testing
|onchainkit:create-a-basename-profile-component,getting-started,installation,restricted,use-coinbase-smart-wallet-and-eoas
|onchainkit/api:build-deposit-to-morpho-tx,build-mint-transaction,build-swap-transaction,build-withdraw-from-morpho-tx,get-mint-details,get-portfolios,get-swap-quote,get-token-details,get-tokens,types
|onchainkit/buy:buy,types
|onchainkit/checkout:checkout,types
|onchainkit/config:is-base,is-ethereum,onchainkit-provider,supplemental-providers,types
|onchainkit/earn:earn,types
|onchainkit/fund:fetch-onramp-config,fetch-onramp-options,fetch-onramp-quote,fetch-onramp-transaction-status,fund-button,fund-card,get-onramp-buy-url,setup-onramp-event-listeners,types
|onchainkit/guides:ai-prompting-guide,build-onchain-apps,contribution,lifecycle-status,reporting-bug,tailwind,telemetry,themes,troubleshooting,use-basename-in-onchain-app,using-ai-powered-ides
|onchainkit/hooks:use-build-deposit-to-morpho-tx,use-build-withdraw-from-morpho-tx,use-earn-context,use-mint-details,use-morpho-vault,use-token-details
|onchainkit/identity:address,avatar,badge,get-address,get-attestations,get-avatar,get-avatars,get-name,get-names,identity-card,identity,name,socials,types,use-address,use-avatar,use-avatars,use-name,use-names
|onchainkit/installation:astro,nextjs,remix,vite
|onchainkit/latest/components/appchain:bridge
|onchainkit/latest/components/buy:buy
|onchainkit/latest/components/checkout:checkout
|onchainkit/latest/components/connected:connected
|onchainkit/latest/components/earn:earn
|onchainkit/latest/components/fund:fund-button,fund-card
|onchainkit/latest/components/identity:address,avatar,badge,identity-card,identity,name,socials
|onchainkit/latest/components/minikit:overview,provider-and-initialization
|onchainkit/latest/components/minikit/hooks:useAddFrame,useAuthenticate,useClose,useComposeCast,useMiniKit,useNotification,useOpenUrl,usePrimaryButton,useViewCast,useViewProfile
|onchainkit/latest/components/mint:nft-card,nft-mint-card
|onchainkit/latest/components/signature:signature
|onchainkit/latest/components/swap:swap-settings,swap
|onchainkit/latest/components/token:token-chip,token-image,token-row,token-search,token-select-dropdown
|onchainkit/latest/components/transaction:transaction
|onchainkit/latest/components/wallet:wallet-dropdown-basename,wallet-dropdown-disconnect,wallet-dropdown-fund-link,wallet-dropdown-link,wallet-island,wallet-modal,wallet
|onchainkit/latest/configuration:onchainkit-provider,themes,wagmi-viem-integration
|onchainkit/latest/getting-started:manual-installation,overview,quickstart-guide,troubleshooting
|onchainkit/latest/guides:ai-prompting-guide,contributing
|onchainkit/latest/hooks/earn:use-build-deposit-to-morpho-tx,use-build-withdraw-from-morpho-tx,use-earn-context,use-morpho-vault
|onchainkit/latest/hooks/identity:use-address,use-avatar,use-avatars,use-name,use-names
|onchainkit/latest/hooks/mint:use-mint-details,use-token-details
|onchainkit/latest/utilities/earn:build-deposit-to-morpho-tx,build-withdraw-from-morpho-tx
|onchainkit/latest/utilities/fund:fetch-onramp-config,fetch-onramp-options,fetch-onramp-quote,fetch-onramp-transaction-status,get-onramp-buy-url,setup-onramp-event-listeners
|onchainkit/latest/utilities/identity:get-address,get-attestations,get-avatar,get-avatars,get-name,get-names
|onchainkit/latest/utilities/token:format-amount
|onchainkit/latest/utilities/wallet:is-valid-aa-entrypoint,is-wallet-a-coinbase-smart-wallet
|onchainkit/mint:nft-card,nft-mint-card,types
|onchainkit/paymaster:erc20-paymaster,errors,gasless-transactions-with-paymaster,how-to-contribute,quickstart-guide,quickstart-headless,security,troubleshooting,welcome
|onchainkit/signature:signature,types
|onchainkit/swap:swap-settings,swap,types
|onchainkit/templates:onchain-commerce-app,onchain-nft-app,onchain-social-profile
|onchainkit/token:format-amount,token-chip,token-image,token-row,token-search,token-select-dropdown,types
|onchainkit/transaction:transaction,types
|onchainkit/wallet:is-valid-aa-entrypoint,is-wallet-a-coinbase-smart-wallet,types,wallet-dropdown-basename,wallet-dropdown-disconnect,wallet-dropdown-fund-link,wallet-dropdown-link,wallet-island,wallet-modal,wallet
|root:AGENTS,cookie-policy,privacy-policy,terms-of-service,tone_of_voice
2 changes: 0 additions & 2 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Base is an Ethereum L2 by Coinbase. Docs for: Base Chain, Smart Wallet, OnchainK
|base-chain/quickstart:base-solana-bridge,bridge-token,connecting-to-base,deploy-on-base,why-base
|base-chain/security:avoid-malicious-flags,bug-bounty,report-vulnerability,security-council
|base-chain/tools:account-abstraction,base-products,block-explorers,cross-chain,data-indexers,network-faucets,node-providers,onboarding,onchain-registry-api,onramps,oracles,tokens-in-wallet
|cookbook:accept-crypto-payments,ai-assisted-documentation-reading,ai-powered-development-fundamentals,ai-prompting,base-app-coins,base-builder-mcp,converting-customizing-mini-apps,defi-your-app,essential-documentation-resources,go-gasless,introduction-to-mini-apps,launch-ai-agents,launch-tokens,mastering-ai-prompt-engineering,onboard-any-user,onchain-social,spend-permissions-ai-agent,successful-miniapps-in-tba,testing-onchain-apps
|cookbook/minikit:add-frame-metadata,add-minikit,build-your-mini-app-with-prompt,configure-environment,create-manifest,fork-and-customize,install,manifest-cli,test-and-deploy
|get-started:base-mentorship-program,base-services-hub,base,build-app,concepts,country-leads-and-ambassadors,deploy-smart-contracts,docs-llms,docs-mcp,get-funded,launch-token,prompt-library
|learn:exercise-contracts,welcome
|learn/address-and-payable:address-and-payable
Expand Down
98 changes: 98 additions & 0 deletions docs/ai-agents/llms-full.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# https://docs.base.org/ai-agents/llms-full.txt

## AI Agents — Deep Guide for LLMs

> Build AI agents that operate as independent economic actors on Base: a wallet to hold and spend funds, identity standards so other agents can trust it, a payment protocol for pay-per-request APIs, and a discovery layer so agents can find each other.

### What you can do here
- Choose a framework (Agent SDK, OpenClaw, BANKR) to build and run your agent
- Give your agent a wallet to hold stablecoins and sign transactions
- Enable your agent to pay for services automatically using the x402 protocol
- Register and verify agent identity for agent-to-agent trust
- Build agent apps — services designed for agents as the primary user
- Apply Base-specific patterns for trading agents using Flashblocks

## Navigation (with brief descriptions)

### Introduction
- [AI Agents on Base](https://docs.base.org/ai-agents/index.md) — Overview and how pieces fit together

### Core Concepts
- [Frameworks](https://docs.base.org/ai-agents/core-concepts/agent-frameworks.md) — Agent SDK, OpenClaw, BANKR comparison
- [Wallets](https://docs.base.org/ai-agents/core-concepts/wallets.md) — Wallet options and setup
- [Payments & Transactions](https://docs.base.org/ai-agents/core-concepts/payments-and-transactions.md) — x402 and skills
- [Identity, Verification & Auth](https://docs.base.org/ai-agents/core-concepts/identity-verification-auth.md) — Agent identity and trust
- [Agent Apps](https://docs.base.org/ai-agents/core-concepts/agent-apps.md) — Build agent-first services

### Advanced
- [Trading on Base](https://docs.base.org/ai-agents/trading.md) — Flashblocks, fee calibration, trading signals


## Key Concepts (excerpts)

Source: `https://docs.base.org/ai-agents/index.md`

Base gives your AI agent the tools to operate as an independent economic actor:
- **Framework**: Self-hosted SDK, open-source assistant (OpenClaw), or managed API (BANKR)
- **Wallet**: Hold stablecoins, send payments, and sign transactions onchain
- **Payments**: Pay for API access with stablecoins using the x402 pay-per-request protocol
- **Identity**: Register your agent in a public directory so other agents and services can discover and verify it
- **Agent Apps**: Create services designed for agents, exposing structured endpoints agents can call programmatically

Source: `https://docs.base.org/ai-agents/core-concepts/agent-frameworks.md`

Framework comparison:
- **BANKR** — Managed Agent API with skill and wallet plugins; best for fast deployment
- **OpenClaw** — Open-source personal AI assistant (Discord, Telegram, web); best for multi-channel agents
- **Agent SDK** — Developer toolkit for custom agents with full control over behavior and integrations

Source: `https://docs.base.org/ai-agents/core-concepts/wallets.md`

An onchain wallet gives your agent the ability to hold funds, authorize transactions, and sign messages. Without one, your agent can read data but can't pay for services, receive payments, or prove its identity.

Source: `https://docs.base.org/ai-agents/core-concepts/payments-and-transactions.md`

- **x402 protocol**: Agents pay for services automatically with stablecoins on a per-request basis, no human approval required
- **Skills**: Pre-built onchain actions (swaps, transfers, contract calls) that your agent can perform through a structured API

Source: `https://docs.base.org/ai-agents/core-concepts/identity-verification-auth.md`

- Agents register in a public directory with verifiable credentials
- Other agents and services can look up and verify identity before trusting
- Authentication flows designed for machine-to-machine (no human in the loop)

Source: `https://docs.base.org/ai-agents/core-concepts/agent-apps.md`

- Agent apps expose structured endpoints (not visual UIs) that agents can discover and call
- Make your service discoverable by registering it in the agent directory
- Design APIs with explicit schemas so agents can reason about inputs and outputs


## Trading Agents (excerpts)

Source: `https://docs.base.org/ai-agents/trading.md`

Base offers two structural advantages for trading agents:
- **Flashblocks**: 200ms preconfirmed block state, 10× faster than the 2-second block
- **Exposed L1/L2 fee structure**: Enables explicit cost-vs-speed tradeoffs

Key patterns:
- Connect to `mainnet-preconf.base.org` for all reads and submissions to access Flashblocks pending state
- Simulate with `eth_simulateV1` against preconfirmed state before signing any transaction
- Poll `base_transactionStatus` (not `eth_getTransactionReceipt`) for low-latency inclusion status (~200ms)
- Use `eth_feeHistory` over last 5–10 blocks with reward percentiles `[50, 90]` for fee calibration

Fee calibration:
```
maxFeePerGas = nextBaseFee * 2 + maxPriorityFeePerGas
```

L1 fee decision rule — if this ratio exceeds 0.8, L1 fee dominates; consider deferring small trades:
```
l1FeeUpperBound / (gasLimit × maxFeePerGas + l1FeeUpperBound) > 0.8
```

Key Flashblocks signals for trading:
- `eth_getBlockByNumber("pending")` on preconf endpoint — preconfirmed pending block state (200ms early)
- `eth_subscribe("newFlashblockTransactions")` — first-mover on large trades entering the block
- `eth_subscribe("pendingLogs", { address, topics })` — detect liquidation thresholds and oracle updates before finality
19 changes: 19 additions & 0 deletions docs/ai-agents/llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://docs.base.org/ai-agents/llms.txt

## AI Agents Documentation

> Build AI agents that operate as independent economic actors on Base — with wallets, payments, identity, and agent-to-agent discovery built in.

## Introduction
- [AI Agents on Base](https://docs.base.org/ai-agents/index.md) — What you can build and how the pieces fit together

## Core Concepts
- [Frameworks](https://docs.base.org/ai-agents/core-concepts/agent-frameworks.md) — Choose between Agent SDK, OpenClaw, and BANKR
- [Wallets](https://docs.base.org/ai-agents/core-concepts/wallets.md) — Give your agent the ability to hold funds and sign transactions
- [Payments & Transactions](https://docs.base.org/ai-agents/core-concepts/payments-and-transactions.md) — Pay for services with x402 and execute onchain actions via skills
- [Identity, Verification & Auth](https://docs.base.org/ai-agents/core-concepts/identity-verification-auth.md) — Register, discover, and verify agents
- [Agent Apps](https://docs.base.org/ai-agents/core-concepts/agent-apps.md) — Build services with agents as the primary user

## Advanced
- [Trading on Base](https://docs.base.org/ai-agents/trading.md) — Flashblocks patterns, fee calibration, and onchain signals for trading agents

4 changes: 1 addition & 3 deletions docs/base-account/improve-ux/spend-permissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,4 @@ This example demonstrates how to combine Base Account's [Spend Permissions](/bas
>
Explore the complete implementation on GitHub
</Card>
</CardGroup>

**Learn more:** [AI Agent with Spend Permissions](/cookbook/spend-permissions-ai-agent)
</CardGroup>
7 changes: 6 additions & 1 deletion docs/base-account/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ const { status } = await getPaymentStatus({ id })
- [Wagmi Base Pay](https://docs.base.org/base-account/framework-integrations/wagmi/base-pay.md) — Payments
- [Wagmi Other Use Cases](https://docs.base.org/base-account/framework-integrations/wagmi/other-use-cases.md) — Patterns
- [Privy Setup](https://docs.base.org/base-account/framework-integrations/privy/setup.md) — Privy
- [Privy Authentication](https://docs.base.org/base-account/framework-integrations/privy/authentication.md) — Privy auth
- [Privy Sub‑Accounts](https://docs.base.org/base-account/framework-integrations/privy/sub-accounts.md) — Privy sub‑accounts
- [Dynamic](https://docs.base.org/base-account/framework-integrations/nextjs-with-dynamic.md) — Dynamic integration
- [Privy Spend Permissions](https://docs.base.org/base-account/framework-integrations/privy/spend-permissions.md) — Privy spend permissions
- [RainbowKit](https://docs.base.org/base-account/framework-integrations/rainbowkit.md) — RainbowKit integration
- [Reown](https://docs.base.org/base-account/framework-integrations/reown.md) — Reown integration
- [Thirdweb](https://docs.base.org/base-account/framework-integrations/thirdweb.md) — Thirdweb integration
- [CDP](https://docs.base.org/base-account/framework-integrations/cdp.md) — CDP integration

### Reference (selected)
- [SDK: createBaseAccount](https://docs.base.org/base-account/reference/core/createBaseAccount.md)
Expand Down
Loading