Skip to main content

xrpl-x402-payer

CLI, HTTP proxy, and MCP payer for canonical XRPL x402 v2 resources.

xrpl-x402 pay https://merchant.example/premium \
  --asset XRP --max-spend 1000

Without explicit asset options, the upstream spend policy accepts recognized pegged assets only and caps each payment at USD 1. XRP, USDC, and custom IOUs require explicit issuer-aware XRPLAssetSpendLimit entries and caps.

Receipts persist the standard SettleResponse together with immutable accepted requirements. Signed payloads and payment identifiers are kept only in a locked attempt sidecar next to the receipt JSONL. The sidecar is atomically replaced before a paid HTTP request or MCP tool call is dispatched. Matching callers share one per-fingerprint claim, so concurrent processes reuse the exact payload. settlement_pending is stored as pending and never counted as paid; paid attempt payloads are pruned by subsequent journal activity after a short concurrent-caller reuse window.

Install xrpl-x402-payer[mcp] and run xrpl-x402 mcp for the local payer tool service. Direct MCP clients should wrap a raw initialized MCP session with wrap_mcp_client_with_xrpl_payment(..., recovery_scope=...). The required scope must be a stable, non-secret label for the endpoint and authenticated principal, for example https://mcp.example/sse|principal:user-42; only its SHA-256 digest is persisted. Never put a bearer token, API key, cookie, or wallet seed in the scope.

paid = wrap_mcp_client_with_xrpl_payment(
    raw_session,
    signer,
    recovery_scope="https://mcp.example/sse|principal:user-42",
)
result = await paid.call_tool("generate_report", {"topic": "XRPL"})

The upstream create_x402_mcp_client re-export remains available as a raw convenience, but it does not use this package's local receipt/attempt journal and therefore cannot provide the same crash or cross-process recovery guarantees.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xrpl_x402_payer-0.2.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xrpl_x402_payer-0.2.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file xrpl_x402_payer-0.2.0.tar.gz.

File metadata

  • Download URL: xrpl_x402_payer-0.2.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xrpl_x402_payer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c6ff9050901d02dc2ab22e29e31868d712f7dbd464a75bb7298d260a982b00e6
MD5 68ebcdf611197f14dbf318f40a75f328
BLAKE2b-256 6810a70c84b617f8d2f5ecea252dbe0da9b98ef095147c3b956513848a04546c

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrpl_x402_payer-0.2.0.tar.gz:

Publisher: publish-package.yml on lgcarrier/xrpl-x402-stack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xrpl_x402_payer-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xrpl_x402_payer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0255d2c2d44daee967f510076a46c17e004d641a0d743405c39f8f00ae40fd6d
MD5 7a245dbaf4bdc46acc10488c2872a5f5
BLAKE2b-256 b75c152fef11932f2bcba1b50fc10fffd8149535afd5213887b27f9224d1b195

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrpl_x402_payer-0.2.0-py3-none-any.whl:

Publisher: publish-package.yml on lgcarrier/xrpl-x402-stack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.2

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page