@piprail/sdk 2.10.0 → 2.11.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/CHANGELOG.md +21 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ All notable changes to `@piprail/sdk` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
|
|
5
5
|
versions follow [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [2.11.0] — 2026-06-21 — A2A interop hardening: spec-correct merchant status + verified x402-V2 conformance
|
|
8
|
+
|
|
9
|
+
A2A transport correctness, after a **live cross-check against Google's official `x402` / `x402_a2a`
|
|
10
|
+
libraries** (reproducible harness + verdict in `examples/a2a-interop/`). One behavior fix on the A2A rejection path;
|
|
11
|
+
HTTP and every other rail are byte-identical to 2.10.0.
|
|
12
|
+
|
|
13
|
+
- **fix(a2a): a rejected proof now re-challenges as `payment-required`, not the client-only
|
|
14
|
+
`payment-rejected`.** Per the A2A x402 spec §5.1 and Google's reference merchant executor, a MERCHANT
|
|
15
|
+
emits only `payment-required` / `payment-completed` / `payment-failed`; `payment-rejected` and
|
|
16
|
+
`payment-submitted` are CLIENT→merchant statuses. A rejection is now signalled by the appended failure
|
|
17
|
+
receipt + the `x402.payment.error` code — the retry loop and the `input-required` state are unchanged.
|
|
18
|
+
- **interop: PipRail's A2A envelopes are byte-conformant with the current x402 V2 standard.** The
|
|
19
|
+
canonical `x402` lib parses our `PaymentRequired` + `PaymentPayload` (CAIP-2 networks, `amount`,
|
|
20
|
+
`x402Version: 2`, nested `accepted`); the five `x402.payment.*` keys + the extension URI match
|
|
21
|
+
`x402_a2a` verbatim. The deferred emit-version question is resolved — **v2** (the live standard; the
|
|
22
|
+
legacy v0.1 `x402-a2a` package is bitrotted and not targeted). New always-on guard:
|
|
23
|
+
`test/transports/a2a-wire-conformance.test.ts`; reproducible cross-check harness: `examples/a2a-interop/`.
|
|
24
|
+
- **docs(a2a):** the A2A guide is now fully runnable — a real `@a2a-js/sdk` `AgentExecutor` mount, a
|
|
25
|
+
complete AgentCard, where the buyer's payload comes from, and the co-resident one-gate pattern.
|
|
26
|
+
- No public API change. A2A remains seller-side (the `A2APayer` buyer + AP2 mandate carriage stay deferred).
|
|
27
|
+
|
|
7
28
|
## [2.10.0] — 2026-06-20 — x402 parity: verifiable receipts · the `upto` metered rail · A2A transport
|
|
8
29
|
|
|
9
30
|
Four ratified-x402 capabilities, all **additive and opt-in** — omit the new options and the 402, the
|
package/dist/index.cjs
CHANGED
|
@@ -7586,7 +7586,7 @@ function createA2APaymentHandler(options) {
|
|
|
7586
7586
|
const network = _nullishCoalesce(attempted, () => ( singleNetworkOf(result.challenge)));
|
|
7587
7587
|
const receipts = appendReceiptFailed(taskId, result.error, result.detail, network);
|
|
7588
7588
|
const metadata = {
|
|
7589
|
-
[A2A_STATUS_KEY]: "payment-
|
|
7589
|
+
[A2A_STATUS_KEY]: "payment-required",
|
|
7590
7590
|
[A2A_ERROR_KEY]: toA2AErrorCode(result.error),
|
|
7591
7591
|
[A2A_REQUIRED_KEY]: result.challenge,
|
|
7592
7592
|
...toA2APaymentReceipts(receipts)
|
package/dist/index.d.cts
CHANGED
|
@@ -7964,15 +7964,21 @@ interface A2ATaskRecord {
|
|
|
7964
7964
|
* • B7 — `receipts[]` is the UNION `(X402Receipt | SettleOutcome)[]` (it carries FAILED
|
|
7965
7965
|
* attempts); a fulfill-throws-AFTER-settle ends the Task `completed` with the successful
|
|
7966
7966
|
* receipt + an error annotation (NEVER re-challenge / failed — the money already moved).
|
|
7967
|
-
* • Emit
|
|
7968
|
-
*
|
|
7967
|
+
* • Emit `x402Version: 2` — RESOLVED 2026-06-21: v2 IS the live x402 standard. A live cross-check
|
|
7968
|
+
* against Google's official libs (reproducible harness in `examples/a2a-interop/`) showed the canonical
|
|
7969
|
+
* `x402` lib (2.13.1, V2: `amount` / CAIP-2 / nested `accepted`) parses our PaymentRequired +
|
|
7970
|
+
* PaymentPayload byte-identically, while the legacy v0.1 `x402_a2a` package (x402Version 1,
|
|
7971
|
+
* `maxAmountRequired`, chain slugs) is bitrotted. Inbound v1 object-cores are absorbed for the
|
|
7972
|
+
* standard `exact` scheme; PipRail-native `onchain-proof` is always v2 (never sent v1-flat).
|
|
7973
|
+
* • Merchant statuses are spec-bounded: `payment-required` (incl. a retryable re-challenge of a
|
|
7974
|
+
* rejected proof) / `payment-completed` / `payment-failed`. `payment-rejected` + `payment-submitted`
|
|
7975
|
+
* are CLIENT→merchant statuses we never emit.
|
|
7969
7976
|
*
|
|
7970
7977
|
* ── DEFERRED (NOT built here — see the x402-parity/03-a2a-transport plan) ──────
|
|
7971
|
-
* • Phase 4 — the A2A BUYER (`A2APayer`):
|
|
7972
|
-
* • Phase 5 — AP2 `CartMandate`/`PaymentMandate` carriage (
|
|
7973
|
-
*
|
|
7974
|
-
*
|
|
7975
|
-
* emit-version decision (a live-runtime gate, not buildable offline).
|
|
7978
|
+
* • Phase 4 — the A2A BUYER (`A2APayer`): the HTTP buyer mints the payload that rides A2A today.
|
|
7979
|
+
* • Phase 5 — AP2 `CartMandate`/`PaymentMandate` carriage (the Embedded Flow; no mandate-trust machinery).
|
|
7980
|
+
* • B8 ship-gate — RESOLVED at the wire level (above). A live `adk-demo` AGENT run is blocked by that
|
|
7981
|
+
* package's dependency bitrot (won't import on current `x402`/`a2a-sdk`), not by PipRail.
|
|
7976
7982
|
*/
|
|
7977
7983
|
|
|
7978
7984
|
/** The x402 A2A extension URI the x402-foundation doc + ALL Google reference code cite
|
package/dist/index.d.ts
CHANGED
|
@@ -7964,15 +7964,21 @@ interface A2ATaskRecord {
|
|
|
7964
7964
|
* • B7 — `receipts[]` is the UNION `(X402Receipt | SettleOutcome)[]` (it carries FAILED
|
|
7965
7965
|
* attempts); a fulfill-throws-AFTER-settle ends the Task `completed` with the successful
|
|
7966
7966
|
* receipt + an error annotation (NEVER re-challenge / failed — the money already moved).
|
|
7967
|
-
* • Emit
|
|
7968
|
-
*
|
|
7967
|
+
* • Emit `x402Version: 2` — RESOLVED 2026-06-21: v2 IS the live x402 standard. A live cross-check
|
|
7968
|
+
* against Google's official libs (reproducible harness in `examples/a2a-interop/`) showed the canonical
|
|
7969
|
+
* `x402` lib (2.13.1, V2: `amount` / CAIP-2 / nested `accepted`) parses our PaymentRequired +
|
|
7970
|
+
* PaymentPayload byte-identically, while the legacy v0.1 `x402_a2a` package (x402Version 1,
|
|
7971
|
+
* `maxAmountRequired`, chain slugs) is bitrotted. Inbound v1 object-cores are absorbed for the
|
|
7972
|
+
* standard `exact` scheme; PipRail-native `onchain-proof` is always v2 (never sent v1-flat).
|
|
7973
|
+
* • Merchant statuses are spec-bounded: `payment-required` (incl. a retryable re-challenge of a
|
|
7974
|
+
* rejected proof) / `payment-completed` / `payment-failed`. `payment-rejected` + `payment-submitted`
|
|
7975
|
+
* are CLIENT→merchant statuses we never emit.
|
|
7969
7976
|
*
|
|
7970
7977
|
* ── DEFERRED (NOT built here — see the x402-parity/03-a2a-transport plan) ──────
|
|
7971
|
-
* • Phase 4 — the A2A BUYER (`A2APayer`):
|
|
7972
|
-
* • Phase 5 — AP2 `CartMandate`/`PaymentMandate` carriage (
|
|
7973
|
-
*
|
|
7974
|
-
*
|
|
7975
|
-
* emit-version decision (a live-runtime gate, not buildable offline).
|
|
7978
|
+
* • Phase 4 — the A2A BUYER (`A2APayer`): the HTTP buyer mints the payload that rides A2A today.
|
|
7979
|
+
* • Phase 5 — AP2 `CartMandate`/`PaymentMandate` carriage (the Embedded Flow; no mandate-trust machinery).
|
|
7980
|
+
* • B8 ship-gate — RESOLVED at the wire level (above). A live `adk-demo` AGENT run is blocked by that
|
|
7981
|
+
* package's dependency bitrot (won't import on current `x402`/`a2a-sdk`), not by PipRail.
|
|
7976
7982
|
*/
|
|
7977
7983
|
|
|
7978
7984
|
/** The x402 A2A extension URI the x402-foundation doc + ALL Google reference code cite
|
package/dist/index.js
CHANGED
|
@@ -7586,7 +7586,7 @@ function createA2APaymentHandler(options) {
|
|
|
7586
7586
|
const network = attempted ?? singleNetworkOf(result.challenge);
|
|
7587
7587
|
const receipts = appendReceiptFailed(taskId, result.error, result.detail, network);
|
|
7588
7588
|
const metadata = {
|
|
7589
|
-
[A2A_STATUS_KEY]: "payment-
|
|
7589
|
+
[A2A_STATUS_KEY]: "payment-required",
|
|
7590
7590
|
[A2A_ERROR_KEY]: toA2AErrorCode(result.error),
|
|
7591
7591
|
[A2A_REQUIRED_KEY]: result.challenge,
|
|
7592
7592
|
...toA2APaymentReceipts(receipts)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piprail/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Accept x402 crypto payments across 29 chains — every major EVM chain plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar & XRPL — in a couple of lines. No backend, no database, no fee; payments settle straight to your wallet.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|