x402 Payment Protocol SDK for Python
Project description
x402
Python SDK for the x402 payment protocol — supports TRON and EVM (BSC) networks.
Installation
pip install bankofai-x402
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)
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
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
bankofai_x402-0.5.8b0.tar.gz
(225.2 kB
view details)
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 bankofai_x402-0.5.8b0.tar.gz.
File metadata
- Download URL: bankofai_x402-0.5.8b0.tar.gz
- Upload date:
- Size: 225.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74c019072c1ada4ab5f6015e385941616202202d283e0f3ec33e2518ddcf7b0e
|
|
| MD5 |
01d4c7eb6700f0ed240bcaf15ff1074e
|
|
| BLAKE2b-256 |
5022a8454f4eaacc9b2b7172bb6a7b20ae49564fe860a18031b02d469a97f58c
|
File details
Details for the file bankofai_x402-0.5.8b0-py3-none-any.whl.
File metadata
- Download URL: bankofai_x402-0.5.8b0-py3-none-any.whl
- Upload date:
- Size: 96.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a0fdcede1ca11584cef9b088c20e4e7e3fb51b291fb02c7fac83427cd747642
|
|
| MD5 |
72d441760f9bfc615514b8af1565687f
|
|
| BLAKE2b-256 |
06486c895e91834e0676a34fa97b705c7fea19bce0f7ed43f6ddd93f34740acc
|