Metadata-Version: 2.4
Name: xrpl-mpp-core
Version: 0.1.4
Summary: Shared XRPL MPP wire models and helpers
Project-URL: Documentation, https://lgcarrier.github.io/xrpl-mpp-stack/packages/core/
Project-URL: Source, https://github.com/lgcarrier/xrpl-mpp-stack/tree/main/packages/core
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: mpp,payments,xrp,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 :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: pydantic<3,>=2
Description-Content-Type: text/markdown

# xrpl-mpp-core

Shared XRPL + MPP HTTP models and helpers.

## Install

```bash
pip install xrpl-mpp-core
```

## Includes

- MPP challenge, credential, receipt, and problem-detail models
- JCS + base64url codecs for `Authorization: Payment` and `Payment-Receipt`
- `WWW-Authenticate: Payment` parsing/rendering
- XRPL asset helpers for XRP, RLUSD, and USDC
- challenge binding, expiry, and body-digest helpers

## Example

```python
from xrpl_mpp_core import (
    XRPLChargeMethodDetails,
    XRPLChargeRequest,
    build_payment_challenge,
    parse_payment_challenge,
    render_payment_challenge,
)

challenge = build_payment_challenge(
    secret="replace-with-a-shared-secret",
    realm="merchant.example",
    method="xrpl",
    intent="charge",
    request_model=XRPLChargeRequest(
        amount="1000",
        currency="XRP:native",
        recipient="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
        methodDetails=XRPLChargeMethodDetails(
            network="xrpl:1",
            invoiceId="A" * 64,
        ),
    ),
    expires_in_seconds=300,
)

header_value = render_payment_challenge(challenge)
decoded = parse_payment_challenge(header_value)
```

Use `xrpl-mpp-core` directly when you need to generate or validate MPP HTTP headers without pulling in the facilitator, middleware, or client runtime packages.
