@puga-labs/x402-mantle-sdk 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/{chunk-GHUWTX7J.js → chunk-CXRILT3C.js} +4 -2
  2. package/dist/{chunk-6GLR5EBK.js → chunk-QWQUSRLY.js} +5 -2
  3. package/dist/{chunk-BRGW36P7.js → chunk-ZLCKBFVJ.js} +27 -1
  4. package/dist/{chunk-WFUDGBKK.js → chunk-ZROK2XOB.js} +4 -2
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +2 -2
  7. package/dist/server-express.cjs +1 -1
  8. package/dist/server-express.js +2 -2
  9. package/dist/server-nextjs.cjs +1 -1
  10. package/dist/server-nextjs.js +2 -2
  11. package/dist/server-web.cjs +1 -1
  12. package/dist/server-web.js +2 -2
  13. package/dist/server.cjs +1 -1
  14. package/dist/server.js +4 -4
  15. package/package.json +2 -2
  16. package/dist/chunk-CTI5CRDY.js +0 -274
  17. package/dist/chunk-DA6ZBXNO.js +0 -275
  18. package/dist/chunk-FD4HG7KR.js +0 -135
  19. package/dist/chunk-FHU6CFHF.js +0 -0
  20. package/dist/chunk-GWVWPS3R.js +0 -277
  21. package/dist/chunk-HTZ3QFY4.js +0 -135
  22. package/dist/chunk-MQALBRGV.js +0 -135
  23. package/dist/chunk-PYIYE3HI.js +0 -135
  24. package/dist/chunk-Q6SPMEIW.js +0 -235
  25. package/dist/chunk-RNKXSBT7.js +0 -135
  26. package/dist/chunk-SPCXFN7C.js +0 -284
  27. package/dist/chunk-T5DRYLNB.js +0 -135
  28. package/dist/chunk-TSEE5NSJ.js +0 -297
  29. package/dist/chunk-WAKJRVUP.js +0 -135
  30. package/dist/chunk-WELDWRDX.js +0 -307
  31. package/dist/chunk-XAQGMFSR.js +0 -56
  32. package/dist/constants-C7aY8u5b.d.cts +0 -77
  33. package/dist/constants-C7aY8u5b.d.ts +0 -77
  34. package/dist/constants-CVFF0ray.d.ts +0 -17
  35. package/dist/constants-DzCGK0Q3.d.cts +0 -17
  36. package/dist/createMantleClient-DS1Ghqrz.d.cts +0 -51
  37. package/dist/createMantleClient-DS1Ghqrz.d.ts +0 -51
  38. package/dist/createMantleClient-DVFkbBfS.d.ts +0 -87
  39. package/dist/createMantleClient-NN0Nitp9.d.cts +0 -87
  40. package/dist/express-Ck7eryef.d.cts +0 -66
  41. package/dist/express-CmEg5hR3.d.ts +0 -66
  42. package/dist/nextjs-Bp8DxYDN.d.ts +0 -45
  43. package/dist/nextjs-CliiaTPe.d.cts +0 -45
  44. package/dist/nextjs-D7t-BC4N.d.ts +0 -45
  45. package/dist/nextjs-ZO2J9mdo.d.cts +0 -45
  46. package/dist/types-2zqbJvcz.d.cts +0 -63
  47. package/dist/types-2zqbJvcz.d.ts +0 -63
  48. package/dist/types-C7EPJ6Hd.d.ts +0 -85
  49. package/dist/types-CEttmr1U.d.cts +0 -97
  50. package/dist/types-D20K36pc.d.ts +0 -97
  51. package/dist/types-xkNm0uzE.d.cts +0 -85
  52. package/dist/web-standards-C3D2vdTg.d.ts +0 -77
  53. package/dist/web-standards-DOYp0UDT.d.cts +0 -77
@@ -1,85 +0,0 @@
1
- import { N as NetworkId, P as PaymentRequirements } from './types-2zqbJvcz.js';
2
-
3
- /** Unique key for a protected route, e.g. "GET /api/protected". */
4
- type RouteKey = string;
5
- /** Pricing config for a single route. */
6
- interface RoutePricingConfig {
7
- /** Price in USD cents, e.g. 1 => $0.01. */
8
- priceUsdCents: number;
9
- /** Network identifier (e.g. "mantle-mainnet"). */
10
- network: NetworkId;
11
- }
12
- /** Map of route keys to pricing config. */
13
- type RoutesConfig = Record<RouteKey, RoutePricingConfig>;
14
- /** Log entry for a successfully settled payment. */
15
- interface PaymentLogEntry {
16
- id: string;
17
- from: string;
18
- to: string;
19
- valueAtomic: string;
20
- network: NetworkId;
21
- asset: string;
22
- route?: RouteKey;
23
- txHash?: string;
24
- timestamp: number;
25
- facilitatorUrl?: string;
26
- paymentRequirements?: PaymentRequirements;
27
- }
28
- /** Config for optional telemetry (billing/analytics). */
29
- interface TelemetryConfig {
30
- /** Project key from nosubs.ai dashboard. */
31
- projectKey: string;
32
- /**
33
- * Telemetry endpoint URL.
34
- * If not specified, uses DEFAULT_TELEMETRY_ENDPOINT (see server/constants.ts).
35
- */
36
- endpoint?: string;
37
- }
38
- /**
39
- * Minimal config for mantlePaywall() - simplified API for single-route protection.
40
- * This is the "sweet path" for Mantle mainnet + USDC with sensible defaults.
41
- */
42
- interface MinimalPaywallOptions {
43
- /** Price in USD (e.g. 0.01 for 1 cent). */
44
- priceUsd: number;
45
- /** Recipient address (developer wallet). */
46
- payTo: `0x${string}`;
47
- /** Optional facilitator URL (defaults to localhost:8080 or NEXT_PUBLIC_FACILITATOR_URL). */
48
- facilitatorUrl?: string;
49
- /** Optional telemetry config. */
50
- telemetry?: TelemetryConfig;
51
- /** Optional payment settled hook. */
52
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
53
- }
54
- /** Input for checkPayment function. */
55
- interface PaymentCheckInput {
56
- /** X-PAYMENT header value (base64 encoded), or null if not present. */
57
- paymentHeader: string | null;
58
- /** Payment requirements for this route. */
59
- paymentRequirements: PaymentRequirements;
60
- /** Facilitator URL for verification. */
61
- facilitatorUrl: string;
62
- /** Route key for logging, e.g. "POST /api/generate-image". */
63
- routeKey?: RouteKey;
64
- /** Network ID for this payment. */
65
- network: NetworkId;
66
- /** Asset address (ERC-20 token). */
67
- asset: string;
68
- /** Telemetry config (optional). */
69
- telemetry?: TelemetryConfig;
70
- /** Payment settled callback (optional). */
71
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
72
- }
73
- /** Result from checkPayment function. */
74
- interface PaymentCheckResult {
75
- /** Status of the payment check. */
76
- status: "require_payment" | "verification_error" | "invalid_payment" | "verified";
77
- /** HTTP status code to return. */
78
- statusCode: 402 | 500 | 200;
79
- /** Response body to return (null if verified). */
80
- responseBody: any | null;
81
- /** Whether payment is valid (only true if status is "verified"). */
82
- isValid: boolean;
83
- }
84
-
85
- export type { MinimalPaywallOptions as M, PaymentLogEntry as P, RouteKey as R, TelemetryConfig as T, RoutePricingConfig as a, RoutesConfig as b, PaymentCheckInput as c, PaymentCheckResult as d };
@@ -1,97 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { N as NetworkId, P as PaymentRequirements } from './types-2zqbJvcz.cjs';
3
-
4
- /** Unique key for a protected route, e.g. "GET /api/protected". */
5
- type RouteKey = string;
6
- /** Pricing config for a single route. */
7
- interface RoutePricingConfig {
8
- /** Price in USD cents, e.g. 1 => $0.01. */
9
- priceUsdCents: number;
10
- /** Network identifier (e.g. "mantle-mainnet"). */
11
- network: NetworkId;
12
- }
13
- /** Map of route keys to pricing config. */
14
- type RoutesConfig = Record<RouteKey, RoutePricingConfig>;
15
- /** Log entry for a successfully settled payment. */
16
- interface PaymentLogEntry {
17
- id: string;
18
- from: string;
19
- to: string;
20
- valueAtomic: string;
21
- network: NetworkId;
22
- asset: string;
23
- route?: RouteKey;
24
- txHash?: string;
25
- timestamp: number;
26
- facilitatorUrl?: string;
27
- paymentRequirements?: PaymentRequirements;
28
- }
29
- /** Config for optional telemetry (billing/analytics). */
30
- interface TelemetryConfig {
31
- /** Project key from nosubs.ai dashboard. */
32
- projectKey: string;
33
- /**
34
- * Telemetry endpoint URL.
35
- * If not specified, uses DEFAULT_TELEMETRY_ENDPOINT (see server/constants.ts).
36
- * If both are undefined, telemetry is not sent.
37
- */
38
- endpoint?: string;
39
- }
40
- /** Telemetry event payload for payment_verified. */
41
- interface TelemetryEvent {
42
- event: "payment_verified";
43
- ts: number;
44
- projectKey: string;
45
- network: string;
46
- buyer: string;
47
- payTo: string;
48
- amountAtomic: string;
49
- asset: string;
50
- decimals: number;
51
- nonce: string;
52
- route: string;
53
- facilitatorType: "hosted" | "self-hosted";
54
- facilitatorUrl?: string;
55
- facilitatorAddress?: string;
56
- txHash?: string;
57
- priceUsd?: string;
58
- }
59
- /** Config for createPaymentMiddleware. */
60
- interface PaymentMiddlewareConfig {
61
- /** Base URL of facilitator, e.g. https://facilitator.nosubs.ai */
62
- facilitatorUrl: string;
63
- /** Recipient address (developer). */
64
- receiverAddress: `0x${string}`;
65
- /** Map of protected routes and their pricing. */
66
- routes: RoutesConfig;
67
- /**
68
- * Optional hook called whenever a payment is successfully settled.
69
- * You can use this to push logs into your DB / analytics pipeline.
70
- */
71
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
72
- /** Optional: Send usage telemetry for billing/analytics. */
73
- telemetry?: TelemetryConfig;
74
- }
75
- /**
76
- * Minimal config for mantlePaywall() - simplified API for single-route protection.
77
- * This is the "sweet path" for Mantle mainnet + USDC with sensible defaults.
78
- */
79
- interface MinimalPaywallOptions {
80
- /** Price in USD (e.g. 0.01 for 1 cent). */
81
- priceUsd: number;
82
- /** Recipient address (developer wallet). */
83
- payTo: `0x${string}`;
84
- /** Optional facilitator URL (defaults to localhost:8080 or NEXT_PUBLIC_FACILITATOR_URL). */
85
- facilitatorUrl?: string;
86
- /** Optional telemetry config. */
87
- telemetry?: TelemetryConfig;
88
- /** Optional payment settled hook. */
89
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
90
- }
91
- /**
92
- * Express middleware function type for Mantle paywall.
93
- * Async function that returns Promise<void>.
94
- */
95
- type MantleMiddleware = (req: Request, res: Response, next: NextFunction) => Promise<void>;
96
-
97
- export type { MantleMiddleware as M, PaymentLogEntry as P, RouteKey as R, TelemetryConfig as T, RoutePricingConfig as a, RoutesConfig as b, TelemetryEvent as c, PaymentMiddlewareConfig as d, MinimalPaywallOptions as e };
@@ -1,97 +0,0 @@
1
- import { Request, Response, NextFunction } from 'express';
2
- import { N as NetworkId, P as PaymentRequirements } from './types-2zqbJvcz.js';
3
-
4
- /** Unique key for a protected route, e.g. "GET /api/protected". */
5
- type RouteKey = string;
6
- /** Pricing config for a single route. */
7
- interface RoutePricingConfig {
8
- /** Price in USD cents, e.g. 1 => $0.01. */
9
- priceUsdCents: number;
10
- /** Network identifier (e.g. "mantle-mainnet"). */
11
- network: NetworkId;
12
- }
13
- /** Map of route keys to pricing config. */
14
- type RoutesConfig = Record<RouteKey, RoutePricingConfig>;
15
- /** Log entry for a successfully settled payment. */
16
- interface PaymentLogEntry {
17
- id: string;
18
- from: string;
19
- to: string;
20
- valueAtomic: string;
21
- network: NetworkId;
22
- asset: string;
23
- route?: RouteKey;
24
- txHash?: string;
25
- timestamp: number;
26
- facilitatorUrl?: string;
27
- paymentRequirements?: PaymentRequirements;
28
- }
29
- /** Config for optional telemetry (billing/analytics). */
30
- interface TelemetryConfig {
31
- /** Project key from nosubs.ai dashboard. */
32
- projectKey: string;
33
- /**
34
- * Telemetry endpoint URL.
35
- * If not specified, uses DEFAULT_TELEMETRY_ENDPOINT (see server/constants.ts).
36
- * If both are undefined, telemetry is not sent.
37
- */
38
- endpoint?: string;
39
- }
40
- /** Telemetry event payload for payment_verified. */
41
- interface TelemetryEvent {
42
- event: "payment_verified";
43
- ts: number;
44
- projectKey: string;
45
- network: string;
46
- buyer: string;
47
- payTo: string;
48
- amountAtomic: string;
49
- asset: string;
50
- decimals: number;
51
- nonce: string;
52
- route: string;
53
- facilitatorType: "hosted" | "self-hosted";
54
- facilitatorUrl?: string;
55
- facilitatorAddress?: string;
56
- txHash?: string;
57
- priceUsd?: string;
58
- }
59
- /** Config for createPaymentMiddleware. */
60
- interface PaymentMiddlewareConfig {
61
- /** Base URL of facilitator, e.g. https://facilitator.nosubs.ai */
62
- facilitatorUrl: string;
63
- /** Recipient address (developer). */
64
- receiverAddress: `0x${string}`;
65
- /** Map of protected routes and their pricing. */
66
- routes: RoutesConfig;
67
- /**
68
- * Optional hook called whenever a payment is successfully settled.
69
- * You can use this to push logs into your DB / analytics pipeline.
70
- */
71
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
72
- /** Optional: Send usage telemetry for billing/analytics. */
73
- telemetry?: TelemetryConfig;
74
- }
75
- /**
76
- * Minimal config for mantlePaywall() - simplified API for single-route protection.
77
- * This is the "sweet path" for Mantle mainnet + USDC with sensible defaults.
78
- */
79
- interface MinimalPaywallOptions {
80
- /** Price in USD (e.g. 0.01 for 1 cent). */
81
- priceUsd: number;
82
- /** Recipient address (developer wallet). */
83
- payTo: `0x${string}`;
84
- /** Optional facilitator URL (defaults to localhost:8080 or NEXT_PUBLIC_FACILITATOR_URL). */
85
- facilitatorUrl?: string;
86
- /** Optional telemetry config. */
87
- telemetry?: TelemetryConfig;
88
- /** Optional payment settled hook. */
89
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
90
- }
91
- /**
92
- * Express middleware function type for Mantle paywall.
93
- * Async function that returns Promise<void>.
94
- */
95
- type MantleMiddleware = (req: Request, res: Response, next: NextFunction) => Promise<void>;
96
-
97
- export type { MantleMiddleware as M, PaymentLogEntry as P, RouteKey as R, TelemetryConfig as T, RoutePricingConfig as a, RoutesConfig as b, TelemetryEvent as c, PaymentMiddlewareConfig as d, MinimalPaywallOptions as e };
@@ -1,85 +0,0 @@
1
- import { N as NetworkId, P as PaymentRequirements } from './types-2zqbJvcz.cjs';
2
-
3
- /** Unique key for a protected route, e.g. "GET /api/protected". */
4
- type RouteKey = string;
5
- /** Pricing config for a single route. */
6
- interface RoutePricingConfig {
7
- /** Price in USD cents, e.g. 1 => $0.01. */
8
- priceUsdCents: number;
9
- /** Network identifier (e.g. "mantle-mainnet"). */
10
- network: NetworkId;
11
- }
12
- /** Map of route keys to pricing config. */
13
- type RoutesConfig = Record<RouteKey, RoutePricingConfig>;
14
- /** Log entry for a successfully settled payment. */
15
- interface PaymentLogEntry {
16
- id: string;
17
- from: string;
18
- to: string;
19
- valueAtomic: string;
20
- network: NetworkId;
21
- asset: string;
22
- route?: RouteKey;
23
- txHash?: string;
24
- timestamp: number;
25
- facilitatorUrl?: string;
26
- paymentRequirements?: PaymentRequirements;
27
- }
28
- /** Config for optional telemetry (billing/analytics). */
29
- interface TelemetryConfig {
30
- /** Project key from nosubs.ai dashboard. */
31
- projectKey: string;
32
- /**
33
- * Telemetry endpoint URL.
34
- * If not specified, uses DEFAULT_TELEMETRY_ENDPOINT (see server/constants.ts).
35
- */
36
- endpoint?: string;
37
- }
38
- /**
39
- * Minimal config for mantlePaywall() - simplified API for single-route protection.
40
- * This is the "sweet path" for Mantle mainnet + USDC with sensible defaults.
41
- */
42
- interface MinimalPaywallOptions {
43
- /** Price in USD (e.g. 0.01 for 1 cent). */
44
- priceUsd: number;
45
- /** Recipient address (developer wallet). */
46
- payTo: `0x${string}`;
47
- /** Optional facilitator URL (defaults to localhost:8080 or NEXT_PUBLIC_FACILITATOR_URL). */
48
- facilitatorUrl?: string;
49
- /** Optional telemetry config. */
50
- telemetry?: TelemetryConfig;
51
- /** Optional payment settled hook. */
52
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
53
- }
54
- /** Input for checkPayment function. */
55
- interface PaymentCheckInput {
56
- /** X-PAYMENT header value (base64 encoded), or null if not present. */
57
- paymentHeader: string | null;
58
- /** Payment requirements for this route. */
59
- paymentRequirements: PaymentRequirements;
60
- /** Facilitator URL for verification. */
61
- facilitatorUrl: string;
62
- /** Route key for logging, e.g. "POST /api/generate-image". */
63
- routeKey?: RouteKey;
64
- /** Network ID for this payment. */
65
- network: NetworkId;
66
- /** Asset address (ERC-20 token). */
67
- asset: string;
68
- /** Telemetry config (optional). */
69
- telemetry?: TelemetryConfig;
70
- /** Payment settled callback (optional). */
71
- onPaymentSettled?: (entry: PaymentLogEntry) => void;
72
- }
73
- /** Result from checkPayment function. */
74
- interface PaymentCheckResult {
75
- /** Status of the payment check. */
76
- status: "require_payment" | "verification_error" | "invalid_payment" | "verified";
77
- /** HTTP status code to return. */
78
- statusCode: 402 | 500 | 200;
79
- /** Response body to return (null if verified). */
80
- responseBody: any | null;
81
- /** Whether payment is valid (only true if status is "verified"). */
82
- isValid: boolean;
83
- }
84
-
85
- export type { MinimalPaywallOptions as M, PaymentLogEntry as P, RouteKey as R, TelemetryConfig as T, RoutePricingConfig as a, RoutesConfig as b, PaymentCheckInput as c, PaymentCheckResult as d };
@@ -1,77 +0,0 @@
1
- import { M as MinimalPaywallOptions } from './types-C7EPJ6Hd.js';
2
-
3
- /**
4
- * Web Standards route handler type.
5
- * Takes a Request and returns a Response.
6
- */
7
- type WebHandler = (request: Request) => Promise<Response>;
8
- /**
9
- * Wrapper function that adds x402 payment verification to Web Standards handler.
10
- */
11
- type WebPaywallWrapper = (handler: WebHandler) => WebHandler;
12
- /**
13
- * Create Web Standards middleware for x402 payment verification.
14
- * Uses Mantle mainnet defaults (USDC, exact scheme, etc.).
15
- *
16
- * Compatible with:
17
- * - Hono
18
- * - Cloudflare Workers
19
- * - Deno
20
- * - Bun
21
- * - Any platform supporting Web Request/Response API
22
- *
23
- * @example
24
- * ```typescript
25
- * // Hono example
26
- * import { Hono } from 'hono'
27
- * import { mantlePaywall } from '@puga-labs/x402-mantle-sdk/server/web'
28
- *
29
- * const app = new Hono()
30
- * const pay = mantlePaywall({
31
- * priceUsd: 0.01,
32
- * payTo: '0x...',
33
- * });
34
- *
35
- * app.post('/api/generate', pay(async (req) => {
36
- * const body = await req.json();
37
- * // Your handler code here
38
- * return new Response(JSON.stringify({ success: true }), {
39
- * headers: { 'Content-Type': 'application/json' }
40
- * });
41
- * }));
42
- * ```
43
- *
44
- * @example
45
- * ```typescript
46
- * // Cloudflare Workers example
47
- * import { mantlePaywall } from '@puga-labs/x402-mantle-sdk/server/web'
48
- *
49
- * const pay = mantlePaywall({
50
- * priceUsd: 0.01,
51
- * payTo: '0x...',
52
- * });
53
- *
54
- * export default {
55
- * async fetch(request: Request) {
56
- * const handler = pay(async (req) => {
57
- * // Your handler code here
58
- * return new Response('Hello World');
59
- * });
60
- * return handler(request);
61
- * }
62
- * }
63
- * ```
64
- *
65
- * @param opts - Minimal configuration (price, payTo, optional facilitator/telemetry).
66
- * @returns Function that wraps Web Standards handlers with payment verification.
67
- */
68
- declare function mantlePaywall(opts: MinimalPaywallOptions): WebPaywallWrapper;
69
-
70
- type webStandards_WebHandler = WebHandler;
71
- type webStandards_WebPaywallWrapper = WebPaywallWrapper;
72
- declare const webStandards_mantlePaywall: typeof mantlePaywall;
73
- declare namespace webStandards {
74
- export { type webStandards_WebHandler as WebHandler, type webStandards_WebPaywallWrapper as WebPaywallWrapper, webStandards_mantlePaywall as mantlePaywall };
75
- }
76
-
77
- export { type WebHandler as W, type WebPaywallWrapper as a, mantlePaywall as m, webStandards as w };
@@ -1,77 +0,0 @@
1
- import { M as MinimalPaywallOptions } from './types-xkNm0uzE.cjs';
2
-
3
- /**
4
- * Web Standards route handler type.
5
- * Takes a Request and returns a Response.
6
- */
7
- type WebHandler = (request: Request) => Promise<Response>;
8
- /**
9
- * Wrapper function that adds x402 payment verification to Web Standards handler.
10
- */
11
- type WebPaywallWrapper = (handler: WebHandler) => WebHandler;
12
- /**
13
- * Create Web Standards middleware for x402 payment verification.
14
- * Uses Mantle mainnet defaults (USDC, exact scheme, etc.).
15
- *
16
- * Compatible with:
17
- * - Hono
18
- * - Cloudflare Workers
19
- * - Deno
20
- * - Bun
21
- * - Any platform supporting Web Request/Response API
22
- *
23
- * @example
24
- * ```typescript
25
- * // Hono example
26
- * import { Hono } from 'hono'
27
- * import { mantlePaywall } from '@puga-labs/x402-mantle-sdk/server/web'
28
- *
29
- * const app = new Hono()
30
- * const pay = mantlePaywall({
31
- * priceUsd: 0.01,
32
- * payTo: '0x...',
33
- * });
34
- *
35
- * app.post('/api/generate', pay(async (req) => {
36
- * const body = await req.json();
37
- * // Your handler code here
38
- * return new Response(JSON.stringify({ success: true }), {
39
- * headers: { 'Content-Type': 'application/json' }
40
- * });
41
- * }));
42
- * ```
43
- *
44
- * @example
45
- * ```typescript
46
- * // Cloudflare Workers example
47
- * import { mantlePaywall } from '@puga-labs/x402-mantle-sdk/server/web'
48
- *
49
- * const pay = mantlePaywall({
50
- * priceUsd: 0.01,
51
- * payTo: '0x...',
52
- * });
53
- *
54
- * export default {
55
- * async fetch(request: Request) {
56
- * const handler = pay(async (req) => {
57
- * // Your handler code here
58
- * return new Response('Hello World');
59
- * });
60
- * return handler(request);
61
- * }
62
- * }
63
- * ```
64
- *
65
- * @param opts - Minimal configuration (price, payTo, optional facilitator/telemetry).
66
- * @returns Function that wraps Web Standards handlers with payment verification.
67
- */
68
- declare function mantlePaywall(opts: MinimalPaywallOptions): WebPaywallWrapper;
69
-
70
- type webStandards_WebHandler = WebHandler;
71
- type webStandards_WebPaywallWrapper = WebPaywallWrapper;
72
- declare const webStandards_mantlePaywall: typeof mantlePaywall;
73
- declare namespace webStandards {
74
- export { type webStandards_WebHandler as WebHandler, type webStandards_WebPaywallWrapper as WebPaywallWrapper, webStandards_mantlePaywall as mantlePaywall };
75
- }
76
-
77
- export { type WebHandler as W, type WebPaywallWrapper as a, mantlePaywall as m, webStandards as w };