# PumpCards (`$PC`) — Autonomous AI Agent & Solana Bot Skill

> **Base URL:** `https://pump-cards.xyz`
> **Agent API Root:** `https://pump-cards.xyz/api/agent/v1`
> **Zero-Dependency CLI & MCP Server:** `https://pump-cards.xyz/agent/pumpcards-agent.mjs`
> **Human Dashboard (Scoped Keys & Spend Caps):** `https://pump-cards.xyz/dashboard#agents`

PumpCards lets AI agents and autonomous Solana bots create accounts with **zero KYC**, fund wallets with **Solana (`USDC`, `USDT`, `SOL`)** (or BTC/ETH/XMR/LTC/TRX/XRP), issue & reload purpose-built **AgentCard Visa** (`"agentcard"` — engineered for OpenAI, Anthropic, xAI, AWS, RunPod, Railway, Vercel, Cloudflare, domains & X API credits) and **Platinum Mastercard** (`"platinum-mastercard"`) virtual cards, check balances & transactions, freeze/unfreeze cards, and (when `allowReveal` is enabled on the key) retrieve live **card number (PAN), CVV, expiry, billing address, and 3DS OTP verification codes** to pay merchants online autonomously.

Holders of `100,000+ $PC` (`pUmpLHQPUDbk92NwncKUiSpzafBuNXqAgnc5B7oCArd`) on a linked Solana wallet also accrue automatic 10-minute on-chain reflections.

---

## 1. Two Ways to Authenticate

All `/api/agent/v1/*` endpoints (except `/info` and `/register*`) use stateless Bearer auth:

```http
Authorization: Bearer pc_agent_live_<32hex>
```

### Option A — Human-Provisioned Key (Recommended when a human funds or supervises the agent)
1. Sign in at `https://pump-cards.xyz/dashboard` -> click **AI Agents** in the sidebar.
2. Choose optional **Max per Card Load (USD)** and **24h Spend Limit (USD)** guardrails.
3. Check **"Allow agent to view card number, CVV, billing address & 3DS codes"** ONLY if the agent should complete online checkouts autonomously.
4. Click **Generate Agent API Key** and pass `PUMPCARDS_AGENT_KEY=pc_agent_live_...` to your agent, CLI, or MCP server.

### Option B — 100% Autonomous Solana AI Bot Self-Onboarding (`0` browser steps, `0` SOL fee)
Any Solana bot holding an ed25519 keypair can register its own PumpCards account and mint its own `pc_agent_live_...` key in two HTTP calls:

1. **Request Challenge:**
   ```bash
   curl -sS -X POST https://pump-cards.xyz/api/agent/v1/register/challenge \
     -H "Content-Type: application/json" \
     -d '{"walletAddress":"<YOUR_SOLANA_PUBKEY>"}'
   ```
   Returns `{ "ok": true, "walletAddress": "...", "nonce": "<32hex>", "message": "PumpCards Autonomous Agent Registration\n..." }`.

2. **Sign `message` (UTF-8 bytes) with ed25519 -> Base58 `signature`, and Register:**
   ```bash
   curl -sS -X POST https://pump-cards.xyz/api/agent/v1/register \
     -H "Content-Type: application/json" \
     -d '{
       "walletAddress": "<YOUR_SOLANA_PUBKEY>",
       "nonce": "<32hex>",
       "signature": "<BASE58_ED25519_SIGNATURE>",
       "ageConfirmed": true,
       "allowReveal": true,
       "label": "Solana Autonomous Bot"
     }'
   ```
   Returns `{ "ok": true, "customerId": "...", "apiKey": "pc_agent_live_...", "backupAccessKey": "PC-SPND-..." }`. Save `apiKey` securely — it is HMAC-hashed server-side and never shown again.

---

## 2. Quickstart: Zero-Install CLI & MCP Server (`Node 18+`)

Download the official zero-dependency CLI + MCP script (uses only Node built-ins `node:crypto` & `fetch` — zero `npm install` needed):

```bash
curl -fsSL https://pump-cards.xyz/agent/pumpcards-agent.mjs -o pumpcards-agent.mjs
```

### Run as CLI (Solana Bot / Bash / OpenClaw / Cron):
```bash
# Autonomous self-signup using a Solana keypair JSON file (saves key to ~/.pumpcards/agent.json)
node pumpcards-agent.mjs register --keypair ~/.config/solana/id.json --save

# Check wallet balance, linked Solana wallet, reflections & key spend limits
node pumpcards-agent.mjs me

# Inspect card tiers, fees & Solana deposit assets
node pumpcards-agent.mjs catalog

# Create a $26 Solana USDC (or SOL) deposit route (add --pay --keypair ~/.config/solana/id.json to auto-send native SOL!)
node pumpcards-agent.mjs deposit create --coin USDC --net sol --usd 26

# Poll deposit until credited to USD account wallet
node pumpcards-agent.mjs deposit status dep_xxxxxxxxxxxxxxxx --wait

# Create a $20 AgentCard Visa (purpose-built for AI, cloud & API backend credits; or --tier platinum-mastercard)
node pumpcards-agent.mjs cards create --tier agentcard --usd 20 --label "AI Compute"

# Top up an existing card
node pumpcards-agent.mjs cards fund --card card_xxxxxxxxxxxxxxxx --usd 25

# List cards & check transactions
node pumpcards-agent.mjs cards list
node pumpcards-agent.mjs cards tx --card card_xxxxxxxxxxxxxxxx

# Read live PAN, CVV, expiry & billing address (requires allowReveal=true on key)
node pumpcards-agent.mjs cards reveal --card card_xxxxxxxxxxxxxxxx

# Read live 3DS OTP verification code during online checkout (requires allowReveal=true)
node pumpcards-agent.mjs cards otp --card card_xxxxxxxxxxxxxxxx

# Freeze / unfreeze card
node pumpcards-agent.mjs cards freeze --card card_xxxxxxxxxxxxxxxx
node pumpcards-agent.mjs cards unfreeze --card card_xxxxxxxxxxxxxxxx
```

### Run as an MCP Server (Claude Desktop / Claude Code / Cursor / Antigravity):
```json
{
  "mcpServers": {
    "pumpcards": {
      "command": "node",
      "args": ["/path/to/pumpcards-agent.mjs", "mcp"],
      "env": {
        "PUMPCARDS_AGENT_KEY": "pc_agent_live_YOUR_KEY_HERE"
      }
    }
  }
}
```

---

## 3. Complete REST API Reference (`/api/agent/v1`)

| Method & Path | Scope | Description |
| :--- | :--- | :--- |
| `GET /api/agent/v1/info` | Public | API metadata, Solana SPL mints (`USDC`, `USDT`, `SOL`), and doc links |
| `POST /api/agent/v1/register/challenge` | Public | Issue 5-minute ed25519 challenge for Solana bot registration |
| `POST /api/agent/v1/register` | Public | Verify Solana wallet signature -> create/bind account + mint `pc_agent_live_...` |
| `GET /api/agent/v1/me` | `read` | Account USD balance, card count, `$PC` reflections, and 24h key spend limits |
| `GET /api/agent/v1/catalog` | `read` | Card products (`agentcard` / `silver-visa`, `platinum-mastercard`), fees, and crypto deposit routes |
| `POST /api/agent/v1/deposits` | `deposit` | Create crypto deposit route (`{"symbol":"USDC","network":"sol","amountUsd":26}`) |
| `GET /api/agent/v1/deposits` | `read` | List recent crypto deposits |
| `GET /api/agent/v1/deposits/:id` | `read` | Poll live deposit status (`awaiting_deposit` -> `confirming` -> `credited`) |
| `POST /api/agent/v1/cards/quote` | `read` | Exact fee quote (`loadAmountUsd`, `issuanceFeeUsd`, `fundingFeeUsd`, `totalDebitUsd`) |
| `GET /api/agent/v1/cards` | `read` | List all owned virtual cards (`cardId`, `lastFour`, `state`, `balanceUsd`) |
| `GET /api/agent/v1/cards/:cardId` | `read` | Refresh & read single card status and balance |
| `POST /api/agent/v1/cards` | `cards:write` | Issue an AgentCard Visa or Platinum Mastercard (`{"productId":"agentcard","amountUsd":20,"label":"AI Compute"}`) |
| `POST /api/agent/v1/cards/:cardId/fund` | `cards:write` | Reload an existing virtual card (`{"amountUsd":25}`) |
| `POST /api/agent/v1/cards/:cardId/state` | `cards:write` | Freeze or unfreeze a card (`{"action":"freeze"}` or `{"action":"unfreeze"}`) |
| `GET /api/agent/v1/cards/:cardId/transactions` | `read` | Recent merchant authorizations, settlements & declines |
| `GET /api/agent/v1/cards/:cardId/credentials` | `cards:reveal` | **Opt-in (`allowReveal=true`)**: Live 16-digit PAN, CVV, expiry, PIN & billing profile |
| `GET /api/agent/v1/cards/:cardId/3ds` | `cards:reveal` | **Opt-in (`allowReveal=true`)**: Live 3DS OTP code / approval link for checkout |
| `GET /api/agent/v1/operations/:opId` | `read` | Poll asynchronous card operation status (`pending` -> `completed`) |

### Idempotency & Error Handling
- Every mutation (`POST /deposits`, `POST /cards`, `POST /cards/:cardId/fund`, `POST /cards/:cardId/state`) accepts an optional UUID v4 `requestId` in JSON body (or `Idempotency-Key` HTTP header). Retrying the same `requestId` never double-charges or double-creates.
- First card minimum load is `$20.00 USD` (`~$25.40 USD` total wallet debit including `$5.00` 1-time activation fee + `2%` funding fee). When funding via crypto, deposit `~$26.00 USDC` (or `~$26.50 SOL`) so your wallet covers the full `$25.40` quote cleanly.
