@haven_ai/sdk 0.0.0-dev.202609281736.4aa027b → 0.0.0-dev.202609281945.3f83e0e
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 +18 -6
- package/dist/{base64-DDWvAiAE.d.cts → base64-BakvjYKS.d.cts} +28 -2
- package/dist/{base64-DDWvAiAE.d.ts → base64-BakvjYKS.d.ts} +28 -2
- package/dist/{chunk-M7BXKTBK.cjs → chunk-FXPB3NEJ.cjs} +21 -2
- package/dist/chunk-FXPB3NEJ.cjs.map +1 -0
- package/dist/{chunk-PIE7TV5C.js → chunk-MPDGUDVP.js} +4 -4
- package/dist/{chunk-PIE7TV5C.js.map → chunk-MPDGUDVP.js.map} +1 -1
- package/dist/{chunk-6ZVB7XDK.cjs → chunk-WXQPO7ZY.cjs} +29 -29
- package/dist/{chunk-6ZVB7XDK.cjs.map → chunk-WXQPO7ZY.cjs.map} +1 -1
- package/dist/{chunk-XH4WMOAM.js → chunk-Y2Q4DZVU.js} +21 -3
- package/dist/chunk-Y2Q4DZVU.js.map +1 -0
- package/dist/edge.cjs +65 -65
- package/dist/edge.d.cts +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +3 -3
- package/dist/index.cjs +307 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/test-support.cjs +18 -18
- package/dist/test-support.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-M7BXKTBK.cjs.map +0 -1
- package/dist/chunk-XH4WMOAM.js.map +0 -1
package/README.md
CHANGED
|
@@ -244,7 +244,12 @@ case where two purchases collided on a key you did not choose.
|
|
|
244
244
|
|
|
245
245
|
This applies to the **EIP-3009 funding-leg** scheme, which routes money
|
|
246
246
|
through the delegate EOA. **erc7710 direct settlement is unaffected**: it has
|
|
247
|
-
no funding leg and no delegate balance to exhaust.
|
|
247
|
+
no funding leg and no delegate balance to exhaust. On erc7710, a key whose
|
|
248
|
+
payment to the same merchant for the same resource already settled makes
|
|
249
|
+
`prepareX402Erc7710()` throw `X402Erc7710AlreadySettledError` (`paymentId`,
|
|
250
|
+
`txHash`) instead of minting a settlement child. A key already used for a
|
|
251
|
+
payment to a different payee or resource is refused with a 409
|
|
252
|
+
`HavenApiError`; amount and MCP tool call are not compared (#3417).
|
|
248
253
|
|
|
249
254
|
For agents that need to inspect the price before paying, use the quote-first
|
|
250
255
|
path. `quoteX402()` probes the merchant and parses the HTTP 402 response, but it
|
|
@@ -640,11 +645,18 @@ try {
|
|
|
640
645
|
}
|
|
641
646
|
```
|
|
642
647
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
+
Two errors are **not** a failure to pay; each reports that the payment it
|
|
649
|
+
describes *succeeded*, earlier. Handle both before the generic branches, and
|
|
650
|
+
treat them as proof of purchase rather than retrying:
|
|
651
|
+
|
|
652
|
+
- `X402AlreadySettledError` extends `HavenApiError` (status 409; EIP-3009
|
|
653
|
+
path) and carries `err.receipt`.
|
|
654
|
+
- `X402Erc7710AlreadySettledError` extends `HavenError`, **not**
|
|
655
|
+
`HavenApiError` (no status; code `PAYMENT_ALREADY_SETTLED`; erc7710
|
|
656
|
+
`prepareX402Erc7710()`), and carries `err.paymentId` and `err.txHash`. An
|
|
657
|
+
`instanceof HavenApiError` branch does not catch it.
|
|
658
|
+
|
|
659
|
+
See [Idempotency](#idempotency-what-the-key-guarantees-and-what-it-costs).
|
|
648
660
|
|
|
649
661
|
## License
|
|
650
662
|
|
|
@@ -1609,6 +1609,32 @@ declare class MerchantTimeoutError extends HavenApiError {
|
|
|
1609
1609
|
readonly merchantErrorCode: "merchant_timeout";
|
|
1610
1610
|
constructor(message: string);
|
|
1611
1611
|
}
|
|
1612
|
+
/**
|
|
1613
|
+
* #3417: an erc7710 `POST /x402` authorize replayed a key whose payment to THIS
|
|
1614
|
+
* merchant for THIS resource has already settled. The backend returns
|
|
1615
|
+
* `200 { status: 'confirmed', tx_hash, to, resource_url }` and, correctly, no
|
|
1616
|
+
* `sign_data`, because nothing is left to sign
|
|
1617
|
+
* (`packages/backend/src/modules/x402/replay.ts`). Before this class the
|
|
1618
|
+
* erc7710 path read that answer as a scheme mismatch and threw a 500, which
|
|
1619
|
+
* hosted callers relayed as "transient, retry". Typed so a caller can report
|
|
1620
|
+
* the original settlement instead of retrying, and never signs anything.
|
|
1621
|
+
*
|
|
1622
|
+
* Only thrown when the confirmed row pays the merchant this request names, for
|
|
1623
|
+
* the resource it asked for. The backend's replay lookup is keyed on the
|
|
1624
|
+
* idempotency key alone, so a key reused for another payee or resource — or
|
|
1625
|
+
* first spent on an EIP-3009 funding leg, whose confirmed `tx_hash` proves only
|
|
1626
|
+
* that the delegate was funded — is refused as a 409 collision instead of read
|
|
1627
|
+
* as this settlement. Amount and the MCP tool call are not compared: on an MCP
|
|
1628
|
+
* merchant the resource is its endpoint, so a key reused for another tool
|
|
1629
|
+
* there is answered as that merchant's earlier payment. A `HavenError`, not a `HavenApiError`: nothing failed upstream.
|
|
1630
|
+
*/
|
|
1631
|
+
declare class X402Erc7710AlreadySettledError extends HavenError {
|
|
1632
|
+
readonly paymentId: string;
|
|
1633
|
+
readonly txHash: string;
|
|
1634
|
+
readonly body?: unknown | undefined;
|
|
1635
|
+
readonly x402ErrorCode: "payment_already_settled";
|
|
1636
|
+
constructor(paymentId: string, txHash: string, body?: unknown | undefined);
|
|
1637
|
+
}
|
|
1612
1638
|
declare class X402UnexpectedStatusError extends HavenApiError {
|
|
1613
1639
|
readonly x402ErrorCode: "unexpected_non_402_status";
|
|
1614
1640
|
/**
|
|
@@ -1969,7 +1995,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
1969
1995
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
1970
1996
|
* it with the package version on every release — never hand-edit it.
|
|
1971
1997
|
*/
|
|
1972
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
1998
|
+
declare const SDK_VERSION = "0.0.0-dev.202609281945.3f83e0e";
|
|
1973
1999
|
/** The request header every published Haven client sends. */
|
|
1974
2000
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
1975
2001
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -3058,4 +3084,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
3058
3084
|
*/
|
|
3059
3085
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
3060
3086
|
|
|
3061
|
-
export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b,
|
|
3087
|
+
export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b, resolveTokenFromAddress as b$, type SweepPreparation as b0, type SweepSubmitResult as b1, type SweepTypedData as b2, TRANSFER_WITH_AUTHORIZATION_TYPES as b3, TYPED_DATA_NOT_ALLOWED as b4, type TaskBudgetCloseExpectation as b5, type TaskChildExpectation as b6, type TaskChildTypedData as b7, type UnsupportedNodeVersionMessageOptions as b8, X402AlreadySettledError as b9, connectorSpec as bA, connectorUpgradeCommand as bB, createNextStepBuilder as bC, decodeBase64Json as bD, decodeBase64Utf8 as bE, defaultNextToolFor as bF, deriveDelegateAccountAddress as bG, encodeBase64Json as bH, encodeBase64Utf8 as bI, encodePaymentProof as bJ, hashDelegation as bK, havenClientIdentity as bL, isConnectorChannel as bM, isErc7710Option as bN, isPackedUserOperationTypedData as bO, isSupportedNodeVersion as bP, isSweepableChain as bQ, isTaskChildTypedData as bR, normalizePaymentRequired as bS, packedUserOperationHash as bT, parseNextTool as bU, parsePaymentRequired as bV, parsePaymentRequiredResponse as bW, readClientUpdate as bX, renderNextTool as bY, resolveConnectorChannel as bZ, resolveTokenBySymbol as b_, X402Erc7710AlreadySettledError as ba, type X402ExpectedAuth as bb, type X402ExpectedContext as bc, type X402PaymentHeaderContext as bd, X402PaymentHeaderValidationError as be, type X402PaymentOption as bf, type X402RequestSnapshot as bg, type X402SchemeSelection as bh, X402TaskBudgetMismatchError as bi, X402UnexpectedStatusError as bj, X402_LEGACY_PAYMENT_HEADER_NAME as bk, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bl, X402_PAYMENT_HEADER_NAME as bm, X402_PAYMENT_HEADER_NAMES_SENT as bn, X402_PAYMENT_REQUIRED_HEADER_NAME as bo, X402_PAYMENT_RESPONSE_HEADER_NAME as bp, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bq, assertBoundDirectPaymentUserOp as br, assertOwnTaskBudgetCloseUserOp as bs, assertOwnTaskChild as bt, assertUserOpTypedDataBinding as bu, buildSweepAuthorizationMessage as bv, buildSweepTypedData as bw, buildX402ExpectedMessage as bx, compareNodeVersions as by, connectorRerunCommand as bz, type PaymentIntent as c, selectErc7710PaymentOption as c0, selectPaymentOption as c1, selectStandardPaymentOption as c2, selectX402SettlementScheme as c3, signerUpdateFallback as c4, sweepUsdcAddress as c5, sweepUsdcDomain as c6, toStandardPaymentRequirements as c7, unsupportedNodeVersionMessage as c8, validateStandardX402PaymentHeader as c9, verifySettlementChild as ca, x402AssetTransferMethod as cb, x402AuthorizationAmount as cc, x402FacilitatorAddresses as cd, x402V2PaymentEnvelope as ce, CAVEAT_ENFORCERS as cf, CAVEAT_TYPEHASH as cg, DELEGATION_MANAGER as ch, DELEGATION_TYPEHASH as ci, DIRECT_PAYMENT_CHAIN_IDS as cj, type DelegationForHashing as ck, EXECUTE_ABI as cl, HYBRID_DELEGATOR_IMPLEMENTATION as cm, MAX_SETTLEMENT_WINDOW_SECONDS as cn, SIMPLE_FACTORY_ADDRESS as co, type SettlementChildTypedData as cp, assertFundingLegPaysDelegate as cq, assertOwnSettlementChild as cr, chainIdForNetwork as cs, isSettlementChildTypedData as ct, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type PaymentResumeState as u, type X402Receipt as v, type X402Quote as w, type X402Erc7710Settlement as x, type X402McpCallContext as y, type SignData as z };
|
|
@@ -1609,6 +1609,32 @@ declare class MerchantTimeoutError extends HavenApiError {
|
|
|
1609
1609
|
readonly merchantErrorCode: "merchant_timeout";
|
|
1610
1610
|
constructor(message: string);
|
|
1611
1611
|
}
|
|
1612
|
+
/**
|
|
1613
|
+
* #3417: an erc7710 `POST /x402` authorize replayed a key whose payment to THIS
|
|
1614
|
+
* merchant for THIS resource has already settled. The backend returns
|
|
1615
|
+
* `200 { status: 'confirmed', tx_hash, to, resource_url }` and, correctly, no
|
|
1616
|
+
* `sign_data`, because nothing is left to sign
|
|
1617
|
+
* (`packages/backend/src/modules/x402/replay.ts`). Before this class the
|
|
1618
|
+
* erc7710 path read that answer as a scheme mismatch and threw a 500, which
|
|
1619
|
+
* hosted callers relayed as "transient, retry". Typed so a caller can report
|
|
1620
|
+
* the original settlement instead of retrying, and never signs anything.
|
|
1621
|
+
*
|
|
1622
|
+
* Only thrown when the confirmed row pays the merchant this request names, for
|
|
1623
|
+
* the resource it asked for. The backend's replay lookup is keyed on the
|
|
1624
|
+
* idempotency key alone, so a key reused for another payee or resource — or
|
|
1625
|
+
* first spent on an EIP-3009 funding leg, whose confirmed `tx_hash` proves only
|
|
1626
|
+
* that the delegate was funded — is refused as a 409 collision instead of read
|
|
1627
|
+
* as this settlement. Amount and the MCP tool call are not compared: on an MCP
|
|
1628
|
+
* merchant the resource is its endpoint, so a key reused for another tool
|
|
1629
|
+
* there is answered as that merchant's earlier payment. A `HavenError`, not a `HavenApiError`: nothing failed upstream.
|
|
1630
|
+
*/
|
|
1631
|
+
declare class X402Erc7710AlreadySettledError extends HavenError {
|
|
1632
|
+
readonly paymentId: string;
|
|
1633
|
+
readonly txHash: string;
|
|
1634
|
+
readonly body?: unknown | undefined;
|
|
1635
|
+
readonly x402ErrorCode: "payment_already_settled";
|
|
1636
|
+
constructor(paymentId: string, txHash: string, body?: unknown | undefined);
|
|
1637
|
+
}
|
|
1612
1638
|
declare class X402UnexpectedStatusError extends HavenApiError {
|
|
1613
1639
|
readonly x402ErrorCode: "unexpected_non_402_status";
|
|
1614
1640
|
/**
|
|
@@ -1969,7 +1995,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
1969
1995
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
1970
1996
|
* it with the package version on every release — never hand-edit it.
|
|
1971
1997
|
*/
|
|
1972
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
1998
|
+
declare const SDK_VERSION = "0.0.0-dev.202609281945.3f83e0e";
|
|
1973
1999
|
/** The request header every published Haven client sends. */
|
|
1974
2000
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
1975
2001
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -3058,4 +3084,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
3058
3084
|
*/
|
|
3059
3085
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
3060
3086
|
|
|
3061
|
-
export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b,
|
|
3087
|
+
export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b, resolveTokenFromAddress as b$, type SweepPreparation as b0, type SweepSubmitResult as b1, type SweepTypedData as b2, TRANSFER_WITH_AUTHORIZATION_TYPES as b3, TYPED_DATA_NOT_ALLOWED as b4, type TaskBudgetCloseExpectation as b5, type TaskChildExpectation as b6, type TaskChildTypedData as b7, type UnsupportedNodeVersionMessageOptions as b8, X402AlreadySettledError as b9, connectorSpec as bA, connectorUpgradeCommand as bB, createNextStepBuilder as bC, decodeBase64Json as bD, decodeBase64Utf8 as bE, defaultNextToolFor as bF, deriveDelegateAccountAddress as bG, encodeBase64Json as bH, encodeBase64Utf8 as bI, encodePaymentProof as bJ, hashDelegation as bK, havenClientIdentity as bL, isConnectorChannel as bM, isErc7710Option as bN, isPackedUserOperationTypedData as bO, isSupportedNodeVersion as bP, isSweepableChain as bQ, isTaskChildTypedData as bR, normalizePaymentRequired as bS, packedUserOperationHash as bT, parseNextTool as bU, parsePaymentRequired as bV, parsePaymentRequiredResponse as bW, readClientUpdate as bX, renderNextTool as bY, resolveConnectorChannel as bZ, resolveTokenBySymbol as b_, X402Erc7710AlreadySettledError as ba, type X402ExpectedAuth as bb, type X402ExpectedContext as bc, type X402PaymentHeaderContext as bd, X402PaymentHeaderValidationError as be, type X402PaymentOption as bf, type X402RequestSnapshot as bg, type X402SchemeSelection as bh, X402TaskBudgetMismatchError as bi, X402UnexpectedStatusError as bj, X402_LEGACY_PAYMENT_HEADER_NAME as bk, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bl, X402_PAYMENT_HEADER_NAME as bm, X402_PAYMENT_HEADER_NAMES_SENT as bn, X402_PAYMENT_REQUIRED_HEADER_NAME as bo, X402_PAYMENT_RESPONSE_HEADER_NAME as bp, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bq, assertBoundDirectPaymentUserOp as br, assertOwnTaskBudgetCloseUserOp as bs, assertOwnTaskChild as bt, assertUserOpTypedDataBinding as bu, buildSweepAuthorizationMessage as bv, buildSweepTypedData as bw, buildX402ExpectedMessage as bx, compareNodeVersions as by, connectorRerunCommand as bz, type PaymentIntent as c, selectErc7710PaymentOption as c0, selectPaymentOption as c1, selectStandardPaymentOption as c2, selectX402SettlementScheme as c3, signerUpdateFallback as c4, sweepUsdcAddress as c5, sweepUsdcDomain as c6, toStandardPaymentRequirements as c7, unsupportedNodeVersionMessage as c8, validateStandardX402PaymentHeader as c9, verifySettlementChild as ca, x402AssetTransferMethod as cb, x402AuthorizationAmount as cc, x402FacilitatorAddresses as cd, x402V2PaymentEnvelope as ce, CAVEAT_ENFORCERS as cf, CAVEAT_TYPEHASH as cg, DELEGATION_MANAGER as ch, DELEGATION_TYPEHASH as ci, DIRECT_PAYMENT_CHAIN_IDS as cj, type DelegationForHashing as ck, EXECUTE_ABI as cl, HYBRID_DELEGATOR_IMPLEMENTATION as cm, MAX_SETTLEMENT_WINDOW_SECONDS as cn, SIMPLE_FACTORY_ADDRESS as co, type SettlementChildTypedData as cp, assertFundingLegPaysDelegate as cq, assertOwnSettlementChild as cr, chainIdForNetwork as cs, isSettlementChildTypedData as ct, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type PaymentResumeState as u, type X402Receipt as v, type X402Quote as w, type X402Erc7710Settlement as x, type X402McpCallContext as y, type SignData as z };
|
|
@@ -359,6 +359,24 @@ var MerchantTimeoutError = class extends HavenApiError {
|
|
|
359
359
|
this.name = "MerchantTimeoutError";
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
+
var X402Erc7710AlreadySettledError = class extends HavenError {
|
|
363
|
+
constructor(paymentId, txHash, body) {
|
|
364
|
+
super(
|
|
365
|
+
`Payment ${paymentId} already settled on-chain (tx ${txHash}); this idempotency key is spent. Nothing was signed and nothing new was charged.`,
|
|
366
|
+
"PAYMENT_ALREADY_SETTLED",
|
|
367
|
+
void 0,
|
|
368
|
+
paymentId
|
|
369
|
+
);
|
|
370
|
+
this.paymentId = paymentId;
|
|
371
|
+
this.txHash = txHash;
|
|
372
|
+
this.body = body;
|
|
373
|
+
this.name = "X402Erc7710AlreadySettledError";
|
|
374
|
+
}
|
|
375
|
+
paymentId;
|
|
376
|
+
txHash;
|
|
377
|
+
body;
|
|
378
|
+
x402ErrorCode = "payment_already_settled";
|
|
379
|
+
};
|
|
362
380
|
var X402UnexpectedStatusError = class extends HavenApiError {
|
|
363
381
|
x402ErrorCode = "unexpected_non_402_status";
|
|
364
382
|
/**
|
|
@@ -998,6 +1016,7 @@ exports.SIMPLE_FACTORY_ADDRESS = SIMPLE_FACTORY_ADDRESS;
|
|
|
998
1016
|
exports.SINGLE_DEFAULT_MODE = SINGLE_DEFAULT_MODE;
|
|
999
1017
|
exports.SignerRefusalCode = SignerRefusalCode;
|
|
1000
1018
|
exports.X402AlreadySettledError = X402AlreadySettledError;
|
|
1019
|
+
exports.X402Erc7710AlreadySettledError = X402Erc7710AlreadySettledError;
|
|
1001
1020
|
exports.X402TaskBudgetMismatchError = X402TaskBudgetMismatchError;
|
|
1002
1021
|
exports.X402UnexpectedStatusError = X402UnexpectedStatusError;
|
|
1003
1022
|
exports.assertRedeemsOwnBudgetDelegation = assertRedeemsOwnBudgetDelegation;
|
|
@@ -1014,5 +1033,5 @@ exports.packedUserOperationHash = packedUserOperationHash;
|
|
|
1014
1033
|
exports.resolveConnectorChannel = resolveConnectorChannel;
|
|
1015
1034
|
exports.signerUpdateFallback = signerUpdateFallback;
|
|
1016
1035
|
exports.verifySettlementChild = verifySettlementChild;
|
|
1017
|
-
//# sourceMappingURL=chunk-
|
|
1018
|
-
//# sourceMappingURL=chunk-
|
|
1036
|
+
//# sourceMappingURL=chunk-FXPB3NEJ.cjs.map
|
|
1037
|
+
//# sourceMappingURL=chunk-FXPB3NEJ.cjs.map
|