Skip to main content

Shared XRPL x402 wire models and helpers

Project description

xrpl-x402-core

Shared XRPL/x402 wire models, codecs, validation helpers, and exact-payment utilities for the Open XRPL x402 Stack.

Install

pip install xrpl-x402-core

Quick Start

from xrpl_x402_core import (
    PaymentRequired,
    XRPLAmount,
    XRPLAsset,
    XRPLPaymentOption,
    decode_model_from_base64,
    encode_model_to_base64,
)

challenge = PaymentRequired(
    error="Payment required",
    accepts=[
        XRPLPaymentOption(
            network="xrpl:1",
            payTo="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
            maxAmountRequired="1000",
            asset=XRPLAsset(code="XRP"),
            amount=XRPLAmount(value="1000", unit="drops", drops=1000),
        )
    ],
)

header_value = encode_model_to_base64(challenge)
parsed = decode_model_from_base64(header_value, PaymentRequired)
assert parsed.accepts[0].network == "xrpl:1"

Public API

  • Shared x402 wire models: PaymentRequired, PaymentPayload, PaymentResponse
  • XRPL payment models: XRPLAsset, XRPLAmount, XRPLPaymentOption, XRPLPaymentPayload
  • Facilitator contract models: PaymentRequest, FacilitatorSupportedResponse, FacilitatorVerifyResponse, FacilitatorSettleResponse
  • Header and matching helpers: encode_model_to_base64, decode_model_from_base64, payment_option_matches, canonical_asset_identifier
  • Asset helpers and constants: parse_asset_identifier, supported_asset_keys, XRP_CODE, RLUSD_*, USDC_*

Compatibility

  • Python 3.12
  • Wire-level validation accepts CAIP-2 xrpl:* network identifiers
  • Built-in asset helpers and examples cover xrpl:0 and xrpl:1
  • No x402 dependency is required for this package

Provenance

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

Project details


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_core-0.1.2.tar.gz (8.0 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_core-0.1.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file xrpl_x402_core-0.1.2.tar.gz.

File metadata

  • Download URL: xrpl_x402_core-0.1.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xrpl_x402_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 df0c9d54b3e00f1ff5985d52a8aaeb3521c61702461e2ff7930e098440a1e49b
MD5 3c2755cf79dff567e1d6b0597c9fa88b
BLAKE2b-256 84ddf54011af5f1bc65ecb06cc96b7f3ad736242516d18b291151e4dc788cb34

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrpl_x402_core-0.1.2.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_core-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: xrpl_x402_core-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xrpl_x402_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 082e3234b9e3bfcf93c9abac94abe4f8435bf8af92d96ae806e0853f0e97f45c
MD5 8b94225f2acc58fddd26d1a057841d53
BLAKE2b-256 a1050bc12930763e8f89cb36c9d40a6839199d0a3beff1b936caab31e7d88182

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrpl_x402_core-0.1.2-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page