Metadata-Version: 2.4
Name: xrpl-x402-client
Version: 0.1.2
Summary: Buyer-side Python SDK for XRPL exact x402 payments
Project-URL: Homepage, https://github.com/lgcarrier/xrpl-x402-stack
Project-URL: Documentation, https://lgcarrier.github.io/xrpl-x402-stack/packages/client/
Project-URL: Repository, https://github.com/lgcarrier/xrpl-x402-stack
Project-URL: Issues, https://github.com/lgcarrier/xrpl-x402-stack/issues
Project-URL: Changelog, https://github.com/lgcarrier/xrpl-x402-stack/blob/main/CHANGELOG.md
Author-email: Louis-Guillaume Carrier-Bedard <lgcarrier@gmail.com>
License-Expression: MIT
Keywords: client,httpx,payments,x402,xrpl
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: httpx==0.28.1
Requires-Dist: pydantic<3,>=2
Requires-Dist: xrpl-py==4.5.0
Requires-Dist: xrpl-x402-core<0.2.0,>=0.1.2
Provides-Extra: x402
Requires-Dist: x402==2.3.0; extra == 'x402'
Description-Content-Type: text/markdown

# xrpl-x402-client

`xrpl-x402-client` is the buyer-side Python SDK for the Open XRPL x402 Stack.

## Install

```bash
pip install xrpl-x402-client
```

Optional Coinbase Python `x402` interop:

```bash
pip install "xrpl-x402-client[x402]"
```

## Quick Start

```python
import asyncio

from xrpl.wallet import Wallet

from xrpl_x402_client import XRPLPaymentSigner, wrap_httpx_with_xrpl_payment

wallet = Wallet.create()
signer = XRPLPaymentSigner(
    wallet,
    network="xrpl:1",
    autofill_enabled=False,
)

async def fetch_paid_resource() -> None:
    async with wrap_httpx_with_xrpl_payment(
        signer,
        base_url="https://merchant.example",
    ) as client:
        response = await client.get("/premium")
        print(response.status_code, response.text)

asyncio.run(fetch_paid_resource())
```

## Public API

- `decode_payment_required(...)`
- `select_payment_option(...)`
- `build_payment_signature(...)`
- `XRPLPaymentSigner`
- `XRPLPaymentTransport`
- `wrap_httpx_with_xrpl_payment(...)`
- Optional adapters under `xrpl_x402_client.adapters.x402`

## Compatibility

- Python `3.12`
- `xrpl-py==4.5.0`
- Optional adapter extra pins `x402==2.3.0`
- Examples target `xrpl:1`; mainnet usage uses `xrpl:0`

When you run the repo buyer example on `xrpl:1`, leave `XRPL_RPC_URL` unset to auto-select a healthy
public Testnet RPC, or set it explicitly to pin a provider.

## Provenance

The implementation is independently developed for the open `x402` protocol and does not copy `x402-xrpl`.
