@haven_ai/sdk 0.12.0-alpha.0 → 0.13.0-alpha.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 (37) hide show
  1. package/dist/{base64-COaV1Sis.d.cts → base64-C3mJNLYR.d.cts} +2 -2
  2. package/dist/{base64-C5OrJLij.d.ts → base64-CxzIc3KH.d.ts} +2 -2
  3. package/dist/{chunk-V2ODMLDD.cjs → chunk-4Z7PKLFD.cjs} +35 -35
  4. package/dist/{chunk-V2ODMLDD.cjs.map → chunk-4Z7PKLFD.cjs.map} +1 -1
  5. package/dist/{chunk-WFTGZS24.js → chunk-CK6VRIPR.js} +3 -3
  6. package/dist/{chunk-WFTGZS24.js.map → chunk-CK6VRIPR.js.map} +1 -1
  7. package/dist/{chunk-7M3CIW7W.js → chunk-CXQ42FOA.js} +4 -4
  8. package/dist/{chunk-7M3CIW7W.js.map → chunk-CXQ42FOA.js.map} +1 -1
  9. package/dist/{chunk-ZA3NOSO2.cjs → chunk-LZHCIK7L.cjs} +2 -2
  10. package/dist/chunk-LZHCIK7L.cjs.map +1 -0
  11. package/dist/{chunk-UPEDQLAL.js → chunk-MI7LVP56.js} +2 -2
  12. package/dist/chunk-MI7LVP56.js.map +1 -0
  13. package/dist/{chunk-4JTLJVBS.cjs → chunk-Z5MTKU6O.cjs} +4 -4
  14. package/dist/{chunk-4JTLJVBS.cjs.map → chunk-Z5MTKU6O.cjs.map} +1 -1
  15. package/dist/edge.cjs +93 -93
  16. package/dist/edge.d.cts +4 -4
  17. package/dist/edge.d.ts +4 -4
  18. package/dist/edge.js +4 -4
  19. package/dist/index.cjs +347 -333
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +10 -6
  22. package/dist/index.d.ts +10 -6
  23. package/dist/index.js +21 -7
  24. package/dist/index.js.map +1 -1
  25. package/dist/{receipt-DyUInpvF.d.ts → receipt-CTOPh2fm.d.ts} +1 -1
  26. package/dist/{receipt-Dy77vCea.d.cts → receipt-DwRqGjGb.d.cts} +1 -1
  27. package/dist/test-support.cjs +58 -21
  28. package/dist/test-support.cjs.map +1 -1
  29. package/dist/test-support.d.cts +47 -3
  30. package/dist/test-support.d.ts +47 -3
  31. package/dist/test-support.js +37 -3
  32. package/dist/test-support.js.map +1 -1
  33. package/dist/{types-CAvsjRKi.d.ts → types-3vUBmumz.d.cts} +19 -0
  34. package/dist/{types-CAvsjRKi.d.cts → types-3vUBmumz.d.ts} +19 -0
  35. package/package.json +2 -2
  36. package/dist/chunk-UPEDQLAL.js.map +0 -1
  37. package/dist/chunk-ZA3NOSO2.cjs.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { P as PaymentReceipt, R as ReceiptVerification } from './receipt-Dy77vCea.cjs';
2
- export { a as RECEIPT_VERSION, v as verifyPaymentReceipt } from './receipt-Dy77vCea.cjs';
3
- import { M as MerchantEgressPolicy, H as HavenClientConfig, P as PaymentRequest, a as PaymentResult, b as PaymentIntent, X as X402PaymentRequired, c as X402AuthorizationOptions, d as X402Intent, e as PaymentStatusResult, f as HavenAgent, g as HavenAgentSummary, S as SweepResult, h as HavenAllowanceSummary, i as HavenBalanceCoverage, B as BudgetPrecheckResult, j as PostPurchaseAllowanceSummary, A as AgentPaymentWarning, k as HavenCatalogEntry, l as HavenCatalogSubmission, m as HavenPaymentReceipt, n as HavenPaymentReceiptsPage, O as OpenTaskBudgetResult, o as HavenTaskBudget, T as TaskBudgetSignContext, p as SubmitTaskBudgetResult, C as CloseTaskBudgetResult, q as SubmitSubBudgetResult, r as HavenPendingSubBudgetSignature, s as CloseSubBudgetResult, t as PaymentResumeState, u as X402Receipt, v as X402Quote, w as X402Erc7710Settlement, x as X402McpCallContext, y as SignData, R as ResumeAuthorizedX402Input, z as ResumeX402PaymentInput, D as X402ResumeState, E as X402McpTransport, F as X402MerchantCallContext, G as X402IntentByKey, I as HavenError } from './types-CAvsjRKi.cjs';
4
- export { J as AGENT_PAYMENT_FAILURE_CODE_VALUES, K as AGENT_PAYMENT_NEXT_ACTION_VALUES, L as AGENT_PAYMENT_PHASE_VALUES, N as AGENT_PAYMENT_RAIL_VALUES, Q as AgentNextStep, U as AgentPaymentEnumSchema, V as AgentPaymentFailureCode, W as AgentPaymentFailureCodeDescriptions, Y as AgentPaymentFailureCodeSchema, Z as AgentPaymentNextAction, _ as AgentPaymentNextActionDescriptions, $ as AgentPaymentNextActionSchema, a0 as AgentPaymentPhase, a1 as AgentPaymentPhaseDescriptions, a2 as AgentPaymentPhaseSchema, a3 as AgentPaymentRail, a4 as AgentPaymentRailDescriptions, a5 as AgentPaymentRailSchema, a6 as AgentPaymentSummary, a7 as AgentPaymentWarningCode, a8 as AgentPurchaseSummary, a9 as CatalogSubmissionAccepted, aa as DEFAULT_CONFIRMATION_TIMEOUT_MS, ab as FundingConfirmationUnknownError, ac as FundingRevertedError, ad as HOSTED_DISCOVERY_TIMEOUT_MS, ae as HOSTED_EGRESS_TIMEOUTS, af as HOSTED_MAX_GET_REDIRECTS, ag as HOSTED_RESPONSE_BYTE_CAPS, ah as HavenAgentAllowanceSummary, ai as HavenAgentReadiness, aj as HavenAgentSupersession, ak as HavenAllowance, al as HavenApiError, am as HavenApiFailureCause, an as HavenCatalogMerchant, ao as HavenListScope, ap as HavenPaymentStateError, aq as HavenSigningError, ar as HavenTimeoutError, as as HavenUnsupportedSignerVersionError, at as HavenZeroSettlementHashError, au as MERCHANT_EGRESS_REFUSED_CODE, av as MERCHANT_EGRESS_RESPONSE_CAP_CODE, aw as MachinePaymentRail, ax as MerchantEgressRefusalReason, ay as MerchantEgressRefusedError, az as MerchantEgressResponseCapError, aA as MerchantEgressTimeouts, aB as MerchantEgressUse, aC as MerchantTimeoutError, aD as PaymentFee, aE as PaymentNextAction, aF as PaymentPhase, aG as PaymentStatus, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aJ as SweepConfirmation, aK as SweepEntry, aL as X402AlreadySettledError, aM as X402Erc7710AlreadySettledError, aN as X402ExpectedAuth, aO as X402ExpectedContext, aP as X402PaymentOption, aQ as X402RequestSnapshot, aR as X402TaskBudgetMismatchError, aS as X402UnexpectedStatusError, aT as assertPublicHttpsMerchantUrl, aU as isPublicHttpsMerchantUrl, aV as publicHttpsMerchantUrlRefusal, aW as readBodyCapped, aX as signerUpdateFallback, aY as strictMerchantEgressPolicy } from './types-CAvsjRKi.cjs';
5
- import { H as HavenClientUpdate, S as SweepPrepareResponse, a as SweepAuthorization, b as SweepSubmitResponse } from './base64-COaV1Sis.cjs';
6
- export { C as CONNECTOR_PACKAGE_NAME, D as DEFAULT_NEXT_TOOL_BY_ACTION, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, d as ERC7710_ASSET_TRANSFER_METHOD, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, h as HYBRID_DELEGATOR_DOMAIN_NAME, i as HYBRID_DELEGATOR_DOMAIN_VERSION, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, M as MAX_TASK_BUDGET_TTL_SECONDS, N as NEXT_TOOL_SERVER_NAMES, l as NEXT_TOOL_SERVER_ROLES, m as NextStep, n as NextStepArguments, o as NextStepHandoff, p as NextStepInput, q as NextStepTarget, r as NextStepTargets, s as NextToolServerRole, P as PACKED_USER_OPERATION_FIELDS, R as ROOT_AUTHORITY, t as SDK_CLIENT_IDENTITY, u as SDK_VERSION, v as SWEEP_BASE_CHAIN_ID, w as SWEEP_BASE_SEPOLIA_CHAIN_ID, x as SWEEP_BASE_SEPOLIA_USDC_ADDRESS, y as SWEEP_BASE_USDC_ADDRESS, z as SettlementChildExpectation, A as SweepEip712Domain, B as SweepExpectedAuth, F as SweepPreparation, G as SweepSubmitResult, I as SweepTypedData, T as TASK_SIGN_CONTEXT_VERSION, J as TRANSFER_WITH_AUTHORIZATION_TYPES, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, U as UnsupportedNodeVersionMessageOptions, X as X402PaymentHeaderContext, V as X402PaymentHeaderValidationError, W as X402SchemeSelection, Y as X402_LEGACY_PAYMENT_HEADER_NAME, Z as X402_MAX_AUTHORIZATION_WINDOW_SECONDS, _ as X402_PAYMENT_HEADER_NAME, $ as X402_PAYMENT_HEADER_NAMES_SENT, a0 as X402_PAYMENT_NONCE_TAG, a1 as X402_PAYMENT_REQUIRED_HEADER_NAME, a2 as X402_PAYMENT_RESPONSE_HEADER_NAME, a3 as X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, a4 as assertBoundDirectPaymentUserOp, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, ab as compareNodeVersions, ac as connectorRerunCommand, ad as connectorSpec, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, ah as decodeBase64Utf8, ai as defaultNextToolFor, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, am as encodeBase64Utf8, an as encodePaymentProof, ao as hashDelegation, ap as havenClientIdentity, aq as isConnectorChannel, ar as isErc7710Option, as as isPackedUserOperationTypedData, at as isSupportedNodeVersion, au as isSweepableChain, av as isTaskChildTypedData, aw as normalizePaymentRequired, ax as packedUserOperationHash, ay as parseNextTool, az as parsePaymentRequired, aA as parsePaymentRequiredResponse, aB as readClientUpdate, aC as renderNextTool, aD as resolveConnectorChannel, aE as resolveTokenBySymbol, aF as resolveTokenFromAddress, aG as selectErc7710PaymentOption, aH as selectPaymentOption, aI as selectStandardPaymentOption, aJ as selectX402SettlementScheme, aK as sweepUsdcAddress, aL as sweepUsdcDomain, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aO as validateStandardX402PaymentHeader, aP as verifySettlementChild, aQ as x402AssetTransferMethod, aR as x402AuthorizationAmount, aS as x402FacilitatorAddresses, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-COaV1Sis.cjs';
1
+ import { P as PaymentReceipt, R as ReceiptVerification } from './receipt-DwRqGjGb.cjs';
2
+ export { a as RECEIPT_VERSION, v as verifyPaymentReceipt } from './receipt-DwRqGjGb.cjs';
3
+ import { M as MerchantEgressPolicy, H as HavenClientConfig, P as PaymentRequest, a as PaymentResult, b as PaymentIntent, X as X402PaymentRequired, c as X402AuthorizationOptions, d as X402Intent, e as PaymentStatusResult, f as HavenAgent, g as HavenAgentSummary, S as SweepResult, h as HavenAllowanceSummary, i as HavenBalanceCoverage, B as BudgetPrecheckResult, j as PostPurchaseAllowanceSummary, A as AgentPaymentWarning, k as HavenCatalogEntry, l as HavenCatalogSubmission, m as HavenPaymentReceipt, n as HavenPaymentReceiptsPage, O as OpenTaskBudgetResult, o as HavenTaskBudget, T as TaskBudgetSignContext, p as SubmitTaskBudgetResult, C as CloseTaskBudgetResult, q as SubmitSubBudgetResult, r as HavenPendingSubBudgetSignature, s as CloseSubBudgetResult, t as PaymentResumeState, u as X402Receipt, v as X402Quote, w as X402Erc7710Settlement, x as X402McpCallContext, y as SignData, R as ResumeAuthorizedX402Input, z as ResumeX402PaymentInput, D as X402ResumeState, E as X402McpTransport, F as X402MerchantCallContext, G as X402IntentByKey, I as HavenError } from './types-3vUBmumz.cjs';
4
+ export { J as AGENT_PAYMENT_FAILURE_CODE_VALUES, K as AGENT_PAYMENT_NEXT_ACTION_VALUES, L as AGENT_PAYMENT_PHASE_VALUES, N as AGENT_PAYMENT_RAIL_VALUES, Q as AgentNextStep, U as AgentPaymentEnumSchema, V as AgentPaymentFailureCode, W as AgentPaymentFailureCodeDescriptions, Y as AgentPaymentFailureCodeSchema, Z as AgentPaymentNextAction, _ as AgentPaymentNextActionDescriptions, $ as AgentPaymentNextActionSchema, a0 as AgentPaymentPhase, a1 as AgentPaymentPhaseDescriptions, a2 as AgentPaymentPhaseSchema, a3 as AgentPaymentRail, a4 as AgentPaymentRailDescriptions, a5 as AgentPaymentRailSchema, a6 as AgentPaymentSummary, a7 as AgentPaymentWarningCode, a8 as AgentPurchaseSummary, a9 as CatalogSubmissionAccepted, aa as DEFAULT_CONFIRMATION_TIMEOUT_MS, ab as FundingConfirmationUnknownError, ac as FundingRevertedError, ad as HOSTED_DISCOVERY_TIMEOUT_MS, ae as HOSTED_EGRESS_TIMEOUTS, af as HOSTED_MAX_GET_REDIRECTS, ag as HOSTED_RESPONSE_BYTE_CAPS, ah as HavenAgentAllowanceSummary, ai as HavenAgentReadiness, aj as HavenAgentSupersession, ak as HavenAllowance, al as HavenApiError, am as HavenApiFailureCause, an as HavenCatalogMerchant, ao as HavenListScope, ap as HavenPaymentStateError, aq as HavenSigningError, ar as HavenTimeoutError, as as HavenUnsupportedSignerVersionError, at as HavenZeroSettlementHashError, au as MERCHANT_EGRESS_REFUSED_CODE, av as MERCHANT_EGRESS_RESPONSE_CAP_CODE, aw as MachinePaymentRail, ax as MerchantEgressRefusalReason, ay as MerchantEgressRefusedError, az as MerchantEgressResponseCapError, aA as MerchantEgressTimeouts, aB as MerchantEgressUse, aC as MerchantTimeoutError, aD as PaymentFee, aE as PaymentNextAction, aF as PaymentPhase, aG as PaymentStatus, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aJ as SweepConfirmation, aK as SweepEntry, aL as X402AlreadySettledError, aM as X402Erc7710AlreadySettledError, aN as X402ExpectedAuth, aO as X402ExpectedContext, aP as X402PaymentOption, aQ as X402RequestSnapshot, aR as X402TaskBudgetMismatchError, aS as X402UnexpectedStatusError, aT as assertPublicHttpsMerchantUrl, aU as isPublicHttpsMerchantUrl, aV as publicHttpsMerchantUrlRefusal, aW as readBodyCapped, aX as signerUpdateFallback, aY as strictMerchantEgressPolicy } from './types-3vUBmumz.cjs';
5
+ import { H as HavenClientUpdate, S as SweepPrepareResponse, a as SweepAuthorization, b as SweepSubmitResponse } from './base64-C3mJNLYR.cjs';
6
+ export { C as CONNECTOR_PACKAGE_NAME, D as DEFAULT_NEXT_TOOL_BY_ACTION, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, d as ERC7710_ASSET_TRANSFER_METHOD, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, h as HYBRID_DELEGATOR_DOMAIN_NAME, i as HYBRID_DELEGATOR_DOMAIN_VERSION, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, M as MAX_TASK_BUDGET_TTL_SECONDS, N as NEXT_TOOL_SERVER_NAMES, l as NEXT_TOOL_SERVER_ROLES, m as NextStep, n as NextStepArguments, o as NextStepHandoff, p as NextStepInput, q as NextStepTarget, r as NextStepTargets, s as NextToolServerRole, P as PACKED_USER_OPERATION_FIELDS, R as ROOT_AUTHORITY, t as SDK_CLIENT_IDENTITY, u as SDK_VERSION, v as SWEEP_BASE_CHAIN_ID, w as SWEEP_BASE_SEPOLIA_CHAIN_ID, x as SWEEP_BASE_SEPOLIA_USDC_ADDRESS, y as SWEEP_BASE_USDC_ADDRESS, z as SettlementChildExpectation, A as SweepEip712Domain, B as SweepExpectedAuth, F as SweepPreparation, G as SweepSubmitResult, I as SweepTypedData, T as TASK_SIGN_CONTEXT_VERSION, J as TRANSFER_WITH_AUTHORIZATION_TYPES, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, U as UnsupportedNodeVersionMessageOptions, X as X402PaymentHeaderContext, V as X402PaymentHeaderValidationError, W as X402SchemeSelection, Y as X402_LEGACY_PAYMENT_HEADER_NAME, Z as X402_MAX_AUTHORIZATION_WINDOW_SECONDS, _ as X402_PAYMENT_HEADER_NAME, $ as X402_PAYMENT_HEADER_NAMES_SENT, a0 as X402_PAYMENT_NONCE_TAG, a1 as X402_PAYMENT_REQUIRED_HEADER_NAME, a2 as X402_PAYMENT_RESPONSE_HEADER_NAME, a3 as X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, a4 as assertBoundDirectPaymentUserOp, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, ab as compareNodeVersions, ac as connectorRerunCommand, ad as connectorSpec, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, ah as decodeBase64Utf8, ai as defaultNextToolFor, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, am as encodeBase64Utf8, an as encodePaymentProof, ao as hashDelegation, ap as havenClientIdentity, aq as isConnectorChannel, ar as isErc7710Option, as as isPackedUserOperationTypedData, at as isSupportedNodeVersion, au as isSweepableChain, av as isTaskChildTypedData, aw as normalizePaymentRequired, ax as packedUserOperationHash, ay as parseNextTool, az as parsePaymentRequired, aA as parsePaymentRequiredResponse, aB as readClientUpdate, aC as renderNextTool, aD as resolveConnectorChannel, aE as resolveTokenBySymbol, aF as resolveTokenFromAddress, aG as selectErc7710PaymentOption, aH as selectPaymentOption, aI as selectStandardPaymentOption, aJ as selectX402SettlementScheme, aK as sweepUsdcAddress, aL as sweepUsdcDomain, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aO as validateStandardX402PaymentHeader, aP as verifySettlementChild, aQ as x402AssetTransferMethod, aR as x402AuthorizationAmount, aS as x402FacilitatorAddresses, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-C3mJNLYR.cjs';
7
7
  import 'x402/types';
8
8
  import 'viem';
9
9
 
@@ -814,6 +814,10 @@ declare class HavenClient {
814
814
  merchantBody?: string;
815
815
  /** #3778: the optional NON-SECRET delivery pointer — see `reportMerchantOutcome`. */
816
816
  deliveryReference?: string;
817
+ /** #4534: an agent-supplied purchase group key — see `reportMerchantOutcome`. */
818
+ purchaseGroupId?: string;
819
+ /** #4534: the merchant's paid response body — see `reportMerchantOutcome`. */
820
+ merchantResponse?: Record<string, unknown>;
817
821
  }): Promise<X402MerchantOutcomeReport>;
818
822
  /**
819
823
  * #2972: report the merchant's real settlement transaction hash for an
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { P as PaymentReceipt, R as ReceiptVerification } from './receipt-DyUInpvF.js';
2
- export { a as RECEIPT_VERSION, v as verifyPaymentReceipt } from './receipt-DyUInpvF.js';
3
- import { M as MerchantEgressPolicy, H as HavenClientConfig, P as PaymentRequest, a as PaymentResult, b as PaymentIntent, X as X402PaymentRequired, c as X402AuthorizationOptions, d as X402Intent, e as PaymentStatusResult, f as HavenAgent, g as HavenAgentSummary, S as SweepResult, h as HavenAllowanceSummary, i as HavenBalanceCoverage, B as BudgetPrecheckResult, j as PostPurchaseAllowanceSummary, A as AgentPaymentWarning, k as HavenCatalogEntry, l as HavenCatalogSubmission, m as HavenPaymentReceipt, n as HavenPaymentReceiptsPage, O as OpenTaskBudgetResult, o as HavenTaskBudget, T as TaskBudgetSignContext, p as SubmitTaskBudgetResult, C as CloseTaskBudgetResult, q as SubmitSubBudgetResult, r as HavenPendingSubBudgetSignature, s as CloseSubBudgetResult, t as PaymentResumeState, u as X402Receipt, v as X402Quote, w as X402Erc7710Settlement, x as X402McpCallContext, y as SignData, R as ResumeAuthorizedX402Input, z as ResumeX402PaymentInput, D as X402ResumeState, E as X402McpTransport, F as X402MerchantCallContext, G as X402IntentByKey, I as HavenError } from './types-CAvsjRKi.js';
4
- export { J as AGENT_PAYMENT_FAILURE_CODE_VALUES, K as AGENT_PAYMENT_NEXT_ACTION_VALUES, L as AGENT_PAYMENT_PHASE_VALUES, N as AGENT_PAYMENT_RAIL_VALUES, Q as AgentNextStep, U as AgentPaymentEnumSchema, V as AgentPaymentFailureCode, W as AgentPaymentFailureCodeDescriptions, Y as AgentPaymentFailureCodeSchema, Z as AgentPaymentNextAction, _ as AgentPaymentNextActionDescriptions, $ as AgentPaymentNextActionSchema, a0 as AgentPaymentPhase, a1 as AgentPaymentPhaseDescriptions, a2 as AgentPaymentPhaseSchema, a3 as AgentPaymentRail, a4 as AgentPaymentRailDescriptions, a5 as AgentPaymentRailSchema, a6 as AgentPaymentSummary, a7 as AgentPaymentWarningCode, a8 as AgentPurchaseSummary, a9 as CatalogSubmissionAccepted, aa as DEFAULT_CONFIRMATION_TIMEOUT_MS, ab as FundingConfirmationUnknownError, ac as FundingRevertedError, ad as HOSTED_DISCOVERY_TIMEOUT_MS, ae as HOSTED_EGRESS_TIMEOUTS, af as HOSTED_MAX_GET_REDIRECTS, ag as HOSTED_RESPONSE_BYTE_CAPS, ah as HavenAgentAllowanceSummary, ai as HavenAgentReadiness, aj as HavenAgentSupersession, ak as HavenAllowance, al as HavenApiError, am as HavenApiFailureCause, an as HavenCatalogMerchant, ao as HavenListScope, ap as HavenPaymentStateError, aq as HavenSigningError, ar as HavenTimeoutError, as as HavenUnsupportedSignerVersionError, at as HavenZeroSettlementHashError, au as MERCHANT_EGRESS_REFUSED_CODE, av as MERCHANT_EGRESS_RESPONSE_CAP_CODE, aw as MachinePaymentRail, ax as MerchantEgressRefusalReason, ay as MerchantEgressRefusedError, az as MerchantEgressResponseCapError, aA as MerchantEgressTimeouts, aB as MerchantEgressUse, aC as MerchantTimeoutError, aD as PaymentFee, aE as PaymentNextAction, aF as PaymentPhase, aG as PaymentStatus, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aJ as SweepConfirmation, aK as SweepEntry, aL as X402AlreadySettledError, aM as X402Erc7710AlreadySettledError, aN as X402ExpectedAuth, aO as X402ExpectedContext, aP as X402PaymentOption, aQ as X402RequestSnapshot, aR as X402TaskBudgetMismatchError, aS as X402UnexpectedStatusError, aT as assertPublicHttpsMerchantUrl, aU as isPublicHttpsMerchantUrl, aV as publicHttpsMerchantUrlRefusal, aW as readBodyCapped, aX as signerUpdateFallback, aY as strictMerchantEgressPolicy } from './types-CAvsjRKi.js';
5
- import { H as HavenClientUpdate, S as SweepPrepareResponse, a as SweepAuthorization, b as SweepSubmitResponse } from './base64-C5OrJLij.js';
6
- export { C as CONNECTOR_PACKAGE_NAME, D as DEFAULT_NEXT_TOOL_BY_ACTION, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, d as ERC7710_ASSET_TRANSFER_METHOD, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, h as HYBRID_DELEGATOR_DOMAIN_NAME, i as HYBRID_DELEGATOR_DOMAIN_VERSION, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, M as MAX_TASK_BUDGET_TTL_SECONDS, N as NEXT_TOOL_SERVER_NAMES, l as NEXT_TOOL_SERVER_ROLES, m as NextStep, n as NextStepArguments, o as NextStepHandoff, p as NextStepInput, q as NextStepTarget, r as NextStepTargets, s as NextToolServerRole, P as PACKED_USER_OPERATION_FIELDS, R as ROOT_AUTHORITY, t as SDK_CLIENT_IDENTITY, u as SDK_VERSION, v as SWEEP_BASE_CHAIN_ID, w as SWEEP_BASE_SEPOLIA_CHAIN_ID, x as SWEEP_BASE_SEPOLIA_USDC_ADDRESS, y as SWEEP_BASE_USDC_ADDRESS, z as SettlementChildExpectation, A as SweepEip712Domain, B as SweepExpectedAuth, F as SweepPreparation, G as SweepSubmitResult, I as SweepTypedData, T as TASK_SIGN_CONTEXT_VERSION, J as TRANSFER_WITH_AUTHORIZATION_TYPES, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, U as UnsupportedNodeVersionMessageOptions, X as X402PaymentHeaderContext, V as X402PaymentHeaderValidationError, W as X402SchemeSelection, Y as X402_LEGACY_PAYMENT_HEADER_NAME, Z as X402_MAX_AUTHORIZATION_WINDOW_SECONDS, _ as X402_PAYMENT_HEADER_NAME, $ as X402_PAYMENT_HEADER_NAMES_SENT, a0 as X402_PAYMENT_NONCE_TAG, a1 as X402_PAYMENT_REQUIRED_HEADER_NAME, a2 as X402_PAYMENT_RESPONSE_HEADER_NAME, a3 as X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, a4 as assertBoundDirectPaymentUserOp, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, ab as compareNodeVersions, ac as connectorRerunCommand, ad as connectorSpec, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, ah as decodeBase64Utf8, ai as defaultNextToolFor, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, am as encodeBase64Utf8, an as encodePaymentProof, ao as hashDelegation, ap as havenClientIdentity, aq as isConnectorChannel, ar as isErc7710Option, as as isPackedUserOperationTypedData, at as isSupportedNodeVersion, au as isSweepableChain, av as isTaskChildTypedData, aw as normalizePaymentRequired, ax as packedUserOperationHash, ay as parseNextTool, az as parsePaymentRequired, aA as parsePaymentRequiredResponse, aB as readClientUpdate, aC as renderNextTool, aD as resolveConnectorChannel, aE as resolveTokenBySymbol, aF as resolveTokenFromAddress, aG as selectErc7710PaymentOption, aH as selectPaymentOption, aI as selectStandardPaymentOption, aJ as selectX402SettlementScheme, aK as sweepUsdcAddress, aL as sweepUsdcDomain, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aO as validateStandardX402PaymentHeader, aP as verifySettlementChild, aQ as x402AssetTransferMethod, aR as x402AuthorizationAmount, aS as x402FacilitatorAddresses, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-C5OrJLij.js';
1
+ import { P as PaymentReceipt, R as ReceiptVerification } from './receipt-CTOPh2fm.js';
2
+ export { a as RECEIPT_VERSION, v as verifyPaymentReceipt } from './receipt-CTOPh2fm.js';
3
+ import { M as MerchantEgressPolicy, H as HavenClientConfig, P as PaymentRequest, a as PaymentResult, b as PaymentIntent, X as X402PaymentRequired, c as X402AuthorizationOptions, d as X402Intent, e as PaymentStatusResult, f as HavenAgent, g as HavenAgentSummary, S as SweepResult, h as HavenAllowanceSummary, i as HavenBalanceCoverage, B as BudgetPrecheckResult, j as PostPurchaseAllowanceSummary, A as AgentPaymentWarning, k as HavenCatalogEntry, l as HavenCatalogSubmission, m as HavenPaymentReceipt, n as HavenPaymentReceiptsPage, O as OpenTaskBudgetResult, o as HavenTaskBudget, T as TaskBudgetSignContext, p as SubmitTaskBudgetResult, C as CloseTaskBudgetResult, q as SubmitSubBudgetResult, r as HavenPendingSubBudgetSignature, s as CloseSubBudgetResult, t as PaymentResumeState, u as X402Receipt, v as X402Quote, w as X402Erc7710Settlement, x as X402McpCallContext, y as SignData, R as ResumeAuthorizedX402Input, z as ResumeX402PaymentInput, D as X402ResumeState, E as X402McpTransport, F as X402MerchantCallContext, G as X402IntentByKey, I as HavenError } from './types-3vUBmumz.js';
4
+ export { J as AGENT_PAYMENT_FAILURE_CODE_VALUES, K as AGENT_PAYMENT_NEXT_ACTION_VALUES, L as AGENT_PAYMENT_PHASE_VALUES, N as AGENT_PAYMENT_RAIL_VALUES, Q as AgentNextStep, U as AgentPaymentEnumSchema, V as AgentPaymentFailureCode, W as AgentPaymentFailureCodeDescriptions, Y as AgentPaymentFailureCodeSchema, Z as AgentPaymentNextAction, _ as AgentPaymentNextActionDescriptions, $ as AgentPaymentNextActionSchema, a0 as AgentPaymentPhase, a1 as AgentPaymentPhaseDescriptions, a2 as AgentPaymentPhaseSchema, a3 as AgentPaymentRail, a4 as AgentPaymentRailDescriptions, a5 as AgentPaymentRailSchema, a6 as AgentPaymentSummary, a7 as AgentPaymentWarningCode, a8 as AgentPurchaseSummary, a9 as CatalogSubmissionAccepted, aa as DEFAULT_CONFIRMATION_TIMEOUT_MS, ab as FundingConfirmationUnknownError, ac as FundingRevertedError, ad as HOSTED_DISCOVERY_TIMEOUT_MS, ae as HOSTED_EGRESS_TIMEOUTS, af as HOSTED_MAX_GET_REDIRECTS, ag as HOSTED_RESPONSE_BYTE_CAPS, ah as HavenAgentAllowanceSummary, ai as HavenAgentReadiness, aj as HavenAgentSupersession, ak as HavenAllowance, al as HavenApiError, am as HavenApiFailureCause, an as HavenCatalogMerchant, ao as HavenListScope, ap as HavenPaymentStateError, aq as HavenSigningError, ar as HavenTimeoutError, as as HavenUnsupportedSignerVersionError, at as HavenZeroSettlementHashError, au as MERCHANT_EGRESS_REFUSED_CODE, av as MERCHANT_EGRESS_RESPONSE_CAP_CODE, aw as MachinePaymentRail, ax as MerchantEgressRefusalReason, ay as MerchantEgressRefusedError, az as MerchantEgressResponseCapError, aA as MerchantEgressTimeouts, aB as MerchantEgressUse, aC as MerchantTimeoutError, aD as PaymentFee, aE as PaymentNextAction, aF as PaymentPhase, aG as PaymentStatus, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aJ as SweepConfirmation, aK as SweepEntry, aL as X402AlreadySettledError, aM as X402Erc7710AlreadySettledError, aN as X402ExpectedAuth, aO as X402ExpectedContext, aP as X402PaymentOption, aQ as X402RequestSnapshot, aR as X402TaskBudgetMismatchError, aS as X402UnexpectedStatusError, aT as assertPublicHttpsMerchantUrl, aU as isPublicHttpsMerchantUrl, aV as publicHttpsMerchantUrlRefusal, aW as readBodyCapped, aX as signerUpdateFallback, aY as strictMerchantEgressPolicy } from './types-3vUBmumz.js';
5
+ import { H as HavenClientUpdate, S as SweepPrepareResponse, a as SweepAuthorization, b as SweepSubmitResponse } from './base64-CxzIc3KH.js';
6
+ export { C as CONNECTOR_PACKAGE_NAME, D as DEFAULT_NEXT_TOOL_BY_ACTION, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, d as ERC7710_ASSET_TRANSFER_METHOD, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, h as HYBRID_DELEGATOR_DOMAIN_NAME, i as HYBRID_DELEGATOR_DOMAIN_VERSION, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, M as MAX_TASK_BUDGET_TTL_SECONDS, N as NEXT_TOOL_SERVER_NAMES, l as NEXT_TOOL_SERVER_ROLES, m as NextStep, n as NextStepArguments, o as NextStepHandoff, p as NextStepInput, q as NextStepTarget, r as NextStepTargets, s as NextToolServerRole, P as PACKED_USER_OPERATION_FIELDS, R as ROOT_AUTHORITY, t as SDK_CLIENT_IDENTITY, u as SDK_VERSION, v as SWEEP_BASE_CHAIN_ID, w as SWEEP_BASE_SEPOLIA_CHAIN_ID, x as SWEEP_BASE_SEPOLIA_USDC_ADDRESS, y as SWEEP_BASE_USDC_ADDRESS, z as SettlementChildExpectation, A as SweepEip712Domain, B as SweepExpectedAuth, F as SweepPreparation, G as SweepSubmitResult, I as SweepTypedData, T as TASK_SIGN_CONTEXT_VERSION, J as TRANSFER_WITH_AUTHORIZATION_TYPES, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, U as UnsupportedNodeVersionMessageOptions, X as X402PaymentHeaderContext, V as X402PaymentHeaderValidationError, W as X402SchemeSelection, Y as X402_LEGACY_PAYMENT_HEADER_NAME, Z as X402_MAX_AUTHORIZATION_WINDOW_SECONDS, _ as X402_PAYMENT_HEADER_NAME, $ as X402_PAYMENT_HEADER_NAMES_SENT, a0 as X402_PAYMENT_NONCE_TAG, a1 as X402_PAYMENT_REQUIRED_HEADER_NAME, a2 as X402_PAYMENT_RESPONSE_HEADER_NAME, a3 as X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, a4 as assertBoundDirectPaymentUserOp, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, ab as compareNodeVersions, ac as connectorRerunCommand, ad as connectorSpec, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, ah as decodeBase64Utf8, ai as defaultNextToolFor, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, am as encodeBase64Utf8, an as encodePaymentProof, ao as hashDelegation, ap as havenClientIdentity, aq as isConnectorChannel, ar as isErc7710Option, as as isPackedUserOperationTypedData, at as isSupportedNodeVersion, au as isSweepableChain, av as isTaskChildTypedData, aw as normalizePaymentRequired, ax as packedUserOperationHash, ay as parseNextTool, az as parsePaymentRequired, aA as parsePaymentRequiredResponse, aB as readClientUpdate, aC as renderNextTool, aD as resolveConnectorChannel, aE as resolveTokenBySymbol, aF as resolveTokenFromAddress, aG as selectErc7710PaymentOption, aH as selectPaymentOption, aI as selectStandardPaymentOption, aJ as selectX402SettlementScheme, aK as sweepUsdcAddress, aL as sweepUsdcDomain, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aO as validateStandardX402PaymentHeader, aP as verifySettlementChild, aQ as x402AssetTransferMethod, aR as x402AuthorizationAmount, aS as x402FacilitatorAddresses, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-CxzIc3KH.js';
7
7
  import 'x402/types';
8
8
  import 'viem';
9
9
 
@@ -814,6 +814,10 @@ declare class HavenClient {
814
814
  merchantBody?: string;
815
815
  /** #3778: the optional NON-SECRET delivery pointer — see `reportMerchantOutcome`. */
816
816
  deliveryReference?: string;
817
+ /** #4534: an agent-supplied purchase group key — see `reportMerchantOutcome`. */
818
+ purchaseGroupId?: string;
819
+ /** #4534: the merchant's paid response body — see `reportMerchantOutcome`. */
820
+ merchantResponse?: Record<string, unknown>;
817
821
  }): Promise<X402MerchantOutcomeReport>;
818
822
  /**
819
823
  * #2972: report the merchant's real settlement transaction hash for an
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { decodeBase64Json, selectStandardPaymentOption, buildX402IdempotencyKey, x402AuthorizationAmount, assertBoundDirectPaymentUserOp, assertFundingLegPaysDelegate, HavenTypedDataRefusedError, assertOwnSettlementChild, parsePaymentRequiredResponse, x402PaymentHeaderNamesSent, SDK_CLIENT_IDENTITY, readClientUpdate, HAVEN_CLIENT_HEADER, isSweepableChain, sweepUsdcAddress, x402PaymentHeaderNamesFor, X402_PAYMENT_HEADER_NAMES, toStandardPaymentRequirements, deriveX402PaymentNonce, encodeBase64Json, x402V2PaymentEnvelope, isErc7710Option, buildSignedTaxDeclaration, encodeTaxDeclarationHeader, selectX402SettlementScheme, selectErc7710PaymentOption, x402AssetTransferMethod, resolveTokenFromAddress, normalizePaymentRequired, X_TAX_DECLARATION_HEADER } from './chunk-7M3CIW7W.js';
2
- export { DEFAULT_NEXT_TOOL_BY_ACTION, ERC7710_ASSET_TRANSFER_METHOD, HAVEN_CLIENT_HEADER, HAVEN_MINIMUM_NODE_VERSION, HavenTypedDataRefusedError, MAX_TASK_BUDGET_TTL_SECONDS, NEXT_TOOL_SERVER_NAMES, NEXT_TOOL_SERVER_ROLES, SDK_CLIENT_IDENTITY, SDK_VERSION, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, TRANSFER_WITH_AUTHORIZATION_TYPES, TYPED_DATA_NOT_ALLOWED, X402PaymentHeaderValidationError, X402_LEGACY_PAYMENT_HEADER_NAME, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_PAYMENT_HEADER_NAME, X402_PAYMENT_HEADER_NAMES_SENT, X402_PAYMENT_NONCE_TAG, X402_PAYMENT_REQUIRED_HEADER_NAME, X402_PAYMENT_RESPONSE_HEADER_NAME, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, assertBoundDirectPaymentUserOp, assertOwnTaskBudgetCloseUserOp, assertOwnTaskChild, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, createNextStepBuilder, decodeBase64Json, decodeBase64Utf8, defaultNextToolFor, deriveX402PaymentNonce, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, hashDelegation, havenClientIdentity, isErc7710Option, isSupportedNodeVersion, isSweepableChain, isTaskChildTypedData, normalizePaymentRequired, parseNextTool, parsePaymentRequired, parsePaymentRequiredResponse, readClientUpdate, renderNextTool, resolveTokenBySymbol, resolveTokenFromAddress, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402PaymentHeaderNamesFor, x402RetryHeadersFor, x402V2PaymentEnvelope } from './chunk-7M3CIW7W.js';
3
- import { verifyPaymentReceipt } from './chunk-WFTGZS24.js';
4
- export { RECEIPT_VERSION, verifyPaymentReceipt } from './chunk-WFTGZS24.js';
5
- import { HavenSigningError, HavenError, DEFAULT_CONFIRMATION_TIMEOUT_MS, HavenApiError, assertUserOpTypedDataBinding, AgentPaymentRail, AgentPaymentPhase, HavenTimeoutError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, X402AlreadySettledError, MerchantTimeoutError, AgentPaymentWarningCode, AgentPaymentNextAction, FundingConfirmationUnknownError, FundingRevertedError, HavenPaymentStateError, HavenZeroSettlementHashError, X402Erc7710AlreadySettledError, chainIdForNetwork } from './chunk-UPEDQLAL.js';
6
- export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, FundingConfirmationUnknownError, FundingRevertedError, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertUserOpTypedDataBinding, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild } from './chunk-UPEDQLAL.js';
1
+ import { decodeBase64Json, selectStandardPaymentOption, buildX402IdempotencyKey, x402AuthorizationAmount, assertBoundDirectPaymentUserOp, assertFundingLegPaysDelegate, HavenTypedDataRefusedError, assertOwnSettlementChild, parsePaymentRequiredResponse, x402PaymentHeaderNamesSent, SDK_CLIENT_IDENTITY, readClientUpdate, HAVEN_CLIENT_HEADER, isSweepableChain, sweepUsdcAddress, x402PaymentHeaderNamesFor, X402_PAYMENT_HEADER_NAMES, toStandardPaymentRequirements, deriveX402PaymentNonce, encodeBase64Json, x402V2PaymentEnvelope, isErc7710Option, buildSignedTaxDeclaration, encodeTaxDeclarationHeader, selectX402SettlementScheme, selectErc7710PaymentOption, x402AssetTransferMethod, resolveTokenFromAddress, normalizePaymentRequired, X_TAX_DECLARATION_HEADER } from './chunk-CXQ42FOA.js';
2
+ export { DEFAULT_NEXT_TOOL_BY_ACTION, ERC7710_ASSET_TRANSFER_METHOD, HAVEN_CLIENT_HEADER, HAVEN_MINIMUM_NODE_VERSION, HavenTypedDataRefusedError, MAX_TASK_BUDGET_TTL_SECONDS, NEXT_TOOL_SERVER_NAMES, NEXT_TOOL_SERVER_ROLES, SDK_CLIENT_IDENTITY, SDK_VERSION, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, TRANSFER_WITH_AUTHORIZATION_TYPES, TYPED_DATA_NOT_ALLOWED, X402PaymentHeaderValidationError, X402_LEGACY_PAYMENT_HEADER_NAME, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_PAYMENT_HEADER_NAME, X402_PAYMENT_HEADER_NAMES_SENT, X402_PAYMENT_NONCE_TAG, X402_PAYMENT_REQUIRED_HEADER_NAME, X402_PAYMENT_RESPONSE_HEADER_NAME, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, assertBoundDirectPaymentUserOp, assertOwnTaskBudgetCloseUserOp, assertOwnTaskChild, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, createNextStepBuilder, decodeBase64Json, decodeBase64Utf8, defaultNextToolFor, deriveX402PaymentNonce, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, hashDelegation, havenClientIdentity, isErc7710Option, isSupportedNodeVersion, isSweepableChain, isTaskChildTypedData, normalizePaymentRequired, parseNextTool, parsePaymentRequired, parsePaymentRequiredResponse, readClientUpdate, renderNextTool, resolveTokenBySymbol, resolveTokenFromAddress, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402PaymentHeaderNamesFor, x402RetryHeadersFor, x402V2PaymentEnvelope } from './chunk-CXQ42FOA.js';
3
+ import { verifyPaymentReceipt } from './chunk-CK6VRIPR.js';
4
+ export { RECEIPT_VERSION, verifyPaymentReceipt } from './chunk-CK6VRIPR.js';
5
+ import { HavenSigningError, HavenError, DEFAULT_CONFIRMATION_TIMEOUT_MS, HavenApiError, assertUserOpTypedDataBinding, AgentPaymentRail, AgentPaymentPhase, HavenTimeoutError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, X402AlreadySettledError, MerchantTimeoutError, AgentPaymentWarningCode, AgentPaymentNextAction, FundingConfirmationUnknownError, FundingRevertedError, HavenPaymentStateError, HavenZeroSettlementHashError, X402Erc7710AlreadySettledError, chainIdForNetwork } from './chunk-MI7LVP56.js';
6
+ export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, FundingConfirmationUnknownError, FundingRevertedError, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertUserOpTypedDataBinding, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild } from './chunk-MI7LVP56.js';
7
7
  import { hashTypedData } from 'viem';
8
8
  import { ethers } from 'ethers';
9
9
  import { AsyncLocalStorage } from 'async_hooks';
@@ -286,6 +286,10 @@ function mapPaymentStatusResult(raw) {
286
286
  // carried through even when `null` (a real, known answer).
287
287
  ...raw.settlement_scheme !== void 0 ? { settlementScheme: raw.settlement_scheme } : {},
288
288
  ...raw.merchant_settlement_recorded === true ? { merchantSettlementRecorded: true } : {},
289
+ // #4530: the recorded transaction itself — absent from the raw payload
290
+ // (older backend, or nothing recorded) stays absent here, so the field
291
+ // never claims a hash the backend did not record.
292
+ ...typeof raw.merchant_settlement_tx_hash === "string" ? { merchantSettlementTxHash: raw.merchant_settlement_tx_hash } : {},
289
293
  // #3494: additive, mirrors the backend's own `status === 'failed'` gate —
290
294
  // absent from the raw payload (older backend, or any non-failed status)
291
295
  // stays absent here.
@@ -376,6 +380,12 @@ function mapPaymentReceipt(raw) {
376
380
  if ("delivery_reference" in raw) {
377
381
  receipt.deliveryReference = raw.delivery_reference ?? null;
378
382
  }
383
+ if ("purchase_group_id" in raw) {
384
+ receipt.purchaseGroupId = raw.purchase_group_id ?? null;
385
+ }
386
+ if ("parent_payment_id" in raw) {
387
+ receipt.parentPaymentId = raw.parent_payment_id ?? null;
388
+ }
379
389
  return receipt;
380
390
  }
381
391
 
@@ -3231,7 +3241,11 @@ var MerchantCompletion = class {
3231
3241
  merchantStatus: input.merchantStatus,
3232
3242
  // #3778: accepted outcomes only — a rejection delivered nothing, so
3233
3243
  // there is no deliverable to point at.
3234
- ...input.deliveryReference ? { deliveryReference: input.deliveryReference } : {}
3244
+ ...input.deliveryReference ? { deliveryReference: input.deliveryReference } : {},
3245
+ // #4534: the purchase correlation key — accepted outcomes only, for the
3246
+ // same reason: a rejected retry bought nothing to group.
3247
+ ...input.purchaseGroupId ? { purchaseGroupId: input.purchaseGroupId } : {},
3248
+ ...input.merchantResponse ? { merchantResponse: input.merchantResponse } : {}
3235
3249
  });
3236
3250
  return { paymentId: status.paymentId, outcome: "accepted", txHash, resourceUrl, recorded: "evidence" };
3237
3251
  }