Skip to main content

Buyer-side Python SDK for XRPL exact x402 payments

Project description

xrpl-x402-client

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

Install

pip install xrpl-x402-client

Optional Coinbase Python x402 interop:

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

Quick Start

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.0.0
  • Optional adapter extra pins x402==2.3.0
  • Examples target xrpl:1; mainnet usage uses xrpl:0

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_client-0.1.0.tar.gz (5.9 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_client-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file xrpl_x402_client-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for xrpl_x402_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a5e7873e11e3f3feffbe3991899257716dec84cf5952b1ef01e5cf01a29b941
MD5 9fc8a4ef596e5dec68f8319b9e8c1cb6
BLAKE2b-256 120106558370ecfb7d79fbce10f2d720618e5c6526d5aa445813dfec06cd404d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xrpl_x402_client-0.1.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_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xrpl_x402_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 933453933eedbeeb77f386df30d53620959517c22360245a43941eff79ade1d1
MD5 4eb99726b2c01b5b7515cc7992d45ec7
BLAKE2b-256 5878b22d6e8ee6ebc4ab3bcf44e666f789be8b3fc48edf02f348e3fc80248add

See more details on using hashes here.

Provenance

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

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