Metadata-Version: 2.4
Name: xrpl-mpp-client
Version: 0.1.4
Summary: Buyer-side Python SDK for XRPL MPP HTTP payments
Project-URL: Documentation, https://lgcarrier.github.io/xrpl-mpp-stack/packages/client/
Project-URL: Source, https://github.com/lgcarrier/xrpl-mpp-stack/tree/main/packages/client
Project-URL: Issues, https://github.com/lgcarrier/xrpl-mpp-stack/issues
Project-URL: Changelog, https://github.com/lgcarrier/xrpl-mpp-stack/blob/main/CHANGELOG.md
Author-email: Louis-Guillaume Carrier-Bedard <lgcarrier@gmail.com>
License-Expression: MIT
Keywords: client,httpx,mpp,payments,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-mpp-core<0.2.0,>=0.1.4
Requires-Dist: xrpl-py==4.5.0
Description-Content-Type: text/markdown

# xrpl-mpp-client

Buyer-side SDK for XRPL-backed MPP HTTP retries.

## Install

```bash
pip install xrpl-mpp-client
```

## Main APIs

- `XRPLPaymentSigner`
- `XRPLPaymentTransport`
- `wrap_httpx_with_mpp_payment(...)`
- `select_payment_challenge(...)`
- `build_payment_authorization(...)`

## Example

```python
import asyncio

from xrpl.wallet import Wallet
from xrpl_mpp_client import XRPLPaymentSigner, wrap_httpx_with_mpp_payment


async def main() -> None:
    signer = XRPLPaymentSigner(
        Wallet.from_seed("sEd..."),
        rpc_url="https://s.altnet.rippletest.net:51234/",
        network="xrpl:1",
    )
    async with wrap_httpx_with_mpp_payment(
        signer,
        asset="XRP:native",
    ) as client:
        response = await client.get("https://merchant.example/premium")
        print(response.status_code)
        print(response.text)


asyncio.run(main())
```

The client understands both `charge` and `session` challenges and reads/writes the MPP HTTP headers directly.
For explicit session teardown, reuse the same `XRPLPaymentTransport` instance and call `await transport.close_session("https://merchant.example/path")`.
