Skip to main content

Module session

Module session 

Source
Expand description

Tempo session payment provider with expiring nonces.

Custom implementation that mirrors tempoxyz/wallet’s approach: uses expiring nonces (nonce=0, nonceKey=MAX, validBefore=now+25s) for channel open transactions instead of fetching sequential nonces via eth_getTransactionCount. This avoids the chicken-and-egg problem when the RPC endpoint is itself 402-gated.

StructsΒ§

SessionProvider
Tempo session provider using expiring nonces.

EnumsΒ§

PendingAction πŸ”’
Tracks uncommitted channel state from the most recent payment.

ConstantsΒ§

EXPIRING_NONCE_KEY πŸ”’
Expiring nonce key (U256::MAX) β€” matches the charge flow.
MAX_FEE_PER_GAS πŸ”’
Max fee per gas (20 gwei β€” Tempo’s fixed base fee).
MAX_PRIORITY_FEE_PER_GAS πŸ”’
Max priority fee per gas.
SESSION_OPEN_GAS_LIMIT πŸ”’
Default gas limit for session open transactions.
VALID_BEFORE_SECS πŸ”’
Validity window (in seconds) for expiring nonce transactions.

StaticsΒ§

GLOBAL_CHANNELS πŸ”’
Process-wide channel state registry, keyed by origin URL.
GLOBAL_PERSISTED πŸ”’
Process-wide persisted channel state, shared across ALL origins.

Type AliasesΒ§

SharedChannelState πŸ”’
Shared per-origin in-memory channel state: (channels, key_provisioned).