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.8.tar.gz (225.2 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.8-py3-none-any.whl (96.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bankofai_x402-0.5.8.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

Hashes for bankofai_x402-0.5.8.tar.gz
Algorithm Hash digest
SHA256 d0dfd19af825fa5d1093c85815b1f862ea5748c479d148bfe004f49774b679e9
MD5 a6aac2c443a360519949f9133d1fa71a
BLAKE2b-256 0cf8017791f2ecfd8832472288d9473d5ebff76e2718717277a26f52cc82e4bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bankofai_x402-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 96.0 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

Hashes for bankofai_x402-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5cc22d7042b5dfa536a5fda96618dce10f2a39af4cb87fd0c45cf11fa6f7538d
MD5 591f12946519862f53df0736d790c77d
BLAKE2b-256 b75d123b3d61ffa98d54c30363eda99d6277355cfd849c04c073c4e7ebbbd175

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