x402
Python SDK for the x402 payment protocol — supports TRON and EVM (BSC) networks.
Current release: bankofai-x402==0.6.1. This release fixes TRON exact_permit facilitator settlement through wallet CLI backed signers and remains aligned with the TypeScript SDK for client, server, and facilitator exact, exact_permit, and exact_gasfree flows.
Compatibility Notes
- The EVM
exactflow is being aligned to the Coinbase x402 v2 payload shape. - Exact transfer authorizations are represented in
payload.authorization. - Server-side migration fallback still accepts the legacy
extensions.transferAuthorizationfield while the spec-aligned path becomes primary.
Installation
pip install bankofai-x402==0.6.1
Optional extras:
pip install "bankofai-x402[tron]"
pip install "bankofai-x402[fastapi]"
pip install "bankofai-x402[flask]"
pip install "bankofai-x402[all]"
Quick Start
from bankofai.x402.clients import X402Client
client = X402Client()
If you want automatic handling of HTTP 402 responses, use X402HttpClient:
import httpx
from bankofai.x402.clients import X402Client, X402HttpClient
x402_client = X402Client()
http_client = httpx.AsyncClient()
client = X402HttpClient(http_client=http_client, x402_client=x402_client)
BSC Testnet Example
For a complete BSC testnet exact smoke example, including a local-private-key client and a server that advertises DHLU for ERC-3009, see examples/bsc-testnet-smoke/README.md.
The key point for BSC exact is that the advertised asset must actually support transferWithAuthorization. The smoke-tested path in this repository uses DHLU on eip155:97.
Supported Schemes
exact_permit: Standard x402 payment scheme using TIP-712/EIP-712 permits.exact_gasfree: (TRON) Pay with USDT/USDD without TRX gas using the GasFree protocol.exact: (EVM) Native direct payment using ERC-3009.
Links
- Repository: https://github.com/BofAI/x402
- Issues: https://github.com/BofAI/x402/issues
- Documentation: https://docs.bankofai.io/
- Contributing: CONTRIBUTING.md
Metadata
Release files for bankofai-x402 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bankofai_x402-0.6.1.tar.gz | 12.6 MB | Without provenance | Details for bankofai_x402-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bankofai_x402-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for bankofai_x402-0.6.1-py3-none-any.whl |
Total release size: 12.7 MB
Release files / bankofai_x402-0.6.1.tar.gz
| Download URL | bankofai_x402-0.6.1.tar.gz |
|---|---|
| Size | 12.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
535fc5f2dbb87602ceb375eca16e050612afe01f8244e61938032d8741f0cd9c
|
|
BLAKE2b-256 checksum How to use checksums |
fa009e48a41c3fa82e9849e335e9bc2e34e93bdbc7bdd0bb06c4539ac73cfa87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / bankofai_x402-0.6.1-py3-none-any.whl
| Download URL | bankofai_x402-0.6.1-py3-none-any.whl |
|---|---|
| Size | 97.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40eac40021994fd02014d671c8a5ba8cca146c57882752a31cac8b11ae9c5576
|
|
BLAKE2b-256 checksum How to use checksums |
8e7f37fd2fa35a47792e5e7ec9812d33c40c99663b0a8690959ce9da077fdcf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for bankofai-x402 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.