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

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.1.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.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xrpl_x402_client-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d9200319b9d5d574447db2b46e5c58bd932227ed33d5033bdbf4e62ae3a57e90
MD5 59f8d211e1b0de1ad94e1a4138c6195d
BLAKE2b-256 2423422fb0cd1f2c4540476e6d4c30ddeb62ce392078ae997b19481b0dc7d0ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xrpl_x402_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99bd77aea288ddbbe602559788d4d2ed0674f2f0c57911d87cfb335a1d3dcb49
MD5 5be5f8be0cf37e7122b4618c8bd60fe3
BLAKE2b-256 396a0d298b992844118fbd335e93f4bc9293ca097471ba6bb19a6e92813f80b9

See more details on using hashes here.

Provenance

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