Skip to main content

Cronos X402 Facilitator SDK for Python

The Cronos Facilitator Python SDK provides a lightweight, strongly typed client for interacting with the Cronos X402 Facilitator API.

It enables Python applications to:

  • Generate EIP-3009 signed payment headers
  • Build X402 Payment Requirements
  • Submit payments for verification and settlement
  • Discover supported networks and capabilities

This SDK supports fully automated off-chain authorization / on-chain execution payment flows on Cronos Mainnet and Cronos Testnet.

Features

  • Facilitator API Client

    • /supported
    • /verify
    • /settle
  • EIP-3009 Payment Header Generator

    • Produces Base64-encoded X402 headers
  • Typed X402 Payment Requirements

    • JSON-serializable and schema-aware
  • Minimal dependencies

    • Uses requests and eth-account only when required
  • Cronos-native

    • Supports Cronos Mainnet and Cronos Testnet

Installation

pip install crypto_com_facilitator_client

Note EIP-3009 signing requires optional dependencies:

pip install eth-account hexbytes

Usage

1. Create a Facilitator Client

The Facilitator base URL is fixed internally and cannot be overridden.

from crypto_com_facilitator_client import Facilitator
from crypto_com_facilitator_client.integrations.facilitator_interface import CronosNetwork

facilitator = Facilitator(
    network=CronosNetwork.CronosTestnet  # or CronosMainnet
)

2. Generate Payment Requirements

requirements = facilitator.generate_payment_requirements(
    pay_to="0xRecipientAddress",
    description="Payment for Order #123",
    max_amount_required="1000000",  # base units
)

print(requirements)

3. Generate a Base64 Payment Header (EIP-3009)

import os
from eth_account import Account

signer = Account.from_key(os.environ["PRIVATE_KEY"])

header = await facilitator.generate_payment_header(
    to="0xRecipientAddress",
    value="1000000",  # 1 USDCe (6 decimals)
    signer=signer,
    valid_before=int(time.time()) + 600,  # 10 min expiry
)

print("header:", header)

4. Verify a Payment Request

body = facilitator.build_verify_request(header, requirements)

verify_response = await facilitator.verify_payment(body)
print("verify:", verify_response)

5. Settle a Verified Payment

settle_response = await facilitator.settle_payment(body)
print("settled:", settle_response)

6. Discover Supported Networks & Capabilities

capabilities = await facilitator.get_supported()
print(capabilities)

End-to-End Example (Full Flow)

from crypto_com_facilitator_client import Facilitator
from crypto_com_facilitator_client.integrations.facilitator_interface import CronosNetwork
from eth_account import Account
import os
import time

facilitator = Facilitator(network=CronosNetwork.CronosTestnet)

signer = Account.from_key(os.environ["PRIVATE_KEY"])
receiver = "0xRecipientAddress"

header = await facilitator.generate_payment_header(
    to=receiver,
    value="1000000",
    signer=signer,
)

requirements = facilitator.generate_payment_requirements(
    pay_to=receiver,
    description="Premium API access",
    max_amount_required="1000000",
)

body = facilitator.build_verify_request(header, requirements)

verify = await facilitator.verify_payment(body)

if verify.get("isValid"):
    settle = await facilitator.settle_payment(body)
    print("Transaction hash:", settle.get("txHash"))

API Overview

Facilitator Client

Method Description
get_supported() Returns supported networks and capabilities
verify_payment(request) Validates the Base64 header + requirements
settle_payment(request) Executes the authorized transfer on-chain
build_verify_request(header, requirements) Helper to produce valid verification/settlement payloads

Utilities

Function Description
generate_cronos_payment_header() Creates Base64 EIP-3009 payment header
generate_payment_requirements() Produces typed X402 Payment Requirements

Supported Networks

  • Cronos Mainnet
  • Cronos Testnet

License

MIT © 2025 Crypto.com

Metadata

Release files for crypto-com-facilitator-client 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for crypto-com-facilitator-client 1.0.3
File Interpreter ABI Platform
crypto_com_facilitator_client-1.0.3-py3-none-any.whl Python 3 none any Details

Release files / crypto_com_facilitator_client-1.0.3-py3-none-any.whl

Download URL crypto_com_facilitator_client-1.0.3-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4f77bfeed184bdde58e09c50d6e32cb2ba5c03a403e814ee086db614eb71dae
BLAKE2b-256 checksum
How to use checksums
f4479ac6f38467a8174efa0668dc4662865b53ffe7b87c6015e509004f120eef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for crypto-com-facilitator-client 1.0.3

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.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page