1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! V2 EIP-155 "upto" payment scheme implementation.
//!
//! This module implements the "upto" payment scheme for EVM chains using
//! the V2 x402 protocol. The upto scheme enables usage-based payments where
//! the client authorizes a maximum amount, and the server settles for the
//! actual amount used at the end of the request.
//!
//! # Key Features
//!
//! - **Variable Settlement**: Client signs a maximum, server settles actual usage
//! - **Permit2 Only**: Uses Permit2 exclusively (EIP-3009 requires exact amounts)
//! - **Zero Settlement**: Supports $0 settlements without on-chain transactions
//! - **Usage-Based Pricing**: Ideal for LLM tokens, bandwidth, compute metering
//!
//! # Differences from Exact Scheme
//!
//! - The `amount` in requirements represents the **maximum** authorized amount
//! - The actual settled amount can be less than or equal to the maximum
//! - Only Permit2 asset transfer method is supported
//! - Settlement can be $0 (no on-chain transaction needed)
//!
//! # Example Use Cases
//!
//! - LLM token generation (charge per token generated)
//! - Bandwidth metering (pay per byte transferred)
//! - Dynamic compute pricing (charge based on resources consumed)
//!
//! # Usage
//!
//! ```ignore
//! use x402_chain_eip155::v2_eip155_upto::V2Eip155Upto;
//! use x402_chain_eip155::networks::{KnownNetworkEip155, USDC};
//!
//! // Create a price tag for up to 5 USDC
//! let usdc = USDC::base();
//! let price = V2Eip155Upto::price_tag(
//! "0x1234...", // pay_to address
//! usdc.amount(5_000_000u64.into()), // max 5 USDC
//! );
//! ```
pub use *;
pub use *;
// Public for consumption by downstream crates.
pub use *;
pub use *;
use X402SchemeId;
/// Scheme identifier for V2 EIP-155 upto payments.
;