@parallel-protocol/mpp 0.1.0 → 0.1.2
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/README.md +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ const app = new Hono();
|
|
|
77
77
|
|
|
78
78
|
app.use(
|
|
79
79
|
paymentMiddleware({
|
|
80
|
-
facilitator: { url: "https://
|
|
80
|
+
facilitator: { url: "https://agents.parallel.best" },
|
|
81
81
|
routes: {
|
|
82
82
|
"/api/quote": {
|
|
83
83
|
price: "0.10", // 0.10 USDC (6 decimals by default)
|
|
@@ -104,7 +104,7 @@ const app = express();
|
|
|
104
104
|
app.use(
|
|
105
105
|
paymentMiddleware({
|
|
106
106
|
facilitator: {
|
|
107
|
-
url: "https://
|
|
107
|
+
url: "https://agents.parallel.best",
|
|
108
108
|
},
|
|
109
109
|
routes: {
|
|
110
110
|
"/api/data": {
|
|
@@ -132,7 +132,7 @@ import { withPayment } from "@parallel-protocol/mpp/next";
|
|
|
132
132
|
|
|
133
133
|
export const GET = withPayment(
|
|
134
134
|
{
|
|
135
|
-
facilitator: { url: "https://
|
|
135
|
+
facilitator: { url: "https://agents.parallel.best" },
|
|
136
136
|
routes: {
|
|
137
137
|
"/api/data": {
|
|
138
138
|
price: "0.05",
|
|
@@ -159,7 +159,7 @@ const app = Fastify();
|
|
|
159
159
|
|
|
160
160
|
await app.register(
|
|
161
161
|
paymentMiddleware({
|
|
162
|
-
facilitator: { url: "https://
|
|
162
|
+
facilitator: { url: "https://agents.parallel.best" },
|
|
163
163
|
routes: {
|
|
164
164
|
"/api/data": {
|
|
165
165
|
price: 1000000n, // 1 USDC as raw bigint (6 decimals → skip parsing)
|
|
@@ -191,7 +191,7 @@ interface MppMiddlewareConfig {
|
|
|
191
191
|
|
|
192
192
|
| Field | Type | Required | Description |
|
|
193
193
|
|-------|------|----------|-------------|
|
|
194
|
-
| `url` | `string` | Yes | Base URL of the Parallel facilitator (e.g. `https://
|
|
194
|
+
| `url` | `string` | Yes | Base URL of the Parallel facilitator (e.g. `https://agents.parallel.best`). The SDK internally appends `/mpp/verify` and `/mpp/settle` to this value. |
|
|
195
195
|
| `apiKey` | `string` | No | Reserved for future use. If provided, sent as `X-API-Key` header on facilitator requests but currently not enforced server-side. |
|
|
196
196
|
|
|
197
197
|
### `MppRouteConfig`
|
|
@@ -466,7 +466,7 @@ Low-level client for the facilitator's MPP endpoints:
|
|
|
466
466
|
import { MppFacilitatorClient } from "@parallel-protocol/mpp";
|
|
467
467
|
|
|
468
468
|
const client = new MppFacilitatorClient({
|
|
469
|
-
url: "https://
|
|
469
|
+
url: "https://agents.parallel.best",
|
|
470
470
|
});
|
|
471
471
|
|
|
472
472
|
// Phase 1: verify signature + reserve nonce (no on-chain tx)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallel-protocol/mpp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Parallel Protocol MPP (Machine Payments Protocol) merchant middleware — the Payment HTTP auth-scheme dance (402 challenge → credential → receipt) over the facilitator's /mpp endpoints",
|
|
5
5
|
"author": "Parallel Protocol <contact@parallel.best>",
|
|
6
6
|
"repository": "github:parallel-protocol/sdk-merchant",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"vitest": "^4.0.14"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@parallel-protocol/chains": "^0.
|
|
122
|
-
"@parallel-protocol/mpp-types": "^0.1.
|
|
121
|
+
"@parallel-protocol/chains": "^0.3.0",
|
|
122
|
+
"@parallel-protocol/mpp-types": "^0.1.3",
|
|
123
123
|
"zod": "^4.4.3"
|
|
124
124
|
}
|
|
125
125
|
}
|