uvd-x402-sdk 2.87.0 → 2.89.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 (73) hide show
  1. package/README.md +235 -0
  2. package/dist/adapters/index.d.mts +1 -1
  3. package/dist/adapters/index.d.ts +1 -1
  4. package/dist/adapters/index.js.map +1 -1
  5. package/dist/adapters/index.mjs.map +1 -1
  6. package/dist/backend/index.d.mts +2 -2
  7. package/dist/backend/index.d.ts +2 -2
  8. package/dist/backend/index.js +138 -0
  9. package/dist/backend/index.js.map +1 -1
  10. package/dist/backend/index.mjs +137 -1
  11. package/dist/backend/index.mjs.map +1 -1
  12. package/dist/erc8128/index.js.map +1 -1
  13. package/dist/erc8128/index.mjs.map +1 -1
  14. package/dist/{index-D8buGZWY.d.mts → index-13ZUDF7c.d.mts} +32 -2
  15. package/dist/{index-CWZUj5mz.d.ts → index-B5B9EK3x.d.ts} +32 -2
  16. package/dist/{index-DOBhTF-j.d.mts → index-BWN0Haa0.d.mts} +476 -2
  17. package/dist/{index-DOBhTF-j.d.ts → index-BWN0Haa0.d.ts} +476 -2
  18. package/dist/{index-BHfYxpzI.d.mts → index-CAJg-_cr.d.mts} +181 -2
  19. package/dist/{index-D67eNxY8.d.ts → index-Cd1Mpznb.d.ts} +181 -2
  20. package/dist/index.d.mts +4 -4
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +472 -8
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +464 -9
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/providers/algorand/index.d.mts +1 -1
  27. package/dist/providers/algorand/index.d.ts +1 -1
  28. package/dist/providers/algorand/index.js.map +1 -1
  29. package/dist/providers/algorand/index.mjs.map +1 -1
  30. package/dist/providers/evm/index.d.mts +1 -1
  31. package/dist/providers/evm/index.d.ts +1 -1
  32. package/dist/providers/evm/index.js.map +1 -1
  33. package/dist/providers/evm/index.mjs.map +1 -1
  34. package/dist/providers/near/index.d.mts +1 -1
  35. package/dist/providers/near/index.d.ts +1 -1
  36. package/dist/providers/near/index.js.map +1 -1
  37. package/dist/providers/near/index.mjs.map +1 -1
  38. package/dist/providers/solana/index.d.mts +1 -1
  39. package/dist/providers/solana/index.d.ts +1 -1
  40. package/dist/providers/solana/index.js.map +1 -1
  41. package/dist/providers/solana/index.mjs.map +1 -1
  42. package/dist/providers/stellar/index.d.mts +1 -1
  43. package/dist/providers/stellar/index.d.ts +1 -1
  44. package/dist/providers/stellar/index.js.map +1 -1
  45. package/dist/providers/stellar/index.mjs.map +1 -1
  46. package/dist/providers/sui/index.d.mts +1 -1
  47. package/dist/providers/sui/index.d.ts +1 -1
  48. package/dist/providers/sui/index.js.map +1 -1
  49. package/dist/providers/sui/index.mjs.map +1 -1
  50. package/dist/providers/xrpl/index.d.mts +1 -1
  51. package/dist/providers/xrpl/index.d.ts +1 -1
  52. package/dist/providers/xrpl/index.js.map +1 -1
  53. package/dist/providers/xrpl/index.mjs.map +1 -1
  54. package/dist/react/index.d.mts +3 -3
  55. package/dist/react/index.d.ts +3 -3
  56. package/dist/react/index.js +463 -8
  57. package/dist/react/index.js.map +1 -1
  58. package/dist/react/index.mjs +463 -8
  59. package/dist/react/index.mjs.map +1 -1
  60. package/dist/react/picker/index.d.mts +1 -1
  61. package/dist/react/picker/index.d.ts +1 -1
  62. package/dist/utils/index.d.mts +2 -2
  63. package/dist/utils/index.d.ts +2 -2
  64. package/dist/utils/index.js.map +1 -1
  65. package/dist/utils/index.mjs.map +1 -1
  66. package/dist/{validation-mSLW4tcO.d.mts → validation-B95g0MqC.d.mts} +1 -1
  67. package/dist/{validation-C7p3a6Ep.d.ts → validation-_Tcjm2gu.d.ts} +1 -1
  68. package/package.json +1 -1
  69. package/src/backend/index.ts +260 -0
  70. package/src/client/X402Client.ts +232 -9
  71. package/src/index.ts +28 -0
  72. package/src/policy.ts +804 -0
  73. package/src/types/index.ts +41 -0
@@ -1,3 +1,3 @@
1
1
  import '../wallet-w7BnImDG.mjs';
2
- import '../index-DOBhTF-j.mjs';
3
- export { A as AMBIGUOUS_LEASE_REASONS, ab as AdvancedAuthorizationResult, ac as AdvancedEscrowClient, ad as AdvancedEscrowClientOptions, ae as AdvancedEscrowContracts, af as AdvancedEscrowTaskTier, ag as AdvancedPaymentInfo, ah as AdvancedTransactionResult, ai as AgentId, aj as AgentIdentity, ak as AgentRegistration, al as AgentRegistrationFile, am as AgentService, an as AtomStats, ao as BASE_MAINNET_CONTRACTS, ap as BazaarClient, aq as BazaarClientOptions, ar as BazaarDiscoverOptions, as as BazaarDiscoverResponse, at as BazaarRegisterOptions, au as BazaarResource, av as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, a as DEFAULT_RETRY_AFTER_SECONDS, aw as DEPOSIT_LIMIT_USDC, ax as DiscoveryAccepts, ay as DiscoveryCuration, az as DiscoveryHealth, aA as DiscoveryHealthStatus, aB as DiscoveryListOptions, aC as DiscoveryPagination, aD as DiscoveryRegisterOptions, aE as DiscoveryResource, aF as DiscoveryResponse, aG as DiscoverySource, aH as DiscoveryStats, aI as DiscoveryTier, aJ as Dispute, aK as DisputeOutcome, aL as ERC8004_CONTRACTS, aM as ERC8004_EXTENSION_ID, aN as ESCROW_CONTRACTS, aO as ESCROW_TIMEOUT_MS, aP as Erc8004Client, aQ as Erc8004ClientOptions, aR as Erc8004LookupError, aS as Erc8004Network, aT as EscrowClient, aU as EscrowClientOptions, aV as EscrowPayment, aW as EscrowStateResponse, aX as EscrowStatus, F as FacilitatorClient, b as FacilitatorClientOptions, c as FacilitatorErrorInfo, d as FacilitatorFailureFields, e as FacilitatorFetchOptions, aY as FeedbackEntry, aZ as FeedbackParams, a_ as FeedbackRequest, a$ as FeedbackResponse, b0 as HEALTH_FILTERS, H as HonoMiddlewareOptions, b1 as IdentityByOwnerResponse, b2 as IdentityMetadataResponse, b3 as IdentityTotalSupplyResponse, b4 as LifecycleAuthOptions, M as MAX_RETRY_AFTER_SECONDS, b5 as MAX_SEARCH_LEN, b6 as MetadataEntryParam, b7 as OPERATOR_ABI, b8 as OPERATOR_ABI_CREATE3, b9 as PAYMENT_INFO_TYPEHASH, P as ParsedFacilitatorErrorBody, q as PaymentAcceptance, r as PaymentMiddlewareOptions, s as PaymentPayloadV2, ba as PaymentRequirementResolver, bb as PaymentRequirements, bc as PaymentRequirementsOptions, t as PaymentRequirementsV2, bd as PrepareRelayFeedbackRequest, be as PrepareRelayFeedbackResponse, bf as PrepareRelayResponseRequest, bg as ProofOfPayment, bh as RELAYED_FEEDBACK_NETWORKS, R as REPLAYABLE_LEASE_REASONS, bi as RefundRequest, bj as RefundStatus, bk as RegisterAgentRequest, bl as RegisterAgentResponse, bm as RegisterJobResponse, bn as RegisterJobStatus, bo as RegistrationPendingError, bp as RelayAuthorizationParams, bq as ReputationResponse, br as ReputationSummary, bs as RequestRefundOptions, u as ResourceInfoV2, S as SETTLEMENT_UNCONFIRMED, bt as SettleRequest, v as SettleRequestV2, bu as SettleResponse, bv as SettleResponseWithProof, bw as SubmitRelayFeedbackRequest, bx as SubmitRelayResponseRequest, by as TIER_FILTERS, bz as TIER_TIMINGS, bA as USDC_DOMAIN_NAME, bB as UnavailableBody, bC as UnavailableResponse, V as VerifiedPaymentState, bD as VerifyRequest, w as VerifyRequestV2, bE as VerifyResponse, W as WRITER_LEASE_REASONS, y as WriterLeaseReason, X as X402_CORS_HEADERS, z as X402_HEADER_NAMES, bF as ZERO_ADDRESS, bG as buildErc8004PaymentRequirements, G as buildPaymentRequirements, I as buildSettleRequest, J as buildSettleRequestForVersion, K as buildSettleRequestV2, bH as buildUnavailableResponse, N as buildVerifyRequest, O as buildVerifyRequestForVersion, Q as buildVerifyRequestV2, bI as canRefundEscrow, bJ as canReleaseEscrow, bK as carryFailureFields, T as create402Response, U as createHonoMiddleware, Y as createPaymentMiddleware, bL as epochToDate, bM as escrowTimeRemaining, Z as extractPaymentFromHeaders, _ as facilitatorFetch, $ as getCorsHeaders, bN as getEscrowContractsByChainId, bO as getEscrowSupportedChainIds, bP as isAlive, a0 as isAmbiguousLeaseReason, bQ as isEscrowExpired, bR as isEscrowSupportedOnChain, bS as isRegisterJobTerminal, a1 as isReplayableLeaseReason, a2 as isSettlementUnconfirmed, a4 as parseFacilitatorErrorBody, bT as parsePaymentHeader, a5 as parseRetryAfterSeconds, a6 as readFacilitatorError, a7 as resolveEnvelopeVersion, bU as supportsRelayedFeedback, a8 as toPaymentRequirementsV2, a9 as toResourceInfoV2, bV as wireNetwork } from '../index-BHfYxpzI.mjs';
2
+ import '../index-BWN0Haa0.mjs';
3
+ export { A as AMBIGUOUS_LEASE_REASONS, ab as AdvancedAuthorizationResult, ac as AdvancedEscrowClient, ad as AdvancedEscrowClientOptions, ae as AdvancedEscrowContracts, af as AdvancedEscrowTaskTier, ag as AdvancedPaymentInfo, ah as AdvancedTransactionResult, ai as AgentId, aj as AgentIdentity, ak as AgentRegistration, al as AgentRegistrationFile, am as AgentService, an as AtomStats, ao as BASE_MAINNET_CONTRACTS, ap as BazaarClient, aq as BazaarClientOptions, ar as BazaarDiscoverOptions, as as BazaarDiscoverResponse, at as BazaarRegisterOptions, au as BazaarResource, av as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, a as DEFAULT_RETRY_AFTER_SECONDS, aw as DEPOSIT_LIMIT_USDC, ax as DiscoveryAccepts, ay as DiscoveryCuration, az as DiscoveryHealth, aA as DiscoveryHealthStatus, aB as DiscoveryListOptions, aC as DiscoveryPagination, aD as DiscoveryRegisterOptions, aE as DiscoveryResource, aF as DiscoveryResponse, aG as DiscoverySource, aH as DiscoveryStats, aI as DiscoveryTier, aJ as Dispute, aK as DisputeOutcome, aL as ERC8004_CONTRACTS, aM as ERC8004_EXTENSION_ID, aN as ESCROW_CONTRACTS, aO as ESCROW_TIMEOUT_MS, aP as Erc8004Client, aQ as Erc8004ClientOptions, aR as Erc8004LookupError, aS as Erc8004Network, aT as EscrowClient, aU as EscrowClientOptions, aV as EscrowPayment, aW as EscrowStateResponse, aX as EscrowStatus, F as FacilitatorClient, b as FacilitatorClientOptions, c as FacilitatorErrorInfo, d as FacilitatorFailureFields, e as FacilitatorFetchOptions, aY as FeedbackEntry, aZ as FeedbackParams, a_ as FeedbackRequest, a$ as FeedbackResponse, b0 as HEALTH_FILTERS, H as HonoMiddlewareOptions, b1 as IdentityByOwnerResponse, b2 as IdentityMetadataResponse, b3 as IdentityTotalSupplyResponse, b4 as LifecycleAuthOptions, M as MAX_RETRY_AFTER_SECONDS, b5 as MAX_SEARCH_LEN, b6 as MetadataEntryParam, b7 as OPERATOR_ABI, b8 as OPERATOR_ABI_CREATE3, b9 as PAYMENT_INFO_TYPEHASH, P as ParsedFacilitatorErrorBody, q as PaymentAcceptance, r as PaymentMiddlewareOptions, s as PaymentPayloadV2, ba as PaymentRequirementResolver, bb as PaymentRequirements, bc as PaymentRequirementsOptions, t as PaymentRequirementsV2, bd as PrepareRelayFeedbackRequest, be as PrepareRelayFeedbackResponse, bf as PrepareRelayResponseRequest, bg as PrepareSolanaFeedbackRequest, bh as PrepareSolanaFeedbackResponse, bi as ProofOfPayment, bj as RELAYED_FEEDBACK_NETWORKS, R as REPLAYABLE_LEASE_REASONS, bk as RefundRequest, bl as RefundStatus, bm as RegisterAgentRequest, bn as RegisterAgentResponse, bo as RegisterJobResponse, bp as RegisterJobStatus, bq as RegistrationPendingError, br as RelayAuthorizationParams, bs as ReputationResponse, bt as ReputationSummary, bu as RequestRefundOptions, u as ResourceInfoV2, S as SETTLEMENT_UNCONFIRMED, bv as SOLANA_FEEDBACK_NETWORKS, bw as SettleRequest, v as SettleRequestV2, bx as SettleResponse, by as SettleResponseWithProof, bz as SubmitRelayFeedbackRequest, bA as SubmitRelayResponseRequest, bB as SubmitSolanaFeedbackRequest, bC as TIER_FILTERS, bD as TIER_TIMINGS, bE as USDC_DOMAIN_NAME, bF as UnavailableBody, bG as UnavailableResponse, V as VerifiedPaymentState, bH as VerifyRequest, w as VerifyRequestV2, bI as VerifyResponse, W as WRITER_LEASE_REASONS, y as WriterLeaseReason, X as X402_CORS_HEADERS, z as X402_HEADER_NAMES, bJ as ZERO_ADDRESS, bK as buildErc8004PaymentRequirements, G as buildPaymentRequirements, I as buildSettleRequest, J as buildSettleRequestForVersion, K as buildSettleRequestV2, bL as buildUnavailableResponse, N as buildVerifyRequest, O as buildVerifyRequestForVersion, Q as buildVerifyRequestV2, bM as canRefundEscrow, bN as canReleaseEscrow, bO as carryFailureFields, T as create402Response, U as createHonoMiddleware, Y as createPaymentMiddleware, bP as epochToDate, bQ as escrowTimeRemaining, Z as extractPaymentFromHeaders, _ as facilitatorFetch, $ as getCorsHeaders, bR as getEscrowContractsByChainId, bS as getEscrowSupportedChainIds, bT as isAlive, a0 as isAmbiguousLeaseReason, bU as isEscrowExpired, bV as isEscrowSupportedOnChain, bW as isRegisterJobTerminal, a1 as isReplayableLeaseReason, a2 as isSettlementUnconfirmed, a4 as parseFacilitatorErrorBody, bX as parsePaymentHeader, a5 as parseRetryAfterSeconds, a6 as readFacilitatorError, a7 as resolveEnvelopeVersion, bY as supportsRelayedFeedback, bZ as supportsSolanaFeedback, a8 as toPaymentRequirementsV2, a9 as toResourceInfoV2, b_ as wireNetwork } from '../index-CAJg-_cr.mjs';
@@ -1,3 +1,3 @@
1
1
  import '../wallet-w7BnImDG.js';
2
- import '../index-DOBhTF-j.js';
3
- export { A as AMBIGUOUS_LEASE_REASONS, ab as AdvancedAuthorizationResult, ac as AdvancedEscrowClient, ad as AdvancedEscrowClientOptions, ae as AdvancedEscrowContracts, af as AdvancedEscrowTaskTier, ag as AdvancedPaymentInfo, ah as AdvancedTransactionResult, ai as AgentId, aj as AgentIdentity, ak as AgentRegistration, al as AgentRegistrationFile, am as AgentService, an as AtomStats, ao as BASE_MAINNET_CONTRACTS, ap as BazaarClient, aq as BazaarClientOptions, ar as BazaarDiscoverOptions, as as BazaarDiscoverResponse, at as BazaarRegisterOptions, au as BazaarResource, av as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, a as DEFAULT_RETRY_AFTER_SECONDS, aw as DEPOSIT_LIMIT_USDC, ax as DiscoveryAccepts, ay as DiscoveryCuration, az as DiscoveryHealth, aA as DiscoveryHealthStatus, aB as DiscoveryListOptions, aC as DiscoveryPagination, aD as DiscoveryRegisterOptions, aE as DiscoveryResource, aF as DiscoveryResponse, aG as DiscoverySource, aH as DiscoveryStats, aI as DiscoveryTier, aJ as Dispute, aK as DisputeOutcome, aL as ERC8004_CONTRACTS, aM as ERC8004_EXTENSION_ID, aN as ESCROW_CONTRACTS, aO as ESCROW_TIMEOUT_MS, aP as Erc8004Client, aQ as Erc8004ClientOptions, aR as Erc8004LookupError, aS as Erc8004Network, aT as EscrowClient, aU as EscrowClientOptions, aV as EscrowPayment, aW as EscrowStateResponse, aX as EscrowStatus, F as FacilitatorClient, b as FacilitatorClientOptions, c as FacilitatorErrorInfo, d as FacilitatorFailureFields, e as FacilitatorFetchOptions, aY as FeedbackEntry, aZ as FeedbackParams, a_ as FeedbackRequest, a$ as FeedbackResponse, b0 as HEALTH_FILTERS, H as HonoMiddlewareOptions, b1 as IdentityByOwnerResponse, b2 as IdentityMetadataResponse, b3 as IdentityTotalSupplyResponse, b4 as LifecycleAuthOptions, M as MAX_RETRY_AFTER_SECONDS, b5 as MAX_SEARCH_LEN, b6 as MetadataEntryParam, b7 as OPERATOR_ABI, b8 as OPERATOR_ABI_CREATE3, b9 as PAYMENT_INFO_TYPEHASH, P as ParsedFacilitatorErrorBody, q as PaymentAcceptance, r as PaymentMiddlewareOptions, s as PaymentPayloadV2, ba as PaymentRequirementResolver, bb as PaymentRequirements, bc as PaymentRequirementsOptions, t as PaymentRequirementsV2, bd as PrepareRelayFeedbackRequest, be as PrepareRelayFeedbackResponse, bf as PrepareRelayResponseRequest, bg as ProofOfPayment, bh as RELAYED_FEEDBACK_NETWORKS, R as REPLAYABLE_LEASE_REASONS, bi as RefundRequest, bj as RefundStatus, bk as RegisterAgentRequest, bl as RegisterAgentResponse, bm as RegisterJobResponse, bn as RegisterJobStatus, bo as RegistrationPendingError, bp as RelayAuthorizationParams, bq as ReputationResponse, br as ReputationSummary, bs as RequestRefundOptions, u as ResourceInfoV2, S as SETTLEMENT_UNCONFIRMED, bt as SettleRequest, v as SettleRequestV2, bu as SettleResponse, bv as SettleResponseWithProof, bw as SubmitRelayFeedbackRequest, bx as SubmitRelayResponseRequest, by as TIER_FILTERS, bz as TIER_TIMINGS, bA as USDC_DOMAIN_NAME, bB as UnavailableBody, bC as UnavailableResponse, V as VerifiedPaymentState, bD as VerifyRequest, w as VerifyRequestV2, bE as VerifyResponse, W as WRITER_LEASE_REASONS, y as WriterLeaseReason, X as X402_CORS_HEADERS, z as X402_HEADER_NAMES, bF as ZERO_ADDRESS, bG as buildErc8004PaymentRequirements, G as buildPaymentRequirements, I as buildSettleRequest, J as buildSettleRequestForVersion, K as buildSettleRequestV2, bH as buildUnavailableResponse, N as buildVerifyRequest, O as buildVerifyRequestForVersion, Q as buildVerifyRequestV2, bI as canRefundEscrow, bJ as canReleaseEscrow, bK as carryFailureFields, T as create402Response, U as createHonoMiddleware, Y as createPaymentMiddleware, bL as epochToDate, bM as escrowTimeRemaining, Z as extractPaymentFromHeaders, _ as facilitatorFetch, $ as getCorsHeaders, bN as getEscrowContractsByChainId, bO as getEscrowSupportedChainIds, bP as isAlive, a0 as isAmbiguousLeaseReason, bQ as isEscrowExpired, bR as isEscrowSupportedOnChain, bS as isRegisterJobTerminal, a1 as isReplayableLeaseReason, a2 as isSettlementUnconfirmed, a4 as parseFacilitatorErrorBody, bT as parsePaymentHeader, a5 as parseRetryAfterSeconds, a6 as readFacilitatorError, a7 as resolveEnvelopeVersion, bU as supportsRelayedFeedback, a8 as toPaymentRequirementsV2, a9 as toResourceInfoV2, bV as wireNetwork } from '../index-D67eNxY8.js';
2
+ import '../index-BWN0Haa0.js';
3
+ export { A as AMBIGUOUS_LEASE_REASONS, ab as AdvancedAuthorizationResult, ac as AdvancedEscrowClient, ad as AdvancedEscrowClientOptions, ae as AdvancedEscrowContracts, af as AdvancedEscrowTaskTier, ag as AdvancedPaymentInfo, ah as AdvancedTransactionResult, ai as AgentId, aj as AgentIdentity, ak as AgentRegistration, al as AgentRegistrationFile, am as AgentService, an as AtomStats, ao as BASE_MAINNET_CONTRACTS, ap as BazaarClient, aq as BazaarClientOptions, ar as BazaarDiscoverOptions, as as BazaarDiscoverResponse, at as BazaarRegisterOptions, au as BazaarResource, av as CreateEscrowOptions, D as DEFAULT_FACILITATOR_RETRIES, a as DEFAULT_RETRY_AFTER_SECONDS, aw as DEPOSIT_LIMIT_USDC, ax as DiscoveryAccepts, ay as DiscoveryCuration, az as DiscoveryHealth, aA as DiscoveryHealthStatus, aB as DiscoveryListOptions, aC as DiscoveryPagination, aD as DiscoveryRegisterOptions, aE as DiscoveryResource, aF as DiscoveryResponse, aG as DiscoverySource, aH as DiscoveryStats, aI as DiscoveryTier, aJ as Dispute, aK as DisputeOutcome, aL as ERC8004_CONTRACTS, aM as ERC8004_EXTENSION_ID, aN as ESCROW_CONTRACTS, aO as ESCROW_TIMEOUT_MS, aP as Erc8004Client, aQ as Erc8004ClientOptions, aR as Erc8004LookupError, aS as Erc8004Network, aT as EscrowClient, aU as EscrowClientOptions, aV as EscrowPayment, aW as EscrowStateResponse, aX as EscrowStatus, F as FacilitatorClient, b as FacilitatorClientOptions, c as FacilitatorErrorInfo, d as FacilitatorFailureFields, e as FacilitatorFetchOptions, aY as FeedbackEntry, aZ as FeedbackParams, a_ as FeedbackRequest, a$ as FeedbackResponse, b0 as HEALTH_FILTERS, H as HonoMiddlewareOptions, b1 as IdentityByOwnerResponse, b2 as IdentityMetadataResponse, b3 as IdentityTotalSupplyResponse, b4 as LifecycleAuthOptions, M as MAX_RETRY_AFTER_SECONDS, b5 as MAX_SEARCH_LEN, b6 as MetadataEntryParam, b7 as OPERATOR_ABI, b8 as OPERATOR_ABI_CREATE3, b9 as PAYMENT_INFO_TYPEHASH, P as ParsedFacilitatorErrorBody, q as PaymentAcceptance, r as PaymentMiddlewareOptions, s as PaymentPayloadV2, ba as PaymentRequirementResolver, bb as PaymentRequirements, bc as PaymentRequirementsOptions, t as PaymentRequirementsV2, bd as PrepareRelayFeedbackRequest, be as PrepareRelayFeedbackResponse, bf as PrepareRelayResponseRequest, bg as PrepareSolanaFeedbackRequest, bh as PrepareSolanaFeedbackResponse, bi as ProofOfPayment, bj as RELAYED_FEEDBACK_NETWORKS, R as REPLAYABLE_LEASE_REASONS, bk as RefundRequest, bl as RefundStatus, bm as RegisterAgentRequest, bn as RegisterAgentResponse, bo as RegisterJobResponse, bp as RegisterJobStatus, bq as RegistrationPendingError, br as RelayAuthorizationParams, bs as ReputationResponse, bt as ReputationSummary, bu as RequestRefundOptions, u as ResourceInfoV2, S as SETTLEMENT_UNCONFIRMED, bv as SOLANA_FEEDBACK_NETWORKS, bw as SettleRequest, v as SettleRequestV2, bx as SettleResponse, by as SettleResponseWithProof, bz as SubmitRelayFeedbackRequest, bA as SubmitRelayResponseRequest, bB as SubmitSolanaFeedbackRequest, bC as TIER_FILTERS, bD as TIER_TIMINGS, bE as USDC_DOMAIN_NAME, bF as UnavailableBody, bG as UnavailableResponse, V as VerifiedPaymentState, bH as VerifyRequest, w as VerifyRequestV2, bI as VerifyResponse, W as WRITER_LEASE_REASONS, y as WriterLeaseReason, X as X402_CORS_HEADERS, z as X402_HEADER_NAMES, bJ as ZERO_ADDRESS, bK as buildErc8004PaymentRequirements, G as buildPaymentRequirements, I as buildSettleRequest, J as buildSettleRequestForVersion, K as buildSettleRequestV2, bL as buildUnavailableResponse, N as buildVerifyRequest, O as buildVerifyRequestForVersion, Q as buildVerifyRequestV2, bM as canRefundEscrow, bN as canReleaseEscrow, bO as carryFailureFields, T as create402Response, U as createHonoMiddleware, Y as createPaymentMiddleware, bP as epochToDate, bQ as escrowTimeRemaining, Z as extractPaymentFromHeaders, _ as facilitatorFetch, $ as getCorsHeaders, bR as getEscrowContractsByChainId, bS as getEscrowSupportedChainIds, bT as isAlive, a0 as isAmbiguousLeaseReason, bU as isEscrowExpired, bV as isEscrowSupportedOnChain, bW as isRegisterJobTerminal, a1 as isReplayableLeaseReason, a2 as isSettlementUnconfirmed, a4 as parseFacilitatorErrorBody, bX as parsePaymentHeader, a5 as parseRetryAfterSeconds, a6 as readFacilitatorError, a7 as resolveEnvelopeVersion, bY as supportsRelayedFeedback, bZ as supportsSolanaFeedback, a8 as toPaymentRequirementsV2, a9 as toResourceInfoV2, b_ as wireNetwork } from '../index-Cd1Mpznb.js';
@@ -3152,6 +3152,13 @@ var RELAYED_FEEDBACK_NETWORKS = [
3152
3152
  function supportsRelayedFeedback(network) {
3153
3153
  return RELAYED_FEEDBACK_NETWORKS.includes(wireNetwork(network));
3154
3154
  }
3155
+ var SOLANA_FEEDBACK_NETWORKS = [
3156
+ "solana",
3157
+ "solana-devnet"
3158
+ ];
3159
+ function supportsSolanaFeedback(network) {
3160
+ return SOLANA_FEEDBACK_NETWORKS.includes(wireNetwork(network));
3161
+ }
3155
3162
  var Erc8004LookupError = class extends Error {
3156
3163
  /** HTTP status returned by the facilitator */
3157
3164
  status;
@@ -3632,6 +3639,135 @@ var Erc8004Client = class {
3632
3639
  };
3633
3640
  }
3634
3641
  }
3642
+ /**
3643
+ * Ask the facilitator for the Solana transaction the rater must sign.
3644
+ *
3645
+ * Step 1 of the rater-authored rail on Solana. Writes nothing on-chain and
3646
+ * costs nothing: it resolves the programs and the agent asset, reads the
3647
+ * registry collection and a finalized blockhash, and hands back an UNSIGNED
3648
+ * transaction whose `client` account is the rater.
3649
+ *
3650
+ * Why this exists, and why it is not the EVM rail: the program's
3651
+ * `give_feedback` instruction declares account 0 as
3652
+ * `[signer, writable] client (feedback author / fee payer)`, and plain
3653
+ * `POST /feedback` puts the FACILITATOR's keypair there — so the chain
3654
+ * records the facilitator as the author of the rating. Solana carries several
3655
+ * signers per transaction natively, so the rater signs as `client` while the
3656
+ * facilitator stays the fee payer. **No delegation and no program change**,
3657
+ * which is why {@link SOLANA_FEEDBACK_NETWORKS} is its own list and `solana`
3658
+ * must never appear in {@link RELAYED_FEEDBACK_NETWORKS} — that one routes to
3659
+ * `/feedback/evm/*`, which answers 400 here.
3660
+ *
3661
+ * What to do with the answer:
3662
+ * 1. Deserialise `transaction` — base64 of the bincode-serialised **legacy**
3663
+ * transaction, which is `@solana/web3.js`'s `Transaction.from()`, not
3664
+ * `VersionedTransaction` — and add the RATER's ed25519 signature. Sign the
3665
+ * message as it came: re-encoding it changes bytes the facilitator will
3666
+ * compare. The fee payer's slot stays empty; `submit` fills it.
3667
+ * 2. Hand it back to {@link Erc8004Client.submitSolanaFeedback} with the SAME
3668
+ * feedback parameters, before `lastValidBlockHeight` passes.
3669
+ *
3670
+ * @param request - Network, rater pubkey and feedback parameters
3671
+ * @returns The unsigned transaction, the fee payer and the blockhash window
3672
+ *
3673
+ * @example
3674
+ * ```ts
3675
+ * import { Transaction } from '@solana/web3.js';
3676
+ *
3677
+ * const prep = await erc8004.prepareSolanaFeedback({
3678
+ * x402Version: 1,
3679
+ * network: 'solana',
3680
+ * feedback: {
3681
+ * agentId: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgHkv',
3682
+ * rater: raterPubkey, // base58: who the chain records as the author
3683
+ * value: 87,
3684
+ * score: 95, // without it the rating counts for nothing
3685
+ * tag1: 'quality',
3686
+ * },
3687
+ * });
3688
+ *
3689
+ * const tx = Transaction.from(Buffer.from(prep.transaction!, 'base64'));
3690
+ * tx.partialSign(raterKeypair);
3691
+ * ```
3692
+ */
3693
+ async prepareSolanaFeedback(request) {
3694
+ const url = `${this.baseUrl}/feedback/solana/prepare`;
3695
+ const controller = new AbortController();
3696
+ const timeoutId = setTimeout(() => controller.abort(), this.timeout);
3697
+ try {
3698
+ const response = await fetch(url, {
3699
+ method: "POST",
3700
+ headers: {
3701
+ "Content-Type": "application/json",
3702
+ "Accept": "application/json"
3703
+ },
3704
+ body: JSON.stringify({ ...request, network: wireNetwork(request.network) }),
3705
+ signal: controller.signal
3706
+ });
3707
+ clearTimeout(timeoutId);
3708
+ if (!response.ok) {
3709
+ const errorText = await response.text();
3710
+ return {
3711
+ success: false,
3712
+ error: `Facilitator error: ${response.status} - ${errorText}`,
3713
+ network: request.network
3714
+ };
3715
+ }
3716
+ return await response.json();
3717
+ } catch (error) {
3718
+ clearTimeout(timeoutId);
3719
+ return {
3720
+ success: false,
3721
+ error: error instanceof Error ? error.message : "Unknown error",
3722
+ network: request.network
3723
+ };
3724
+ }
3725
+ }
3726
+ /**
3727
+ * Co-sign and send a rater-signed Solana feedback transaction.
3728
+ *
3729
+ * Step 2 of the rater-authored rail on Solana. What lands on-chain has the
3730
+ * RATER as `client`, so the agent's feedback lists the rater rather than the
3731
+ * facilitator — and only the rater can revoke it.
3732
+ *
3733
+ * Pass back the same feedback parameters {@link Erc8004Client.prepareSolanaFeedback}
3734
+ * was given. They are not redundant: the facilitator re-derives the message
3735
+ * from them plus the blockhash inside the submitted transaction, and refuses
3736
+ * to co-sign anything that is not byte-for-byte what it built
3737
+ * (`400 "submitted transaction does not match the one this facilitator built"`).
3738
+ * The rater's signature is verified BEFORE the facilitator adds its own, so a
3739
+ * transaction the network would reject never costs a fee.
3740
+ *
3741
+ * @param request - Feedback parameters plus the rater-signed transaction
3742
+ * @returns Feedback response with the transaction signature
3743
+ */
3744
+ async submitSolanaFeedback(request) {
3745
+ const url = `${this.baseUrl}/feedback/solana/submit`;
3746
+ try {
3747
+ const { response, error } = await this.writeJson(url, {
3748
+ ...request,
3749
+ network: wireNetwork(request.network)
3750
+ });
3751
+ if (error) {
3752
+ return {
3753
+ success: false,
3754
+ error: error.error,
3755
+ network: request.network,
3756
+ ...failureFields(error)
3757
+ };
3758
+ }
3759
+ return await response.json();
3760
+ } catch (error) {
3761
+ return {
3762
+ success: false,
3763
+ error: error instanceof Error ? error.message : "Unknown error",
3764
+ network: request.network,
3765
+ retryable: true,
3766
+ safeToReplay: false,
3767
+ retryAfterSeconds: DEFAULT_RETRY_AFTER_SECONDS
3768
+ };
3769
+ }
3770
+ }
3635
3771
  /**
3636
3772
  * Revoke previously submitted feedback
3637
3773
  *
@@ -5155,6 +5291,7 @@ exports.RELAYED_FEEDBACK_NETWORKS = RELAYED_FEEDBACK_NETWORKS;
5155
5291
  exports.REPLAYABLE_LEASE_REASONS = REPLAYABLE_LEASE_REASONS;
5156
5292
  exports.RegistrationPendingError = RegistrationPendingError;
5157
5293
  exports.SETTLEMENT_UNCONFIRMED = SETTLEMENT_UNCONFIRMED;
5294
+ exports.SOLANA_FEEDBACK_NETWORKS = SOLANA_FEEDBACK_NETWORKS;
5158
5295
  exports.TIER_FILTERS = TIER_FILTERS;
5159
5296
  exports.TIER_TIMINGS = TIER_TIMINGS;
5160
5297
  exports.USDC_DOMAIN_NAME = USDC_DOMAIN_NAME;
@@ -5197,6 +5334,7 @@ exports.parseRetryAfterSeconds = parseRetryAfterSeconds;
5197
5334
  exports.readFacilitatorError = readFacilitatorError;
5198
5335
  exports.resolveEnvelopeVersion = resolveEnvelopeVersion;
5199
5336
  exports.supportsRelayedFeedback = supportsRelayedFeedback;
5337
+ exports.supportsSolanaFeedback = supportsSolanaFeedback;
5200
5338
  exports.toPaymentRequirementsV2 = toPaymentRequirementsV2;
5201
5339
  exports.toResourceInfoV2 = toResourceInfoV2;
5202
5340
  exports.wireNetwork = wireNetwork;