@wtflabs/x402 0.0.1-beta.0

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 (96) hide show
  1. package/README.md +60 -0
  2. package/dist/cjs/client/index.d.ts +64 -0
  3. package/dist/cjs/client/index.js +832 -0
  4. package/dist/cjs/client/index.js.map +1 -0
  5. package/dist/cjs/config-CFBSAuxW.d.ts +10 -0
  6. package/dist/cjs/config-Dfuvno71.d.ts +19 -0
  7. package/dist/cjs/facilitator/index.d.ts +42 -0
  8. package/dist/cjs/facilitator/index.js +2574 -0
  9. package/dist/cjs/facilitator/index.js.map +1 -0
  10. package/dist/cjs/index.d.ts +16 -0
  11. package/dist/cjs/index.js +2974 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/middleware-6_1ApcJn.d.ts +93 -0
  14. package/dist/cjs/middleware-B_ewwsQp.d.ts +93 -0
  15. package/dist/cjs/middleware-Brgsx32F.d.ts +93 -0
  16. package/dist/cjs/middleware-BwfW7mAs.d.ts +93 -0
  17. package/dist/cjs/middleware-CQb61c1k.d.ts +93 -0
  18. package/dist/cjs/middleware-DB9lqy9f.d.ts +93 -0
  19. package/dist/cjs/middleware-DcHctwQV.d.ts +93 -0
  20. package/dist/cjs/middleware-De0jD3Bp.d.ts +93 -0
  21. package/dist/cjs/middleware-HoFOmpgv.d.ts +93 -0
  22. package/dist/cjs/middleware-Y8AiAfYw.d.ts +93 -0
  23. package/dist/cjs/middleware-pnres9YM.d.ts +93 -0
  24. package/dist/cjs/network-FrFmmiyj.d.ts +11 -0
  25. package/dist/cjs/network-RtNddYQk.d.ts +11 -0
  26. package/dist/cjs/paywall/index.d.ts +30 -0
  27. package/dist/cjs/paywall/index.js +131 -0
  28. package/dist/cjs/paywall/index.js.map +1 -0
  29. package/dist/cjs/rpc-BMvnNNHd.d.ts +35 -0
  30. package/dist/cjs/rpc-Ca8eHCWz.d.ts +35 -0
  31. package/dist/cjs/schemes/index.d.ts +533 -0
  32. package/dist/cjs/schemes/index.js +3144 -0
  33. package/dist/cjs/schemes/index.js.map +1 -0
  34. package/dist/cjs/shared/evm/index.d.ts +71 -0
  35. package/dist/cjs/shared/evm/index.js +947 -0
  36. package/dist/cjs/shared/evm/index.js.map +1 -0
  37. package/dist/cjs/shared/index.d.ts +182 -0
  38. package/dist/cjs/shared/index.js +674 -0
  39. package/dist/cjs/shared/index.js.map +1 -0
  40. package/dist/cjs/types/index.d.ts +1515 -0
  41. package/dist/cjs/types/index.js +1645 -0
  42. package/dist/cjs/types/index.js.map +1 -0
  43. package/dist/cjs/verify/index.d.ts +7 -0
  44. package/dist/cjs/verify/index.js +438 -0
  45. package/dist/cjs/verify/index.js.map +1 -0
  46. package/dist/cjs/wallet-BRWfOM5D.d.ts +153 -0
  47. package/dist/cjs/wallet-BTqCm9Zp.d.ts +27 -0
  48. package/dist/cjs/wallet-BYRAGtOB.d.ts +153 -0
  49. package/dist/cjs/wallet-BmEtlgEf.d.ts +48 -0
  50. package/dist/cjs/wallet-CNOAmyZ6.d.ts +48 -0
  51. package/dist/cjs/wallet-CQ0Fe_M5.d.ts +88 -0
  52. package/dist/cjs/wallet-D1SoxFTw.d.ts +48 -0
  53. package/dist/cjs/wallet-SJ-hbjm9.d.ts +153 -0
  54. package/dist/cjs/wallet-SJKJpUgQ.d.ts +167 -0
  55. package/dist/cjs/wallet-ecnda4Aj.d.ts +48 -0
  56. package/dist/cjs/wallet-gP8Qoi-c.d.ts +74 -0
  57. package/dist/cjs/x402Specs-B7InXo2L.d.ts +1065 -0
  58. package/dist/cjs/x402Specs-BLH3j34O.d.ts +1696 -0
  59. package/dist/cjs/x402Specs-C7LipAZg.d.ts +1715 -0
  60. package/dist/cjs/x402Specs-CYq5tSY1.d.ts +1745 -0
  61. package/dist/cjs/x402Specs-CeajqonG.d.ts +1696 -0
  62. package/dist/cjs/x402Specs-qMujgEV5.d.ts +1715 -0
  63. package/dist/cjs/x402Specs-qUBCpcuz.d.ts +1715 -0
  64. package/dist/esm/chunk-34YNR4LY.mjs +106 -0
  65. package/dist/esm/chunk-34YNR4LY.mjs.map +1 -0
  66. package/dist/esm/chunk-57UEJN5U.mjs +1416 -0
  67. package/dist/esm/chunk-57UEJN5U.mjs.map +1 -0
  68. package/dist/esm/chunk-5LTKIVOA.mjs +858 -0
  69. package/dist/esm/chunk-5LTKIVOA.mjs.map +1 -0
  70. package/dist/esm/chunk-AQQR4PXH.mjs +80 -0
  71. package/dist/esm/chunk-AQQR4PXH.mjs.map +1 -0
  72. package/dist/esm/chunk-LGXWNXCO.mjs +76 -0
  73. package/dist/esm/chunk-LGXWNXCO.mjs.map +1 -0
  74. package/dist/esm/chunk-RX2JKK4O.mjs +349 -0
  75. package/dist/esm/chunk-RX2JKK4O.mjs.map +1 -0
  76. package/dist/esm/chunk-UCBE7FDY.mjs +1041 -0
  77. package/dist/esm/chunk-UCBE7FDY.mjs.map +1 -0
  78. package/dist/esm/client/index.mjs +17 -0
  79. package/dist/esm/client/index.mjs.map +1 -0
  80. package/dist/esm/facilitator/index.mjs +14 -0
  81. package/dist/esm/facilitator/index.mjs.map +1 -0
  82. package/dist/esm/index.mjs +28 -0
  83. package/dist/esm/index.mjs.map +1 -0
  84. package/dist/esm/paywall/index.mjs +46 -0
  85. package/dist/esm/paywall/index.mjs.map +1 -0
  86. package/dist/esm/schemes/index.mjs +16 -0
  87. package/dist/esm/schemes/index.mjs.map +1 -0
  88. package/dist/esm/shared/evm/index.mjs +20 -0
  89. package/dist/esm/shared/evm/index.mjs.map +1 -0
  90. package/dist/esm/shared/index.mjs +31 -0
  91. package/dist/esm/shared/index.mjs.map +1 -0
  92. package/dist/esm/types/index.mjs +87 -0
  93. package/dist/esm/types/index.mjs.map +1 -0
  94. package/dist/esm/verify/index.mjs +105 -0
  95. package/dist/esm/verify/index.mjs.map +1 -0
  96. package/package.json +148 -0
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ import { N as Network } from './network-FrFmmiyj.js';
3
+ import { E as EvmSigner } from './wallet-BYRAGtOB.js';
4
+ import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-CYq5tSY1.js';
5
+
6
+ declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
7
+ type Money = z.input<typeof moneySchema>;
8
+
9
+ type Resource = `${string}://${string}`;
10
+
11
+ type CreateHeaders = () => Promise<{
12
+ verify: Record<string, string>;
13
+ settle: Record<string, string>;
14
+ supported: Record<string, string>;
15
+ list?: Record<string, string>;
16
+ }>;
17
+ /**
18
+ * Creates a facilitator client for interacting with the X402 payment facilitator service
19
+ *
20
+ * @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
21
+ * @returns An object containing verify and settle functions for interacting with the facilitator
22
+ */
23
+ declare function useFacilitator(facilitator?: FacilitatorConfig): {
24
+ verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
25
+ settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
26
+ supported: () => Promise<SupportedPaymentKindsResponse>;
27
+ list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
28
+ };
29
+ declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
30
+ declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
31
+ declare const supported: () => Promise<SupportedPaymentKindsResponse>;
32
+ declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
33
+
34
+ type FacilitatorConfig = {
35
+ url: Resource;
36
+ createAuthHeaders?: CreateHeaders;
37
+ };
38
+ type PaywallConfig = {
39
+ cdpClientKey?: string;
40
+ appName?: string;
41
+ appLogo?: string;
42
+ sessionTokenEndpoint?: string;
43
+ };
44
+ type PaymentMiddlewareConfig = {
45
+ description?: string;
46
+ mimeType?: string;
47
+ maxTimeoutSeconds?: number;
48
+ inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
49
+ outputSchema?: object;
50
+ discoverable?: boolean;
51
+ customPaywallHtml?: string;
52
+ resource?: Resource;
53
+ errorMessages?: {
54
+ paymentRequired?: string;
55
+ invalidPayment?: string;
56
+ noMatchingRequirements?: string;
57
+ verificationFailed?: string;
58
+ settlementFailed?: string;
59
+ };
60
+ };
61
+ interface ERC20TokenAmount {
62
+ amount: string;
63
+ asset: {
64
+ address: `0x${string}`;
65
+ decimals: number;
66
+ eip712: {
67
+ name: string;
68
+ version: string;
69
+ };
70
+ };
71
+ }
72
+ interface SPLTokenAmount {
73
+ amount: string;
74
+ asset: {
75
+ address: string;
76
+ decimals: number;
77
+ };
78
+ }
79
+ type Price = Money | ERC20TokenAmount | SPLTokenAmount;
80
+ interface RouteConfig {
81
+ price: Price;
82
+ network: Network;
83
+ config?: PaymentMiddlewareConfig;
84
+ }
85
+ type RoutesConfig = Record<string, Price | RouteConfig>;
86
+ interface RoutePattern {
87
+ verb: string;
88
+ pattern: RegExp;
89
+ config: RouteConfig;
90
+ }
91
+ type Wallet = EvmSigner;
92
+
93
+ export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ import { N as Network } from './network-RtNddYQk.js';
3
+ import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
4
+ import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-qMujgEV5.js';
5
+
6
+ declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
7
+ type Money = z.input<typeof moneySchema>;
8
+
9
+ type Resource = `${string}://${string}`;
10
+
11
+ type CreateHeaders = () => Promise<{
12
+ verify: Record<string, string>;
13
+ settle: Record<string, string>;
14
+ supported: Record<string, string>;
15
+ list?: Record<string, string>;
16
+ }>;
17
+ /**
18
+ * Creates a facilitator client for interacting with the X402 payment facilitator service
19
+ *
20
+ * @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
21
+ * @returns An object containing verify and settle functions for interacting with the facilitator
22
+ */
23
+ declare function useFacilitator(facilitator?: FacilitatorConfig): {
24
+ verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
25
+ settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
26
+ supported: () => Promise<SupportedPaymentKindsResponse>;
27
+ list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
28
+ };
29
+ declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
30
+ declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
31
+ declare const supported: () => Promise<SupportedPaymentKindsResponse>;
32
+ declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
33
+
34
+ type FacilitatorConfig = {
35
+ url: Resource;
36
+ createAuthHeaders?: CreateHeaders;
37
+ };
38
+ type PaywallConfig = {
39
+ cdpClientKey?: string;
40
+ appName?: string;
41
+ appLogo?: string;
42
+ sessionTokenEndpoint?: string;
43
+ };
44
+ type PaymentMiddlewareConfig = {
45
+ description?: string;
46
+ mimeType?: string;
47
+ maxTimeoutSeconds?: number;
48
+ inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
49
+ outputSchema?: object;
50
+ discoverable?: boolean;
51
+ customPaywallHtml?: string;
52
+ resource?: Resource;
53
+ errorMessages?: {
54
+ paymentRequired?: string;
55
+ invalidPayment?: string;
56
+ noMatchingRequirements?: string;
57
+ verificationFailed?: string;
58
+ settlementFailed?: string;
59
+ };
60
+ };
61
+ interface ERC20TokenAmount {
62
+ amount: string;
63
+ asset: {
64
+ address: `0x${string}`;
65
+ decimals: number;
66
+ eip712: {
67
+ name: string;
68
+ version: string;
69
+ };
70
+ };
71
+ }
72
+ interface SPLTokenAmount {
73
+ amount: string;
74
+ asset: {
75
+ address: string;
76
+ decimals: number;
77
+ };
78
+ }
79
+ type Price = Money | ERC20TokenAmount | SPLTokenAmount;
80
+ interface RouteConfig {
81
+ price: Price;
82
+ network: Network;
83
+ config?: PaymentMiddlewareConfig;
84
+ }
85
+ type RoutesConfig = Record<string, Price | RouteConfig>;
86
+ interface RoutePattern {
87
+ verb: string;
88
+ pattern: RegExp;
89
+ config: RouteConfig;
90
+ }
91
+ type Wallet = EvmSigner;
92
+
93
+ export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ import { N as Network } from './network-RtNddYQk.js';
3
+ import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
4
+ import { a as PaymentPayload, P as PaymentRequirements, u as VerifyResponse, S as SettleResponse, F as SupportedPaymentKindsResponse, w as ListDiscoveryResourcesRequest, z as ListDiscoveryResourcesResponse, m as HTTPRequestStructure } from './x402Specs-B7InXo2L.js';
5
+
6
+ declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
7
+ type Money = z.input<typeof moneySchema>;
8
+
9
+ type Resource = `${string}://${string}`;
10
+
11
+ type CreateHeaders = () => Promise<{
12
+ verify: Record<string, string>;
13
+ settle: Record<string, string>;
14
+ supported: Record<string, string>;
15
+ list?: Record<string, string>;
16
+ }>;
17
+ /**
18
+ * Creates a facilitator client for interacting with the X402 payment facilitator service
19
+ *
20
+ * @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
21
+ * @returns An object containing verify and settle functions for interacting with the facilitator
22
+ */
23
+ declare function useFacilitator(facilitator?: FacilitatorConfig): {
24
+ verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
25
+ settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
26
+ supported: () => Promise<SupportedPaymentKindsResponse>;
27
+ list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
28
+ };
29
+ declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
30
+ declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
31
+ declare const supported: () => Promise<SupportedPaymentKindsResponse>;
32
+ declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
33
+
34
+ type FacilitatorConfig = {
35
+ url: Resource;
36
+ createAuthHeaders?: CreateHeaders;
37
+ };
38
+ type PaywallConfig = {
39
+ cdpClientKey?: string;
40
+ appName?: string;
41
+ appLogo?: string;
42
+ sessionTokenEndpoint?: string;
43
+ };
44
+ type PaymentMiddlewareConfig = {
45
+ description?: string;
46
+ mimeType?: string;
47
+ maxTimeoutSeconds?: number;
48
+ inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
49
+ outputSchema?: object;
50
+ discoverable?: boolean;
51
+ customPaywallHtml?: string;
52
+ resource?: Resource;
53
+ errorMessages?: {
54
+ paymentRequired?: string;
55
+ invalidPayment?: string;
56
+ noMatchingRequirements?: string;
57
+ verificationFailed?: string;
58
+ settlementFailed?: string;
59
+ };
60
+ };
61
+ interface ERC20TokenAmount {
62
+ amount: string;
63
+ asset: {
64
+ address: `0x${string}`;
65
+ decimals: number;
66
+ eip712: {
67
+ name: string;
68
+ version: string;
69
+ };
70
+ };
71
+ }
72
+ interface SPLTokenAmount {
73
+ amount: string;
74
+ asset: {
75
+ address: string;
76
+ decimals: number;
77
+ };
78
+ }
79
+ type Price = Money | ERC20TokenAmount | SPLTokenAmount;
80
+ interface RouteConfig {
81
+ price: Price;
82
+ network: Network;
83
+ config?: PaymentMiddlewareConfig;
84
+ }
85
+ type RoutesConfig = Record<string, Price | RouteConfig>;
86
+ interface RoutePattern {
87
+ verb: string;
88
+ pattern: RegExp;
89
+ config: RouteConfig;
90
+ }
91
+ type Wallet = EvmSigner;
92
+
93
+ export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ import { N as Network } from './network-FrFmmiyj.js';
3
+ import { E as EvmSigner } from './wallet-gP8Qoi-c.js';
4
+ import { a as PaymentPayload, P as PaymentRequirements, J as VerifyResponse, S as SettleResponse, X as SupportedPaymentKindsResponse, M as ListDiscoveryResourcesRequest, O as ListDiscoveryResourcesResponse, z as HTTPRequestStructure } from './x402Specs-CYq5tSY1.js';
5
+
6
+ declare const moneySchema: z.ZodPipeline<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, z.ZodNumber>;
7
+ type Money = z.input<typeof moneySchema>;
8
+
9
+ type Resource = `${string}://${string}`;
10
+
11
+ type CreateHeaders = () => Promise<{
12
+ verify: Record<string, string>;
13
+ settle: Record<string, string>;
14
+ supported: Record<string, string>;
15
+ list?: Record<string, string>;
16
+ }>;
17
+ /**
18
+ * Creates a facilitator client for interacting with the X402 payment facilitator service
19
+ *
20
+ * @param facilitator - The facilitator config to use. If not provided, the default facilitator will be used.
21
+ * @returns An object containing verify and settle functions for interacting with the facilitator
22
+ */
23
+ declare function useFacilitator(facilitator?: FacilitatorConfig): {
24
+ verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
25
+ settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
26
+ supported: () => Promise<SupportedPaymentKindsResponse>;
27
+ list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
28
+ };
29
+ declare const verify: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<VerifyResponse>;
30
+ declare const settle: (payload: PaymentPayload, paymentRequirements: PaymentRequirements) => Promise<SettleResponse>;
31
+ declare const supported: () => Promise<SupportedPaymentKindsResponse>;
32
+ declare const list: (config?: ListDiscoveryResourcesRequest) => Promise<ListDiscoveryResourcesResponse>;
33
+
34
+ type FacilitatorConfig = {
35
+ url: Resource;
36
+ createAuthHeaders?: CreateHeaders;
37
+ };
38
+ type PaywallConfig = {
39
+ cdpClientKey?: string;
40
+ appName?: string;
41
+ appLogo?: string;
42
+ sessionTokenEndpoint?: string;
43
+ };
44
+ type PaymentMiddlewareConfig = {
45
+ description?: string;
46
+ mimeType?: string;
47
+ maxTimeoutSeconds?: number;
48
+ inputSchema?: Omit<HTTPRequestStructure, "type" | "method">;
49
+ outputSchema?: object;
50
+ discoverable?: boolean;
51
+ customPaywallHtml?: string;
52
+ resource?: Resource;
53
+ errorMessages?: {
54
+ paymentRequired?: string;
55
+ invalidPayment?: string;
56
+ noMatchingRequirements?: string;
57
+ verificationFailed?: string;
58
+ settlementFailed?: string;
59
+ };
60
+ };
61
+ interface ERC20TokenAmount {
62
+ amount: string;
63
+ asset: {
64
+ address: `0x${string}`;
65
+ decimals: number;
66
+ eip712: {
67
+ name: string;
68
+ version: string;
69
+ };
70
+ };
71
+ }
72
+ interface SPLTokenAmount {
73
+ amount: string;
74
+ asset: {
75
+ address: string;
76
+ decimals: number;
77
+ };
78
+ }
79
+ type Price = Money | ERC20TokenAmount | SPLTokenAmount;
80
+ interface RouteConfig {
81
+ price: Price;
82
+ network: Network;
83
+ config?: PaymentMiddlewareConfig;
84
+ }
85
+ type RoutesConfig = Record<string, Price | RouteConfig>;
86
+ interface RoutePattern {
87
+ verb: string;
88
+ pattern: RegExp;
89
+ config: RouteConfig;
90
+ }
91
+ type Wallet = EvmSigner;
92
+
93
+ export { type CreateHeaders as C, type ERC20TokenAmount as E, type FacilitatorConfig as F, type Money as M, type Price as P, type RoutesConfig as R, type SPLTokenAmount as S, type Wallet as W, type RoutePattern as a, type Resource as b, type PaywallConfig as c, type PaymentMiddlewareConfig as d, type RouteConfig as e, supported as f, list as l, moneySchema as m, settle as s, useFacilitator as u, verify as v };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const NetworkSchema: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq", "bsc", "bsc-testnet"]>;
4
+ type Network = z.infer<typeof NetworkSchema>;
5
+ declare const SupportedEVMNetworks: Network[];
6
+ declare const EvmNetworkToChainId: Map<"base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "bsc" | "bsc-testnet" | "solana-devnet" | "solana", number>;
7
+ declare const SupportedSVMNetworks: Network[];
8
+ declare const SvmNetworkToChainId: Map<"base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "bsc" | "bsc-testnet" | "solana-devnet" | "solana", number>;
9
+ declare const ChainIdToNetwork: Record<number, Network>;
10
+
11
+ export { ChainIdToNetwork as C, EvmNetworkToChainId as E, type Network as N, SupportedEVMNetworks as S, NetworkSchema as a, SupportedSVMNetworks as b, SvmNetworkToChainId as c };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const NetworkSchema: z.ZodEnum<["base-sepolia", "base", "avalanche-fuji", "avalanche", "iotex", "solana-devnet", "solana", "sei", "sei-testnet", "polygon", "polygon-amoy", "peaq"]>;
4
+ type Network = z.infer<typeof NetworkSchema>;
5
+ declare const SupportedEVMNetworks: Network[];
6
+ declare const EvmNetworkToChainId: Map<"base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana", number>;
7
+ declare const SupportedSVMNetworks: Network[];
8
+ declare const SvmNetworkToChainId: Map<"base-sepolia" | "avalanche-fuji" | "base" | "avalanche" | "sei" | "sei-testnet" | "polygon" | "polygon-amoy" | "peaq" | "iotex" | "solana-devnet" | "solana", number>;
9
+ declare const ChainIdToNetwork: Record<number, Network>;
10
+
11
+ export { ChainIdToNetwork as C, EvmNetworkToChainId as E, type Network as N, SupportedEVMNetworks as S, NetworkSchema as a, SupportedSVMNetworks as b, SvmNetworkToChainId as c };
@@ -0,0 +1,30 @@
1
+ import { P as PaymentRequirements } from '../x402Specs-CYq5tSY1.js';
2
+ import 'zod';
3
+
4
+ interface PaywallOptions {
5
+ amount: number;
6
+ paymentRequirements: PaymentRequirements[];
7
+ currentUrl: string;
8
+ testnet: boolean;
9
+ cdpClientKey?: string;
10
+ appName?: string;
11
+ appLogo?: string;
12
+ sessionTokenEndpoint?: string;
13
+ }
14
+ /**
15
+ * Generates an HTML paywall page that allows users to pay for content access
16
+ *
17
+ * @param options - The options for generating the paywall
18
+ * @param options.amount - The amount to be paid in USD
19
+ * @param options.paymentRequirements - The payment requirements for the content
20
+ * @param options.currentUrl - The URL of the content being accessed
21
+ * @param options.testnet - Whether to use testnet or mainnet
22
+ * @param options.cdpClientKey - CDP client API key for OnchainKit
23
+ * @param options.appName - The name of the application to display in the wallet connection modal
24
+ * @param options.appLogo - The logo of the application to display in the wallet connection modal
25
+ * @param options.sessionTokenEndpoint - The API endpoint for generating session tokens for Onramp authentication
26
+ * @returns An HTML string containing the paywall page
27
+ */
28
+ declare function getPaywallHtml({ amount, testnet, paymentRequirements, currentUrl, cdpClientKey, appName, appLogo, sessionTokenEndpoint, }: PaywallOptions): string;
29
+
30
+ export { getPaywallHtml };