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
9 changes: 5 additions & 4 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @agent-score/pay

CLI wallet for one-shell-command agent payments across x402 (Base, Solana) and MPP (Tempo). ESM-only.
CLI wallet for one-shell-command agent payments across x402 (Base) and MPP (Tempo, Solana). ESM-only.

## Purpose

Expand All @@ -19,13 +19,13 @@ Single-package TypeScript CLI published to npm. Runnable via `npx @agent-score/p
| `src/prompts.ts` | Passphrase input (respects `AGENTSCORE_PAY_PASSPHRASE` env) |
| `src/constants.ts` | Chain network IDs, USDC addresses, RPC URLs |
| `src/chains/base.ts` | EVM adapter (x402): viem Account, USDC balance, EIP-681 QR URI |
| `src/chains/solana.ts` | SVM adapter (x402): `@solana/kit` KeyPairSigner, SPL balance, `solana:` URI |
| `src/chains/solana.ts` | SVM adapter (MPP `solana/charge`): `@solana/kit` KeyPairSigner, SPL balance, `solana:` URI |
| `src/chains/tempo.ts` | EVM adapter (MPP): viem Account on chain 4217, USDC.e balance, EIP-681 QR URI |
| `src/commands/wallet.ts` | `wallet create/import/address/list/remove/export/show-mnemonic` |
| `src/commands/balance.ts` | `balance` across chains |
| `src/commands/qr.ts` | `qr` with optional amount |
| `src/commands/fund.ts` | `fund` — receive QR + balance polling (Tempo testnet uses programmatic mint via tempo_fundAddress) |
| `src/commands/pay.ts` | `pay <METHOD> <URL>` — routes to `@x402/fetch` (base/solana) or `mppx/client` (tempo) |
| `src/commands/pay.ts` | `pay <METHOD> <URL>` — routes to `@x402/fetch` (base) or `mppx/client` (tempo, solana via `@solana/mpp/client`) |
| `src/commands/identity.ts` | `reputation`, `assess`, `sessions create/get`, `credentials create/list/revoke`, `associate-wallet` (wraps `@agent-score/sdk`) |
| `src/commands/passport.ts` | `passport login/status/logout` — AgentScore Passport (buyer-side identity); stores opc_ at `~/.agentscore/passport.json`, auto-attached on `pay <url>` settle leg |
| `src/passport/{auth,storage,attach}.ts` | Passport login flow (mint+poll), conf-style local keystore, X-Operator-Token attach decision tree |
Expand All @@ -35,8 +35,9 @@ Single-package TypeScript CLI published to npm. Runnable via `npx @agent-score/p

## Chain-to-protocol routing

- `base` / `solana` → x402Client + ExactEvmScheme or ExactSvmScheme, via `wrapFetchWithPayment`
- `base` → x402Client + ExactEvmScheme, via `wrapFetchWithPayment`
- `tempo` → `Mppx.create({ methods: [tempo({ account })] })`, via mpp.fetch
- `solana` → `Mppx.create({ methods: [solanaCharge({ signer, rpcUrl })] })` from `@solana/mpp/client`, via mpp.fetch

Both paths preserve POST bodies through the 402 round-trip. The CLI's passphrase + keystore layer is chain-agnostic.

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![npm version](https://img.shields.io/npm/v/@agent-score/pay.svg)](https://www.npmjs.com/package/@agent-score/pay)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

**AgentScore Payone CLI for agent payments across the ecosystem.** Pay any 402/MPP merchant from a single shell commandnatively across **x402** (Base, Solana) and **MPP** (Tempo), with structured hints to compatible clients for rails we don't fund directly (Stripe SPT via [link-cli](https://github.com/stripe/link-cli), other x402 networks).
**AgentScore Pay; one CLI for agent payments across the ecosystem.** Pay any 402/MPP merchant from a single shell command, natively across **x402** (Base) and **MPP** (Tempo, Solana), with structured hints to compatible clients for rails we don't fund directly (Stripe SPT via [link-cli](https://github.com/stripe/link-cli), other x402 networks).

Closes the UX gap for shell-tool LLM agents (Claude Code, Cursor, ChatGPT with Bash) that want to pay protocol-gated endpoints. Mirrors the ergonomics of `tempo request` for MPP — one shell command, body preserved, agent never sees a private key on the wire. Built and maintained by AgentScore — works with every 402-gated merchant in the ecosystem, AgentScore-gated or not. Pay does not contact AgentScore APIs unless the merchant's 402 challenge requires AgentScore identity.

Expand Down Expand Up @@ -220,10 +220,10 @@ The CLI never touches stdout for human chrome when `--json` is passed — every
| Chain | Protocol | Library | Network |
|---|---|---|---|
| `base` | x402 (EIP-3009) | `@x402/fetch` + `@x402/evm` | `eip155:8453` |
| `solana` | x402 (SPL Token) | `@x402/fetch` + `@x402/svm` | `solana:5eykt...` |
| `tempo` | MPP | `mppx/client` | chain 4217 |
| `solana` | MPP `solana/charge` | `mppx/client` + `@solana/mpp/client` | `solana:5eykt...` |
| `tempo` | MPP `tempo/charge` | `mppx/client` | chain 4217 |

The rail set matches Stripe's x402 facilitator chains (Tempo, Base, Solana). Tempo is always MPP — pay routes Tempo through `mppx/client`; the x402-on-Tempo path is a Stripe-facilitator surface that pay does not call directly.
Solana payments route through MPP `solana/charge` (Solana Foundation's `@solana/mpp` package) rather than x402. Tempo is always MPP via `mppx/client`. Base is the only x402 rail pay funds directly.

## Rail selection

Expand Down Expand Up @@ -457,7 +457,7 @@ agentscore-pay fund-estimate https://agents.martinestate.com/purchase \

## Security

- Keystore is AES-256-GCM encrypted with a scrypt-derived key (`N=131072, r=8, p=1`), one file per chain.
- Keystore is AES-256-GCM encrypted with a scrypt-derived key, one file per chain.
- Files written with `0600` perms, parent dir `0700`.
- Passphrase prompted per signing operation; override with `AGENTSCORE_PAY_PASSPHRASE` env var for non-interactive agents.
- `wallet export` is guarded by `--danger` + "type EXPORT" prompt.
Expand Down
Loading
Loading