Skip to main content

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

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

bankofai_x402-0.5.7.tar.gz (226.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bankofai_x402-0.5.7-py3-none-any.whl (96.8 kB view details)

Uploaded Python 3

File details

Details for the file bankofai_x402-0.5.7.tar.gz.

File metadata

  • Download URL: bankofai_x402-0.5.7.tar.gz
  • Upload date:
  • Size: 226.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.22

File hashes

Hashes for bankofai_x402-0.5.7.tar.gz
Algorithm Hash digest
SHA256 5fe0e272326ac8504b5a1016291ffa95bdd88d846770a6a8af7c5daa33fd56cd
MD5 4e9d78171117c95e950edd3c9848d2a8
BLAKE2b-256 0e0814bdf2d6a843e89157bade11645f14582f9b729ec18ca7d1b7a1faef1ee2

See more details on using hashes here.

File details

Details for the file bankofai_x402-0.5.7-py3-none-any.whl.

File metadata

File hashes

Hashes for bankofai_x402-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c01f303710469b363b9be20c5405faf678eb839ee92a0885d0fbc667c0041ffb
MD5 471022d128dd7457e51400609bf8bf54
BLAKE2b-256 d0707eaaa2d3d0d7c26d4797f0f5168f4c5c551f3684bfc6a28c4d6294c56e39

See more details on using hashes here.

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