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.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.

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.2.tar.gz (6.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_client-0.1.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xrpl_x402_client-0.1.2.tar.gz
  • Upload date:
  • Size: 6.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_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9511192face36988963f392e386d4318cf555b1ea56b3c75c4e894955df41dad
MD5 21aa3a6aea023eaf04bc5b844b28a909
BLAKE2b-256 92bbfa2b22c9821ccd138cbe867f261d4176aebfd99a880863b36a6cb338135e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xrpl_x402_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0289352f3dfbf5f3360418fede40c4bd426716e1ddcace06096bf378a85ac930
MD5 44f294cdbde6b22ae98e1ca8f2be14cd
BLAKE2b-256 588595ab9503e191ec0ed23fe83786f23b2fe6987c9e684b3e36edb6e4f631ef

See more details on using hashes here.

Provenance

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