uvd-x402-sdk 2.104.3 → 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.
- package/README.md +39 -0
- package/dist/backend/index.d.mts +1 -1
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.js +6 -4
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs +6 -4
- package/dist/backend/index.mjs.map +1 -1
- package/dist/batch-settlement/index.d.mts +322 -0
- package/dist/batch-settlement/index.d.ts +322 -0
- package/dist/batch-settlement/index.js +585 -0
- package/dist/batch-settlement/index.js.map +1 -0
- package/dist/batch-settlement/index.mjs +555 -0
- package/dist/batch-settlement/index.mjs.map +1 -0
- package/dist/erc7702-CC-UIL7E.d.mts +158 -0
- package/dist/erc7702-CC-UIL7E.d.ts +158 -0
- package/dist/{escrow-contracts-amyDktMD.d.mts → escrow-contracts-D3iLODtY.d.mts} +2 -2
- package/dist/{escrow-contracts-Bf3PU_Ub.d.ts → escrow-contracts-RTO6mJCW.d.ts} +2 -2
- package/dist/index.d.mts +4 -159
- package/dist/index.d.ts +4 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/reputation/index.d.mts +1159 -0
- package/dist/reputation/index.d.ts +1159 -0
- package/dist/reputation/index.js +3670 -0
- package/dist/reputation/index.js.map +1 -0
- package/dist/reputation/index.mjs +3603 -0
- package/dist/reputation/index.mjs.map +1 -0
- package/package.json +23 -2
- package/src/backend/index.ts +8 -3
- package/src/batch-settlement.ts +882 -0
- package/src/reputation/README.md +167 -0
- package/src/reputation/canonical.ts +76 -0
- package/src/reputation/constants.ts +136 -0
- package/src/reputation/directory.ts +60 -0
- package/src/reputation/errors.ts +108 -0
- package/src/reputation/evidence.ts +321 -0
- package/src/reputation/governor.ts +389 -0
- package/src/reputation/index.ts +144 -0
- package/src/reputation/message-ref.ts +63 -0
- package/src/reputation/outbox.ts +510 -0
- package/src/reputation/payment.ts +490 -0
- package/src/reputation/redact.ts +82 -0
- package/src/reputation/sign.ts +227 -0
- package/src/reputation/sqlite-outbox.ts +244 -0
- package/src/reputation/submit.ts +1005 -0
- package/src/reputation/validate.ts +372 -0
- package/src/reputation/values.ts +106 -0
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ Users sign a message or transaction, and the Ultravioleta facilitator handles on
|
|
|
23
23
|
- **Escrow & Refunds**: Hold payments with dispute resolution
|
|
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
|
+
- **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
|
|
26
28
|
- **Commerce Scheme**: `'commerce'` scheme alias for marketplace integrations (identical to `'escrow'` on-chain)
|
|
27
29
|
- **`/accepts` Negotiation**: Discover facilitator capabilities before constructing payments
|
|
28
30
|
- **Bazaar Discovery**: Register and discover paid resources across the x402 network
|
|
@@ -686,6 +688,43 @@ const paymentAuth = await buildEscrowPreAuth(new EnvKeyAdapter(), {
|
|
|
686
688
|
|
|
687
689
|
Any `SigningWalletAdapter` works as the signer (only `signTypedData` is used); browser wallets can pass a minimal `{ signTypedData }` wrapper. Validation fails loud instead of falling back: incomplete network config, unknown tier, bounty outside the on-chain deposit limit ($100), or a `maxFeeBps` below the operator's 1300 bps all throw before anything is signed. What the config asserts is also checked against the SDK's own tables before signing, as in the Python SDK: the `chain_id` against the `network` you name (a registry name or `eip155:<id>`), the escrow, token collector and USDC against `ESCROW_CONTRACTS`, the operator against `ESCROW_OPERATORS`, `maxFeeBps` against the chain's ceiling in `ESCROW_MAX_FEE_BPS`, and the USDC EIP-712 domain (`usdc_domain_name` / `usdc_domain_version`) against the token's on-chain domain in `VERIFIED_USDC_DOMAINS`. A contradiction throws `INVALID_CONFIG`, and so do a `network` the SDK does not register and a chain without a row in each of the four tables, with or without `network`; name the network you expect to pay on, from your own code, never one read from the config. A server-published tier window must be an integer from 0 to its `ESCROW_TIER_WINDOW_MAX`, and `authorizationExpiry` at most `ESCROW_MAX_AUTHORIZATION_SEC` after now: past either, the SDK refuses, it never clamps. `computeEscrowNonce` is exported to reproduce `AuthCaptureEscrow.getHash` externally.
|
|
688
690
|
|
|
691
|
+
## Batch Settlement (buyer)
|
|
692
|
+
|
|
693
|
+
The buyer side of the x402 `batch-settlement` scheme on EVM ([spec](https://github.com/coinbase/x402/tree/main/specs/schemes/batch-settlement)): the first paid request signs an ERC-3009 deposit into a payment channel plus a voucher, and every later request on that channel signs only the next cumulative voucher. Same API and the same golden vectors as the Python SDK's `uvd_x402_sdk.batch_settlement`.
|
|
694
|
+
|
|
695
|
+
```typescript
|
|
696
|
+
import { EnvKeyAdapter } from 'uvd-x402-sdk';
|
|
697
|
+
import { BatchSettlementClient, FileChannelStorage } from 'uvd-x402-sdk/batch-settlement';
|
|
698
|
+
|
|
699
|
+
const client = new BatchSettlementClient(new EnvKeyAdapter(), {
|
|
700
|
+
storage: new FileChannelStorage('./channels.json'), // Node; MemoryChannelStorage by default
|
|
701
|
+
maxDeposit: 1_000_000n, // the default: 1 USDC in atomic units
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
const prepared = await client.createPayment(accepted, { url }); // accepted = the 402's batch-settlement accept
|
|
705
|
+
const res = await fetch(url, { headers: { 'PAYMENT-SIGNATURE': prepared.header() } });
|
|
706
|
+
if (res.ok) await client.confirm(prepared, settleResponse.extra); // from the PAYMENT-RESPONSE header
|
|
707
|
+
```
|
|
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.
|
|
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
|
+
|
|
689
728
|
## Multi-Stablecoin (EVM)
|
|
690
729
|
|
|
691
730
|
```typescript
|
package/dist/backend/index.d.mts
CHANGED
|
@@ -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,
|
|
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';
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -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,
|
|
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';
|
package/dist/backend/index.js
CHANGED
|
@@ -5786,13 +5786,14 @@ var Erc8004Client = class {
|
|
|
5786
5786
|
});
|
|
5787
5787
|
clearTimeout(timeoutId);
|
|
5788
5788
|
if (!response.ok) {
|
|
5789
|
-
const
|
|
5789
|
+
const info = await readFacilitatorError(response);
|
|
5790
5790
|
return {
|
|
5791
5791
|
success: false,
|
|
5792
5792
|
delegated: false,
|
|
5793
5793
|
chainId: 0,
|
|
5794
|
-
error:
|
|
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
|
}
|