uvd-x402-sdk 2.105.0 → 2.106.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 (38) hide show
  1. package/README.md +18 -0
  2. package/dist/backend/index.d.mts +1 -1
  3. package/dist/backend/index.d.ts +1 -1
  4. package/dist/backend/index.js +6 -4
  5. package/dist/backend/index.js.map +1 -1
  6. package/dist/backend/index.mjs +6 -4
  7. package/dist/backend/index.mjs.map +1 -1
  8. package/dist/{escrow-contracts-amyDktMD.d.mts → escrow-contracts-D3iLODtY.d.mts} +2 -2
  9. package/dist/{escrow-contracts-Bf3PU_Ub.d.ts → escrow-contracts-RTO6mJCW.d.ts} +2 -2
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/reputation/index.d.mts +1159 -0
  15. package/dist/reputation/index.d.ts +1159 -0
  16. package/dist/reputation/index.js +3670 -0
  17. package/dist/reputation/index.js.map +1 -0
  18. package/dist/reputation/index.mjs +3603 -0
  19. package/dist/reputation/index.mjs.map +1 -0
  20. package/package.json +15 -2
  21. package/src/backend/index.ts +8 -3
  22. package/src/reputation/README.md +167 -0
  23. package/src/reputation/canonical.ts +76 -0
  24. package/src/reputation/constants.ts +136 -0
  25. package/src/reputation/directory.ts +60 -0
  26. package/src/reputation/errors.ts +108 -0
  27. package/src/reputation/evidence.ts +321 -0
  28. package/src/reputation/governor.ts +389 -0
  29. package/src/reputation/index.ts +144 -0
  30. package/src/reputation/message-ref.ts +63 -0
  31. package/src/reputation/outbox.ts +510 -0
  32. package/src/reputation/payment.ts +490 -0
  33. package/src/reputation/redact.ts +82 -0
  34. package/src/reputation/sign.ts +227 -0
  35. package/src/reputation/sqlite-outbox.ts +244 -0
  36. package/src/reputation/submit.ts +1005 -0
  37. package/src/reputation/validate.ts +372 -0
  38. package/src/reputation/values.ts +106 -0
package/README.md CHANGED
@@ -24,6 +24,7 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
24
24
  - **Advanced Escrow**: Full escrow lifecycle (authorize, release, refund, charge) with SigningWalletAdapter support
25
25
  - **Escrow Pre-Auth**: Sign-on-assignment `X-Payment-Auth` builder (`buildEscrowPreAuth`) — vector-pinned parity with the Python SDK and Execution Market
26
26
  - **Batch Settlement (buyer)**: `uvd-x402-sdk/batch-settlement` — one ERC-3009 deposit opens a channel, each later request pays with a cumulative voucher; capped deposits, vector-pinned parity with the Python SDK
27
+ - **Reputation (rater-authored ERC-8004)**: `uvd-x402-sdk/reputation` — anchor payment, checked prepare, low-s signatures, a persistent outbox that never prepares twice, caps and a circuit breaker, evidence without chat text; vector-pinned parity with the Python SDK
27
28
  - **Commerce Scheme**: `'commerce'` scheme alias for marketplace integrations (identical to `'escrow'` on-chain)
28
29
  - **`/accepts` Negotiation**: Discover facilitator capabilities before constructing payments
29
30
  - **Bazaar Discovery**: Register and discover paid resources across the x402 network
@@ -707,6 +708,23 @@ if (res.ok) await client.confirm(prepared, settleResponse.extra); // from the PA
707
708
 
708
709
  A deposit is never above `maxDeposit`: the seller's `extra.minDeposit` is a target, and a deposit the next voucher needs above the cap throws `BatchSettlementError` with nothing signed. Only `eip155:*` networks and the ERC-3009 deposit are signed (`assetTransferMethod: 'permit2'` throws). `confirm` records previous cumulative + `chargedAmount` and never copies the seller's `channelState`; a mismatch leaves the local state untouched and resolves to `false`. If the payer may be an EIP-7702 delegated account (a Paybox wallet), pass `delegationResolver` (e.g. `rpcDelegationResolver(rpcUrl)`): the deposit authorization is then wrapped for ERC-1271 when the delegate needs it, and an unreadable chain refuses instead of signing plain. Not included: Permit2 deposits, the cooperative refund and the corrective-402 resync.
709
710
 
711
+ ## Reputation (rater-authored ERC-8004)
712
+
713
+ Ratings the chain records as authored by your program's own rater wallet, relayed by the facilitator, each anchored by a small USDC payment from the rater to the rated wallet. One module for every program, the same contract and shared vectors as the Python SDK's `uvd_x402_sdk.reputation`. Integration in fifteen lines, the money rules, the outbox states and `!forgetme`: [`src/reputation/README.md`](src/reputation/README.md).
714
+
715
+ ```typescript
716
+ import { Erc8004Client } from 'uvd-x402-sdk/backend';
717
+ import { Governor, SqliteRatingOutbox, describeNetHealth, messageRef, processRating } from 'uvd-x402-sdk/reputation';
718
+
719
+ const outbox = new SqliteRatingOutbox(db); // a better-sqlite3 Database (optional peer dependency), synchronous = FULL
720
+ const governor = new Governor(caps, describeNetHealth(), { store: outbox }); // caps: eight parameters, no defaults
721
+ const ref = messageRef('my-app:v1', streamId, messageId);
722
+ await outbox.enqueue({ ref, network: 'base', subject: wallet, streamId, value: 90, amount: 1000, viewerId });
723
+ await processRating(ref, { outbox, governor, client: new Erc8004Client(), rpc, signer, resolveAgent, buildFeedback });
724
+ ```
725
+
726
+ The module never reads a key (it signs through the `signer` you pass), never pays a wallet whose agent it has not resolved and checked, refuses to sign any prepare that is not the exact rating asked for, stores the signed payment before broadcasting it and the signed rating before sending it, and once a rating is signed it only reads the chain until the deadline, and the delegate's own spent-nonce cell in the rater's storage, prove it did not land.
727
+
710
728
  ## Multi-Stablecoin (EVM)
711
729
 
712
730
  ```typescript
@@ -1,4 +1,4 @@
1
1
  import '../wallet-T0NFUUkT.mjs';
2
2
  export { a as FacilitatorReceipt, F as FetchReceiptResult, P as PaymentState, b as PurchaseContext, c as RECEIPT_ISSUER, R as ReceiptFetchOptions, d as ReceiptKeys, e as STACK_KEY_HEADER, S as StackKeyOptions, f as StackKeyRedirectError, g as canonicalReceiptJson, h as createPurchaseContext, i as fetchWithReceipt, j as getFacilitatorReceipt, m as mergeHeaderList, k as mergePaymentResponseHeaders, p as parseFacilitatorReceipt, l as paymentResponseHeaders, n as purchaseContextHeader, r as receiptCommitment, o as receiptFromErrorBody, q as receiptFromResponse, v as validatePurchaseContext, s as verifyFacilitatorReceipt } from '../receipts-DsOSK0yB.mjs';
3
3
  import '../index-DARXHuQl.mjs';
4
- export { A as AMBIGUOUS_LEASE_REASONS, b as AUTHORIZATION_ALREADY_SETTLED, c as AUTHORIZATION_IN_FLIGHT, d as AdmittedAuthorizationCode, bf as AdvancedAuthorizationResult, bg as AdvancedEscrowClient, bh as AdvancedEscrowClientOptions, bi as AdvancedEscrowContracts, bj as AdvancedEscrowTaskTier, bk as AdvancedPaymentInfo, bl as AdvancedTransactionResult, bm as AgentId, bn as AgentIdentity, bo as AgentRegistration, bp as AgentRegistrationFile, bq as AgentService, br as AtomStats, bs as BASE_MAINNET_CONTRACTS, B as BAZAAR_BODY_METHODS, g as BAZAAR_BODY_TYPES, h as BAZAAR_QUERY_METHODS, j as BazaarBodyEndpoint, k as BazaarBodyMethod, l as BazaarBodyType, bt as BazaarClient, bu as BazaarClientOptions, bv as BazaarDiscoverOptions, bw as BazaarDiscoverResponse, m as BazaarExtensionOptions, n as BazaarOutput, o as BazaarQueryEndpoint, p as BazaarQueryMethod, bx as BazaarRegisterOptions, by as BazaarResource, bz as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, bA as DEFAULT_MAX_SEARCH_LEN, r as DEFAULT_RETRY_AFTER_SECONDS, bB as DEPOSIT_LIMIT_USDC, s as DURABLE_DEFAULT_TIMEOUT_MS, bC as DiscoveryAccepts, bD as DiscoveryCuration, bE as DiscoveryHealth, bF as DiscoveryHealthStatus, bG as DiscoveryKind, bH as DiscoveryListOptions, bI as DiscoveryMethod, bJ as DiscoveryPagination, bK as DiscoveryRegisterOptions, bL as DiscoveryResource, bM as DiscoveryResponse, bN as DiscoverySource, bO as DiscoveryStats, bP as DiscoveryTier, bQ as Dispute, bR as DisputeOutcome, u as DurableEvidenceContext, v as DurableEvidenceOptions, bS as ERC8004_CONTRACTS, bT as ERC8004_EXTENSION_ID, bU as ESCROW_CONTRACTS, bV as ESCROW_NOTHING_TO_VOID, bW as ESCROW_OPERATOR_GENERATION, bX as ESCROW_OPERATOR_NOT_DEPLOYED, bY as ESCROW_TIMEOUT_MS, bZ as ESCROW_UNSUPPORTED_ON_GENERATION, b_ as ESCROW_VOID_AMOUNT_MISMATCH, b$ as Erc8004Client, c0 as Erc8004ClientOptions, c1 as Erc8004LookupError, c2 as Erc8004Network, c3 as EscrowClient, c4 as EscrowClientOptions, c5 as EscrowOperatorGeneration, c6 as EscrowPayment, c7 as EscrowStateResponse, c8 as EscrowStatus, F as FacilitatorCallOptions, G as FacilitatorClient, H as FacilitatorClientOptions, I as FacilitatorErrorInfo, J as FacilitatorFailureFields, K as FacilitatorFetchOptions, c9 as FeedbackEntry, ca as FeedbackParams, cb as FeedbackRequest, cc as FeedbackResponse, L as FetchPaywall, M as FetchPaywallOptions, N as FetchRouteInput, cd as HEALTH_FILTERS, O as HonoMiddlewareOptions, P as IDEMPOTENCY_KEY_HEADER, Q as IDEMPOTENT_REPLAYED_HEADER, ce as IdentityByOwnerResponse, cf as IdentityMetadataResponse, cg as IdentityTotalSupplyResponse, ch as KIND_FILTERS, ci as LifecycleAuthOptions, a1 as MAX_RETRY_AFTER_SECONDS, cj as MAX_SEARCH_LEN, ck as METHOD_FILTERS, cl as MetadataEntryParam, cm as OPERATOR_ABI, cn as OPERATOR_ABI_CREATE3, co as OPERATOR_ABI_V3, cp as PAYMENT_INFO_TYPEHASH, a2 as ParsedFacilitatorErrorBody, a3 as PaymentAcceptance, a4 as PaymentConflictResponse, a5 as PaymentMiddlewareOptions, a6 as PaymentPayloadV2, cq as PaymentRequirementResolver, cr as PaymentRequirements, cs as PaymentRequirementsOptions, a7 as PaymentRequirementsV2, ct as PrepareRelayFeedbackRequest, cu as PrepareRelayFeedbackResponse, cv as PrepareRelayResponseRequest, cw as PrepareSolanaFeedbackRequest, cx as PrepareSolanaFeedbackResponse, cy as ProofOfPayment, a8 as RECEIPT_REQUEST_CONFLICT, cz as RELAYED_FEEDBACK_NETWORKS, a9 as REPLAYABLE_LEASE_REASONS, cA as RefundRequest, cB as RefundStatus, cC as RegisterAgentRequest, cD as RegisterAgentResponse, cE as RegisterJobResponse, cF as RegisterJobStatus, cG as RegistrationPendingError, cH as RelayAuthorizationParams, cI as ReputationResponse, cJ as ReputationSummary, cK as RequestRefundOptions, ab as ResourceInfoV2, ac as SETTLEMENT_UNCONFIRMED, cL as SOLANA_FEEDBACK_NETWORKS, cM as SettleRequest, ad as SettleRequestV2, ae as SettleResponse, cN as SettleResponseWithProof, cO as SubmitRelayFeedbackRequest, cP as SubmitRelayResponseRequest, cQ as SubmitSolanaFeedbackRequest, cR as TIER_FILTERS, cS as TIER_TIMINGS, cT as USDC_DOMAIN_NAME, cU as UnavailableBody, cV as UnavailableResponse, af as VerifiedPaymentState, cW as VerifyRequest, ag as VerifyRequestV2, ah as VerifyResponse, ai as WRITER_LEASE_REASONS, ak as WriterLeaseReason, al as X402_CORS_HEADERS, am as X402_HEADER_NAMES, cX as ZERO_ADDRESS, ar as bazaarExtension, cY as buildErc8004PaymentRequirements, au as buildPaymentConflictResponse, av as buildPaymentRequirements, aw as buildSettleRequest, ax as buildSettleRequestForVersion, ay as buildSettleRequestV2, cZ as buildUnavailableResponse, az as buildVerifyRequest, aA as buildVerifyRequestForVersion, aB as buildVerifyRequestV2, c_ as canRefundEscrow, c$ as canReleaseEscrow, d0 as carryFailureFields, aD as create402Response, aE as createFetchPaywall, aF as createHonoMiddleware, aG as createIdempotencyKey, aH as createPaymentMiddleware, d1 as epochToDate, d2 as escrowTimeRemaining, aN as extractPaymentFromHeaders, aO as facilitatorFetch, aP as getCorsHeaders, d3 as getEscrowContractsByChainId, d4 as getEscrowOperatorGeneration, d5 as getEscrowSupportedChainIds, d6 as isAlive, aQ as isAmbiguousLeaseReason, aR as isAuthorizationAlreadyUsed, aS as isAuthorizationInFlight, d7 as isEscrowExpired, d8 as isEscrowSupportedOnChain, d9 as isRegisterJobTerminal, aU as isReplayableLeaseReason, aV as isSettlementUnconfirmed, aY as parseFacilitatorErrorBody, da as parsePaymentHeader, aZ as parseRetryAfterSeconds, b1 as readFacilitatorError, b3 as resolveEnvelopeVersion, db as supportsRelayedFeedback, dc as supportsSolanaFeedback, ba as toPaymentRequirementsV2, bb as toResourceInfoV2, dd as wireNetwork, be as withDiscoverable } from '../escrow-contracts-amyDktMD.mjs';
4
+ export { A as AMBIGUOUS_LEASE_REASONS, b as AUTHORIZATION_ALREADY_SETTLED, c as AUTHORIZATION_IN_FLIGHT, d as AdmittedAuthorizationCode, bi as AdvancedAuthorizationResult, bj as AdvancedEscrowClient, bk as AdvancedEscrowClientOptions, bl as AdvancedEscrowContracts, bm as AdvancedEscrowTaskTier, bn as AdvancedPaymentInfo, bo as AdvancedTransactionResult, bp as AgentId, bq as AgentIdentity, br as AgentRegistration, bs as AgentRegistrationFile, bt as AgentService, bu as AtomStats, bv as BASE_MAINNET_CONTRACTS, B as BAZAAR_BODY_METHODS, g as BAZAAR_BODY_TYPES, h as BAZAAR_QUERY_METHODS, j as BazaarBodyEndpoint, k as BazaarBodyMethod, l as BazaarBodyType, bw as BazaarClient, bx as BazaarClientOptions, by as BazaarDiscoverOptions, bz as BazaarDiscoverResponse, m as BazaarExtensionOptions, n as BazaarOutput, o as BazaarQueryEndpoint, p as BazaarQueryMethod, bA as BazaarRegisterOptions, bB as BazaarResource, bC as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, bD as DEFAULT_MAX_SEARCH_LEN, r as DEFAULT_RETRY_AFTER_SECONDS, bE as DEPOSIT_LIMIT_USDC, s as DURABLE_DEFAULT_TIMEOUT_MS, bF as DiscoveryAccepts, bG as DiscoveryCuration, bH as DiscoveryHealth, bI as DiscoveryHealthStatus, bJ as DiscoveryKind, bK as DiscoveryListOptions, bL as DiscoveryMethod, bM as DiscoveryPagination, bN as DiscoveryRegisterOptions, bO as DiscoveryResource, bP as DiscoveryResponse, bQ as DiscoverySource, bR as DiscoveryStats, bS as DiscoveryTier, bT as Dispute, bU as DisputeOutcome, u as DurableEvidenceContext, v as DurableEvidenceOptions, bV as ERC8004_CONTRACTS, bW as ERC8004_EXTENSION_ID, bX as ESCROW_CONTRACTS, bY as ESCROW_NOTHING_TO_VOID, bZ as ESCROW_OPERATOR_GENERATION, b_ as ESCROW_OPERATOR_NOT_DEPLOYED, b$ as ESCROW_TIMEOUT_MS, c0 as ESCROW_UNSUPPORTED_ON_GENERATION, c1 as ESCROW_VOID_AMOUNT_MISMATCH, c2 as Erc8004Client, c3 as Erc8004ClientOptions, c4 as Erc8004LookupError, c5 as Erc8004Network, c6 as EscrowClient, c7 as EscrowClientOptions, c8 as EscrowOperatorGeneration, c9 as EscrowPayment, ca as EscrowStateResponse, cb as EscrowStatus, F as FacilitatorCallOptions, G as FacilitatorClient, H as FacilitatorClientOptions, I as FacilitatorErrorInfo, J as FacilitatorFailureFields, K as FacilitatorFetchOptions, cc as FeedbackEntry, cd as FeedbackParams, ce as FeedbackRequest, cf as FeedbackResponse, L as FetchPaywall, M as FetchPaywallOptions, N as FetchRouteInput, cg as HEALTH_FILTERS, O as HonoMiddlewareOptions, P as IDEMPOTENCY_KEY_HEADER, Q as IDEMPOTENT_REPLAYED_HEADER, ch as IdentityByOwnerResponse, ci as IdentityMetadataResponse, cj as IdentityTotalSupplyResponse, ck as KIND_FILTERS, cl as LifecycleAuthOptions, a1 as MAX_RETRY_AFTER_SECONDS, cm as MAX_SEARCH_LEN, cn as METHOD_FILTERS, co as MetadataEntryParam, cp as OPERATOR_ABI, cq as OPERATOR_ABI_CREATE3, cr as OPERATOR_ABI_V3, cs as PAYMENT_INFO_TYPEHASH, a2 as ParsedFacilitatorErrorBody, a3 as PaymentAcceptance, a4 as PaymentConflictResponse, a5 as PaymentMiddlewareOptions, a6 as PaymentPayloadV2, ct as PaymentRequirementResolver, cu as PaymentRequirements, cv as PaymentRequirementsOptions, a7 as PaymentRequirementsV2, bg as PrepareRelayFeedbackRequest, cw as PrepareRelayFeedbackResponse, cx as PrepareRelayResponseRequest, cy as PrepareSolanaFeedbackRequest, cz as PrepareSolanaFeedbackResponse, bf as ProofOfPayment, a8 as RECEIPT_REQUEST_CONFLICT, cA as RELAYED_FEEDBACK_NETWORKS, a9 as REPLAYABLE_LEASE_REASONS, cB as RefundRequest, cC as RefundStatus, cD as RegisterAgentRequest, cE as RegisterAgentResponse, cF as RegisterJobResponse, cG as RegisterJobStatus, cH as RegistrationPendingError, cI as RelayAuthorizationParams, cJ as ReputationResponse, cK as ReputationSummary, cL as RequestRefundOptions, ab as ResourceInfoV2, ac as SETTLEMENT_UNCONFIRMED, cM as SOLANA_FEEDBACK_NETWORKS, cN as SettleRequest, ad as SettleRequestV2, ae as SettleResponse, cO as SettleResponseWithProof, bh as SubmitRelayFeedbackRequest, cP as SubmitRelayResponseRequest, cQ as SubmitSolanaFeedbackRequest, cR as TIER_FILTERS, cS as TIER_TIMINGS, cT as USDC_DOMAIN_NAME, cU as UnavailableBody, cV as UnavailableResponse, af as VerifiedPaymentState, cW as VerifyRequest, ag as VerifyRequestV2, ah as VerifyResponse, ai as WRITER_LEASE_REASONS, ak as WriterLeaseReason, al as X402_CORS_HEADERS, am as X402_HEADER_NAMES, cX as ZERO_ADDRESS, ar as bazaarExtension, cY as buildErc8004PaymentRequirements, au as buildPaymentConflictResponse, av as buildPaymentRequirements, aw as buildSettleRequest, ax as buildSettleRequestForVersion, ay as buildSettleRequestV2, cZ as buildUnavailableResponse, az as buildVerifyRequest, aA as buildVerifyRequestForVersion, aB as buildVerifyRequestV2, c_ as canRefundEscrow, c$ as canReleaseEscrow, d0 as carryFailureFields, aD as create402Response, aE as createFetchPaywall, aF as createHonoMiddleware, aG as createIdempotencyKey, aH as createPaymentMiddleware, d1 as epochToDate, d2 as escrowTimeRemaining, aN as extractPaymentFromHeaders, aO as facilitatorFetch, aP as getCorsHeaders, d3 as getEscrowContractsByChainId, d4 as getEscrowOperatorGeneration, d5 as getEscrowSupportedChainIds, d6 as isAlive, aQ as isAmbiguousLeaseReason, aR as isAuthorizationAlreadyUsed, aS as isAuthorizationInFlight, d7 as isEscrowExpired, d8 as isEscrowSupportedOnChain, d9 as isRegisterJobTerminal, aU as isReplayableLeaseReason, aV as isSettlementUnconfirmed, aY as parseFacilitatorErrorBody, da as parsePaymentHeader, aZ as parseRetryAfterSeconds, b1 as readFacilitatorError, b3 as resolveEnvelopeVersion, db as supportsRelayedFeedback, dc as supportsSolanaFeedback, ba as toPaymentRequirementsV2, bb as toResourceInfoV2, dd as wireNetwork, be as withDiscoverable } from '../escrow-contracts-D3iLODtY.mjs';
@@ -1,4 +1,4 @@
1
1
  import '../wallet-T0NFUUkT.js';
2
2
  export { a as FacilitatorReceipt, F as FetchReceiptResult, P as PaymentState, b as PurchaseContext, c as RECEIPT_ISSUER, R as ReceiptFetchOptions, d as ReceiptKeys, e as STACK_KEY_HEADER, S as StackKeyOptions, f as StackKeyRedirectError, g as canonicalReceiptJson, h as createPurchaseContext, i as fetchWithReceipt, j as getFacilitatorReceipt, m as mergeHeaderList, k as mergePaymentResponseHeaders, p as parseFacilitatorReceipt, l as paymentResponseHeaders, n as purchaseContextHeader, r as receiptCommitment, o as receiptFromErrorBody, q as receiptFromResponse, v as validatePurchaseContext, s as verifyFacilitatorReceipt } from '../receipts-CMuWVtO0.js';
3
3
  import '../index-DARXHuQl.js';
4
- export { A as AMBIGUOUS_LEASE_REASONS, b as AUTHORIZATION_ALREADY_SETTLED, c as AUTHORIZATION_IN_FLIGHT, d as AdmittedAuthorizationCode, bf as AdvancedAuthorizationResult, bg as AdvancedEscrowClient, bh as AdvancedEscrowClientOptions, bi as AdvancedEscrowContracts, bj as AdvancedEscrowTaskTier, bk as AdvancedPaymentInfo, bl as AdvancedTransactionResult, bm as AgentId, bn as AgentIdentity, bo as AgentRegistration, bp as AgentRegistrationFile, bq as AgentService, br as AtomStats, bs as BASE_MAINNET_CONTRACTS, B as BAZAAR_BODY_METHODS, g as BAZAAR_BODY_TYPES, h as BAZAAR_QUERY_METHODS, j as BazaarBodyEndpoint, k as BazaarBodyMethod, l as BazaarBodyType, bt as BazaarClient, bu as BazaarClientOptions, bv as BazaarDiscoverOptions, bw as BazaarDiscoverResponse, m as BazaarExtensionOptions, n as BazaarOutput, o as BazaarQueryEndpoint, p as BazaarQueryMethod, bx as BazaarRegisterOptions, by as BazaarResource, bz as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, bA as DEFAULT_MAX_SEARCH_LEN, r as DEFAULT_RETRY_AFTER_SECONDS, bB as DEPOSIT_LIMIT_USDC, s as DURABLE_DEFAULT_TIMEOUT_MS, bC as DiscoveryAccepts, bD as DiscoveryCuration, bE as DiscoveryHealth, bF as DiscoveryHealthStatus, bG as DiscoveryKind, bH as DiscoveryListOptions, bI as DiscoveryMethod, bJ as DiscoveryPagination, bK as DiscoveryRegisterOptions, bL as DiscoveryResource, bM as DiscoveryResponse, bN as DiscoverySource, bO as DiscoveryStats, bP as DiscoveryTier, bQ as Dispute, bR as DisputeOutcome, u as DurableEvidenceContext, v as DurableEvidenceOptions, bS as ERC8004_CONTRACTS, bT as ERC8004_EXTENSION_ID, bU as ESCROW_CONTRACTS, bV as ESCROW_NOTHING_TO_VOID, bW as ESCROW_OPERATOR_GENERATION, bX as ESCROW_OPERATOR_NOT_DEPLOYED, bY as ESCROW_TIMEOUT_MS, bZ as ESCROW_UNSUPPORTED_ON_GENERATION, b_ as ESCROW_VOID_AMOUNT_MISMATCH, b$ as Erc8004Client, c0 as Erc8004ClientOptions, c1 as Erc8004LookupError, c2 as Erc8004Network, c3 as EscrowClient, c4 as EscrowClientOptions, c5 as EscrowOperatorGeneration, c6 as EscrowPayment, c7 as EscrowStateResponse, c8 as EscrowStatus, F as FacilitatorCallOptions, G as FacilitatorClient, H as FacilitatorClientOptions, I as FacilitatorErrorInfo, J as FacilitatorFailureFields, K as FacilitatorFetchOptions, c9 as FeedbackEntry, ca as FeedbackParams, cb as FeedbackRequest, cc as FeedbackResponse, L as FetchPaywall, M as FetchPaywallOptions, N as FetchRouteInput, cd as HEALTH_FILTERS, O as HonoMiddlewareOptions, P as IDEMPOTENCY_KEY_HEADER, Q as IDEMPOTENT_REPLAYED_HEADER, ce as IdentityByOwnerResponse, cf as IdentityMetadataResponse, cg as IdentityTotalSupplyResponse, ch as KIND_FILTERS, ci as LifecycleAuthOptions, a1 as MAX_RETRY_AFTER_SECONDS, cj as MAX_SEARCH_LEN, ck as METHOD_FILTERS, cl as MetadataEntryParam, cm as OPERATOR_ABI, cn as OPERATOR_ABI_CREATE3, co as OPERATOR_ABI_V3, cp as PAYMENT_INFO_TYPEHASH, a2 as ParsedFacilitatorErrorBody, a3 as PaymentAcceptance, a4 as PaymentConflictResponse, a5 as PaymentMiddlewareOptions, a6 as PaymentPayloadV2, cq as PaymentRequirementResolver, cr as PaymentRequirements, cs as PaymentRequirementsOptions, a7 as PaymentRequirementsV2, ct as PrepareRelayFeedbackRequest, cu as PrepareRelayFeedbackResponse, cv as PrepareRelayResponseRequest, cw as PrepareSolanaFeedbackRequest, cx as PrepareSolanaFeedbackResponse, cy as ProofOfPayment, a8 as RECEIPT_REQUEST_CONFLICT, cz as RELAYED_FEEDBACK_NETWORKS, a9 as REPLAYABLE_LEASE_REASONS, cA as RefundRequest, cB as RefundStatus, cC as RegisterAgentRequest, cD as RegisterAgentResponse, cE as RegisterJobResponse, cF as RegisterJobStatus, cG as RegistrationPendingError, cH as RelayAuthorizationParams, cI as ReputationResponse, cJ as ReputationSummary, cK as RequestRefundOptions, ab as ResourceInfoV2, ac as SETTLEMENT_UNCONFIRMED, cL as SOLANA_FEEDBACK_NETWORKS, cM as SettleRequest, ad as SettleRequestV2, ae as SettleResponse, cN as SettleResponseWithProof, cO as SubmitRelayFeedbackRequest, cP as SubmitRelayResponseRequest, cQ as SubmitSolanaFeedbackRequest, cR as TIER_FILTERS, cS as TIER_TIMINGS, cT as USDC_DOMAIN_NAME, cU as UnavailableBody, cV as UnavailableResponse, af as VerifiedPaymentState, cW as VerifyRequest, ag as VerifyRequestV2, ah as VerifyResponse, ai as WRITER_LEASE_REASONS, ak as WriterLeaseReason, al as X402_CORS_HEADERS, am as X402_HEADER_NAMES, cX as ZERO_ADDRESS, ar as bazaarExtension, cY as buildErc8004PaymentRequirements, au as buildPaymentConflictResponse, av as buildPaymentRequirements, aw as buildSettleRequest, ax as buildSettleRequestForVersion, ay as buildSettleRequestV2, cZ as buildUnavailableResponse, az as buildVerifyRequest, aA as buildVerifyRequestForVersion, aB as buildVerifyRequestV2, c_ as canRefundEscrow, c$ as canReleaseEscrow, d0 as carryFailureFields, aD as create402Response, aE as createFetchPaywall, aF as createHonoMiddleware, aG as createIdempotencyKey, aH as createPaymentMiddleware, d1 as epochToDate, d2 as escrowTimeRemaining, aN as extractPaymentFromHeaders, aO as facilitatorFetch, aP as getCorsHeaders, d3 as getEscrowContractsByChainId, d4 as getEscrowOperatorGeneration, d5 as getEscrowSupportedChainIds, d6 as isAlive, aQ as isAmbiguousLeaseReason, aR as isAuthorizationAlreadyUsed, aS as isAuthorizationInFlight, d7 as isEscrowExpired, d8 as isEscrowSupportedOnChain, d9 as isRegisterJobTerminal, aU as isReplayableLeaseReason, aV as isSettlementUnconfirmed, aY as parseFacilitatorErrorBody, da as parsePaymentHeader, aZ as parseRetryAfterSeconds, b1 as readFacilitatorError, b3 as resolveEnvelopeVersion, db as supportsRelayedFeedback, dc as supportsSolanaFeedback, ba as toPaymentRequirementsV2, bb as toResourceInfoV2, dd as wireNetwork, be as withDiscoverable } from '../escrow-contracts-Bf3PU_Ub.js';
4
+ export { A as AMBIGUOUS_LEASE_REASONS, b as AUTHORIZATION_ALREADY_SETTLED, c as AUTHORIZATION_IN_FLIGHT, d as AdmittedAuthorizationCode, bi as AdvancedAuthorizationResult, bj as AdvancedEscrowClient, bk as AdvancedEscrowClientOptions, bl as AdvancedEscrowContracts, bm as AdvancedEscrowTaskTier, bn as AdvancedPaymentInfo, bo as AdvancedTransactionResult, bp as AgentId, bq as AgentIdentity, br as AgentRegistration, bs as AgentRegistrationFile, bt as AgentService, bu as AtomStats, bv as BASE_MAINNET_CONTRACTS, B as BAZAAR_BODY_METHODS, g as BAZAAR_BODY_TYPES, h as BAZAAR_QUERY_METHODS, j as BazaarBodyEndpoint, k as BazaarBodyMethod, l as BazaarBodyType, bw as BazaarClient, bx as BazaarClientOptions, by as BazaarDiscoverOptions, bz as BazaarDiscoverResponse, m as BazaarExtensionOptions, n as BazaarOutput, o as BazaarQueryEndpoint, p as BazaarQueryMethod, bA as BazaarRegisterOptions, bB as BazaarResource, bC as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, bD as DEFAULT_MAX_SEARCH_LEN, r as DEFAULT_RETRY_AFTER_SECONDS, bE as DEPOSIT_LIMIT_USDC, s as DURABLE_DEFAULT_TIMEOUT_MS, bF as DiscoveryAccepts, bG as DiscoveryCuration, bH as DiscoveryHealth, bI as DiscoveryHealthStatus, bJ as DiscoveryKind, bK as DiscoveryListOptions, bL as DiscoveryMethod, bM as DiscoveryPagination, bN as DiscoveryRegisterOptions, bO as DiscoveryResource, bP as DiscoveryResponse, bQ as DiscoverySource, bR as DiscoveryStats, bS as DiscoveryTier, bT as Dispute, bU as DisputeOutcome, u as DurableEvidenceContext, v as DurableEvidenceOptions, bV as ERC8004_CONTRACTS, bW as ERC8004_EXTENSION_ID, bX as ESCROW_CONTRACTS, bY as ESCROW_NOTHING_TO_VOID, bZ as ESCROW_OPERATOR_GENERATION, b_ as ESCROW_OPERATOR_NOT_DEPLOYED, b$ as ESCROW_TIMEOUT_MS, c0 as ESCROW_UNSUPPORTED_ON_GENERATION, c1 as ESCROW_VOID_AMOUNT_MISMATCH, c2 as Erc8004Client, c3 as Erc8004ClientOptions, c4 as Erc8004LookupError, c5 as Erc8004Network, c6 as EscrowClient, c7 as EscrowClientOptions, c8 as EscrowOperatorGeneration, c9 as EscrowPayment, ca as EscrowStateResponse, cb as EscrowStatus, F as FacilitatorCallOptions, G as FacilitatorClient, H as FacilitatorClientOptions, I as FacilitatorErrorInfo, J as FacilitatorFailureFields, K as FacilitatorFetchOptions, cc as FeedbackEntry, cd as FeedbackParams, ce as FeedbackRequest, cf as FeedbackResponse, L as FetchPaywall, M as FetchPaywallOptions, N as FetchRouteInput, cg as HEALTH_FILTERS, O as HonoMiddlewareOptions, P as IDEMPOTENCY_KEY_HEADER, Q as IDEMPOTENT_REPLAYED_HEADER, ch as IdentityByOwnerResponse, ci as IdentityMetadataResponse, cj as IdentityTotalSupplyResponse, ck as KIND_FILTERS, cl as LifecycleAuthOptions, a1 as MAX_RETRY_AFTER_SECONDS, cm as MAX_SEARCH_LEN, cn as METHOD_FILTERS, co as MetadataEntryParam, cp as OPERATOR_ABI, cq as OPERATOR_ABI_CREATE3, cr as OPERATOR_ABI_V3, cs as PAYMENT_INFO_TYPEHASH, a2 as ParsedFacilitatorErrorBody, a3 as PaymentAcceptance, a4 as PaymentConflictResponse, a5 as PaymentMiddlewareOptions, a6 as PaymentPayloadV2, ct as PaymentRequirementResolver, cu as PaymentRequirements, cv as PaymentRequirementsOptions, a7 as PaymentRequirementsV2, bg as PrepareRelayFeedbackRequest, cw as PrepareRelayFeedbackResponse, cx as PrepareRelayResponseRequest, cy as PrepareSolanaFeedbackRequest, cz as PrepareSolanaFeedbackResponse, bf as ProofOfPayment, a8 as RECEIPT_REQUEST_CONFLICT, cA as RELAYED_FEEDBACK_NETWORKS, a9 as REPLAYABLE_LEASE_REASONS, cB as RefundRequest, cC as RefundStatus, cD as RegisterAgentRequest, cE as RegisterAgentResponse, cF as RegisterJobResponse, cG as RegisterJobStatus, cH as RegistrationPendingError, cI as RelayAuthorizationParams, cJ as ReputationResponse, cK as ReputationSummary, cL as RequestRefundOptions, ab as ResourceInfoV2, ac as SETTLEMENT_UNCONFIRMED, cM as SOLANA_FEEDBACK_NETWORKS, cN as SettleRequest, ad as SettleRequestV2, ae as SettleResponse, cO as SettleResponseWithProof, bh as SubmitRelayFeedbackRequest, cP as SubmitRelayResponseRequest, cQ as SubmitSolanaFeedbackRequest, cR as TIER_FILTERS, cS as TIER_TIMINGS, cT as USDC_DOMAIN_NAME, cU as UnavailableBody, cV as UnavailableResponse, af as VerifiedPaymentState, cW as VerifyRequest, ag as VerifyRequestV2, ah as VerifyResponse, ai as WRITER_LEASE_REASONS, ak as WriterLeaseReason, al as X402_CORS_HEADERS, am as X402_HEADER_NAMES, cX as ZERO_ADDRESS, ar as bazaarExtension, cY as buildErc8004PaymentRequirements, au as buildPaymentConflictResponse, av as buildPaymentRequirements, aw as buildSettleRequest, ax as buildSettleRequestForVersion, ay as buildSettleRequestV2, cZ as buildUnavailableResponse, az as buildVerifyRequest, aA as buildVerifyRequestForVersion, aB as buildVerifyRequestV2, c_ as canRefundEscrow, c$ as canReleaseEscrow, d0 as carryFailureFields, aD as create402Response, aE as createFetchPaywall, aF as createHonoMiddleware, aG as createIdempotencyKey, aH as createPaymentMiddleware, d1 as epochToDate, d2 as escrowTimeRemaining, aN as extractPaymentFromHeaders, aO as facilitatorFetch, aP as getCorsHeaders, d3 as getEscrowContractsByChainId, d4 as getEscrowOperatorGeneration, d5 as getEscrowSupportedChainIds, d6 as isAlive, aQ as isAmbiguousLeaseReason, aR as isAuthorizationAlreadyUsed, aS as isAuthorizationInFlight, d7 as isEscrowExpired, d8 as isEscrowSupportedOnChain, d9 as isRegisterJobTerminal, aU as isReplayableLeaseReason, aV as isSettlementUnconfirmed, aY as parseFacilitatorErrorBody, da as parsePaymentHeader, aZ as parseRetryAfterSeconds, b1 as readFacilitatorError, b3 as resolveEnvelopeVersion, db as supportsRelayedFeedback, dc as supportsSolanaFeedback, ba as toPaymentRequirementsV2, bb as toResourceInfoV2, dd as wireNetwork, be as withDiscoverable } from '../escrow-contracts-RTO6mJCW.js';
@@ -5786,13 +5786,14 @@ var Erc8004Client = class {
5786
5786
  });
5787
5787
  clearTimeout(timeoutId);
5788
5788
  if (!response.ok) {
5789
- const errorText = await response.text();
5789
+ const info = await readFacilitatorError(response);
5790
5790
  return {
5791
5791
  success: false,
5792
5792
  delegated: false,
5793
5793
  chainId: 0,
5794
- error: `Facilitator error: ${response.status} - ${errorText}`,
5795
- network: request.network
5794
+ error: info.error,
5795
+ network: request.network,
5796
+ ...failureFields(info)
5796
5797
  };
5797
5798
  }
5798
5799
  return refuseInexactRelayTypedData(await response.json(), request.network);
@@ -5803,7 +5804,8 @@ var Erc8004Client = class {
5803
5804
  delegated: false,
5804
5805
  chainId: 0,
5805
5806
  error: error instanceof Error ? error.message : "Unknown error",
5806
- network: request.network
5807
+ network: request.network,
5808
+ retryable: true
5807
5809
  };
5808
5810
  }
5809
5811
  }