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:0andxrpl:1 - No
x402dependency is required for this package
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_core-0.1.1.tar.gz.
File metadata
- Download URL: xrpl_x402_core-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c334ad3029abe3298c083ba95e0ba5cec240a2efee08ecd6775191b4631a764d
|
|
| MD5 |
b65ed6fbb413b8bdc6c872e615387115
|
|
| BLAKE2b-256 |
0ffb025463828cfa7525ca66001273b219fc24b926fe3f47bee75b5da19f4c4b
|
Provenance
The following attestation bundles were made for xrpl_x402_core-0.1.1.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_core-0.1.1.tar.gz -
Subject digest:
c334ad3029abe3298c083ba95e0ba5cec240a2efee08ecd6775191b4631a764d - Sigstore transparency entry: 1123431974
- Sigstore integration time:
-
Permalink:
lgcarrier/xrpl-x402-stack@cdd4c7d6a6dc8f42543fe816791f6b0602eebe75 -
Branch / Tag:
refs/tags/core-v0.1.1 - Owner: https://github.com/lgcarrier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@cdd4c7d6a6dc8f42543fe816791f6b0602eebe75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xrpl_x402_core-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xrpl_x402_core-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.6 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 |
aa9d4483618ec15dc9654782cf57dcf237aeda69a239f928e2d4963943ba3405
|
|
| MD5 |
9797d2bd7c672639f47cde343527e821
|
|
| BLAKE2b-256 |
e23c1451dbc0cb15978dfd26ce869bbc010ddb75e4a6cc779f68bf95359efcdf
|
Provenance
The following attestation bundles were made for xrpl_x402_core-0.1.1-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_core-0.1.1-py3-none-any.whl -
Subject digest:
aa9d4483618ec15dc9654782cf57dcf237aeda69a239f928e2d4963943ba3405 - Sigstore transparency entry: 1123432030
- Sigstore integration time:
-
Permalink:
lgcarrier/xrpl-x402-stack@cdd4c7d6a6dc8f42543fe816791f6b0602eebe75 -
Branch / Tag:
refs/tags/core-v0.1.1 - Owner: https://github.com/lgcarrier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@cdd4c7d6a6dc8f42543fe816791f6b0602eebe75 -
Trigger Event:
push
-
Statement type: