@haven_ai/sdk 0.0.0-dev.202609261556.90c27a2 → 0.0.0-dev.202609272032.679e797
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/dist/{base64-64gEwlyv.d.cts → base64-uq8A2tP_.d.cts} +70 -2
- package/dist/{base64-64gEwlyv.d.ts → base64-uq8A2tP_.d.ts} +70 -2
- package/dist/{chunk-XCC2QYHC.js → chunk-BVNBYB7Q.js} +4 -4
- package/dist/{chunk-XCC2QYHC.js.map → chunk-BVNBYB7Q.js.map} +1 -1
- package/dist/{chunk-62O4M6OH.cjs → chunk-U4DQ3APD.cjs} +29 -29
- package/dist/{chunk-62O4M6OH.cjs.map → chunk-U4DQ3APD.cjs.map} +1 -1
- package/dist/{chunk-KNUEZ5LH.js → chunk-USEZLMWK.js} +16 -3
- package/dist/chunk-USEZLMWK.js.map +1 -0
- package/dist/{chunk-N26RN2BN.cjs → chunk-VJA3OQWY.cjs} +16 -2
- package/dist/chunk-VJA3OQWY.cjs.map +1 -0
- package/dist/edge.cjs +64 -64
- package/dist/edge.d.cts +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +3 -3
- package/dist/index.cjs +351 -299
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +66 -18
- 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-KNUEZ5LH.js.map +0 -1
- package/dist/chunk-N26RN2BN.cjs.map +0 -1
|
@@ -277,6 +277,10 @@ interface X402AuthorizationOptions {
|
|
|
277
277
|
* a task budget's recipient pin is compared with the agent's own delegate
|
|
278
278
|
* wallet, so a merchant-pinned task budget is refused there
|
|
279
279
|
* (`task_budget_recipient_mismatch`); it pays through erc7710 only (#3378).
|
|
280
|
+
* #3392: the receipt cache and in-flight map record this id per entry —
|
|
281
|
+
* reusing an idempotency key under a DIFFERENT budget throws
|
|
282
|
+
* `X402TaskBudgetMismatchError` before any network call; pay again under a
|
|
283
|
+
* new key instead.
|
|
280
284
|
*/
|
|
281
285
|
taskBudgetId?: string;
|
|
282
286
|
}
|
|
@@ -831,6 +835,33 @@ interface PaymentParties {
|
|
|
831
835
|
delegate: string | null;
|
|
832
836
|
delegateAccount: string | null;
|
|
833
837
|
merchant: string | null;
|
|
838
|
+
/**
|
|
839
|
+
* #3332: the paying agent's owner's company details — additive, present
|
|
840
|
+
* only when the backend has `HAVEN_OWNER_COMPANY_DETAILS` on AND the owner
|
|
841
|
+
* saved details; absent (not `undefined`-valued, the KEY is absent)
|
|
842
|
+
* otherwise. `viesStatus: 'valid'` means VIES accepted the VAT number —
|
|
843
|
+
* never render that as "verified" (see Haven's agent-passport docs on the
|
|
844
|
+
* same naming discipline).
|
|
845
|
+
*
|
|
846
|
+
* Present only on the receipt surfaces — `GET /payments/:id/receipt` and
|
|
847
|
+
* `GET /machine-payments/receipts` (`HavenClient.getReceipt()`,
|
|
848
|
+
* `listReceipts()`/`listReceiptsPage()`) — never on `GET
|
|
849
|
+
* /machine-payments/:id/status` (`getPaymentStatus`) or the evidence-attach echo,
|
|
850
|
+
* even with the feature on: those report payment/settlement state, not the
|
|
851
|
+
* buyer's company details (out of scope for #3332, see
|
|
852
|
+
* docs/product/owner-company-details.md).
|
|
853
|
+
*/
|
|
854
|
+
buyer?: PaymentPartiesBuyer;
|
|
855
|
+
}
|
|
856
|
+
interface PaymentPartiesBuyer {
|
|
857
|
+
legalName: string;
|
|
858
|
+
/** ISO 3166-1 alpha-2. */
|
|
859
|
+
country: string;
|
|
860
|
+
/** For a sole trader this IS the personal identity number. */
|
|
861
|
+
orgNumber: string;
|
|
862
|
+
vatNumber: string | null;
|
|
863
|
+
viesStatus: 'pending' | 'valid' | 'invalid' | 'not_verifiable' | null;
|
|
864
|
+
viesCheckedAt: string | null;
|
|
834
865
|
}
|
|
835
866
|
/** @internal wire shape of {@link PaymentParties}. */
|
|
836
867
|
interface RawPaymentParties {
|
|
@@ -838,6 +869,16 @@ interface RawPaymentParties {
|
|
|
838
869
|
delegate: string | null;
|
|
839
870
|
delegate_account: string | null;
|
|
840
871
|
merchant: string | null;
|
|
872
|
+
buyer?: RawPaymentPartiesBuyer;
|
|
873
|
+
}
|
|
874
|
+
/** @internal wire shape of {@link PaymentPartiesBuyer}. */
|
|
875
|
+
interface RawPaymentPartiesBuyer {
|
|
876
|
+
legal_name: string;
|
|
877
|
+
country: string;
|
|
878
|
+
org_number: string;
|
|
879
|
+
vat_number: string | null;
|
|
880
|
+
vies_status: 'pending' | 'valid' | 'invalid' | 'not_verifiable' | null;
|
|
881
|
+
vies_checked_at: string | null;
|
|
841
882
|
}
|
|
842
883
|
/**
|
|
843
884
|
* #3132 (owner decision 3 on #3130): what population a list row came from and
|
|
@@ -1626,6 +1667,33 @@ declare class HavenPaymentStateError extends HavenApiError {
|
|
|
1626
1667
|
get phase(): PaymentPhase;
|
|
1627
1668
|
get nextAction(): PaymentNextAction;
|
|
1628
1669
|
}
|
|
1670
|
+
/**
|
|
1671
|
+
* #3392: the SDK's x402 receipt cache and in-flight map record the
|
|
1672
|
+
* `taskBudgetId` each entry was created under. A call reusing an idempotency
|
|
1673
|
+
* key whose cached/in-flight entry was created under a DIFFERENT task budget
|
|
1674
|
+
* is refused with this typed error BEFORE any network call — the alternative
|
|
1675
|
+
* was silently returning (or joining) a payment charged to another budget.
|
|
1676
|
+
* Typed rather than `HavenApiError`-shaped: no request was attempted, so
|
|
1677
|
+
* there is no HTTP status or response body to carry (the
|
|
1678
|
+
* `HavenZeroSettlementHashError` precedent). A caller that genuinely wants to
|
|
1679
|
+
* pay again under a different budget passes a new `idempotencyKey`.
|
|
1680
|
+
*/
|
|
1681
|
+
declare class X402TaskBudgetMismatchError extends HavenError {
|
|
1682
|
+
/** The idempotency key whose cached entry was created under another budget. */
|
|
1683
|
+
readonly idempotencyKey: string;
|
|
1684
|
+
/** The budget the cached/in-flight entry was created under (undefined = none). */
|
|
1685
|
+
readonly entryTaskBudgetId: string | undefined;
|
|
1686
|
+
/** The budget this call named (undefined = none). */
|
|
1687
|
+
readonly requestedTaskBudgetId: string | undefined;
|
|
1688
|
+
readonly x402ErrorCode: "task_budget_mismatch";
|
|
1689
|
+
constructor(message: string,
|
|
1690
|
+
/** The idempotency key whose cached entry was created under another budget. */
|
|
1691
|
+
idempotencyKey: string,
|
|
1692
|
+
/** The budget the cached/in-flight entry was created under (undefined = none). */
|
|
1693
|
+
entryTaskBudgetId: string | undefined,
|
|
1694
|
+
/** The budget this call named (undefined = none). */
|
|
1695
|
+
requestedTaskBudgetId: string | undefined);
|
|
1696
|
+
}
|
|
1629
1697
|
declare class HavenSigningError extends HavenError {
|
|
1630
1698
|
constructor(message: string);
|
|
1631
1699
|
}
|
|
@@ -1901,7 +1969,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
1901
1969
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
1902
1970
|
* it with the package version on every release — never hand-edit it.
|
|
1903
1971
|
*/
|
|
1904
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
1972
|
+
declare const SDK_VERSION = "0.0.0-dev.202609272032.679e797";
|
|
1905
1973
|
/** The request header every published Haven client sends. */
|
|
1906
1974
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
1907
1975
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -2955,4 +3023,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
2955
3023
|
*/
|
|
2956
3024
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
2957
3025
|
|
|
2958
|
-
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,
|
|
3026
|
+
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, selectStandardPaymentOption 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, createNextStepBuilder as bA, decodeBase64Json as bB, decodeBase64Utf8 as bC, defaultNextToolFor as bD, deriveDelegateAccountAddress as bE, encodeBase64Json as bF, encodeBase64Utf8 as bG, encodePaymentProof as bH, hashDelegation as bI, havenClientIdentity as bJ, isConnectorChannel as bK, isErc7710Option as bL, isPackedUserOperationTypedData as bM, isSupportedNodeVersion as bN, isSweepableChain as bO, isTaskChildTypedData as bP, normalizePaymentRequired as bQ, packedUserOperationHash as bR, parseNextTool as bS, parsePaymentRequired as bT, parsePaymentRequiredResponse as bU, readClientUpdate as bV, renderNextTool as bW, resolveConnectorChannel as bX, resolveTokenFromAddress as bY, selectErc7710PaymentOption as bZ, selectPaymentOption as b_, type X402ExpectedAuth as ba, type X402ExpectedContext as bb, type X402PaymentHeaderContext as bc, X402PaymentHeaderValidationError as bd, type X402PaymentOption as be, type X402RequestSnapshot as bf, type X402SchemeSelection as bg, X402TaskBudgetMismatchError as bh, X402UnexpectedStatusError as bi, X402_LEGACY_PAYMENT_HEADER_NAME as bj, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bk, X402_PAYMENT_HEADER_NAME as bl, X402_PAYMENT_HEADER_NAMES_SENT as bm, X402_PAYMENT_REQUIRED_HEADER_NAME as bn, X402_PAYMENT_RESPONSE_HEADER_NAME as bo, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bp, assertBoundDirectPaymentUserOp as bq, assertOwnTaskBudgetCloseUserOp as br, assertOwnTaskChild as bs, assertUserOpTypedDataBinding as bt, buildSweepAuthorizationMessage as bu, buildSweepTypedData as bv, buildX402ExpectedMessage as bw, compareNodeVersions as bx, connectorRerunCommand as by, connectorSpec as bz, type PaymentIntent as c, selectX402SettlementScheme as c0, signerUpdateFallback as c1, sweepUsdcAddress as c2, sweepUsdcDomain as c3, toStandardPaymentRequirements as c4, unsupportedNodeVersionMessage as c5, validateStandardX402PaymentHeader as c6, verifySettlementChild as c7, x402AssetTransferMethod as c8, x402AuthorizationAmount as c9, x402FacilitatorAddresses as ca, x402V2PaymentEnvelope as cb, CAVEAT_ENFORCERS as cc, CAVEAT_TYPEHASH as cd, DELEGATION_MANAGER as ce, DELEGATION_TYPEHASH as cf, DIRECT_PAYMENT_CHAIN_IDS as cg, type DelegationForHashing as ch, EXECUTE_ABI as ci, HYBRID_DELEGATOR_IMPLEMENTATION as cj, MAX_SETTLEMENT_WINDOW_SECONDS as ck, SIMPLE_FACTORY_ADDRESS as cl, type SettlementChildTypedData as cm, assertFundingLegPaysDelegate as cn, assertOwnSettlementChild as co, chainIdForNetwork as cp, isSettlementChildTypedData as cq, 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 };
|
|
@@ -277,6 +277,10 @@ interface X402AuthorizationOptions {
|
|
|
277
277
|
* a task budget's recipient pin is compared with the agent's own delegate
|
|
278
278
|
* wallet, so a merchant-pinned task budget is refused there
|
|
279
279
|
* (`task_budget_recipient_mismatch`); it pays through erc7710 only (#3378).
|
|
280
|
+
* #3392: the receipt cache and in-flight map record this id per entry —
|
|
281
|
+
* reusing an idempotency key under a DIFFERENT budget throws
|
|
282
|
+
* `X402TaskBudgetMismatchError` before any network call; pay again under a
|
|
283
|
+
* new key instead.
|
|
280
284
|
*/
|
|
281
285
|
taskBudgetId?: string;
|
|
282
286
|
}
|
|
@@ -831,6 +835,33 @@ interface PaymentParties {
|
|
|
831
835
|
delegate: string | null;
|
|
832
836
|
delegateAccount: string | null;
|
|
833
837
|
merchant: string | null;
|
|
838
|
+
/**
|
|
839
|
+
* #3332: the paying agent's owner's company details — additive, present
|
|
840
|
+
* only when the backend has `HAVEN_OWNER_COMPANY_DETAILS` on AND the owner
|
|
841
|
+
* saved details; absent (not `undefined`-valued, the KEY is absent)
|
|
842
|
+
* otherwise. `viesStatus: 'valid'` means VIES accepted the VAT number —
|
|
843
|
+
* never render that as "verified" (see Haven's agent-passport docs on the
|
|
844
|
+
* same naming discipline).
|
|
845
|
+
*
|
|
846
|
+
* Present only on the receipt surfaces — `GET /payments/:id/receipt` and
|
|
847
|
+
* `GET /machine-payments/receipts` (`HavenClient.getReceipt()`,
|
|
848
|
+
* `listReceipts()`/`listReceiptsPage()`) — never on `GET
|
|
849
|
+
* /machine-payments/:id/status` (`getPaymentStatus`) or the evidence-attach echo,
|
|
850
|
+
* even with the feature on: those report payment/settlement state, not the
|
|
851
|
+
* buyer's company details (out of scope for #3332, see
|
|
852
|
+
* docs/product/owner-company-details.md).
|
|
853
|
+
*/
|
|
854
|
+
buyer?: PaymentPartiesBuyer;
|
|
855
|
+
}
|
|
856
|
+
interface PaymentPartiesBuyer {
|
|
857
|
+
legalName: string;
|
|
858
|
+
/** ISO 3166-1 alpha-2. */
|
|
859
|
+
country: string;
|
|
860
|
+
/** For a sole trader this IS the personal identity number. */
|
|
861
|
+
orgNumber: string;
|
|
862
|
+
vatNumber: string | null;
|
|
863
|
+
viesStatus: 'pending' | 'valid' | 'invalid' | 'not_verifiable' | null;
|
|
864
|
+
viesCheckedAt: string | null;
|
|
834
865
|
}
|
|
835
866
|
/** @internal wire shape of {@link PaymentParties}. */
|
|
836
867
|
interface RawPaymentParties {
|
|
@@ -838,6 +869,16 @@ interface RawPaymentParties {
|
|
|
838
869
|
delegate: string | null;
|
|
839
870
|
delegate_account: string | null;
|
|
840
871
|
merchant: string | null;
|
|
872
|
+
buyer?: RawPaymentPartiesBuyer;
|
|
873
|
+
}
|
|
874
|
+
/** @internal wire shape of {@link PaymentPartiesBuyer}. */
|
|
875
|
+
interface RawPaymentPartiesBuyer {
|
|
876
|
+
legal_name: string;
|
|
877
|
+
country: string;
|
|
878
|
+
org_number: string;
|
|
879
|
+
vat_number: string | null;
|
|
880
|
+
vies_status: 'pending' | 'valid' | 'invalid' | 'not_verifiable' | null;
|
|
881
|
+
vies_checked_at: string | null;
|
|
841
882
|
}
|
|
842
883
|
/**
|
|
843
884
|
* #3132 (owner decision 3 on #3130): what population a list row came from and
|
|
@@ -1626,6 +1667,33 @@ declare class HavenPaymentStateError extends HavenApiError {
|
|
|
1626
1667
|
get phase(): PaymentPhase;
|
|
1627
1668
|
get nextAction(): PaymentNextAction;
|
|
1628
1669
|
}
|
|
1670
|
+
/**
|
|
1671
|
+
* #3392: the SDK's x402 receipt cache and in-flight map record the
|
|
1672
|
+
* `taskBudgetId` each entry was created under. A call reusing an idempotency
|
|
1673
|
+
* key whose cached/in-flight entry was created under a DIFFERENT task budget
|
|
1674
|
+
* is refused with this typed error BEFORE any network call — the alternative
|
|
1675
|
+
* was silently returning (or joining) a payment charged to another budget.
|
|
1676
|
+
* Typed rather than `HavenApiError`-shaped: no request was attempted, so
|
|
1677
|
+
* there is no HTTP status or response body to carry (the
|
|
1678
|
+
* `HavenZeroSettlementHashError` precedent). A caller that genuinely wants to
|
|
1679
|
+
* pay again under a different budget passes a new `idempotencyKey`.
|
|
1680
|
+
*/
|
|
1681
|
+
declare class X402TaskBudgetMismatchError extends HavenError {
|
|
1682
|
+
/** The idempotency key whose cached entry was created under another budget. */
|
|
1683
|
+
readonly idempotencyKey: string;
|
|
1684
|
+
/** The budget the cached/in-flight entry was created under (undefined = none). */
|
|
1685
|
+
readonly entryTaskBudgetId: string | undefined;
|
|
1686
|
+
/** The budget this call named (undefined = none). */
|
|
1687
|
+
readonly requestedTaskBudgetId: string | undefined;
|
|
1688
|
+
readonly x402ErrorCode: "task_budget_mismatch";
|
|
1689
|
+
constructor(message: string,
|
|
1690
|
+
/** The idempotency key whose cached entry was created under another budget. */
|
|
1691
|
+
idempotencyKey: string,
|
|
1692
|
+
/** The budget the cached/in-flight entry was created under (undefined = none). */
|
|
1693
|
+
entryTaskBudgetId: string | undefined,
|
|
1694
|
+
/** The budget this call named (undefined = none). */
|
|
1695
|
+
requestedTaskBudgetId: string | undefined);
|
|
1696
|
+
}
|
|
1629
1697
|
declare class HavenSigningError extends HavenError {
|
|
1630
1698
|
constructor(message: string);
|
|
1631
1699
|
}
|
|
@@ -1901,7 +1969,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
1901
1969
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
1902
1970
|
* it with the package version on every release — never hand-edit it.
|
|
1903
1971
|
*/
|
|
1904
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
1972
|
+
declare const SDK_VERSION = "0.0.0-dev.202609272032.679e797";
|
|
1905
1973
|
/** The request header every published Haven client sends. */
|
|
1906
1974
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
1907
1975
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -2955,4 +3023,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
2955
3023
|
*/
|
|
2956
3024
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
2957
3025
|
|
|
2958
|
-
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,
|
|
3026
|
+
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, selectStandardPaymentOption 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, createNextStepBuilder as bA, decodeBase64Json as bB, decodeBase64Utf8 as bC, defaultNextToolFor as bD, deriveDelegateAccountAddress as bE, encodeBase64Json as bF, encodeBase64Utf8 as bG, encodePaymentProof as bH, hashDelegation as bI, havenClientIdentity as bJ, isConnectorChannel as bK, isErc7710Option as bL, isPackedUserOperationTypedData as bM, isSupportedNodeVersion as bN, isSweepableChain as bO, isTaskChildTypedData as bP, normalizePaymentRequired as bQ, packedUserOperationHash as bR, parseNextTool as bS, parsePaymentRequired as bT, parsePaymentRequiredResponse as bU, readClientUpdate as bV, renderNextTool as bW, resolveConnectorChannel as bX, resolveTokenFromAddress as bY, selectErc7710PaymentOption as bZ, selectPaymentOption as b_, type X402ExpectedAuth as ba, type X402ExpectedContext as bb, type X402PaymentHeaderContext as bc, X402PaymentHeaderValidationError as bd, type X402PaymentOption as be, type X402RequestSnapshot as bf, type X402SchemeSelection as bg, X402TaskBudgetMismatchError as bh, X402UnexpectedStatusError as bi, X402_LEGACY_PAYMENT_HEADER_NAME as bj, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bk, X402_PAYMENT_HEADER_NAME as bl, X402_PAYMENT_HEADER_NAMES_SENT as bm, X402_PAYMENT_REQUIRED_HEADER_NAME as bn, X402_PAYMENT_RESPONSE_HEADER_NAME as bo, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bp, assertBoundDirectPaymentUserOp as bq, assertOwnTaskBudgetCloseUserOp as br, assertOwnTaskChild as bs, assertUserOpTypedDataBinding as bt, buildSweepAuthorizationMessage as bu, buildSweepTypedData as bv, buildX402ExpectedMessage as bw, compareNodeVersions as bx, connectorRerunCommand as by, connectorSpec as bz, type PaymentIntent as c, selectX402SettlementScheme as c0, signerUpdateFallback as c1, sweepUsdcAddress as c2, sweepUsdcDomain as c3, toStandardPaymentRequirements as c4, unsupportedNodeVersionMessage as c5, validateStandardX402PaymentHeader as c6, verifySettlementChild as c7, x402AssetTransferMethod as c8, x402AuthorizationAmount as c9, x402FacilitatorAddresses as ca, x402V2PaymentEnvelope as cb, CAVEAT_ENFORCERS as cc, CAVEAT_TYPEHASH as cd, DELEGATION_MANAGER as ce, DELEGATION_TYPEHASH as cf, DIRECT_PAYMENT_CHAIN_IDS as cg, type DelegationForHashing as ch, EXECUTE_ABI as ci, HYBRID_DELEGATOR_IMPLEMENTATION as cj, MAX_SETTLEMENT_WINDOW_SECONDS as ck, SIMPLE_FACTORY_ADDRESS as cl, type SettlementChildTypedData as cm, assertFundingLegPaysDelegate as cn, assertOwnSettlementChild as co, chainIdForNetwork as cp, isSettlementChildTypedData as cq, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HavenSigningError, deriveDelegateAccountAddress, DELEGATION_MANAGER, assertRedeemsOwnBudgetDelegation, verifySettlementChild, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, CAVEAT_ENFORCERS, DELEGATION_TUPLE_COMPONENTS } from './chunk-
|
|
1
|
+
import { HavenSigningError, deriveDelegateAccountAddress, DELEGATION_MANAGER, assertRedeemsOwnBudgetDelegation, verifySettlementChild, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, CAVEAT_ENFORCERS, DELEGATION_TUPLE_COMPONENTS } from './chunk-USEZLMWK.js';
|
|
2
2
|
import { decodeFunctionData, encodeFunctionData, encodePacked, recoverTypedDataAddress, encodeAbiParameters, keccak256 } from 'viem';
|
|
3
3
|
import { createHash } from 'crypto';
|
|
4
4
|
|
|
@@ -777,7 +777,7 @@ function stableStringify2(value) {
|
|
|
777
777
|
}
|
|
778
778
|
|
|
779
779
|
// src/client-identity.ts
|
|
780
|
-
var SDK_VERSION = "0.0.0-dev.
|
|
780
|
+
var SDK_VERSION = "0.0.0-dev.202609272032.679e797";
|
|
781
781
|
var HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
782
782
|
function havenClientIdentity(pkg, version) {
|
|
783
783
|
return `${pkg}/${version}`;
|
|
@@ -1207,5 +1207,5 @@ function hashDelegation(delegation) {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
1209
|
export { CAVEAT_TYPEHASH, DEFAULT_NEXT_TOOL_BY_ACTION, DELEGATION_TYPEHASH, DIRECT_PAYMENT_CHAIN_IDS, ERC7710_ASSET_TRANSFER_METHOD, EXECUTE_ABI, 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, X402_PAYMENT_HEADER_NAMES_SENT, X402_PAYMENT_REQUIRED_HEADER_NAME, X402_PAYMENT_RESPONSE_HEADER_NAME, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, assertBoundDirectPaymentUserOp, assertFundingLegPaysDelegate, assertOwnSettlementChild, assertOwnTaskBudgetCloseUserOp, assertOwnTaskChild, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, buildX402IdempotencyKey, compareNodeVersions, createNextStepBuilder, decodeBase64Json, decodeBase64Utf8, defaultNextToolFor, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, hashDelegation, havenClientIdentity, isErc7710Option, isSupportedNodeVersion, isSweepableChain, isTaskChildTypedData, normalizePaymentRequired, parseNextTool, parsePaymentRequired, parsePaymentRequiredResponse, readClientUpdate, renderNextTool, resolveTokenFromAddress, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402PaymentHeaderNamesFor, x402PaymentHeaderNamesSent, x402V2PaymentEnvelope };
|
|
1210
|
-
//# sourceMappingURL=chunk-
|
|
1211
|
-
//# sourceMappingURL=chunk-
|
|
1210
|
+
//# sourceMappingURL=chunk-BVNBYB7Q.js.map
|
|
1211
|
+
//# sourceMappingURL=chunk-BVNBYB7Q.js.map
|