@piprail/sdk 2.13.0 → 2.14.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 (30) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/{algorand-AA3WXKW4.js → algorand-6J3IABVF.js} +12 -11
  3. package/dist/{algorand-FCEECDG6.cjs → algorand-QU6G2DQZ.cjs} +43 -42
  4. package/dist/{aptos-LY67Q6QF.js → aptos-DHOMTBLZ.js} +11 -10
  5. package/dist/{aptos-GHJPO6JJ.cjs → aptos-LFTQGBBK.cjs} +41 -40
  6. package/dist/{chunk-MWBT7MCE.cjs → chunk-GYM46G5L.cjs} +22 -4
  7. package/dist/{chunk-SC2ZYDHD.js → chunk-PAMKCWVW.js} +22 -4
  8. package/dist/index.cjs +505 -234
  9. package/dist/index.d.cts +281 -12
  10. package/dist/index.d.ts +281 -12
  11. package/dist/index.js +302 -31
  12. package/dist/{ledger-mF_SoiDB.d.ts → ledger-uFtXlIHY.d.cts} +31 -1
  13. package/dist/{ledger-mF_SoiDB.d.cts → ledger-uFtXlIHY.d.ts} +31 -1
  14. package/dist/{near-FZBUICCS.js → near-5PXTVQ47.js} +14 -5
  15. package/dist/{near-6KAQVVG2.cjs → near-YNNK7RW7.cjs} +39 -30
  16. package/dist/node.d.cts +2 -2
  17. package/dist/node.d.ts +2 -2
  18. package/dist/{solana-ELUWO6N5.js → solana-HITVI3HF.js} +22 -7
  19. package/dist/{solana-MYF4HBO4.cjs → solana-N3UCNCYE.cjs} +54 -39
  20. package/dist/{stellar-ASP2THL2.js → stellar-2QT6YYKN.js} +4 -4
  21. package/dist/{stellar-CRWBSX4E.cjs → stellar-Y3SQN7S5.cjs} +23 -23
  22. package/dist/{sui-Y4RLKKE2.cjs → sui-4AL4E6XU.cjs} +35 -27
  23. package/dist/{sui-FZIKZNVI.js → sui-FV5L6WF5.js} +20 -12
  24. package/dist/{ton-7GKCTC5H.js → ton-5FWDQ4QR.js} +18 -7
  25. package/dist/{ton-AOR3EURW.cjs → ton-5HDVOTMR.cjs} +33 -22
  26. package/dist/{tron-BMCWN5SS.js → tron-AZDY7BMQ.js} +10 -10
  27. package/dist/{tron-OMXB6EW2.cjs → tron-TX2B4N2A.cjs} +39 -39
  28. package/dist/{xrpl-Y6SQNYLC.cjs → xrpl-5TYDLQFS.cjs} +31 -31
  29. package/dist/{xrpl-DD7TJL5L.js → xrpl-UJL5J7CY.js} +13 -13
  30. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Caip2, X as X402AcceptEntry, x as X402AnyAccept, z as X402ExactAcceptEntry, d as ExactPaymentPayloadAny, p as SignedReceipt, w as VerifyResult, G as X402UptoAcceptEntry, n as Permit2UptoPaymentPayload, v as SpendSummary, y as X402Challenge, D as X402Receipt, S as SettleOutcome, u as SpendStore, s as SpendLedger, t as SpendRecord, o as PipRailReceipt, V as VerifyErrorCode, a as AssetId, A as AddressId, P as PaidReceipt } from './ledger-mF_SoiDB.js';
2
- export { E as EXT_OFFER_RECEIPT, b as ExactAuthorizationWire, c as ExactPaymentPayload, H as HEADER_REQUIRED, e as HEADER_RESPONSE, f as HEADER_RESPONSE_V1, g as HEADER_SIGNATURE, h as HEADER_SIGNATURE_V1, i as ParsedExactPayment, j as ParsedUptoPayment, k as Permit2Authorization, l as Permit2PaymentPayload, m as Permit2UptoAuthorization, q as SpendAssetTotal, r as SpendDenomTotal, B as X402PaymentSignature, F as X402ResourceObject, I as buildChallengeHeader, J as buildExactSignatureHeader, K as buildReceiptExtension, L as buildReceiptHeader, M as buildSignatureHeader, N as buildUptoSignatureHeader, O as decodeBase64Json, Q as memorySpendStore, R as parseChallenge, T as parseExactObject, U as parseExactPaymentHeader, W as parseReceipt, Y as parseReceiptExtension, Z as parseSettleResponse, _ as parseSignatureHeader, $ as parseSignatureObject, a0 as parseUptoObject, a1 as parseUptoPaymentHeader, a2 as pickAccept } from './ledger-mF_SoiDB.js';
1
+ import { C as Caip2, X as X402AcceptEntry, y as X402AnyAccept, B as X402ExactAcceptEntry, e as ExactPaymentPayloadAny, q as SignedReceipt, x as VerifyResult, I as X402UptoAcceptEntry, o as Permit2UptoPaymentPayload, w as SpendSummary, z as X402Challenge, F as X402Receipt, S as SettleOutcome, v as SpendStore, t as SpendLedger, u as SpendRecord, p as PipRailReceipt, V as VerifyErrorCode, a as AssetId, A as AddressId, P as PaidReceipt } from './ledger-uFtXlIHY.js';
2
+ export { E as EXT_OFFER_RECEIPT, b as EXT_PAYMENT_IDENTIFIER, c as ExactAuthorizationWire, d as ExactPaymentPayload, H as HEADER_REQUIRED, f as HEADER_RESPONSE, g as HEADER_RESPONSE_V1, h as HEADER_SIGNATURE, i as HEADER_SIGNATURE_V1, j as ParsedExactPayment, k as ParsedUptoPayment, l as Permit2Authorization, m as Permit2PaymentPayload, n as Permit2UptoAuthorization, r as SpendAssetTotal, s as SpendDenomTotal, D as X402PaymentSignature, G as X402ResourceObject, J as buildChallengeHeader, K as buildExactSignatureHeader, L as buildPaymentIdentifierAdvertisement, M as buildReceiptExtension, N as buildReceiptHeader, O as buildSignatureHeader, Q as buildUptoSignatureHeader, R as decodeBase64Json, T as memorySpendStore, U as parseChallenge, W as parseExactObject, Y as parseExactPaymentHeader, Z as parseReceipt, _ as parseReceiptExtension, $ as parseSettleResponse, a0 as parseSignatureHeader, a1 as parseSignatureObject, a2 as parseUptoObject, a3 as parseUptoPaymentHeader, a4 as pickAccept, a5 as readPaymentIdentifier } from './ledger-uFtXlIHY.js';
3
3
  import * as viem_zksync from 'viem/zksync';
4
4
  import * as abitype from 'abitype';
5
5
  import * as viem_chains from 'viem/chains';
@@ -4622,10 +4622,12 @@ declare class MaxRetriesExceededError extends PipRailError {
4622
4622
  /**
4623
4623
  * The proof ref — recover with it, don't re-pay. Its meaning depends on the
4624
4624
  * scheme: for `onchain-proof` it's the already-broadcast transaction ref
4625
- * (re-verify or re-submit it). For a standard `exact` rail it's the EIP-3009
4626
- * authorization NONCE (a `0x…` 32-byte value, NOT a tx hash) — re-PRESENT the
4627
- * same signed authorization, never re-sign a fresh nonce; check the token's
4628
- * `authorizationState(from, nonce)` before assuming it didn't settle.
4625
+ * (re-verify or re-submit it). For a standard `exact` rail it's the authorization's
4626
+ * single-use marker (NOT a tx hash) — re-PRESENT the same signed authorization, never
4627
+ * re-sign a fresh nonce, and verify it on-chain before assuming it didn't settle. On
4628
+ * EVM that marker is the EIP-3009 NONCE (a `0x…` value), checked via the token's
4629
+ * `authorizationState(from, nonce)`; the non-EVM `exact` rails key off their own marker
4630
+ * (Solana tx signature, Algorand group id, Aptos account sequence number, NEAR access-key nonce).
4629
4631
  */
4630
4632
  readonly ref?: string;
4631
4633
  constructor(message: string, options?: ErrorOptions & {
@@ -4990,8 +4992,8 @@ interface PolicyContext {
4990
4992
  declare function evaluatePolicy(intent: PaymentIntent, policy: PaymentPolicy | undefined, spentForAssetBase: bigint, ctx?: PolicyContext): PolicyDecision;
4991
4993
 
4992
4994
  /** The payment schemes a client can settle: PipRail's native `onchain-proof` (the
4993
- * default), the standard x402 `exact` rail (EVM EIP-3009/Permit2 + Solana SVM + Algorand,
4994
- * opt-in), and the standard x402 `upto` (metered) rail (EVM-Permit2, opt-in). */
4995
+ * default), the standard x402 `exact` rail (EVM EIP-3009/Permit2 + Solana SVM + Algorand
4996
+ * + Aptos + NEAR, opt-in), and the standard x402 `upto` (metered) rail (EVM-Permit2, opt-in). */
4995
4997
  type PaymentScheme = 'onchain-proof' | 'exact' | 'upto';
4996
4998
 
4997
4999
  /** Observability events. `ref` is the proof — a chain-specific id (EVM tx hash, Solana signature, TON locator, Stellar tx hash). */
@@ -5780,7 +5782,8 @@ declare class PipRailClient {
5780
5782
  * before publishing, so retry with a brief backoff if a fresh listing is missing.
5781
5783
  * - Results are cross-scheme (mostly the mainstream `exact` scheme); `fetch()` pays
5782
5784
  * `onchain-proof` rails by default, and standard `exact` rails too once you opt in
5783
- * with `schemes: ['onchain-proof', 'exact']` (EVM EIP-3009/Permit2 + Solana SVM + Algorand).
5785
+ * with `schemes: ['onchain-proof', 'exact']` (EVM EIP-3009/Permit2 + Solana SVM + Algorand
5786
+ * + Aptos + NEAR).
5784
5787
  */
5785
5788
  discover(opts?: DiscoverOptions): Promise<DiscoveredResource[]>;
5786
5789
  /**
@@ -6275,7 +6278,7 @@ declare function describeChallenge(challenge: X402Challenge): string;
6275
6278
  * literally, so a wrong name or order actively misleads. A test pins the load-
6276
6279
  * bearing phrases.
6277
6280
  */
6278
- declare const PIPRAIL_AGENT_GUIDE = "# Paying with PipRail \u2014 the agent contract\n\nYou can pay for x402 \"402 Payment Required\" resources autonomously. Money moves\nstraight from your wallet to the server; PipRail custodies nothing. Follow this.\n\n## Landing cold \u2014 read the self-description\nEvery PipRail 402 self-describes. Read challenge.extensions.piprail for { name, what, pay[]\n(each rail's how-to-pay), sdk.install, mcp, docs } \u2014 never guess what an endpoint is. If your\ntooling can't pay a rail (e.g. a stock x402 client can't pay the onchain-proof scheme), the\nblock says how: install @piprail/sdk (npm i @piprail/sdk) or run the MCP (npx -y @piprail/mcp)\nand pay with the tools below.\n\n## The loop: quote \u2192 plan \u2192 pay\n1. piprail_quote_payment(url) \u2014 PRICE it. Returns the amount, token, chain, and\n whether it is within your spend policy. No funds move. Use it to decide if a\n resource is worth buying.\n2. piprail_plan_payment(url) \u2014 can I afford it NOW? Reads your balance, native gas,\n and recipient-readiness across every rail, and returns { payable, best,\n fundingHint, session? }. If payable is false, do NOT attempt the payment \u2014\n fundingHint says exactly what to fix.\n3. piprail_pay_request(url, method?, body?) \u2014 PAY (only if the plan was payable)\n and return the result.\nAlways plan before you pay so you never commit to a payment you cannot finish.\n\n## Gasless \u2014 the exact rail (zero gas for you)\nA 402 may offer up to three rails; you don't choose per payment \u2014 the client does, automatically:\n- onchain-proof (PipRail's default): you broadcast the payment yourself and pay the network gas\n (the native coin \u2014 ETH/SOL/\u2026). Works on every chain.\n- exact (the ratified x402 rail, opt-in): you only SIGN; the server \u2014 or a facilitator it chose\n (e.g. PayAI) \u2014 broadcasts it, so you pay ZERO gas (you need only the token, no native coin). It\n works on EVM, Solana + Algorand, and the on-chain method (EIP-3009 / Permit2 / SVM / Algorand\n fee-pooled group) is picked automatically.\n- upto (the metered/variable x402 rail, opt-in, EVM): the amount you see is a MAXIMUM \u2014 you sign\n a ceiling, the server meters real usage and settles the ACTUAL (<= the max). BUDGET AGAINST THE MAX:\n the plan/policy treat the ceiling as the spend (a server may charge up to it), so a payable plan\n means the MAX fits your budget; the settled actual is recorded for reconciliation.\nWhen the exact scheme is enabled AND balance-aware routing is on, paying picks the cheapest\nsettleable rail \u2014 i.e. the gasless exact one. Nothing changes in your loop: quote \u2192 plan \u2192 pay is\nidentical. The exact/upto schemes are OPT-IN by the operator (MCP: PIPRAIL_SCHEMES=onchain-proof,exact,upto);\nyou can't enable them yourself, but you can report when a 402 needs one (see UNSUPPORTED_SCHEME below).\n\n## Reading a refusal \u2014 never crash, never double-spend\nA failed pay returns a STRUCTURED object, never a thrown error you must catch:\n { ok:false, code, reason, explain, ref?, reasonCode?, declined? }\nBranch on `code` (always reliable). Key cases:\n- declined:true with reasonCode:'SESSION_EXPIRED' \u2014 your time budget is over. This\n is TERMINAL: STOP. Do not retry ANY payment this process; it cannot be undone\n without a restart / a longer TTL.\n- declined:true with reasonCode:'APPROVAL' \u2014 a human (or hook) declined this\n payment. Terminal for this pay: do NOT auto-retry \u2014 they said no, or no one\n answered.\n- declined:true with reasonCode:'OUTSIDE_WINDOW' \u2014 your rolling rate-limit is\n exhausted. Wait for it to free, then retry; do not raise the amount.\n- declined:true with reasonCode:'POLICY' or 'BUDGET' \u2014 a spend cap or allowlist\n refused it. Don't retry the same payment; pick a cheaper/allowed one.\n- code:'INSUFFICIENT_FUNDS' \u2014 top up the wallet (token and/or native gas), retry.\n- code:'PAYMENT_TIMEOUT' / 'MAX_RETRIES_EXCEEDED' / 'CONFIRMATION_TIMEOUT' \u2014 the\n payment may ALREADY be on-chain. Recover using the proof on `.ref` (re-verify\n or re-submit it); never re-pay \u2014 a fresh payment would double-spend. On a gasless\n exact rail `.ref` is the authorization NONCE, not a tx hash: re-present the SAME\n signed authorization, never sign a fresh one (that would risk a double-spend).\n- code:'NO_COMPATIBLE_ACCEPT' / 'UNSUPPORTED_SCHEME' \u2014 the 402 isn't payable on\n your chain/scheme; `explain` says whether it's the wrong chain or a scheme to enable.\n If it's a standard x402 server offering an exact rail, that's a config fix the operator makes\n once (enable the exact scheme); report it, don't retry the same call blindly.\n\n## Knowing your leash \u2014 call piprail_budget\npiprail_budget tells you how much budget and time you have left: per (network,\nasset) remaining, the cross-token GRAND TOTAL per denomination (e.g. how much\nUSD you can still spend across every stablecoin and chain), the payment-count\nleash, the session time envelope, your spend so far, and the configured policy\nread back. Read-only; moves no funds. Use it in Mode A to self-check before paying.\n\n## Two modes\n- Mode A (headless, default): you run FREE inside a pre-set budget + time\n envelope. The policy IS the consent \u2014 there is no per-payment prompt. Stay\n inside it; piprail_budget shows what's left.\n- Mode B (supervised): the host may ask a human to approve each payment. A\n decline/cancel/timeout comes back as declined:true (reasonCode:'APPROVAL') \u2014\n do NOT retry it as if it were a transient error.\n\n## Hard facts\n- Per-payment + per-(network, asset) caps always apply. A cross-token GRAND TOTAL per\n denomination (maxTotalPerDenom, e.g. \"$20 across every USD stablecoin + chain\") is\n OPTIONAL \u2014 it sums tokens declared as one unit, each 1:1; it is NOT a price oracle and\n never prices a volatile native coin. Payment-COUNT caps (maxPayments / per-window) also\n span every chain + token.\n- The time envelope lives IN-MEMORY for THIS process (resets on restart). The money + count\n totals also reset on restart UNLESS a durable spend store is configured \u2014 then they resume.\n- A refusal arrives as declined:true with a reasonCode; 'BUDGET' covers the lifetime, denom,\n and count caps; 'OUTSIDE_WINDOW' covers both the rolling money and rolling count windows.\n";
6281
+ declare const PIPRAIL_AGENT_GUIDE = "# Paying with PipRail \u2014 the agent contract\n\nYou can pay for x402 \"402 Payment Required\" resources autonomously. Money moves\nstraight from your wallet to the server; PipRail custodies nothing. Follow this.\n\n## Landing cold \u2014 read the self-description\nEvery PipRail 402 self-describes. Read challenge.extensions.piprail for { name, what, pay[]\n(each rail's how-to-pay), sdk.install, mcp, docs } \u2014 never guess what an endpoint is. If your\ntooling can't pay a rail (e.g. a stock x402 client can't pay the onchain-proof scheme), the\nblock says how: install @piprail/sdk (npm i @piprail/sdk) or run the MCP (npx -y @piprail/mcp)\nand pay with the tools below.\n\n## The loop: quote \u2192 plan \u2192 pay\n1. piprail_quote_payment(url) \u2014 PRICE it. Returns the amount, token, chain, and\n whether it is within your spend policy. No funds move. Use it to decide if a\n resource is worth buying.\n2. piprail_plan_payment(url) \u2014 can I afford it NOW? Reads your balance, native gas,\n and recipient-readiness across every rail, and returns { payable, best,\n fundingHint, session? }. If payable is false, do NOT attempt the payment \u2014\n fundingHint says exactly what to fix.\n3. piprail_pay_request(url, method?, body?) \u2014 PAY (only if the plan was payable)\n and return the result.\nAlways plan before you pay so you never commit to a payment you cannot finish.\n\n## Gasless \u2014 the exact rail (zero gas for you)\nA 402 may offer up to three rails; you don't choose per payment \u2014 the client does, automatically:\n- onchain-proof (PipRail's default): you broadcast the payment yourself and pay the network gas\n (the native coin \u2014 ETH/SOL/\u2026). Works on every chain.\n- exact (the ratified x402 rail, opt-in): you only SIGN; the server \u2014 or a facilitator it chose\n (e.g. PayAI) \u2014 broadcasts it, so you pay ZERO gas (you need only the token, no native coin). It\n works on EVM, Solana, Algorand, Aptos + NEAR, and the on-chain method (EIP-3009 / Permit2 / SVM /\n Algorand fee-pooled group / Aptos fee-payer / NEAR SignedDelegateAction) is picked automatically.\n- upto (the metered/variable x402 rail, opt-in, EVM): the amount you see is a MAXIMUM \u2014 you sign\n a ceiling, the server meters real usage and settles the ACTUAL (<= the max). BUDGET AGAINST THE MAX:\n the plan/policy treat the ceiling as the spend (a server may charge up to it), so a payable plan\n means the MAX fits your budget; the settled actual is recorded for reconciliation.\nWhen the exact scheme is enabled AND balance-aware routing is on, paying picks the cheapest\nsettleable rail \u2014 i.e. the gasless exact one. Nothing changes in your loop: quote \u2192 plan \u2192 pay is\nidentical. The exact/upto schemes are OPT-IN by the operator (MCP: PIPRAIL_SCHEMES=onchain-proof,exact,upto);\nyou can't enable them yourself, but you can report when a 402 needs one (see UNSUPPORTED_SCHEME below).\n\n## Reading a refusal \u2014 never crash, never double-spend\nA failed pay returns a STRUCTURED object, never a thrown error you must catch:\n { ok:false, code, reason, explain, ref?, reasonCode?, declined? }\nBranch on `code` (always reliable). Key cases:\n- declined:true with reasonCode:'SESSION_EXPIRED' \u2014 your time budget is over. This\n is TERMINAL: STOP. Do not retry ANY payment this process; it cannot be undone\n without a restart / a longer TTL.\n- declined:true with reasonCode:'APPROVAL' \u2014 a human (or hook) declined this\n payment. Terminal for this pay: do NOT auto-retry \u2014 they said no, or no one\n answered.\n- declined:true with reasonCode:'OUTSIDE_WINDOW' \u2014 your rolling rate-limit is\n exhausted. Wait for it to free, then retry; do not raise the amount.\n- declined:true with reasonCode:'POLICY' or 'BUDGET' \u2014 a spend cap or allowlist\n refused it. Don't retry the same payment; pick a cheaper/allowed one.\n- code:'INSUFFICIENT_FUNDS' \u2014 top up the wallet (token and/or native gas), retry.\n- code:'PAYMENT_TIMEOUT' / 'MAX_RETRIES_EXCEEDED' / 'CONFIRMATION_TIMEOUT' \u2014 the\n payment may ALREADY be on-chain. Recover using the proof on `.ref` (re-verify\n or re-submit it); never re-pay \u2014 a fresh payment would double-spend. On a gasless\n exact rail `.ref` is the authorization NONCE, not a tx hash: re-present the SAME\n signed authorization, never sign a fresh one (that would risk a double-spend).\n- code:'NO_COMPATIBLE_ACCEPT' / 'UNSUPPORTED_SCHEME' \u2014 the 402 isn't payable on\n your chain/scheme; `explain` says whether it's the wrong chain or a scheme to enable.\n If it's a standard x402 server offering an exact rail, that's a config fix the operator makes\n once (enable the exact scheme); report it, don't retry the same call blindly.\n\n## Knowing your leash \u2014 call piprail_budget\npiprail_budget tells you how much budget and time you have left: per (network,\nasset) remaining, the cross-token GRAND TOTAL per denomination (e.g. how much\nUSD you can still spend across every stablecoin and chain), the payment-count\nleash, the session time envelope, your spend so far, and the configured policy\nread back. Read-only; moves no funds. Use it in Mode A to self-check before paying.\n\n## Two modes\n- Mode A (headless, default): you run FREE inside a pre-set budget + time\n envelope. The policy IS the consent \u2014 there is no per-payment prompt. Stay\n inside it; piprail_budget shows what's left.\n- Mode B (supervised): the host may ask a human to approve each payment. A\n decline/cancel/timeout comes back as declined:true (reasonCode:'APPROVAL') \u2014\n do NOT retry it as if it were a transient error.\n\n## Hard facts\n- Per-payment + per-(network, asset) caps always apply. A cross-token GRAND TOTAL per\n denomination (maxTotalPerDenom, e.g. \"$20 across every USD stablecoin + chain\") is\n OPTIONAL \u2014 it sums tokens declared as one unit, each 1:1; it is NOT a price oracle and\n never prices a volatile native coin. Payment-COUNT caps (maxPayments / per-window) also\n span every chain + token.\n- The time envelope lives IN-MEMORY for THIS process (resets on restart). The money + count\n totals also reset on restart UNLESS a durable spend store is configured \u2014 then they resume.\n- A refusal arrives as declined:true with a reasonCode; 'BUDGET' covers the lifetime, denom,\n and count caps; 'OUTSIDE_WINDOW' covers both the rolling money and rolling count windows.\n";
6279
6282
  /** Returns {@link PIPRAIL_AGENT_GUIDE} (a parity accessor for callers that prefer a function). */
6280
6283
  declare function agentGuide(): string;
6281
6284
 
@@ -6435,6 +6438,17 @@ interface SelfDescription {
6435
6438
  * `accepts[]`. PURE — every rail is derived from data the gate already has (no new
6436
6439
  * data, no I/O). `instruction` is the optional one-line human summary the gate computes
6437
6440
  * via `describeChallenge` (in `render.ts`) and passes in.
6441
+ *
6442
+ * INVARIANT — this block emits NO per-response DYNAMIC field (no nonce, timestamp, or
6443
+ * other per-call value). It is long-lived, static metadata: brand-string constants plus
6444
+ * values derived from the (static) resolved `accepts[]`. This matters for the x402
6445
+ * `dynamicInfoFields` mechanism (x402-foundation #2655): an official client that
6446
+ * echo-validates `extensions` does a SUBSET check — an UNDECLARED field that changes per
6447
+ * response would trip `extension_echo_mismatch` and false-reject the buyer. If you EVER
6448
+ * add a per-call value to this block, you MUST either (1) keep it out, or (2) declare it
6449
+ * in a `dynamicInfoFields` list the echo check honours. See
6450
+ * `.claude/plans/x402-maxout/05-additive-conformance.md` §4.3 — and the regression guard
6451
+ * in `test/selfdescribe.test.ts` that fails the day a dynamic field appears here.
6438
6452
  */
6439
6453
  declare function buildSelfDescription(input: {
6440
6454
  accepts: X402AnyAccept[];
@@ -6616,6 +6630,50 @@ interface WellKnownX402 {
6616
6630
  resources: string[];
6617
6631
  ownershipProofs?: string[];
6618
6632
  }
6633
+ /**
6634
+ * The official `/.well-known/x402.json` discovery manifest (x402-foundation PR #2646,
6635
+ * "Well known x402 discovery" — **DO NOT MERGE YET / for discussion**). A RICHER origin
6636
+ * file than the legacy {@link WellKnownX402}: per-item resource metadata + the resolved
6637
+ * `accepts` + a lifted input/output contract. PipRail emits this as a SECOND,
6638
+ * forward-compatible artifact — {@link buildWellKnownX402} (the x402scan legacy file) is
6639
+ * left untouched, so nothing is pinned to an unstable spec. The merchant hosts the result
6640
+ * at `<origin>/.well-known/x402.json`.
6641
+ */
6642
+ interface WellKnownX402Manifest {
6643
+ x402Version: 2;
6644
+ /** Unix timestamp (seconds) the manifest was generated. */
6645
+ lastUpdated: number;
6646
+ items: WellKnownX402Item[];
6647
+ }
6648
+ /** One resource in a {@link WellKnownX402Manifest}. The live 402 stays authoritative —
6649
+ * `accepts` here is advisory, nonce-free discovery metadata. */
6650
+ interface WellKnownX402Item {
6651
+ resource: {
6652
+ url: string;
6653
+ description?: string;
6654
+ mimeType?: string;
6655
+ serviceName?: string;
6656
+ tags?: string[];
6657
+ };
6658
+ /** The transport the resource is paid over. PipRail emits `'http'` today. */
6659
+ type: 'http' | 'mcp';
6660
+ /** The payment options the gate offers (its resolved rails, nonce-free). */
6661
+ accepts: PaymentRail[];
6662
+ /** How to call the resource (lifted from the route config). */
6663
+ input?: {
6664
+ method: string;
6665
+ routeTemplate?: string;
6666
+ pathParams?: Record<string, unknown>;
6667
+ queryParams?: Record<string, unknown>;
6668
+ };
6669
+ /** Output hint for a richer listing. */
6670
+ output?: {
6671
+ mimeType?: string;
6672
+ example?: unknown;
6673
+ };
6674
+ /** Capability hints (extension keys) the resource requires, when any. */
6675
+ requires?: string[];
6676
+ }
6619
6677
  /**
6620
6678
  * Describes a resource's INPUT for discovery. The open indexes that REQUIRE an
6621
6679
  * input schema (x402scan rejects a listing without one) read this from a
@@ -6682,6 +6740,18 @@ declare function buildOpenApi(input: ManifestInput): OpenApiDocument;
6682
6740
  * `/openapi.json` is the primary doc; this is a compatibility breadcrumb.
6683
6741
  */
6684
6742
  declare function buildWellKnownX402(input: ManifestInput): WellKnownX402;
6743
+ /**
6744
+ * Build the official `/.well-known/x402.json` manifest (x402-foundation PR #2646 shape) — a
6745
+ * SECOND, richer discovery file beside the legacy {@link buildWellKnownX402}. Forward-compatible
6746
+ * by design: it emits only the fields the proposal defines, tolerates the spec adding more, and
6747
+ * pins nothing (the PR is explicitly pre-merge), so when #2646 stabilises only this one emitter
6748
+ * (and the docs recommendation) move — no default ever changed. `lastUpdated` defaults to now
6749
+ * (Unix seconds); pass it explicitly for a deterministic file. PURE — no network, no chain
6750
+ * library, fully deterministic given its args. The merchant hosts the result; PipRail serves nothing.
6751
+ */
6752
+ declare function buildWellKnownX402Manifest(input: ManifestInput & {
6753
+ lastUpdated?: number;
6754
+ }): WellKnownX402Manifest;
6685
6755
  /**
6686
6756
  * Build the `_x402` DNS TXT record (experimental draft) that POINTS at a
6687
6757
  * discovery doc. `host` is the exact host the agent talks to (no inheritance);
@@ -6981,6 +7051,19 @@ interface RequirePaymentOptions {
6981
7051
  * byte-identical default of before this feature). See {@link buildSelfDescription}.
6982
7052
  */
6983
7053
  selfDescribe?: boolean;
7054
+ /**
7055
+ * Advertise + honor the standard x402 **`payment-identifier`** extension — an OPTIONAL
7056
+ * idempotency `id` (16–128 chars `[A-Za-z0-9_-]`) the client attaches to its payload at
7057
+ * `extensions['payment-identifier'].info.id`. When on, the gate advertises the extension on
7058
+ * every 402 and, on submission, **dedupes the id on its existing used-proof set** (namespaced
7059
+ * `pid:<id>`): a reused id bound to a different/already-settled payment is rejected
7060
+ * (`tx_already_used`), a malformed id is re-challenged (`signature_invalid`), and the id is
7061
+ * echoed back on the settled `PAYMENT-RESPONSE`. The id is ADDITIVE to — never a replacement
7062
+ * for — the proof-set replay protection (a payment with no id is protected exactly as today).
7063
+ * **Default off** (the challenge + verdict are byte-identical). Backendless: the dedupe rides
7064
+ * the same in-memory / pluggable `isUsed`/`markUsed` store as a tx ref — no new state.
7065
+ */
7066
+ paymentIdentifier?: boolean;
6984
7067
  /**
6985
7068
  * Emit a **verifiable receipt** on every settled payment — a self-contained
6986
7069
  * {@link PipRailReceipt} that the buyer keeps and **anyone** re-verifies against the
@@ -7306,7 +7389,11 @@ interface DeliverReceiptOptions {
7306
7389
  url: string;
7307
7390
  /**
7308
7391
  * Shared secret. When set, the raw JSON body is signed HMAC-SHA256 and sent as
7309
- * `<signatureHeader>: sha256=<hex>` so the receiver can verify authenticity.
7392
+ * `<signatureHeader>: sha256=<hex>` so the receiver can verify authenticity. Signing uses Web
7393
+ * Crypto (`crypto.subtle`) — always present on the supported runtimes (Node ≥ 20, modern
7394
+ * browsers). On a runtime that lacks it the body is sent **unsigned, with no signature header**,
7395
+ * so a receiver must treat a *missing* signature as unauthenticated (reject it), never silently
7396
+ * accept an unsigned body.
7310
7397
  */
7311
7398
  secret?: string;
7312
7399
  /** Extra retry attempts after the first send (default 5 → up to 6 POSTs total). */
@@ -8127,4 +8214,186 @@ interface A2APaymentHandler {
8127
8214
  */
8128
8215
  declare function createA2APaymentHandler(options: A2APaymentHandlerOptions): A2APaymentHandler;
8129
8216
 
8130
- export { type A2AArtifact, type A2AExtensionDeclaration, type A2AMessage, type A2AMetadata, type A2APart, type A2APaymentHandler, type A2APaymentHandlerOptions, type A2APaymentStatus, type A2ATask, type A2ATaskRecord, type A2ATaskState, type A2ATaskStore, A2A_ERROR_KEY, A2A_EXTENSIONS_HEADER, A2A_PAYLOAD_KEY, A2A_RECEIPTS_KEY, A2A_REQUIRED_KEY, A2A_STATUS_KEY, A2A_X402_EXTENSION_URI_V01, A2A_X402_EXTENSION_URI_V02, type AcceptOption, AddressId, type AgentTool, type AlgorandToken, type AptosToken, AssetId, BRAND, BUILTIN_DENOMS, type BazaarExtension, type BuildExactParams, CHAINS, Caip2, type ChainFamily, type ChainInput, type ChainName, type ChainPreset, type ChainSelector, type ChallengeTriage, type ChallengeVerdict, type ConfirmInfo, ConfirmationTimeoutError, type CostEstimate, type CountStatus, DENOM_PRECISION, DIRECTORY_INFO, type DeclineReasonCode, type DeliverAttempt, type DeliverReceiptOptions, type DeliverResult, type DenomRemaining, type DirectoryInfo, type DiscoverOptions, type DiscoveredRail, type DiscoveredResource, type DiscoveryDescriptor, type DiscoverySigner, type DiscoverySort, type DiscoverySource, type DomainClaim, type DomainVerification, EIP3009_TYPES, EXACT_NETWORK_SLUGS, type EvmToken, type ExactAccept, type ExactAuthorization, ExactPaymentPayloadAny, type ExactRailOption, type ExpressLikeMiddleware, type ExpressLikeNext, type ExpressLikeRequest, type ExpressLikeResponse, type FacilitatorConfig, type FacilitatorPaymentRequirements, type FacilitatorSupportedKind, type FailedPayment, GENERATOR, InsufficientFundsError, InvalidEnvelopeError, KNOWN_FACILITATORS, type KnownFacilitator, type ListingVisibility, type ManifestInput, MaxRetriesExceededError, MissingDriverError, MultiChainPayer, type MultiChainPayerOptions, type NearToken, NoCompatibleAcceptError, NonReplayableBodyError, type OpenApiDocument, type OpenApiOperation, PERMIT2_ADDRESS, PERMIT2_PROXY_CHAIN_IDS, PERMIT2_UPTO_WITNESS_TYPES, PERMIT2_WITNESS_TYPES, PIPRAIL_AGENT_GUIDE, POWERED_BY, PaidReceipt, type PayBlocker, type PayOption, type PayWarning, type PayingClient, PaymentDeclinedError, type PaymentDriver, type PaymentGate, type PaymentIntent, type PaymentPlan, type PaymentPolicy, type PaymentRail, type PaymentScheme, PaymentTimeoutError, Permit2UptoPaymentPayload, PipRailClient, type PipRailClientOptions, type PipRailCostQuote, PipRailError, type PipRailEvent, type PipRailQuote, PipRailReceipt, type PolicyDecision, type PolicyDenyCode, REGISTER_ATTRIBUTION, type ReceiptInput, type ReceiptOption, type ReceiptVerification, RecipientNotReadyError, type RecipientReason, type RegisterInput, type RegisterOptions, type RegisterOutcome, type RequirePaymentOptions, type ResolveOptions, type ResolvedChain, type ResolvedNetwork, type ResolvedToken, type ResourceDescription, type SearchOpenIndexesOptions, type SelfDescribeEndpoint, type SelfDescribeRail, type SelfDescription, type SessionBudget, SettleOutcome, type SettleViaFacilitatorInput, SettlementError, SignedReceipt, type SolanaToken, SpendLedger, SpendRecord, type SpendRemaining, SpendStore, SpendSummary, type StellarToken, type SuiToken, type TokenInfo, type TokenInput, type TonToken, type ToolAnnotations, type TronToken, UPTO_PROXY_CHAIN_IDS, UnknownTokenError, UnsupportedNetworkError, UnsupportedSchemeError, type UptoRailOption, VERIFY_CODE_TO_A2A_ERROR, VerifyErrorCode, type VerifyPaymentResult, VerifyResult, type WalletBalance, type WalletHandle, type WalletInput, WalletRequiredError, type WellKnownX402, WrongChainError, WrongFamilyError, X402AcceptEntry, X402AnyAccept, X402Challenge, type X402DnsRecord, X402ExactAcceptEntry, type X402InvalidBody, X402Receipt, X402UptoAcceptEntry, X402_EXACT_PERMIT2_PROXY, X402_UPTO_PERMIT2_PROXY, type XrplToken, agentGuide, appendAttribution, appendKeywords, buildBazaarExtension, buildEndpointInfo, buildExactAuthorization, buildOpenApi, buildSelfDescription, buildWellKnownX402, buildX402DnsTxt, chainIdForExactNetwork, claim402IndexDomain, classifyChallenge, createA2APaymentHandler, createPaymentGate, decorateOutcome, deliverReceipt, denomOf, describeChallenge, discoveryHeaders, eip3009Abi, encodeXPaymentHeader, evaluatePolicy, explainDecline, facilitatorCoverage, fetchAcross, firstKeylessFacilitator, formatSpendReport, fromA2APaymentPayload, fromA2APaymentRequired, getDirectoryInfo, isPermit2ProxyChain, isUptoProxyChain, knownFacilitatorsFor, normalizeNetwork, parseExactRequirements, parseFacilitatorSupported, paymentTools, planAcross, rankResources, readExactDomain, register402Index, registerDriver, registerX402Scan, renderLandingPage, requirePayment, resolveChain, scoreResource, searchOpenIndexes, settleViaFacilitator, summarizePlan, toA2AErrorCode, toA2APaymentFailed, toA2APaymentReceipts, toA2APaymentRequired, toInsufficientFundsError, toInvalidBody, verify402IndexDomain };
8217
+ /**
8218
+ * Minimal, DUCK-TYPED MCP message shapes — the structural surface the PipRail MCP transport
8219
+ * reads/writes, and NOTHING more. Like `a2a-types.ts`, these declare only the fields the adapter
8220
+ * touches, so any MCP runtime's objects (the `@modelcontextprotocol/sdk` low-level `Server`, a
8221
+ * hand-rolled tool handler) satisfy them structurally — **with ZERO `@modelcontextprotocol/sdk`
8222
+ * dependency** (the SDK transport stays chain- AND runtime-agnostic; the `@piprail/mcp` wiring may
8223
+ * use the real MCP types).
8224
+ *
8225
+ * x402-over-MCP carries PipRail's EXISTING `X402Challenge` / PaymentPayload / `SettleOutcome`
8226
+ * envelopes over MCP **tool calls**: a 402 challenge as an `isError` tool result (the
8227
+ * PaymentRequired in `structuredContent` AND a byte-equal `content[0].text`), the payment under
8228
+ * the call's `params._meta["x402/payment"]`, the settlement under the result's
8229
+ * `_meta["x402/payment-response"]`. Verified against the x402-foundation
8230
+ * `specs/transports-v2/mcp.md` binding.
8231
+ */
8232
+
8233
+ /** The `_meta` key strings — EXACTLY as the spec defines them (a SLASH, not a dot — distinct from
8234
+ * A2A's `x402.payment.*` dotted keys). Exported so the conformance test pins them. */
8235
+ declare const MCP_PAYMENT_META_KEY = "x402/payment";
8236
+ declare const MCP_PAYMENT_RESPONSE_META_KEY = "x402/payment-response";
8237
+ /** A single MCP content block (only the text block the binding uses). */
8238
+ interface McpContentBlock {
8239
+ type: 'text' | string;
8240
+ text?: string;
8241
+ [extra: string]: unknown;
8242
+ }
8243
+ /** An inbound tool-call's params — only the fields the seller reads. `_meta["x402/payment"]`
8244
+ * carries the raw PaymentPayload object (fed straight to `gate.verifyObject`). */
8245
+ interface McpToolCallParams {
8246
+ name?: string;
8247
+ arguments?: Record<string, unknown>;
8248
+ _meta?: {
8249
+ 'x402/payment'?: unknown;
8250
+ [extra: string]: unknown;
8251
+ };
8252
+ [extra: string]: unknown;
8253
+ }
8254
+ /** A tool result — the seller produces it; the buyer reads it. The 402 challenge is an `isError`
8255
+ * result with `structuredContent` + a byte-equal `content[0].text`; a settlement carries
8256
+ * `_meta["x402/payment-response"]`. */
8257
+ interface McpToolResult {
8258
+ content: McpContentBlock[];
8259
+ isError?: boolean;
8260
+ structuredContent?: Record<string, unknown>;
8261
+ _meta?: {
8262
+ 'x402/payment-response'?: SettleOutcome;
8263
+ [extra: string]: unknown;
8264
+ };
8265
+ [extra: string]: unknown;
8266
+ }
8267
+ /** The PaymentPayload value carried under `params._meta["x402/payment"]` (raw JSON, not base64) —
8268
+ * `{ x402Version, resource?, accepted, payload }`, where `accepted` is the chosen `accepts[]`
8269
+ * entry and `payload` is the scheme payload (both consumed by `gate.verifyObject`). */
8270
+ interface McpPaymentMeta {
8271
+ x402Version: number;
8272
+ resource?: {
8273
+ url: string;
8274
+ description?: string;
8275
+ mimeType?: string;
8276
+ };
8277
+ accepted: unknown;
8278
+ payload: unknown;
8279
+ }
8280
+
8281
+ /**
8282
+ * x402-over-MCP — the third official x402 transport (after HTTP and A2A), carrying PipRail's
8283
+ * EXISTING x402 envelopes over MCP **tool calls** instead of HTTP headers or A2A task metadata:
8284
+ *
8285
+ * - a 402 challenge is an `isError` tool result with the `X402Challenge` (the spec's
8286
+ * PaymentRequired) in `structuredContent` AND a byte-equal `content[0].text`;
8287
+ * - the payment rides in the call's `params._meta["x402/payment"]`;
8288
+ * - the settlement rides in the result's `_meta["x402/payment-response"]`.
8289
+ *
8290
+ * It is the conspicuous missing twin of the A2A transport. A thin re-keying of the SDK's verify
8291
+ * onto the MCP message shape — the SELLER calls the EXISTING `gate.verifyObject` (shared replay
8292
+ * set, re-derive-every-field-from-the-trusted-accept), so this transport writes NO crypto and
8293
+ * touches NO driver: every family rides it for free, exactly as over HTTP/A2A.
8294
+ *
8295
+ * PURE protocol layer (STANDARDS §1): imports only `server.ts`/`x402.ts`/`errors.ts` + the
8296
+ * duck-typed `./mcp-types.js` + the A2A error map — ZERO chain libs, ZERO `@modelcontextprotocol/sdk`.
8297
+ *
8298
+ * Scope: this ships the SELLER (`createMcpPaymentTool`) + the full pure codec + the buyer-side
8299
+ * READ/FRAME helpers (`fromMcpPaymentRequired` / `fromMcpPaymentResponse` / `buildMcpPaymentMeta`).
8300
+ * A buyer pays the challenge via the existing policy-gated client/gate machinery and frames the
8301
+ * result with `buildMcpPaymentMeta`; a fully-automatic `McpPayer` (driving the client pay path) is
8302
+ * a documented fast-follow, exactly as A2A shipped seller-first.
8303
+ */
8304
+
8305
+ /**
8306
+ * Build the 402 challenge tool result: `isError: true` + the `X402Challenge` in
8307
+ * `structuredContent` AND a **byte-equal** `content[0].text` (`text === JSON.stringify(challenge)`
8308
+ * — the spec requires the two to match; a divergence is a silent interop break, guarded by the
8309
+ * conformance test). PipRail's `X402Challenge` IS the spec's PaymentRequired object — no transform.
8310
+ */
8311
+ declare function toMcpPaymentRequired(challenge: X402Challenge): McpToolResult;
8312
+ /**
8313
+ * Build the settled tool result: the tool's REAL output in `content` + the settlement under
8314
+ * `_meta["x402/payment-response"]`, projected to EXACTLY the spec's 4 fields
8315
+ * `{ success, transaction, network, payer }` (the richer {@link X402Receipt} is never leaked verbatim).
8316
+ */
8317
+ declare function toMcpPaymentResponse(content: McpContentBlock[], receipt: X402Receipt): McpToolResult;
8318
+ /**
8319
+ * Read the inbound RAW payment-payload object out of a tool call's `params._meta["x402/payment"]`.
8320
+ * The value is `{ x402Version, resource?, accepted, payload }`; `gate.verifyObject` reads
8321
+ * `accepted`/`payload` and ignores the extra `resource` sibling — so it's handed in as-is. Returns
8322
+ * `null` when there's no payment (→ the seller emits a fresh 402 challenge).
8323
+ */
8324
+ declare function fromMcpPayment(params: McpToolCallParams): unknown | null;
8325
+ /**
8326
+ * Read the `X402Challenge` (PaymentRequired) back out of an `isError` tool result — the BUYER side.
8327
+ * Reads `structuredContent` first; falls back to parsing `content[0].text`. Returns `null` when the
8328
+ * result is not a 402 (a plain tool failure, or a success) so a buyer never mistakes a non-402
8329
+ * `isError` for a payment request.
8330
+ */
8331
+ declare function fromMcpPaymentRequired(result: McpToolResult): X402Challenge | null;
8332
+ /** Is this tool result a 402 challenge (an `isError` result carrying a parseable PaymentRequired)? */
8333
+ declare function isMcpPaymentRequired(result: McpToolResult): boolean;
8334
+ /**
8335
+ * Read the settlement {@link SettleOutcome} back out of a settled tool result's
8336
+ * `_meta["x402/payment-response"]` — the BUYER side. Returns `null` when absent. The buyer records
8337
+ * the spend only on `success: true` (the existing `parseSettleResponse` rule).
8338
+ */
8339
+ declare function fromMcpPaymentResponse(result: McpToolResult): SettleOutcome | null;
8340
+ /**
8341
+ * Frame an already-produced payment (the SAME `{ accepted, payload }` a PipRail buyer builds for
8342
+ * HTTP/A2A, after paying through the policy-gated client/gate machinery) into the
8343
+ * `_meta["x402/payment"]` entry to attach to the RETRY tool call's `params._meta`. Pure codec — it
8344
+ * mints no signature and grants no spend authority; the buyer signs/broadcasts via the existing
8345
+ * client, then frames the result here for the MCP carrier.
8346
+ */
8347
+ declare function buildMcpPaymentMeta(input: {
8348
+ accepted: unknown;
8349
+ payload: unknown;
8350
+ resource?: {
8351
+ url: string;
8352
+ description?: string;
8353
+ mimeType?: string;
8354
+ };
8355
+ x402Version?: number;
8356
+ }): {
8357
+ 'x402/payment': McpPaymentMeta;
8358
+ };
8359
+ /** Options for {@link createMcpPaymentTool}. */
8360
+ interface McpPaymentToolOptions extends Partial<RequirePaymentOptions> {
8361
+ /**
8362
+ * Pass the SAME {@link PaymentGate} the HTTP/A2A paths use → ONE shared replay set
8363
+ * (`localUsed` / injected `isUsed`/`markUsed`), so a proof settled over one transport and
8364
+ * replayed over MCP is caught once. If omitted, a fresh gate is built from the inline gate
8365
+ * config (`chain`/`token`/`amount`/`payTo`/…) on these same options.
8366
+ */
8367
+ gate?: PaymentGate;
8368
+ /** Produce the tool's REAL output AFTER a verified settle — the merchant's own work. */
8369
+ fulfill: (ctx: {
8370
+ receipt: X402Receipt;
8371
+ params: McpToolCallParams;
8372
+ }) => Promise<McpContentBlock[]> | McpContentBlock[];
8373
+ /** Resource URL stamped into the challenge (cosmetic; MCP tools have no inherent URL). */
8374
+ resourceUrl?: string;
8375
+ }
8376
+ /** A paid MCP tool — turns one inbound tool call into the next tool result. */
8377
+ interface McpPaymentTool {
8378
+ /**
8379
+ * Process one inbound tool call → the next tool result:
8380
+ * - no `_meta` payment → `isError` + a PaymentRequired challenge
8381
+ * - payment, verified+settled → the `fulfill` output + `_meta` payment-response
8382
+ * - settled but `fulfill` threw → STILL a `_meta` payment-response (success) + an error note in
8383
+ * content — never a re-challenge (the proof already settled; B7)
8384
+ * - payment, rejected/malformed → `isError` + a FRESH re-challenge PaymentRequired (retry)
8385
+ * - settle threw (relayer) → `isError` + "settlement failed" (onchain-proof fallback noted)
8386
+ */
8387
+ handleToolCall(params: McpToolCallParams): Promise<McpToolResult>;
8388
+ /** The underlying gate (the shared replay set lives here). */
8389
+ readonly gate: PaymentGate;
8390
+ }
8391
+ /**
8392
+ * Wrap an x402 {@link PaymentGate} as a paid MCP tool — the MCP analogue of `requirePayment` /
8393
+ * `createA2APaymentHandler`. All verify/settle/replay is the gate's `verifyObject` (the same seam
8394
+ * A2A uses): the trusted-accept re-derivation, the bounded replay set, self/facilitator settlement
8395
+ * — none of it is re-implemented here. Backendless: the merchant self-verifies and self-settles.
8396
+ */
8397
+ declare function createMcpPaymentTool(options: McpPaymentToolOptions): McpPaymentTool;
8398
+
8399
+ export { type A2AArtifact, type A2AExtensionDeclaration, type A2AMessage, type A2AMetadata, type A2APart, type A2APaymentHandler, type A2APaymentHandlerOptions, type A2APaymentStatus, type A2ATask, type A2ATaskRecord, type A2ATaskState, type A2ATaskStore, A2A_ERROR_KEY, A2A_EXTENSIONS_HEADER, A2A_PAYLOAD_KEY, A2A_RECEIPTS_KEY, A2A_REQUIRED_KEY, A2A_STATUS_KEY, A2A_X402_EXTENSION_URI_V01, A2A_X402_EXTENSION_URI_V02, type AcceptOption, AddressId, type AgentTool, type AlgorandToken, type AptosToken, AssetId, BRAND, BUILTIN_DENOMS, type BazaarExtension, type BuildExactParams, CHAINS, Caip2, type ChainFamily, type ChainInput, type ChainName, type ChainPreset, type ChainSelector, type ChallengeTriage, type ChallengeVerdict, type ConfirmInfo, ConfirmationTimeoutError, type CostEstimate, type CountStatus, DENOM_PRECISION, DIRECTORY_INFO, type DeclineReasonCode, type DeliverAttempt, type DeliverReceiptOptions, type DeliverResult, type DenomRemaining, type DirectoryInfo, type DiscoverOptions, type DiscoveredRail, type DiscoveredResource, type DiscoveryDescriptor, type DiscoverySigner, type DiscoverySort, type DiscoverySource, type DomainClaim, type DomainVerification, EIP3009_TYPES, EXACT_NETWORK_SLUGS, type EvmToken, type ExactAccept, type ExactAuthorization, ExactPaymentPayloadAny, type ExactRailOption, type ExpressLikeMiddleware, type ExpressLikeNext, type ExpressLikeRequest, type ExpressLikeResponse, type FacilitatorConfig, type FacilitatorPaymentRequirements, type FacilitatorSupportedKind, type FailedPayment, GENERATOR, InsufficientFundsError, InvalidEnvelopeError, KNOWN_FACILITATORS, type KnownFacilitator, type ListingVisibility, MCP_PAYMENT_META_KEY, MCP_PAYMENT_RESPONSE_META_KEY, type ManifestInput, MaxRetriesExceededError, type McpContentBlock, type McpPaymentMeta, type McpPaymentTool, type McpPaymentToolOptions, type McpToolCallParams, type McpToolResult, MissingDriverError, MultiChainPayer, type MultiChainPayerOptions, type NearToken, NoCompatibleAcceptError, NonReplayableBodyError, type OpenApiDocument, type OpenApiOperation, PERMIT2_ADDRESS, PERMIT2_PROXY_CHAIN_IDS, PERMIT2_UPTO_WITNESS_TYPES, PERMIT2_WITNESS_TYPES, PIPRAIL_AGENT_GUIDE, POWERED_BY, PaidReceipt, type PayBlocker, type PayOption, type PayWarning, type PayingClient, PaymentDeclinedError, type PaymentDriver, type PaymentGate, type PaymentIntent, type PaymentPlan, type PaymentPolicy, type PaymentRail, type PaymentScheme, PaymentTimeoutError, Permit2UptoPaymentPayload, PipRailClient, type PipRailClientOptions, type PipRailCostQuote, PipRailError, type PipRailEvent, type PipRailQuote, PipRailReceipt, type PolicyDecision, type PolicyDenyCode, REGISTER_ATTRIBUTION, type ReceiptInput, type ReceiptOption, type ReceiptVerification, RecipientNotReadyError, type RecipientReason, type RegisterInput, type RegisterOptions, type RegisterOutcome, type RequirePaymentOptions, type ResolveOptions, type ResolvedChain, type ResolvedNetwork, type ResolvedToken, type ResourceDescription, type SearchOpenIndexesOptions, type SelfDescribeEndpoint, type SelfDescribeRail, type SelfDescription, type SessionBudget, SettleOutcome, type SettleViaFacilitatorInput, SettlementError, SignedReceipt, type SolanaToken, SpendLedger, SpendRecord, type SpendRemaining, SpendStore, SpendSummary, type StellarToken, type SuiToken, type TokenInfo, type TokenInput, type TonToken, type ToolAnnotations, type TronToken, UPTO_PROXY_CHAIN_IDS, UnknownTokenError, UnsupportedNetworkError, UnsupportedSchemeError, type UptoRailOption, VERIFY_CODE_TO_A2A_ERROR, VerifyErrorCode, type VerifyPaymentResult, VerifyResult, type WalletBalance, type WalletHandle, type WalletInput, WalletRequiredError, type WellKnownX402, type WellKnownX402Item, type WellKnownX402Manifest, WrongChainError, WrongFamilyError, X402AcceptEntry, X402AnyAccept, X402Challenge, type X402DnsRecord, X402ExactAcceptEntry, type X402InvalidBody, X402Receipt, X402UptoAcceptEntry, X402_EXACT_PERMIT2_PROXY, X402_UPTO_PERMIT2_PROXY, type XrplToken, agentGuide, appendAttribution, appendKeywords, buildBazaarExtension, buildEndpointInfo, buildExactAuthorization, buildMcpPaymentMeta, buildOpenApi, buildSelfDescription, buildWellKnownX402, buildWellKnownX402Manifest, buildX402DnsTxt, chainIdForExactNetwork, claim402IndexDomain, classifyChallenge, createA2APaymentHandler, createMcpPaymentTool, createPaymentGate, decorateOutcome, deliverReceipt, denomOf, describeChallenge, discoveryHeaders, eip3009Abi, encodeXPaymentHeader, evaluatePolicy, explainDecline, facilitatorCoverage, fetchAcross, firstKeylessFacilitator, formatSpendReport, fromA2APaymentPayload, fromA2APaymentRequired, fromMcpPayment, fromMcpPaymentRequired, fromMcpPaymentResponse, getDirectoryInfo, isMcpPaymentRequired, isPermit2ProxyChain, isUptoProxyChain, knownFacilitatorsFor, normalizeNetwork, parseExactRequirements, parseFacilitatorSupported, paymentTools, planAcross, rankResources, readExactDomain, register402Index, registerDriver, registerX402Scan, renderLandingPage, requirePayment, resolveChain, scoreResource, searchOpenIndexes, settleViaFacilitator, summarizePlan, toA2AErrorCode, toA2APaymentFailed, toA2APaymentReceipts, toA2APaymentRequired, toInsufficientFundsError, toInvalidBody, toMcpPaymentRequired, toMcpPaymentResponse, verify402IndexDomain };