---
name: xdc-taskman
description: Pay for x402 services on the XDC network with USDC. Log in with email, get a custodial XDC wallet, browse the curated marketplace, and call any x402 URL — the payment is signed from your wallet and you never pay gas (EIP-3009).
---

# XDC Taskman skill

Use this skill to discover and pay for x402-protected services on XDC. Drive it through the `xdc-taskman` CLI (installed via `npx xdc-taskman` or `pnpm cli --`).

## When to use
- The user wants onchain data or any paid API that returns HTTP 402 on XDC.
- The user asks to log in, check a wallet balance, list marketplace services, or call a paid URL.

## Environments (important)
This skill is a **CLI** — it needs a shell and outbound network. That means:
- ✅ **Claude Code, Cursor, Codex, a terminal** — `npx xdc-taskman …` works directly.
- ❌ **claude.ai web** — its sandbox blocks outbound network, so `login` can't reach the
  auth/wallet service. In claude.ai, **add the MCP connector instead**:
  `https://xdctaskman-x402-server.vercel.app/mcp` (Settings → Connectors → Add custom
  connector). It exposes the same flow as tools (`login_start`, `login_verify`,
  `wallet_address`, `wallet_balance`, `marketplace_list`, `call`, `wallet_transfer`) and runs
  the network work server-side.

## Setup (once)
```
npx xdc-taskman login            # email → OTP → an XDC wallet is created for you
npx xdc-taskman wallet address   # show the address to fund with USDC
npx xdc-taskman wallet balance   # check USDC + XDC balance
```

## Core loop
```
npx xdc-taskman marketplace list --search weather,forecast   # find the best-matching services
npx xdc-taskman call https://provider.example/x402/endpoint
```
Pass `--search` comma-separated keywords from the task; results are ranked by tags
+ capability (best match first) against the **live** catalog — the fastest way to
find the most relevant API for a prompt.
`call` performs the full x402 flow automatically: it requests the URL, and if it
returns `402`, signs an EIP-3009 USDC payment authorization from your wallet,
resends with the `X-PAYMENT` header, and returns the result. **You never pay gas**
— a relayer settles the signed authorization on-chain.

## Commands
- `login [--email <e>] [--code <c>]` — authenticate; creates/loads your XDC wallet.
- `whoami` / `logout`
- `wallet address|balance|fund`
- `marketplace list [--search <a,b,c>] [--capability <c>] [--max-price <usdc>]` — `--search` ranks live services by tags + capability (OR over the terms, best first).
- `call <serviceUrl> [--method GET|POST] [--data <json>]`

## Output contract (for agents)
- **stdout** = exactly one JSON object per command — parse this.
  - `call` → `{ ok, status, paid, txHash?, explorer?, result }`
  - `wallet transfer` → `{ success, amount, token, to, txHash?, explorer?, error? }`
  - `login` → `{ loggedIn, email, address }`; `wallet address|balance|fund` → JSON; `whoami` → JSON
  - On any failure → `{ "error": "<message>" }` and a non-zero exit code.
- **stderr** = human/log lines (prompts, "Sent a code…", structured logs). Ignore for parsing.
- Set `LOG_LEVEL=error` to silence info logs.

## Notes
- Amounts are in USDC (6 decimals). Prices are shown per call.
- Always `wallet balance` before paid calls; if USDC is 0, tell the user to fund
  the printed address (gas is sponsored — no native XDC needed).
