> ## Documentation Index
> Fetch the complete documentation index at: https://developers.fd.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Wallet

> How the Agent Wallet picks a network, signs inside the TEE, and returns a ready-to-submit x402 payment.

When your agent hits a paywall or receives x402 payment requirements, the Agent Wallet takes over. It reads `accepts`, picks the best network and token based on your balance, signs an ERC-3009 authorization inside the TEE, and hands back the complete signed object.

## How Signing Works

The private key never leaves the secure enclave. The wallet:

1. Receives the `paymentRequirements` object (the `accepts` array from the merchant)
2. Selects a network/token pair — based on balance availability and chain preference
3. Constructs an ERC-3009 `transferWithAuthorization` and signs it inside the TEE
4. Returns the full x402 payment object for the agent to submit

```json theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
{
  "paymentPayload": {
    "signature": "0x...",
    "authorization": {
      "from":        "0xAgentWalletAddress",
      "to":          "0xMerchantAddress",
      "value":       "10000",
      "validAfter":  "0",
      "validBefore": "1760000000",
      "nonce":       "0x..."
    }
  },
  "paymentRequirements": {
    "x402Version": 2,
    "accepts": [ "..." ]
  }
}
```

## Using x402 via MCP

If your agent is connected to the Agent Wallet MCP server, x402 authorization is exposed as a tool. Pass `paymentRequirements` from the merchant response and receive the signed object back — no additional formatting required.

See [Agent Wallet MCP Server](/agent-wallet/ai-integration/mcp-server) to get connected, and [x402 Payments in Agent Wallet](/agent-wallet/concepts/x402-payments) for a full breakdown of the buyer-side flow.

<CardGroup cols={2}>
  <Card title="Agent Wallet MCP Server" icon="plug" href="/agent-wallet/ai-integration/mcp-server">
    Connect your agent to the wallet via MCP
  </Card>

  <Card title="x402 Payments Concept" icon="bolt" href="/agent-wallet/concepts/x402-payments">
    Deep dive into x402 from the buyer perspective
  </Card>
</CardGroup>
