Skip to main content

bsv_payment_actix_middleware/
lib.rs

1#![warn(missing_docs)]
2//! BSV payment middleware for Actix-web.
3//!
4//! Wire-compatible with the TypeScript `payment-express-middleware`. Enforces
5//! BSV micropayments on protected routes by verifying payment headers, deriving
6//! keys, and internalizing transactions via a [`WalletInterface`] implementation.
7//!
8//! [`WalletInterface`]: bsv::wallet::interfaces::WalletInterface
9
10pub mod config;
11pub mod error;
12pub mod extractor;
13pub mod middleware;
14pub mod types;
15
16#[cfg(feature = "bridge")]
17pub mod bridge;
18
19pub use config::{PaymentMiddlewareConfig, PaymentMiddlewareConfigBuilder};
20pub use error::PaymentError;
21pub use extractor::AuthIdentity;
22pub use middleware::{PaymentMiddlewareFactory, PaymentMiddlewareService};
23pub use types::{
24    BSVPayment, CalculateRequestPrice, PaymentInfo, DEFAULT_SATOSHIS, PAYMENT_VERSION,
25};
26
27#[cfg(feature = "bridge")]
28pub use bridge::{AuthToPaymentBridge, AuthToPaymentBridgeService};