UNPKG

@bsv/payment-express-middleware

Version:

BSV Blockchain service monetization express middleware

15 lines 826 B
import { Request, Response, NextFunction } from 'express'; import { PaymentMiddlewareOptions } from './types.js'; /** * Creates middleware that enforces BSV payment for HTTP requests. * * NOTE: This middleware should run after the authentication middleware so that `req.auth` is available. * * @param options - Configuration for the payment middleware * @param options.wallet - A wallet instance capable of submitting direct transactions. * @param options.calculateRequestPrice - A function returning the price for the request in satoshis. * * @returns Express middleware that requires payment if `calculateRequestPrice` > 0. */ export declare function createPaymentMiddleware(options: PaymentMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => Promise<void>; //# sourceMappingURL=index.d.ts.map