@peac/adapter-x402 0.12.8 → 0.12.10
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 +30 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -10,7 +10,36 @@ pnpm add @peac/adapter-x402
|
|
|
10
10
|
|
|
11
11
|
## What It Does
|
|
12
12
|
|
|
13
|
-
`@peac/adapter-x402` is a Layer 4 adapter that verifies x402 offer and receipt artifacts, extracts receipt data from HTTP response headers, and maps the results into canonical PEAC interaction records. It implements a verification-first architecture with layered checks: wire validation, term-matching, offer-receipt consistency, and opt-in cryptographic verification. The adapter reads both PEAC-Receipt and upstream x402 response headers (v1 and v2) with priority-based fallback.
|
|
13
|
+
`@peac/adapter-x402` is a Layer 4 adapter that verifies x402 offer and receipt artifacts, extracts receipt data from HTTP response headers, and maps the results into canonical PEAC interaction records. It implements a verification-first architecture with layered checks: wire validation, term-matching (including the `scheme` identifier), offer-receipt consistency, and opt-in cryptographic verification. The adapter reads both PEAC-Receipt and upstream x402 response headers (v1 and v2) with priority-based fallback.
|
|
14
|
+
|
|
15
|
+
## Scheme scope
|
|
16
|
+
|
|
17
|
+
The adapter is **scheme-agnostic at the verification layer**. It preserves and
|
|
18
|
+
term-matches the x402 `scheme` identifier (`exact`, `upto`, or any future
|
|
19
|
+
upstream scheme) as a required string alongside `network`, `asset`, `payTo`,
|
|
20
|
+
and `amount`. The raw signed artifact is stored verbatim at
|
|
21
|
+
`proofs.x402.offer`, so downstream auditors retain the full scheme-level
|
|
22
|
+
payload for review.
|
|
23
|
+
|
|
24
|
+
The adapter **does not enforce scheme-specific invariants**. In particular,
|
|
25
|
+
for `upto` it does not enforce:
|
|
26
|
+
|
|
27
|
+
- Single-use authorization
|
|
28
|
+
- Time bounds (`validAfter` / `validBefore`)
|
|
29
|
+
- Recipient binding to a specific payee
|
|
30
|
+
- Facilitator binding
|
|
31
|
+
- Max-amount enforcement on-chain
|
|
32
|
+
- Phase-dependent amount semantics (verify returns authorized maximum; settle
|
|
33
|
+
returns actual charged amount)
|
|
34
|
+
|
|
35
|
+
Those invariants are the x402 scheme layer's responsibility and are enforced
|
|
36
|
+
on-chain or by the facilitator, not by PEAC. PEAC captures and surfaces the
|
|
37
|
+
scheme identifier so downstream auditors can reason about phase semantics at
|
|
38
|
+
review time.
|
|
39
|
+
|
|
40
|
+
For current upstream truth and the PEAC-tested compatibility matrix, see
|
|
41
|
+
[`docs/compatibility/x402-scheme-coverage.md`](../../../docs/compatibility/x402-scheme-coverage.md)
|
|
42
|
+
and [`docs/specs/X402-PROFILE.md § 3.0`](../../../docs/specs/X402-PROFILE.md).
|
|
14
43
|
|
|
15
44
|
## How Do I Use It?
|
|
16
45
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peac/adapter-x402",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.10",
|
|
4
4
|
"description": "x402 offer/receipt verification, term-matching, and PEAC record mapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@peac/
|
|
23
|
-
"@peac/
|
|
24
|
-
"@peac/
|
|
25
|
-
"@peac/
|
|
22
|
+
"@peac/crypto": "0.12.10",
|
|
23
|
+
"@peac/schema": "0.12.10",
|
|
24
|
+
"@peac/kernel": "0.12.10",
|
|
25
|
+
"@peac/adapter-core": "0.12.10"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.19.11",
|