Expand description
Tron chain support for the x402 payment protocol.
This crate provides implementations of the x402 payment protocol for Tron
chains with the “exact” payment scheme based on EIP-3009
transferWithAuthorization and SUN.io Permit2 via x402ExactPermit2Proxy.
§Features
- CAIP-2 Addressing: Uses CAIP-2 chain IDs (e.g.,
tron:0x2b6653dc) for chain identification Base58CheckAddresses: Tron-nativeT-prefixed addresses with 0x41 prefix- TIP-712 Signing: Byte-compatible with EIP-712, using secp256k1 ECDSA
- EIP-3009 Payments: Gasless token transfers using
transferWithAuthorization - Permit2 Payments: SUN.io Permit2 fallback for tokens without EIP-3009 (e.g. USDT)
TronGridAPI: HTTP REST API for chain interaction (no JSON-RPC)
§Architecture
The crate is organized into two modules:
§Feature Flags
server- Server-side price tag generationclient- Client-side payment signingfacilitator- Facilitator-side payment verification and settlementtelemetry-OpenTelemetrytracing support
Re-exports§
pub use exact::TronExact;pub use exact::client::Eip3009SigningParams;clientpub use exact::client::Permit2SigningParams;clientpub use exact::client::SignerLike;clientpub use exact::client::TronExactClient;client
Modules§
Structs§
- USDT
- Ergonomic accessors for USDT token deployments on well-known Tron chains.
Constants§
- TRON_
DEFAULT_ CLOCK_ SKEW_ TOLERANCE_ SECS - Default clock-skew tolerance (seconds) applied to TIP-712 time-window checks.
Statics§
- TRON_
NETWORKS - Well-known Tron networks with their names and CAIP-2 identifiers.
Functions§
- usdt_
tron_ deployment - Returns the USDT deployment for a specific Tron chain, if known.
- usdt_
tron_ deployments - Returns all known USDT deployments on Tron chains.