Expand description
Authentication middleware for ChainStream API.
Supports three modes:
- API Key:
X-API-KEYheader (viaApiKeyAuthMiddleware) - Wallet signature:
X-Wallet-*headers for x402 (viaWalletAuthMiddleware) - Bearer token:
Authorization: Bearerheader (viaBearerAuthMiddlewarein tests)
Structs§
- ApiKey
Auth Middleware - Middleware for reqwest that adds X-API-KEY header.
- Siwx
Auth Middleware - Middleware for reqwest that adds Authorization: SIWX header. Uses SIWX token (sign once, reuse for 1h) instead of per-request X-Wallet-* headers.
- Wallet
Auth Headers - Wallet auth headers for HTTP requests.
- Wallet
Auth Middleware - Legacy middleware for reqwest that adds X-Wallet-* headers (deprecated).
Traits§
- Wallet
Signer - Trait for wallet signers (EVM or Solana).
Functions§
- build_
sign_ message - Build the message that must be signed for wallet auth.
- build_
siwx_ message - Build a SIWX (EIP-4361) message for authentication.
- create_
wallet_ auth_ headers - Generate X-Wallet-* headers for a request.