402fly-client
HTTP client library for the X402 payment protocol with automatic and explicit payment handling.
This library provides both high-level (automatic) and low-level (explicit) APIs for interacting with X402-enabled services.
Features
- Fly402Client: Explicit control over payment requests and responses
- Fly402AutoClient: Automatic payment handling with configurable payment limits and retry logic
- Full HTTP Support: GET and POST requests with transparent payment integration
- Error Handling: Proper error types for payment failures and network issues
- Async/Await: Built on Tokio for non-blocking operations
Quick Start
Add to your Cargo.toml:
[]
= "0.0.1"
= { = "1.35", = ["full"] }
Automatic Payment (Recommended)
use 402;
use Keypair;
async
Explicit Payment Control
use 402Fly402Client;
use Keypair;
async
Configuration
AutoClientOptions
Documentation
For full documentation, visit: https://402fly.github.io/docs
License
MIT License - See LICENSE file for details.
Related Packages
402fly-core- Core protocol library402fly-rocket- Rocket server integration402fly-actix- Actix Web server integration