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(...)XRPLPaymentSignerXRPLPaymentTransportwrap_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 usesxrpl: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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9511192face36988963f392e386d4318cf555b1ea56b3c75c4e894955df41dad
|
|
| MD5 |
21aa3a6aea023eaf04bc5b844b28a909
|
|
| BLAKE2b-256 |
92bbfa2b22c9821ccd138cbe867f261d4176aebfd99a880863b36a6cb338135e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrpl_x402_client-0.1.2.tar.gz -
Subject digest:
9511192face36988963f392e386d4318cf555b1ea56b3c75c4e894955df41dad - Sigstore transparency entry: 1135619527
- Sigstore integration time:
-
Permalink:
lgcarrier/xrpl-x402-stack@1e7efb65a92a16abe35a0befa4558d2b53172cc3 -
Branch / Tag:
refs/tags/client-v0.1.2 - Owner: https://github.com/lgcarrier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@1e7efb65a92a16abe35a0befa4558d2b53172cc3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xrpl_x402_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: xrpl_x402_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0289352f3dfbf5f3360418fede40c4bd426716e1ddcace06096bf378a85ac930
|
|
| MD5 |
44f294cdbde6b22ae98e1ca8f2be14cd
|
|
| BLAKE2b-256 |
588595ab9503e191ec0ed23fe83786f23b2fe6987c9e684b3e36edb6e4f631ef
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrpl_x402_client-0.1.2-py3-none-any.whl -
Subject digest:
0289352f3dfbf5f3360418fede40c4bd426716e1ddcace06096bf378a85ac930 - Sigstore transparency entry: 1135619612
- Sigstore integration time:
-
Permalink:
lgcarrier/xrpl-x402-stack@1e7efb65a92a16abe35a0befa4558d2b53172cc3 -
Branch / Tag:
refs/tags/client-v0.1.2 - Owner: https://github.com/lgcarrier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@1e7efb65a92a16abe35a0befa4558d2b53172cc3 -
Trigger Event:
push
-
Statement type: