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.2.tar.gz (213.7 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.2-py3-none-any.whl (95.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bankofai_x402-0.5.2.tar.gz
  • Upload date:
  • Size: 213.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for bankofai_x402-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3d721b50eebc5a7848f467ce4056a0a615e10fd8e75e8300ef9054f346af968f
MD5 edeff4ad7558bd346c4c8c945c5241cb
BLAKE2b-256 4e448010566172bbf1697ae37fb3fc365f8a731af6e740b625ea1521e14dae27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bankofai_x402-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 95.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for bankofai_x402-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2ab28f1c523675de9316f698b02c3a2de1b0c9d70a8a08a73d8937d521be0c
MD5 5a553691ebe946893f1b0cb8c9cb5a8c
BLAKE2b-256 f498e5cced3f2c9c1016d1bbf60c09cc3fb1c4e55070194274bb2648e8ac2495

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