@haven_ai/sdk 0.1.22-alpha.0 → 0.1.23-alpha.1
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 +11 -7
- package/dist/index.cjs +137 -550
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -158
- package/dist/index.d.ts +110 -158
- package/dist/index.js +137 -547
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -270,6 +270,21 @@ interface X402AuthorizationOptions {
|
|
|
270
270
|
* omit for a non-MCP-tool x402 merchant (plain HTTP resource).
|
|
271
271
|
*/
|
|
272
272
|
mcpCallContext?: X402McpCallContext;
|
|
273
|
+
/**
|
|
274
|
+
* #1348: the agent's delegate address, when the caller already resolved it
|
|
275
|
+
* from `getAgent()` in this same flow — skips `createX402Intent`'s internal
|
|
276
|
+
* agent fetch (one full round trip on every guided purchase). Staleness
|
|
277
|
+
* caveat (#1358 review): the backend derives the funding shape by comparing
|
|
278
|
+
* `payTo` to the CURRENT delegate address, so a value made stale by a
|
|
279
|
+
* delegate rotation mid-flow is not always a clean failure — a pinned-budget
|
|
280
|
+
* agent gets a 403, but an open-budget delegation agent would route to the
|
|
281
|
+
* settlement shape with the stale address. The window is one tool call
|
|
282
|
+
* (previously sub-millisecond, now the merchant-quote duration), never
|
|
283
|
+
* externally suppliable; server-truth hardening is tracked in #1360. Only
|
|
284
|
+
* pass an address fetched in THIS flow; omit to keep the self-contained
|
|
285
|
+
* fetch.
|
|
286
|
+
*/
|
|
287
|
+
delegateAddress?: string;
|
|
273
288
|
}
|
|
274
289
|
/**
|
|
275
290
|
* Keyless x402 construct result.
|
|
@@ -403,6 +418,16 @@ interface X402Quote {
|
|
|
403
418
|
amountAtomic: string;
|
|
404
419
|
amount: string;
|
|
405
420
|
token: string;
|
|
421
|
+
/**
|
|
422
|
+
* #1351: decimals for `asset` on `network`, resolved from the SAME
|
|
423
|
+
* address→token binding that produced `token` — the quote's own authority on
|
|
424
|
+
* how many atomic units one human unit is. `null` when the merchant's asset
|
|
425
|
+
* is not a token Haven recognises on that network, in which case `token` is
|
|
426
|
+
* an unverified fallback label and NO human→atomic conversion is safe.
|
|
427
|
+
* Consumers converting a human-denominated figure (a user-intent spending
|
|
428
|
+
* cap) MUST fail closed on `null` rather than assume 6.
|
|
429
|
+
*/
|
|
430
|
+
decimals: number | null;
|
|
406
431
|
asset: string;
|
|
407
432
|
network: string;
|
|
408
433
|
chainId: number | null;
|
|
@@ -428,49 +453,7 @@ interface X402ResumeState {
|
|
|
428
453
|
chainId: number | null;
|
|
429
454
|
merchantAddress: string;
|
|
430
455
|
}
|
|
431
|
-
|
|
432
|
-
/** Stable caller-supplied key for this user intent. Prevents duplicate approvals across retries. */
|
|
433
|
-
idempotencyKey?: string;
|
|
434
|
-
}
|
|
435
|
-
/** Quote parsed from an MPP challenge without creating a Haven payment. */
|
|
436
|
-
interface MppQuote {
|
|
437
|
-
rail: 'mpp';
|
|
438
|
-
paymentRail: MachinePaymentRail;
|
|
439
|
-
idempotencyKey: string;
|
|
440
|
-
challenge: MachinePaymentChallenge;
|
|
441
|
-
request: X402RequestSnapshot;
|
|
442
|
-
resourceUrl: string;
|
|
443
|
-
description: string | null;
|
|
444
|
-
amountAtomic: string;
|
|
445
|
-
amount: string;
|
|
446
|
-
token: string;
|
|
447
|
-
asset: string;
|
|
448
|
-
network: string;
|
|
449
|
-
chainId: number;
|
|
450
|
-
merchantAddress: string;
|
|
451
|
-
expiresAt: string;
|
|
452
|
-
}
|
|
453
|
-
/** State bundle an agent can persist while waiting for manual MPP approval. */
|
|
454
|
-
interface MppResumeState {
|
|
455
|
-
rail: 'mpp';
|
|
456
|
-
paymentRail: MachinePaymentRail;
|
|
457
|
-
paymentId: string;
|
|
458
|
-
idempotencyKey: string;
|
|
459
|
-
challenge: MachinePaymentChallenge;
|
|
460
|
-
url: string;
|
|
461
|
-
request?: X402RequestSnapshot;
|
|
462
|
-
resourceUrl: string;
|
|
463
|
-
description: string | null;
|
|
464
|
-
amountAtomic: string;
|
|
465
|
-
amount: string;
|
|
466
|
-
token: string;
|
|
467
|
-
asset: string;
|
|
468
|
-
network: string;
|
|
469
|
-
chainId: number;
|
|
470
|
-
merchantAddress: string;
|
|
471
|
-
expiresAt: string;
|
|
472
|
-
}
|
|
473
|
-
type PaymentResumeState = X402ResumeState | MppResumeState;
|
|
456
|
+
type PaymentResumeState = X402ResumeState;
|
|
474
457
|
interface ResumeAuthorizedX402Input extends X402AuthorizationOptions {
|
|
475
458
|
/** Payment or approval request ID returned by authorizeX402 / haven.fetch. */
|
|
476
459
|
paymentId: string;
|
|
@@ -489,63 +472,7 @@ interface ResumeX402PaymentInput extends X402AuthorizationOptions {
|
|
|
489
472
|
/** Original or freshly parsed x402 requirements. Supplying this avoids an extra merchant 402 probe. */
|
|
490
473
|
paymentRequired?: X402PaymentRequired;
|
|
491
474
|
}
|
|
492
|
-
interface ResumeAuthorizedMppInput extends MppAuthorizationOptions {
|
|
493
|
-
/** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
|
|
494
|
-
paymentId: string;
|
|
495
|
-
/** Original MPP challenge returned by the paid resource. */
|
|
496
|
-
challenge: MachinePaymentChallenge;
|
|
497
|
-
}
|
|
498
|
-
interface ResumeMppPaymentInput extends MppAuthorizationOptions {
|
|
499
|
-
/** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
|
|
500
|
-
paymentId: string;
|
|
501
|
-
/** Original paid URL. If challenge is omitted, Haven will call it once to re-read the MPP challenge. */
|
|
502
|
-
url: string;
|
|
503
|
-
/** Original fetch options. Reused for the 402 probe and final merchant retry. */
|
|
504
|
-
init?: RequestInit;
|
|
505
|
-
/** Serializable original request captured by quoteMpp() / pending approval errors. */
|
|
506
|
-
request?: X402RequestSnapshot;
|
|
507
|
-
/** Original MPP challenge. Supplying this avoids an extra paid-resource 402 probe. */
|
|
508
|
-
challenge?: MachinePaymentChallenge;
|
|
509
|
-
}
|
|
510
475
|
type MachinePaymentRail = 'x402' | 'mpp_demo' | 'mpp_crypto' | 'stripe_deposit' | 'spt';
|
|
511
|
-
interface MachinePaymentChallenge {
|
|
512
|
-
rail: MachinePaymentRail;
|
|
513
|
-
version: string;
|
|
514
|
-
challengeId: string;
|
|
515
|
-
resource: string;
|
|
516
|
-
description: string;
|
|
517
|
-
network: {
|
|
518
|
-
chainId: number;
|
|
519
|
-
name: 'base';
|
|
520
|
-
};
|
|
521
|
-
asset: {
|
|
522
|
-
symbol: 'USDC';
|
|
523
|
-
address: string;
|
|
524
|
-
decimals: 6;
|
|
525
|
-
};
|
|
526
|
-
amount: {
|
|
527
|
-
display: string;
|
|
528
|
-
atomic: string;
|
|
529
|
-
};
|
|
530
|
-
recipient: string;
|
|
531
|
-
expiresAt: string;
|
|
532
|
-
metadata?: Record<string, unknown>;
|
|
533
|
-
}
|
|
534
|
-
interface MachinePaymentReceipt {
|
|
535
|
-
success: boolean;
|
|
536
|
-
rail: MachinePaymentRail;
|
|
537
|
-
paymentId: string;
|
|
538
|
-
challengeId: string;
|
|
539
|
-
txHash: string;
|
|
540
|
-
token: string;
|
|
541
|
-
amount: string;
|
|
542
|
-
to: string;
|
|
543
|
-
resourceUrl: string;
|
|
544
|
-
explorerUrl: string;
|
|
545
|
-
payer?: string;
|
|
546
|
-
chainId?: number;
|
|
547
|
-
proofHeader: string;
|
|
548
|
-
}
|
|
549
476
|
interface HavenAgent {
|
|
550
477
|
id: string;
|
|
551
478
|
name: string;
|
|
@@ -825,6 +752,22 @@ declare const AgentPaymentFailureCode: {
|
|
|
825
752
|
* mcp_transport explicitly (the version-skew path).
|
|
826
753
|
*/
|
|
827
754
|
readonly MerchantCallContextUnavailable: "MERCHANT_CALL_CONTEXT_UNAVAILABLE";
|
|
755
|
+
/**
|
|
756
|
+
* #1351: the caller supplied BOTH the atomic `max_amount` and the
|
|
757
|
+
* human-denominated `max_amount_human` cap for one purchase. Haven refuses
|
|
758
|
+
* to guess which the user meant — the two differ by a factor of 10^decimals,
|
|
759
|
+
* so picking wrong is exactly the silent-overspend this cap exists to
|
|
760
|
+
* prevent. Rejected before any merchant probe, funding intent, or signature.
|
|
761
|
+
*/
|
|
762
|
+
readonly AmbiguousMaxAmount: "AMBIGUOUS_MAX_AMOUNT";
|
|
763
|
+
/**
|
|
764
|
+
* #1351: a human-denominated cap was supplied, but it cannot be converted to
|
|
765
|
+
* atomic units against THIS quote — either the quote's asset has no known
|
|
766
|
+
* decimals on its network, or the cap carries more fraction digits than the
|
|
767
|
+
* asset can represent (truncating it would silently change the user's cap).
|
|
768
|
+
* The fallback is the exact atomic `max_amount`.
|
|
769
|
+
*/
|
|
770
|
+
readonly MaxAmountUnconvertible: "MAX_AMOUNT_UNCONVERTIBLE";
|
|
828
771
|
};
|
|
829
772
|
type AgentPaymentFailureCode = (typeof AgentPaymentFailureCode)[keyof typeof AgentPaymentFailureCode];
|
|
830
773
|
/**
|
|
@@ -833,17 +776,19 @@ type AgentPaymentFailureCode = (typeof AgentPaymentFailureCode)[keyof typeof Age
|
|
|
833
776
|
*
|
|
834
777
|
* Two layers of vocabulary share this enum because both reach the wire:
|
|
835
778
|
*
|
|
836
|
-
* - **Categorical rails** identify the rail family and are used as
|
|
837
|
-
*
|
|
779
|
+
* - **Categorical rails** identify the rail family and are used as the
|
|
780
|
+
* `PaymentResumeState` discriminator: `direct`, `x402` (`mpp` remains a
|
|
781
|
+
* valid categorical VALUE on historical status reads, but #1328 retired
|
|
782
|
+
* the `MppResumeState` variant that used to carry it — the mpp_demo
|
|
783
|
+
* client resume flow no longer exists).
|
|
838
784
|
* - **Granular rails** identify the specific protocol the backend persists
|
|
839
785
|
* and returns on response bodies: `mpp_demo`, `mpp_crypto`,
|
|
840
786
|
* `stripe_deposit`, `spt`. `x402` doubles as both categorical and
|
|
841
787
|
* granular.
|
|
842
788
|
*
|
|
843
789
|
* Consumers reading the top-level `rail` field on a payment status response
|
|
844
|
-
* should treat any `mpp*` value as the MPP family
|
|
845
|
-
*
|
|
846
|
-
* with the granular value on `paymentRail`.
|
|
790
|
+
* should treat any `mpp*` value as the MPP family — this still applies to
|
|
791
|
+
* historical `mpp_demo` rows, which remain readable.
|
|
847
792
|
*/
|
|
848
793
|
declare const AgentPaymentRail: {
|
|
849
794
|
/** Standard Haven payment from the user's Safe through an approved delegate allowance. */
|
|
@@ -866,8 +811,8 @@ type PaymentPhase = AgentPaymentPhase;
|
|
|
866
811
|
type PaymentNextAction = AgentPaymentNextAction;
|
|
867
812
|
declare const AGENT_PAYMENT_PHASE_VALUES: ("rejected" | "expired" | "failed" | "agent_signature_required" | "payment_submitted" | "payment_confirmed" | "user_approval_required" | "user_execution_required" | "waiting_for_additional_approvals" | "funding_sent" | "insufficient_funds" | "funded_but_unsettled")[];
|
|
868
813
|
declare const AGENT_PAYMENT_NEXT_ACTION_VALUES: ("sign_and_submit_payment" | "check_status_later" | "none" | "wait_for_user_approval" | "wait_for_user_to_complete_payment" | "retry_original_x402_request" | "stop_and_tell_user" | "request_again_if_user_still_wants_it" | "retry_with_explicit_context" | "payment_window_expired" | "fund_safe_or_raise_allowance" | "sweep_stranded_funds")[];
|
|
869
|
-
declare const AGENT_PAYMENT_FAILURE_CODE_VALUES: ("PRICE_EXCEEDS_MAX" | "PAYMENT_WINDOW_EXPIRED" | "MERCHANT_REJECTED_AFTER_FUNDING" | "MERCHANT_UNRESPONSIVE_AFTER_FUNDING" | "MERCHANT_CALL_CONTEXT_UNAVAILABLE")[];
|
|
870
|
-
declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "
|
|
814
|
+
declare const AGENT_PAYMENT_FAILURE_CODE_VALUES: ("PRICE_EXCEEDS_MAX" | "PAYMENT_WINDOW_EXPIRED" | "MERCHANT_REJECTED_AFTER_FUNDING" | "MERCHANT_UNRESPONSIVE_AFTER_FUNDING" | "MERCHANT_CALL_CONTEXT_UNAVAILABLE" | "AMBIGUOUS_MAX_AMOUNT" | "MAX_AMOUNT_UNCONVERTIBLE")[];
|
|
815
|
+
declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "mpp_demo" | "mpp_crypto" | "stripe_deposit" | "spt" | "direct" | "mpp")[];
|
|
871
816
|
declare const AgentPaymentPhaseDescriptions: Record<AgentPaymentPhase, string>;
|
|
872
817
|
declare const AgentPaymentNextActionDescriptions: Record<AgentPaymentNextAction, string>;
|
|
873
818
|
declare const AgentPaymentFailureCodeDescriptions: Record<AgentPaymentFailureCode, string>;
|
|
@@ -931,6 +876,34 @@ interface AgentNextStep {
|
|
|
931
876
|
safe_to_continue: boolean;
|
|
932
877
|
reason: string;
|
|
933
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* #1349: compact, Haven-generated reporting evidence for a completed x402
|
|
881
|
+
* merchant purchase. `status`, money fields, merchant endpoint/address, and
|
|
882
|
+
* funding transaction come from Haven payment state; `product` and
|
|
883
|
+
* `invoice_id` are optional merchant-supplied display metadata. The raw
|
|
884
|
+
* merchant result remains separate evidence and MUST NOT be used to infer
|
|
885
|
+
* settlement status.
|
|
886
|
+
*/
|
|
887
|
+
interface AgentPurchaseSummary {
|
|
888
|
+
/** Set only after Haven has completed the funding and merchant-settlement flow. */
|
|
889
|
+
status: 'settled';
|
|
890
|
+
product: string | null;
|
|
891
|
+
amount: string | null;
|
|
892
|
+
amount_atomic: string | null;
|
|
893
|
+
asset: string | null;
|
|
894
|
+
network: string | null;
|
|
895
|
+
merchant: {
|
|
896
|
+
address: string | null;
|
|
897
|
+
resource_url: string | null;
|
|
898
|
+
};
|
|
899
|
+
/** Merchant-supplied identifier, or null when the merchant did not supply one. */
|
|
900
|
+
invoice_id: string | null;
|
|
901
|
+
funding_tx_hash: string | null;
|
|
902
|
+
/** Optional merchant receipt reference parsed from PAYMENT-RESPONSE; not Haven settlement proof. */
|
|
903
|
+
settlement_tx_hash: string | null;
|
|
904
|
+
/** Same read-only allowance block returned at the top level, or null when unavailable. */
|
|
905
|
+
allowance: PostPurchaseAllowanceSummary | null;
|
|
906
|
+
}
|
|
934
907
|
/** #1308: compact reporting summary — what the agent tells the user. */
|
|
935
908
|
interface AgentPaymentSummary {
|
|
936
909
|
payment_id: string;
|
|
@@ -941,6 +914,12 @@ interface AgentPaymentSummary {
|
|
|
941
914
|
network?: string;
|
|
942
915
|
expires_at?: string;
|
|
943
916
|
product?: string;
|
|
917
|
+
/**
|
|
918
|
+
* Default reporting contract for a successful `haven_settle_mcp_tool` call.
|
|
919
|
+
* The merchant's raw `result` remains available separately as advanced
|
|
920
|
+
* evidence; do not parse it to determine whether a payment settled.
|
|
921
|
+
*/
|
|
922
|
+
purchase_summary?: AgentPurchaseSummary;
|
|
944
923
|
}
|
|
945
924
|
declare const AgentPaymentRailDescriptions: Record<AgentPaymentRail, string>;
|
|
946
925
|
declare const AgentPaymentPhaseSchema: AgentPaymentEnumSchema;
|
|
@@ -1048,7 +1027,7 @@ declare class X402UnexpectedStatusError extends HavenApiError {
|
|
|
1048
1027
|
}
|
|
1049
1028
|
declare class HavenPaymentStateError extends HavenApiError {
|
|
1050
1029
|
readonly state: PaymentStatusResult;
|
|
1051
|
-
resumeState?: X402ResumeState
|
|
1030
|
+
resumeState?: X402ResumeState;
|
|
1052
1031
|
constructor(message: string, statusCode: number, state: PaymentStatusResult, body?: unknown);
|
|
1053
1032
|
get status(): string;
|
|
1054
1033
|
get phase(): PaymentPhase;
|
|
@@ -1300,7 +1279,6 @@ declare class HavenClient {
|
|
|
1300
1279
|
private readonly chainRpcs;
|
|
1301
1280
|
private readonly inFlightX402;
|
|
1302
1281
|
private readonly x402ReceiptCache;
|
|
1303
|
-
private readonly inFlightMachinePayments;
|
|
1304
1282
|
/**
|
|
1305
1283
|
* Setup-time headers configured via `HavenClientConfig.defaultHeaders`.
|
|
1306
1284
|
* Read-only after construction — use `withRequestContext` for per-call
|
|
@@ -1408,6 +1386,8 @@ declare class HavenClient {
|
|
|
1408
1386
|
* Get the agent identity tied to this API key.
|
|
1409
1387
|
*/
|
|
1410
1388
|
getAgent(): Promise<HavenAgent>;
|
|
1389
|
+
private agentInFlight;
|
|
1390
|
+
private fetchAgent;
|
|
1411
1391
|
/**
|
|
1412
1392
|
* One-shot "am I ready?" bootstrap: identity + live spend authority + a
|
|
1413
1393
|
* readiness signal, in a single call. Folds {@link getAgent} and
|
|
@@ -1478,6 +1458,8 @@ declare class HavenClient {
|
|
|
1478
1458
|
getPostPurchaseAllowanceSummary(paymentId: string): Promise<{
|
|
1479
1459
|
allowance: PostPurchaseAllowanceSummary | null;
|
|
1480
1460
|
warnings: AgentPaymentWarning[];
|
|
1461
|
+
/** Same authenticated payment-state read used to resolve the settled token. */
|
|
1462
|
+
payment: PaymentStatusResult | null;
|
|
1481
1463
|
}>;
|
|
1482
1464
|
/**
|
|
1483
1465
|
* `haven_get_payment_status` convenience: fetch status and, for a
|
|
@@ -1506,6 +1488,7 @@ declare class HavenClient {
|
|
|
1506
1488
|
*/
|
|
1507
1489
|
discoverTools(options?: {
|
|
1508
1490
|
category?: string;
|
|
1491
|
+
search?: string;
|
|
1509
1492
|
rail?: 'x402' | 'mpp';
|
|
1510
1493
|
}): Promise<HavenCatalogEntry[]>;
|
|
1511
1494
|
/**
|
|
@@ -1535,10 +1518,11 @@ declare class HavenClient {
|
|
|
1535
1518
|
verification: ReceiptVerification;
|
|
1536
1519
|
}>;
|
|
1537
1520
|
/**
|
|
1538
|
-
* Rehydrate the x402
|
|
1521
|
+
* Rehydrate the x402 resume-state bundle for a payment id (#1328: the MPP
|
|
1522
|
+
* resume-state variant retired along with the rest of the mpp_demo surface).
|
|
1539
1523
|
*
|
|
1540
1524
|
* The server returns stored protocol context only. The client still signs the
|
|
1541
|
-
* merchant proof locally when resumeX402Payment()
|
|
1525
|
+
* merchant proof locally when resumeX402Payment() runs.
|
|
1542
1526
|
*/
|
|
1543
1527
|
getResumeState(paymentId: string): Promise<PaymentResumeState>;
|
|
1544
1528
|
/**
|
|
@@ -1627,15 +1611,6 @@ declare class HavenClient {
|
|
|
1627
1611
|
* Non-SSE responses pass through untouched.
|
|
1628
1612
|
*/
|
|
1629
1613
|
private surfaceMcpResult;
|
|
1630
|
-
/**
|
|
1631
|
-
* Probe a paid MPP endpoint or inspect an existing challenge without creating
|
|
1632
|
-
* a Haven payment or approval request.
|
|
1633
|
-
*/
|
|
1634
|
-
quoteMpp(challengeOrUrl: MachinePaymentChallenge | string, init?: RequestInit, options?: MppAuthorizationOptions): Promise<MppQuote>;
|
|
1635
|
-
/**
|
|
1636
|
-
* Pay a previously inspected MPP quote and retry the exact captured request.
|
|
1637
|
-
*/
|
|
1638
|
-
payMppChallenge(quote: MppQuote, options?: MppAuthorizationOptions): Promise<Response>;
|
|
1639
1614
|
private retryX402Request;
|
|
1640
1615
|
/**
|
|
1641
1616
|
* #956: capture the merchant's OWN receipt when the paid response carries
|
|
@@ -1704,21 +1679,12 @@ declare class HavenClient {
|
|
|
1704
1679
|
getX402MerchantCallContext(paymentId: string): Promise<X402MerchantCallContext>;
|
|
1705
1680
|
private resolveX402MerchantCompletionContext;
|
|
1706
1681
|
private resolveX402WalletForMerchantCall;
|
|
1707
|
-
authorizeMachinePayment(challenge: MachinePaymentChallenge, options?: MppAuthorizationOptions): Promise<MachinePaymentReceipt>;
|
|
1708
|
-
private authorizeMppDemoPayment;
|
|
1709
|
-
resumeAuthorizedMpp(input: ResumeAuthorizedMppInput): Promise<MachinePaymentReceipt>;
|
|
1710
|
-
resumeMppPayment(input: ResumeMppPaymentInput | MppResumeState): Promise<Response>;
|
|
1711
|
-
private fetchWithMachinePayment;
|
|
1712
|
-
private retryMppRequest;
|
|
1713
1682
|
private assertCanResumeX402;
|
|
1714
|
-
private assertCanResumeMpp;
|
|
1715
1683
|
private mapX402ReceiptFromAuthorization;
|
|
1716
1684
|
private mapX402ReceiptFromStatus;
|
|
1717
1685
|
private buildX402Receipt;
|
|
1718
1686
|
private createStandardX402Header;
|
|
1719
1687
|
private cacheX402Receipt;
|
|
1720
|
-
private mapMachinePaymentReceipt;
|
|
1721
|
-
private mapMachinePaymentReceiptFromStatus;
|
|
1722
1688
|
private recordMerchantRetryRejected;
|
|
1723
1689
|
private reportMachinePaymentEvidence;
|
|
1724
1690
|
/**
|
|
@@ -1742,11 +1708,8 @@ declare class HavenClient {
|
|
|
1742
1708
|
private buildX402Quote;
|
|
1743
1709
|
private detectX402McpTransport;
|
|
1744
1710
|
private buildX402ResumeState;
|
|
1745
|
-
private buildMppQuote;
|
|
1746
|
-
private buildMppResumeState;
|
|
1747
1711
|
private attachResumeState;
|
|
1748
1712
|
private attachX402ResumeState;
|
|
1749
|
-
private attachMppResumeState;
|
|
1750
1713
|
/**
|
|
1751
1714
|
* Execute a tool call by name and input.
|
|
1752
1715
|
*
|
|
@@ -1919,7 +1882,7 @@ declare const toolDescriptions: {
|
|
|
1919
1882
|
readonly payX402OneShot: {
|
|
1920
1883
|
readonly summary: "Fetch an x402 paid HTTP resource in a single call. Handles the full probe -> pay -> retry round trip and returns the merchant response.";
|
|
1921
1884
|
readonly selectionGuidance: "Prefer this over the quote+pay split when the agent just wants the paid resource and does not need to inspect the price first. If you already have a quote from haven_quote_x402, use haven_pay_x402_quote instead. Do not use for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
|
|
1922
|
-
readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns
|
|
1885
|
+
readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns a non-402 status, returns it unchanged without contacting Haven.";
|
|
1923
1886
|
readonly nextActionGuidance: string;
|
|
1924
1887
|
};
|
|
1925
1888
|
readonly resumeX402: {
|
|
@@ -1927,29 +1890,13 @@ declare const toolDescriptions: {
|
|
|
1927
1890
|
readonly behavior: "Accepts either resume_state or payment_id, validates the original x402 details against the approved Haven funding, and retries the merchant request with the X-PAYMENT header. No new Haven approval is created.";
|
|
1928
1891
|
readonly nextActionGuidance: "Only use when get_payment_status returns nextAction=retry_original_x402_request; do not start a new merchant session.";
|
|
1929
1892
|
};
|
|
1930
|
-
readonly quoteMpp: {
|
|
1931
|
-
readonly summary: "Inspect a Haven MPP challenge or paid MPP URL without creating a Haven payment, signature, approval, or on-chain transaction.";
|
|
1932
|
-
readonly behavior: "Parses an MPP challenge envelope and returns a typed quote with rail tag, amount, asset, and merchant context. Pure read-only — Haven is not contacted.";
|
|
1933
|
-
readonly nextActionGuidance: "On success the returned quote is the input to haven_pay_mpp_challenge. Do not call the merchant again — Haven re-uses the captured request when paying.";
|
|
1934
|
-
};
|
|
1935
|
-
readonly payMpp: {
|
|
1936
|
-
readonly summary: "Pay an inspected MPP challenge. The delegate key signs locally; Haven only validates and relays signed, on-chain-constrained payment transactions.";
|
|
1937
|
-
readonly selectionGuidance: "Do not use this for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
|
|
1938
|
-
readonly behavior: "Authorizes the payment through Haven within the on-chain allowance, signs the challenge proof, and returns the proof header for retrying the original paid resource.";
|
|
1939
|
-
readonly nextActionGuidance: "If approval is needed, preserve resume_state or payment_id and wait for nextAction=retry_original_x402_request before resuming.";
|
|
1940
|
-
};
|
|
1941
|
-
readonly resumeMpp: {
|
|
1942
|
-
readonly summary: "Resume an MPP payment after the Haven wallet owner approved the funding step.";
|
|
1943
|
-
readonly behavior: "Accepts either resume_state or payment_id and retries the original paid resource with the MPP proof header. No new Haven approval is created.";
|
|
1944
|
-
readonly nextActionGuidance: "";
|
|
1945
|
-
};
|
|
1946
1893
|
readonly getPaymentStatus: {
|
|
1947
1894
|
readonly summary: "Fetch structured Haven payment status, including phase and nextAction taxonomy for agent recovery.";
|
|
1948
1895
|
readonly behavior: "Accepts a payment intent or approval request id and returns the full state taxonomy (phase, nextAction, rail, amount, merchant, resource url, idempotency key, message).";
|
|
1949
1896
|
readonly nextActionGuidance: "";
|
|
1950
1897
|
};
|
|
1951
1898
|
readonly getResumeState: {
|
|
1952
|
-
readonly summary: "Rehydrate stored x402
|
|
1899
|
+
readonly summary: "Rehydrate stored x402 resume_state by payment_id.";
|
|
1953
1900
|
readonly behavior: "Returns the context that the agent originally received in a pending-approval response, reconstructed from Haven's database. This is context only; signing still happens locally when a resume tool is called.";
|
|
1954
1901
|
readonly nextActionGuidance: "";
|
|
1955
1902
|
};
|
|
@@ -1987,7 +1934,7 @@ declare const toolDescriptions: {
|
|
|
1987
1934
|
readonly summary: "Step 1 of a purchase: discover payable services from Haven's curated merchant catalog — names, prices, and which pay tool to use next.";
|
|
1988
1935
|
readonly selectionGuidance: string;
|
|
1989
1936
|
readonly behavior: string;
|
|
1990
|
-
readonly nextActionGuidance: "Pick an entry and pay it with the tool named in suggested_tool, passing the entry's resource_url, tool_name, and tool_arguments for MCP merchants. Confirm the price from the live pay-tool result (not the catalog), and pass
|
|
1937
|
+
readonly nextActionGuidance: "Pick an entry and pay it with the tool named in suggested_tool, passing the entry's resource_url, tool_name, and tool_arguments for MCP merchants. Confirm the price from the live pay-tool result (not the catalog), and pass the user's cap as max_amount_human in whole tokens (\"no more than 1 USDC\" → max_amount_human: \"1\") — never convert it to atomic units by hand (#1351).";
|
|
1991
1938
|
};
|
|
1992
1939
|
readonly sweep_delegate: {
|
|
1993
1940
|
readonly summary: "Sweep stranded USDC and/or ETH from the delegate wallet back to the originating Safe.";
|
|
@@ -2023,7 +1970,7 @@ type SharedToolKey = keyof typeof toolDescriptions;
|
|
|
2023
1970
|
* this canonical string and asserts byte-for-byte equality, so the two copies
|
|
2024
1971
|
* cannot drift.
|
|
2025
1972
|
*/
|
|
2026
|
-
declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; payments above the remaining budget wait for the\nuser's approval in Haven.\n\nHosted tools run in the `mcp__haven__` namespace. Local signing tools run in\nthe `mcp__haven-signer__` namespace and keep the delegate key on this machine.\nTool results carry the exact next step (`next_action`, `next_tool`,\n`next_arguments`) \u2014 follow those fields first; the prose below is fallback\nand orientation, not the source of truth.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Identity and budget\n\nDo not guess the wallet address, network, or budget.\n\nFor instant orientation at the start of a session, read the non-secret\n`agent.json` the connector wrote to your Haven credential directory (typically\n`~/.haven/agents/<agent-id>/agent.json` \u2014 if you don't know the agent id, list\n`~/.haven/agents/` to find the folder). It\nholds your agent id, Haven wallet address, network, and *configured* per-token\nbudget, and contains no keys \u2014 the fastest way to answer \"who am I and what may\nI spend\" with no round trip. If that file is absent (some setups don't write\nit), use the tools below instead.\n\nBefore any payment, confirm the *live remaining* budget with the tools \u2014\n`agent.json` shows the configured budget, not what is left after recent\nspending:\n\n- `mcp__haven__haven_get_agent` \u2014 the recommended first call: identity\n (wallet, network) plus a readiness signal (`ready` / `needs_approval` /\n `revoked`) and live remaining per-token allowance, in one shot.\n- `mcp__haven__haven_get_allowances` \u2014 detailed per-token breakdown\n (configured, spent, reset window) when you need more than the summary.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is queued for the user to approve in the Haven dashboard \u2014 this is\nnormal, not an error.\n\n## Paying\n\n**Catalog purchases \u2014 the primary path for MCP merchants:**\n\n1. `mcp__haven__haven_discover_tools` to find a payable service and its\n `catalog_id`.\n2. `mcp__haven__haven_prepare_catalog_purchase` with `catalog_id` and\n
|
|
1973
|
+
declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; payments above the remaining budget wait for the\nuser's approval in Haven.\n\nHosted tools run in the `mcp__haven__` namespace. Local signing tools run in\nthe `mcp__haven-signer__` namespace and keep the delegate key on this machine.\nTool results carry the exact next step (`next_action`, `next_tool`,\n`next_arguments`) \u2014 follow those fields first; the prose below is fallback\nand orientation, not the source of truth.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Identity and budget\n\nDo not guess the wallet address, network, or budget.\n\nFor instant orientation at the start of a session, read the non-secret\n`agent.json` the connector wrote to your Haven credential directory (typically\n`~/.haven/agents/<agent-id>/agent.json` \u2014 if you don't know the agent id, list\n`~/.haven/agents/` to find the folder). It\nholds your agent id, Haven wallet address, network, and *configured* per-token\nbudget, and contains no keys \u2014 the fastest way to answer \"who am I and what may\nI spend\" with no round trip. If that file is absent (some setups don't write\nit), use the tools below instead.\n\nBefore any payment, confirm the *live remaining* budget with the tools \u2014\n`agent.json` shows the configured budget, not what is left after recent\nspending:\n\n- `mcp__haven__haven_get_agent` \u2014 the recommended first call: identity\n (wallet, network) plus a readiness signal (`ready` / `needs_approval` /\n `revoked`) and live remaining per-token allowance, in one shot.\n- `mcp__haven__haven_get_allowances` \u2014 detailed per-token breakdown\n (configured, spent, reset window) when you need more than the summary.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is queued for the user to approve in the Haven dashboard \u2014 this is\nnormal, not an error.\n\n## Paying\n\n**Catalog purchases \u2014 the primary path for MCP merchants:**\n\n1. `mcp__haven__haven_discover_tools` to find a payable service and its\n `catalog_id`.\n2. `mcp__haven__haven_prepare_catalog_purchase` with `catalog_id` and a\n spending cap. A cap is REQUIRED on this tool and is best practice on every\n paid call below too \u2014 it caps what the LIVE merchant quote may charge,\n checked before any funding intent is created. Write it the way the user\n said it: `max_amount_human` is whole tokens, so \"no more than 1 USDC\" is\n `max_amount_human: \"1\"`. (`max_amount` is the atomic-unit form, where\n \"1\" means 0.000001 USDC \u2014 do not convert by hand, and never send both.)\n3. Then FOLLOW THE RESPONSE'S GUIDANCE FIELDS: `next_action`, `next_tool`,\n and `next_arguments` name the exact next call \u2014 act on those first; the\n prose in this section is fallback and debugging detail. If the catalog\n entry is missing or degraded, the response instead names\n `mcp__haven__haven_pay_mcp_tool` (merchant URL, tool name, arguments) as\n the manual fallback.\n\n**Signing:** `mcp__haven-signer__haven_sign_x402` with `payment_id` ONLY \u2014\nthe local signer fetches the exact signing bytes AND `payment_required`\nitself, so never relay `typed_data` or the 402 blob yourself. If the signer\nreports its fetched context carried no `payment_required` (older backend),\nre-call with `payment_required` added verbatim. Fallback for an older signer\nor backend: re-run the quote/prepare tool with the SAME `idempotency_key`\nplus `include_signing_payload=true`, then pass `payload_hash`,\n`x402_expected` (the nested `x402.expected` object), and\n`typed_data`/`typed_data_b64` through unchanged.\n\n**Settle:** `mcp__haven__haven_settle_mcp_tool` with `payment_id`,\n`signature`, and `payment_header` ONLY \u2014 Haven rehydrates the merchant call\ncontext (`merchant_url`, `tool_name`, `arguments`, `mcp_transport`)\nserver-side from `payment_id`. Pass those four fields explicitly only as a\nversion-skew fallback when Haven has no stored context for the id \u2014 both or\nnone together, never just one. If the settle result carries `settled: false`,\nfunding is queued for the user's approval \u2014 tell them and check status later,\ndo not re-pay.\n\nStep-by-step alternative (also key-safe; for an older signer or backend, or\nwhen you already have a merchant URL and tool name instead of a\n`catalog_id`): `mcp__haven__haven_pay_mcp_tool` then\n`mcp__haven-signer__haven_sign` \u2192 `mcp__haven__haven_submit` \u2192\n`mcp__haven-signer__haven_x402_sign_header` \u2192\n`mcp__haven__haven_complete_mcp_tool`. Pass `payment_required`,\n`arguments`, and `mcp_transport` verbatim from the quote/prepare result.\nThe returned `expires_at` is the signing window; if a tool returns\n`PAYMENT_WINDOW_EXPIRED`, re-run the same quote/prepare tool with the same\n`idempotency_key`. Do not call the merchant yourself \u2014 Haven completes the\nmerchant leg for you.\n\n**Direct transfer / non-MCP paywall:** `mcp__haven__haven_pay` with\nrecipient, amount, and token for a plain transfer. For an arbitrary,\nnon-MCP x402 paywall: `mcp__haven__haven_quote_x402` to get a quote, then\n`mcp__haven__haven_pay_x402_quote` \u2014 follow the result's guidance fields\nfirst, sign in the local Haven signer, and retry the original request only\nwhen the result says `retry_original_x402_request`.\n\n**Catalog tool arguments:** when `haven_discover_tools` returns\n`tool_arguments`, pass that object unchanged as the pay tool's\n`arguments` field (for example\n`tool_arguments: { \"tier\": \"50gb\" }` -> `arguments: { \"tier\": \"50gb\" }`).\n\n**Prices:** show the user the live price from the pay-tool result, never a\ncatalog price. `haven_discover_tools` prices are indicative\n(`price_is_indicative`) and can be stale. The pay-tool result's `amount` /\n`amount_atomic` is the amount Haven authorizes for the call \u2014 a ceiling the\nmerchant settles at or below \u2014 so present it as the most the user will pay.\n\n**Status:** `mcp__haven__haven_get_payment_status` with a `payment_id` to\ncheck on queued or in-flight payments. Do not poll in a tight loop.\n\n## Approval semantics\n\n- A result with `pending_approval` means the payment exceeded the remaining\n budget and is waiting for the user in Haven. Tell the user, then check\n status later.\n- `safe_to_continue: false` on a guidance block is the same signal in\n machine-readable form: stop and involve the user before calling anything\n else for this payment.\n- Never ask the user for private keys. Signing happens only in the local Haven\n signer; the hosted Haven tools never receive the signing key. If a tool\n reports a missing or invalid credential, tell the user to re-run the Haven\n setup command.\n\n## Failure handling\n\nHaven tool failures are shaped like `{ success: false, code, message, ... }`\nor older `{ error, status, details? }` responses. Branch on `code` when\npresent and surface `message` or `error` verbatim. Common cases:\n\n- `pending_approval`: queued for the user's approval (see above).\n- `insufficient_funds`: the Haven wallet doesn't hold enough of that token.\n Suggest the user add funds in the Haven dashboard.\n- `PRICE_EXCEEDS_MAX`: the live merchant price exceeded your cap. No funds\n moved; ask the user before retrying with a higher one.\n- `AMBIGUOUS_MAX_AMOUNT`: you sent both `max_amount` and\n `max_amount_human`. Nothing was contacted or spent \u2014 re-send with exactly\n one (`max_amount_human` for a cap the user stated in tokens).\n- `MAX_AMOUNT_UNCONVERTIBLE`: `max_amount_human` does not fit this quote's\n asset \u2014 unknown decimals, or more decimal places than the asset supports.\n Round the cap, or send an exact atomic `max_amount`.\n- `PAYMENT_WINDOW_EXPIRED`: re-run the quote/prepare tool with the same\n `idempotency_key`, then sign the fresh payload.\n- `MERCHANT_REJECTED_AFTER_FUNDING`: the merchant refused the paid retry.\n Stop-and-sweep \u2014 stop retrying the merchant and use\n `mcp__haven__haven_sweep_delegate` to recover stranded delegate funds.\n- `MERCHANT_UNRESPONSIVE_AFTER_FUNDING`: funding confirmed on-chain, but the\n merchant never answered the paid retry. This is NOT proof of rejection \u2014 the\n merchant may still settle late. Verify-then-sweep, never a blind sweep:\n check `mcp__haven__haven_get_payment_status`, retry\n `mcp__haven__haven_complete_mcp_tool` ONCE, and only sweep with\n `mcp__haven__haven_sweep_delegate` if no settlement appears.\n- Budget exceeded: tell the user how much remains (from\n `mcp__haven__haven_get_allowances`) and that they can raise the budget in\n Haven.\n\n## Reporting after a purchase\n\nA settled `mcp__haven__haven_settle_mcp_tool` response carries\n`agent_summary.purchase_summary` and the remaining post-purchase allowance\nin `allowance` \u2014 report the product, Haven-derived payment/transaction\nfields, and what is left from those fields directly. `result` is optional\nraw merchant evidence; never use it to decide whether the purchase was paid.\nDo not call `haven_get_agent` or `haven_get_allowances` again just to\nreport a purchase you already made.\n\n## Revoke\n\nIf this agent's credential may have leaked, tell the user to pause or revoke\nthe agent in the Haven dashboard under Agents. New requests stop immediately\nfor that credential.\n";
|
|
2027
1974
|
/** Directory name for the installed skill folder. */
|
|
2028
1975
|
declare const SKILL_FOLDER_NAME = "haven-pay";
|
|
2029
1976
|
|
|
@@ -2061,7 +2008,7 @@ declare const SKILL_FOLDER_NAME = "haven-pay";
|
|
|
2061
2008
|
* package. A guard test in each package asserts exactly that against its own
|
|
2062
2009
|
* `package.json`, so the two cannot drift again silently.
|
|
2063
2010
|
*/
|
|
2064
|
-
declare const HAVEN_MINIMUM_NODE_VERSION = "
|
|
2011
|
+
declare const HAVEN_MINIMUM_NODE_VERSION = "22.0.0";
|
|
2065
2012
|
/**
|
|
2066
2013
|
* Compare two Node versions. Negative when `left` is older.
|
|
2067
2014
|
*
|
|
@@ -2206,11 +2153,16 @@ declare function encodePaymentProof(receipt: {
|
|
|
2206
2153
|
payer?: string;
|
|
2207
2154
|
chainId?: number;
|
|
2208
2155
|
}): string;
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2156
|
+
/**
|
|
2157
|
+
* Resolve a token symbol from a contract address.
|
|
2158
|
+
*
|
|
2159
|
+
* Checks all supported chains. For chain-specific resolution,
|
|
2160
|
+
* pass the optional `network` CAIP-2 string (e.g. "eip155:100").
|
|
2161
|
+
*/
|
|
2162
|
+
declare function resolveTokenFromAddress(address: string, network?: string): {
|
|
2163
|
+
symbol: string;
|
|
2164
|
+
decimals: number;
|
|
2165
|
+
} | null;
|
|
2214
2166
|
|
|
2215
2167
|
/**
|
|
2216
2168
|
* Runtime-agnostic base64 helpers — the single source of truth for the wire
|
|
@@ -2278,4 +2230,4 @@ declare function discoverMerchantMcpUrl(inputUrl: string): Promise<string | null
|
|
|
2278
2230
|
/** Trailing-slash/percent-case echoes compare equal; unparseable never does. */
|
|
2279
2231
|
declare function sameUrl(a: string, b: string): boolean;
|
|
2280
2232
|
|
|
2281
|
-
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type
|
|
2233
|
+
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentRail, MerchantTimeoutError, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedX402Input, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, X402UnexpectedStatusError, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isSupportedNodeVersion, isSweepableChain, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectPaymentOption, selectStandardPaymentOption, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, verifyPaymentReceipt, verifySignature, x402AuthorizationAmount };
|