@parallel-protocol/x402 0.5.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.
- package/LICENSE +21 -0
- package/README.md +610 -0
- package/dist/chunk-2UEAVMCH.js +17 -0
- package/dist/chunk-FDQULXKG.js +452 -0
- package/dist/chunk-W3SMR5LQ.cjs +465 -0
- package/dist/chunk-XUNNMCO5.cjs +20 -0
- package/dist/express.cjs +131 -0
- package/dist/express.d.cts +19 -0
- package/dist/express.d.ts +19 -0
- package/dist/express.js +128 -0
- package/dist/fastify.cjs +79 -0
- package/dist/fastify.d.cts +16 -0
- package/dist/fastify.d.ts +16 -0
- package/dist/fastify.js +72 -0
- package/dist/hono.cjs +77 -0
- package/dist/hono.d.cts +18 -0
- package/dist/hono.d.ts +18 -0
- package/dist/hono.js +74 -0
- package/dist/index.cjs +54 -0
- package/dist/index.d.cts +52 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +1 -0
- package/dist/next.cjs +81 -0
- package/dist/next.d.cts +17 -0
- package/dist/next.d.ts +17 -0
- package/dist/next.js +78 -0
- package/dist/types-CUi55YSx.d.cts +95 -0
- package/dist/types-CUi55YSx.d.ts +95 -0
- package/package.json +145 -0
package/dist/next.cjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkXUNNMCO5_cjs = require('./chunk-XUNNMCO5.cjs');
|
|
4
|
+
var chunkW3SMR5LQ_cjs = require('./chunk-W3SMR5LQ.cjs');
|
|
5
|
+
var server = require('next/server');
|
|
6
|
+
|
|
7
|
+
// src/next/adapter.ts
|
|
8
|
+
var NextAdapter = class {
|
|
9
|
+
constructor(req) {
|
|
10
|
+
this.req = req;
|
|
11
|
+
}
|
|
12
|
+
req;
|
|
13
|
+
getHeader(name) {
|
|
14
|
+
return this.req.headers.get(name) ?? void 0;
|
|
15
|
+
}
|
|
16
|
+
getMethod() {
|
|
17
|
+
return this.req.method;
|
|
18
|
+
}
|
|
19
|
+
getPath() {
|
|
20
|
+
return this.req.nextUrl.pathname;
|
|
21
|
+
}
|
|
22
|
+
getUrl() {
|
|
23
|
+
return this.req.url;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/next/index.ts
|
|
28
|
+
function withPayment(config, handler) {
|
|
29
|
+
const gate = chunkW3SMR5LQ_cjs.createPaymentGate(config);
|
|
30
|
+
return async (req) => {
|
|
31
|
+
const gateResult = await gate(new NextAdapter(req));
|
|
32
|
+
if (gateResult.type === "pass") {
|
|
33
|
+
return handler(req);
|
|
34
|
+
}
|
|
35
|
+
if (gateResult.type === "error") {
|
|
36
|
+
return new server.NextResponse(JSON.stringify(gateResult.result.body), {
|
|
37
|
+
status: gateResult.result.status,
|
|
38
|
+
headers: {
|
|
39
|
+
...gateResult.result.headers,
|
|
40
|
+
"Content-Type": "application/json"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
let response;
|
|
45
|
+
try {
|
|
46
|
+
const outcome = await chunkXUNNMCO5_cjs.raceTimeout(handler(req));
|
|
47
|
+
if (outcome === chunkXUNNMCO5_cjs.HANDLER_TIMEOUT) {
|
|
48
|
+
return new server.NextResponse(null, { status: 504 });
|
|
49
|
+
}
|
|
50
|
+
response = outcome;
|
|
51
|
+
} catch {
|
|
52
|
+
return new server.NextResponse(null, { status: 504 });
|
|
53
|
+
}
|
|
54
|
+
if (response.status >= 200 && response.status < 300) {
|
|
55
|
+
try {
|
|
56
|
+
const settleResponse = await gateResult.settle();
|
|
57
|
+
if (settleResponse.success) {
|
|
58
|
+
const headers = new Headers(response.headers);
|
|
59
|
+
headers.set("payment-response", chunkW3SMR5LQ_cjs.encodeBase64(settleResponse));
|
|
60
|
+
headers.set("access-control-expose-headers", "payment-response");
|
|
61
|
+
return new server.NextResponse(response.body, {
|
|
62
|
+
status: response.status,
|
|
63
|
+
headers
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
return server.NextResponse.json(
|
|
69
|
+
{
|
|
70
|
+
error: "PAYMENT_SETTLEMENT_FAILED",
|
|
71
|
+
message: "Payment could not be confirmed after multiple attempts. Please retry."
|
|
72
|
+
},
|
|
73
|
+
{ status: 402 }
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return response;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
exports.NextAdapter = NextAdapter;
|
|
81
|
+
exports.withPayment = withPayment;
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { H as HTTPAdapter, P as PaymentMiddlewareConfig } from './types-CUi55YSx.cjs';
|
|
3
|
+
import 'viem';
|
|
4
|
+
|
|
5
|
+
declare class NextAdapter implements HTTPAdapter {
|
|
6
|
+
private readonly req;
|
|
7
|
+
constructor(req: NextRequest);
|
|
8
|
+
getHeader(name: string): string | undefined;
|
|
9
|
+
getMethod(): string;
|
|
10
|
+
getPath(): string;
|
|
11
|
+
getUrl(): string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type NextHandler = (req: NextRequest) => Promise<NextResponse>;
|
|
15
|
+
declare function withPayment(config: PaymentMiddlewareConfig, handler: NextHandler): NextHandler;
|
|
16
|
+
|
|
17
|
+
export { NextAdapter, withPayment };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { H as HTTPAdapter, P as PaymentMiddlewareConfig } from './types-CUi55YSx.js';
|
|
3
|
+
import 'viem';
|
|
4
|
+
|
|
5
|
+
declare class NextAdapter implements HTTPAdapter {
|
|
6
|
+
private readonly req;
|
|
7
|
+
constructor(req: NextRequest);
|
|
8
|
+
getHeader(name: string): string | undefined;
|
|
9
|
+
getMethod(): string;
|
|
10
|
+
getPath(): string;
|
|
11
|
+
getUrl(): string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type NextHandler = (req: NextRequest) => Promise<NextResponse>;
|
|
15
|
+
declare function withPayment(config: PaymentMiddlewareConfig, handler: NextHandler): NextHandler;
|
|
16
|
+
|
|
17
|
+
export { NextAdapter, withPayment };
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { raceTimeout, HANDLER_TIMEOUT } from './chunk-2UEAVMCH.js';
|
|
2
|
+
import { createPaymentGate, encodeBase64 } from './chunk-FDQULXKG.js';
|
|
3
|
+
import { NextResponse } from 'next/server';
|
|
4
|
+
|
|
5
|
+
// src/next/adapter.ts
|
|
6
|
+
var NextAdapter = class {
|
|
7
|
+
constructor(req) {
|
|
8
|
+
this.req = req;
|
|
9
|
+
}
|
|
10
|
+
req;
|
|
11
|
+
getHeader(name) {
|
|
12
|
+
return this.req.headers.get(name) ?? void 0;
|
|
13
|
+
}
|
|
14
|
+
getMethod() {
|
|
15
|
+
return this.req.method;
|
|
16
|
+
}
|
|
17
|
+
getPath() {
|
|
18
|
+
return this.req.nextUrl.pathname;
|
|
19
|
+
}
|
|
20
|
+
getUrl() {
|
|
21
|
+
return this.req.url;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/next/index.ts
|
|
26
|
+
function withPayment(config, handler) {
|
|
27
|
+
const gate = createPaymentGate(config);
|
|
28
|
+
return async (req) => {
|
|
29
|
+
const gateResult = await gate(new NextAdapter(req));
|
|
30
|
+
if (gateResult.type === "pass") {
|
|
31
|
+
return handler(req);
|
|
32
|
+
}
|
|
33
|
+
if (gateResult.type === "error") {
|
|
34
|
+
return new NextResponse(JSON.stringify(gateResult.result.body), {
|
|
35
|
+
status: gateResult.result.status,
|
|
36
|
+
headers: {
|
|
37
|
+
...gateResult.result.headers,
|
|
38
|
+
"Content-Type": "application/json"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
let response;
|
|
43
|
+
try {
|
|
44
|
+
const outcome = await raceTimeout(handler(req));
|
|
45
|
+
if (outcome === HANDLER_TIMEOUT) {
|
|
46
|
+
return new NextResponse(null, { status: 504 });
|
|
47
|
+
}
|
|
48
|
+
response = outcome;
|
|
49
|
+
} catch {
|
|
50
|
+
return new NextResponse(null, { status: 504 });
|
|
51
|
+
}
|
|
52
|
+
if (response.status >= 200 && response.status < 300) {
|
|
53
|
+
try {
|
|
54
|
+
const settleResponse = await gateResult.settle();
|
|
55
|
+
if (settleResponse.success) {
|
|
56
|
+
const headers = new Headers(response.headers);
|
|
57
|
+
headers.set("payment-response", encodeBase64(settleResponse));
|
|
58
|
+
headers.set("access-control-expose-headers", "payment-response");
|
|
59
|
+
return new NextResponse(response.body, {
|
|
60
|
+
status: response.status,
|
|
61
|
+
headers
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
return NextResponse.json(
|
|
67
|
+
{
|
|
68
|
+
error: "PAYMENT_SETTLEMENT_FAILED",
|
|
69
|
+
message: "Payment could not be confirmed after multiple attempts. Please retry."
|
|
70
|
+
},
|
|
71
|
+
{ status: 402 }
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return response;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { NextAdapter, withPayment };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
|
|
3
|
+
interface FacilitatorConfig {
|
|
4
|
+
url: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
}
|
|
7
|
+
interface RouteConfig {
|
|
8
|
+
price: string | bigint;
|
|
9
|
+
decimals?: number;
|
|
10
|
+
network: string;
|
|
11
|
+
payTo: Address;
|
|
12
|
+
acceptedTokens?: Address[];
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PaymentMiddlewareConfig {
|
|
16
|
+
facilitator: FacilitatorConfig;
|
|
17
|
+
routes: Record<string, RouteConfig>;
|
|
18
|
+
}
|
|
19
|
+
interface RunHandlerResult {
|
|
20
|
+
status: number;
|
|
21
|
+
setResponseHeader(name: string, value: string): void;
|
|
22
|
+
sendResponse(): void;
|
|
23
|
+
discardResponse(): void;
|
|
24
|
+
}
|
|
25
|
+
interface HTTPAdapter {
|
|
26
|
+
getHeader(name: string): string | undefined;
|
|
27
|
+
getMethod(): string;
|
|
28
|
+
getPath(): string;
|
|
29
|
+
getUrl(): string;
|
|
30
|
+
runHandler?(): Promise<RunHandlerResult>;
|
|
31
|
+
}
|
|
32
|
+
interface ResourceInfo {
|
|
33
|
+
url: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
mimeType?: string;
|
|
36
|
+
}
|
|
37
|
+
interface PaymentRequirements {
|
|
38
|
+
scheme: string;
|
|
39
|
+
network: string;
|
|
40
|
+
asset: string;
|
|
41
|
+
amount: string;
|
|
42
|
+
payTo: string;
|
|
43
|
+
maxTimeoutSeconds: number;
|
|
44
|
+
extra: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
interface PaymentRequired {
|
|
47
|
+
x402Version: number;
|
|
48
|
+
error?: string;
|
|
49
|
+
resource: ResourceInfo;
|
|
50
|
+
accepts: PaymentRequirements[];
|
|
51
|
+
extensions?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
interface FacilitatorPaymentRequirements {
|
|
54
|
+
maxAmountRequired: string;
|
|
55
|
+
asset: string;
|
|
56
|
+
payTo: string;
|
|
57
|
+
network: string;
|
|
58
|
+
}
|
|
59
|
+
interface PaymentConfirmation {
|
|
60
|
+
success: true;
|
|
61
|
+
txHash: Address;
|
|
62
|
+
route: string;
|
|
63
|
+
chain: string;
|
|
64
|
+
gasSponsored: boolean;
|
|
65
|
+
networkId: string;
|
|
66
|
+
}
|
|
67
|
+
interface PaymentFailure {
|
|
68
|
+
success: false;
|
|
69
|
+
error: {
|
|
70
|
+
code: string;
|
|
71
|
+
message: string;
|
|
72
|
+
hint?: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
type FacilitatorResponse = PaymentConfirmation | PaymentFailure;
|
|
76
|
+
interface MiddlewareResult {
|
|
77
|
+
status: number;
|
|
78
|
+
headers: Record<string, string>;
|
|
79
|
+
body: unknown;
|
|
80
|
+
}
|
|
81
|
+
interface PassResult {
|
|
82
|
+
pass: true;
|
|
83
|
+
handlerRan?: true;
|
|
84
|
+
}
|
|
85
|
+
type PaymentGateResult = {
|
|
86
|
+
type: "pass";
|
|
87
|
+
} | {
|
|
88
|
+
type: "error";
|
|
89
|
+
result: MiddlewareResult;
|
|
90
|
+
} | {
|
|
91
|
+
type: "verified";
|
|
92
|
+
settle(): Promise<FacilitatorResponse>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type { FacilitatorConfig as F, HTTPAdapter as H, MiddlewareResult as M, PaymentMiddlewareConfig as P, RunHandlerResult as R, FacilitatorPaymentRequirements as a, FacilitatorResponse as b, PaymentGateResult as c, PassResult as d, PaymentConfirmation as e, PaymentFailure as f, PaymentRequired as g, PaymentRequirements as h, ResourceInfo as i, RouteConfig as j };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
|
|
3
|
+
interface FacilitatorConfig {
|
|
4
|
+
url: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
}
|
|
7
|
+
interface RouteConfig {
|
|
8
|
+
price: string | bigint;
|
|
9
|
+
decimals?: number;
|
|
10
|
+
network: string;
|
|
11
|
+
payTo: Address;
|
|
12
|
+
acceptedTokens?: Address[];
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PaymentMiddlewareConfig {
|
|
16
|
+
facilitator: FacilitatorConfig;
|
|
17
|
+
routes: Record<string, RouteConfig>;
|
|
18
|
+
}
|
|
19
|
+
interface RunHandlerResult {
|
|
20
|
+
status: number;
|
|
21
|
+
setResponseHeader(name: string, value: string): void;
|
|
22
|
+
sendResponse(): void;
|
|
23
|
+
discardResponse(): void;
|
|
24
|
+
}
|
|
25
|
+
interface HTTPAdapter {
|
|
26
|
+
getHeader(name: string): string | undefined;
|
|
27
|
+
getMethod(): string;
|
|
28
|
+
getPath(): string;
|
|
29
|
+
getUrl(): string;
|
|
30
|
+
runHandler?(): Promise<RunHandlerResult>;
|
|
31
|
+
}
|
|
32
|
+
interface ResourceInfo {
|
|
33
|
+
url: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
mimeType?: string;
|
|
36
|
+
}
|
|
37
|
+
interface PaymentRequirements {
|
|
38
|
+
scheme: string;
|
|
39
|
+
network: string;
|
|
40
|
+
asset: string;
|
|
41
|
+
amount: string;
|
|
42
|
+
payTo: string;
|
|
43
|
+
maxTimeoutSeconds: number;
|
|
44
|
+
extra: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
interface PaymentRequired {
|
|
47
|
+
x402Version: number;
|
|
48
|
+
error?: string;
|
|
49
|
+
resource: ResourceInfo;
|
|
50
|
+
accepts: PaymentRequirements[];
|
|
51
|
+
extensions?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
interface FacilitatorPaymentRequirements {
|
|
54
|
+
maxAmountRequired: string;
|
|
55
|
+
asset: string;
|
|
56
|
+
payTo: string;
|
|
57
|
+
network: string;
|
|
58
|
+
}
|
|
59
|
+
interface PaymentConfirmation {
|
|
60
|
+
success: true;
|
|
61
|
+
txHash: Address;
|
|
62
|
+
route: string;
|
|
63
|
+
chain: string;
|
|
64
|
+
gasSponsored: boolean;
|
|
65
|
+
networkId: string;
|
|
66
|
+
}
|
|
67
|
+
interface PaymentFailure {
|
|
68
|
+
success: false;
|
|
69
|
+
error: {
|
|
70
|
+
code: string;
|
|
71
|
+
message: string;
|
|
72
|
+
hint?: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
type FacilitatorResponse = PaymentConfirmation | PaymentFailure;
|
|
76
|
+
interface MiddlewareResult {
|
|
77
|
+
status: number;
|
|
78
|
+
headers: Record<string, string>;
|
|
79
|
+
body: unknown;
|
|
80
|
+
}
|
|
81
|
+
interface PassResult {
|
|
82
|
+
pass: true;
|
|
83
|
+
handlerRan?: true;
|
|
84
|
+
}
|
|
85
|
+
type PaymentGateResult = {
|
|
86
|
+
type: "pass";
|
|
87
|
+
} | {
|
|
88
|
+
type: "error";
|
|
89
|
+
result: MiddlewareResult;
|
|
90
|
+
} | {
|
|
91
|
+
type: "verified";
|
|
92
|
+
settle(): Promise<FacilitatorResponse>;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type { FacilitatorConfig as F, HTTPAdapter as H, MiddlewareResult as M, PaymentMiddlewareConfig as P, RunHandlerResult as R, FacilitatorPaymentRequirements as a, FacilitatorResponse as b, PaymentGateResult as c, PassResult as d, PaymentConfirmation as e, PaymentFailure as f, PaymentRequired as g, PaymentRequirements as h, ResourceInfo as i, RouteConfig as j };
|
package/package.json
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@parallel-protocol/x402",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Parallel Protocol x402 payment middleware — Express, Next.js, Fastify, Hono",
|
|
5
|
+
"author": "Parallel Protocol <contact@parallel.best>",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/parallel-protocol/sdk-merchant.git",
|
|
9
|
+
"directory": "packages/x402"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/parallel-protocol/sdk-merchant",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/parallel-protocol/sdk-merchant/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.cjs",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/index.d.cts",
|
|
29
|
+
"default": "./dist/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./express": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/express.d.ts",
|
|
35
|
+
"default": "./dist/express.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/express.d.cts",
|
|
39
|
+
"default": "./dist/express.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./next": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/next.d.ts",
|
|
45
|
+
"default": "./dist/next.js"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/next.d.cts",
|
|
49
|
+
"default": "./dist/next.cjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"./fastify": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/fastify.d.ts",
|
|
55
|
+
"default": "./dist/fastify.js"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/fastify.d.cts",
|
|
59
|
+
"default": "./dist/fastify.cjs"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"./hono": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./dist/hono.d.ts",
|
|
65
|
+
"default": "./dist/hono.js"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./dist/hono.d.cts",
|
|
69
|
+
"default": "./dist/hono.cjs"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./package.json": "./package.json"
|
|
73
|
+
},
|
|
74
|
+
"files": [
|
|
75
|
+
"dist",
|
|
76
|
+
"README.md",
|
|
77
|
+
"LICENSE"
|
|
78
|
+
],
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"registry": "https://registry.npmjs.org",
|
|
81
|
+
"access": "public"
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"build": "tsup",
|
|
85
|
+
"dev": "tsup --watch",
|
|
86
|
+
"clean": "rm -rf dist coverage",
|
|
87
|
+
"type-check": "tsc --noEmit",
|
|
88
|
+
"test": "vitest"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"viem": "^2.0.0",
|
|
92
|
+
"express": "^4.0.0 || ^5.0.0",
|
|
93
|
+
"next": "^14.0.0 || ^15.0.0",
|
|
94
|
+
"fastify": "^4.0.0 || ^5.0.0",
|
|
95
|
+
"hono": "^4.0.0"
|
|
96
|
+
},
|
|
97
|
+
"peerDependenciesMeta": {
|
|
98
|
+
"viem": {
|
|
99
|
+
"optional": true
|
|
100
|
+
},
|
|
101
|
+
"express": {
|
|
102
|
+
"optional": true
|
|
103
|
+
},
|
|
104
|
+
"next": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"fastify": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"hono": {
|
|
111
|
+
"optional": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"devDependencies": {
|
|
115
|
+
"@types/express": "^5.0.1",
|
|
116
|
+
"@types/node": "^22.0.0",
|
|
117
|
+
"fastify": "^5.0.0",
|
|
118
|
+
"hono": "^4.0.0",
|
|
119
|
+
"next": "^15.0.0",
|
|
120
|
+
"tsup": "^8.0.0",
|
|
121
|
+
"typescript": "^5.9.0",
|
|
122
|
+
"viem": "^2.47.0",
|
|
123
|
+
"vitest": "^4.0.14"
|
|
124
|
+
},
|
|
125
|
+
"dependencies": {
|
|
126
|
+
"@parallel-protocol/chains": "^0.2.0",
|
|
127
|
+
"fastify-plugin": "^6.0.0",
|
|
128
|
+
"zod": "^4.4.3"
|
|
129
|
+
},
|
|
130
|
+
"keywords": [
|
|
131
|
+
"x402",
|
|
132
|
+
"402",
|
|
133
|
+
"agent-payments",
|
|
134
|
+
"stablecoin",
|
|
135
|
+
"middleware",
|
|
136
|
+
"express",
|
|
137
|
+
"fastify",
|
|
138
|
+
"hono",
|
|
139
|
+
"nextjs",
|
|
140
|
+
"parallel-protocol"
|
|
141
|
+
],
|
|
142
|
+
"engines": {
|
|
143
|
+
"node": ">=18"
|
|
144
|
+
}
|
|
145
|
+
}
|