Skip to main content

Module transport

Module transport 

Source
Expand description

MPP (Machine Payments Protocol) HTTP transport.

Wraps a standard reqwest HTTP transport with automatic 402 Payment Required handling via the MPP protocol. When the RPC endpoint returns a 402 response, this transport automatically pays the challenge and retries the request.

Structsยง

LazySessionProvider
A payment provider that lazily initializes a SessionProvider from the Tempo wallet configuration on first use.
MppHttpTransport
HTTP transport with automatic MPP (Machine Payments Protocol) 402 handling.

Constantsยง

DEFAULT_DEPOSIT ๐Ÿ”’
Default deposit amount for new channels (in base units).
MPP_RETRY_TIMEOUT ๐Ÿ”’
Timeout for MPP retry requests (open/topUp may wait for on-chain settlement).

Staticsยง

GLOBAL_PAY_LOCKS ๐Ÿ”’
Process-wide payment serialization locks, keyed by origin URL.

Traitsยง

ResolveProvider ๐Ÿ”’
Trait for resolving a concrete PaymentProvider from a potentially lazy wrapper.

Functionsยง

default_deposit ๐Ÿ”’
Resolve the deposit amount from MPP_DEPOSIT env var or the default.
extract_challenge_chain_and_currency ๐Ÿ”’
Extract (chainId, currency) from a parsed MPP challenge.
format_http_diagnostics ๐Ÿ”’

Type Aliasesยง

LazyMppHttpTransport
Production transport: lazily discovers MPP keys from the Tempo wallet on first 402 response.