@dvmkit/sdk 0.1.3-rc.7 → 0.1.5-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +116 -9
  2. package/dist/{chunk-ANFX5HEG.js → chunk-2UUXIIOC.js} +43 -13
  3. package/dist/{chunk-C6JHBLMW.js → chunk-BIP6G74V.js} +1 -1
  4. package/dist/{chunk-EPNDZ5DH.js → chunk-CEOAHV2I.js} +0 -30
  5. package/dist/{chunk-TSWKITGR.js → chunk-CGKZDODG.js} +8 -1
  6. package/dist/{chunk-YDIYXGYL.js → chunk-E4EVGPDX.js} +16 -9
  7. package/dist/{chunk-NFRM5QYP.js → chunk-EVBK675R.js} +5 -0
  8. package/dist/{chunk-DBCLBYHP.js → chunk-KVEHHC7W.js} +11 -1
  9. package/dist/{chunk-2K7E3N2D.js → chunk-KXCKFIJI.js} +77 -14
  10. package/dist/{chunk-3ZHMQCYP.js → chunk-NJFOV36R.js} +663 -235
  11. package/dist/{chunk-5GFED3GJ.js → chunk-NPIW5VR5.js} +40 -6
  12. package/dist/{chunk-LLXV32HA.js → chunk-SSSZUVWM.js} +96 -3
  13. package/dist/{chunk-7AKBC4PW.js → chunk-TQWGQCNV.js} +1 -1
  14. package/dist/{chunk-4B56DEEV.js → chunk-U6M3ATSG.js} +7 -1
  15. package/dist/{credit-menu-C7zAJElJ.d.ts → credit-menu-B-e3vZGo.d.ts} +136 -21
  16. package/dist/{fx-BF_SG2i0.d.ts → fx-CGRJE8rm.d.ts} +1 -1
  17. package/dist/index.d.ts +5 -5
  18. package/dist/internal/caller.d.ts +54 -22
  19. package/dist/internal/caller.js +171 -38
  20. package/dist/internal/index.js +1 -1
  21. package/dist/internal/server.d.ts +8 -8
  22. package/dist/internal/server.js +7 -7
  23. package/dist/{job-store-Bn23V3QU.d.ts → job-store-Cnlv9pOx.d.ts} +16 -1
  24. package/dist/{lightning-backend-C04nH94l.d.ts → lightning-backend-KvQM0YHi.d.ts} +1 -1
  25. package/dist/{memory-credit-ledger-OP24Z2KO.js → memory-credit-ledger-MNUOTQO5.js} +1 -1
  26. package/dist/{mpp-setup-MOBWGTWJ.js → mpp-setup-SPBOF5AM.js} +11 -1
  27. package/dist/{postgres-job-store-TAONYLIF.js → postgres-job-store-3RAXMNSY.js} +1 -1
  28. package/dist/{revenue-reporter-XXSU5KVB.js → revenue-reporter-ASZ7SHHH.js} +1 -1
  29. package/dist/server/index.d.ts +26 -13
  30. package/dist/server/index.js +219 -55
  31. package/dist/{step-cache-3cT4Shk0.d.ts → step-cache-CwM_Q8rK.d.ts} +149 -3
  32. package/dist/{tempo-lifecycle-SQL3KLEZ.js → tempo-lifecycle-DFIXQ54Q.js} +3 -3
  33. package/dist/{tempo-wallet-QOLEIPCV.js → tempo-wallet-4QKSV65O.js} +10 -2
  34. package/dist/testing/index.d.ts +13 -3
  35. package/dist/testing/index.js +31 -2
  36. package/dist/{usd-BnuXoFl5.d.ts → usd-nYZSb7KQ.d.ts} +1 -1
  37. package/dist/{x402-T2C5MX3T.js → x402-5H27DCBE.js} +2 -2
  38. package/package.json +6 -4
@@ -1,21 +1,21 @@
1
- import { aa as CashuMode, bJ as CreditDrainEnqueue, R as ResolvedCreditConfig, bK as DVMAuthScheme, z as SignedRequestDomain, bL as CreditLedgerLike, bM as X402RefundSettlementGate, bN as CreditSnapshot, bO as DrawResult, bP as X402SettlementStatus, bQ as X402UnresolvedRefund, bR as GrownDrawResult, bS as DrawResolution, bT as FundingRecord, W as FundingReceipt, bU as CreditInvoiceRecord, bV as InvoiceSettlement, bW as BlockedInvoiceCursor, bX as InvoiceReconciliation, bY as InvoiceWriteOff, bZ as DrawRecord, b_ as StalePendingDrawCursor, b$ as TempoCreditLossEvidence, c0 as CreditLedgerQuerier, c1 as TempoCreditLoss, c2 as X402CreditLossEvidence, c3 as X402CreditLoss, c4 as DrainMethod, c5 as DrainRequestResult, c6 as BitcoinDepositLiability, bn as FundingLot, c7 as CreditDrainRecord, c8 as ChannelDrainCursor, c9 as DrainWriteOff, ca as DrainReleaseResult, cb as DrainFulfilment, cc as DrainTransitionResult, X as JobReceipt, a0 as Message, K as KVStore, F as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-3cT4Shk0.js';
2
- export { cd as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ce as ClientCompatibility, cf as ClientCompatibilityEnv, cg as ClientCompatibilityGate, ch as ClientCompatibilityRequirement, ci as ClientSemVer, e as CreateSignedRequestVerifierOpts, cj as CreditFundingBasis, ck as CreditInvoiceStatus, cl as CreditLedger, cm as CreditLedgerError, cn as CreditLedgerErrorCode, co as CreditLedgerErrorDetails, cp as CreditLedgerPool, cq as CreditStatus, cr as DRAIN_DELIVERY_RESERVE_SATS, cs as DVM_PROTOCOL_VERSION, ct as DrainConflictReason, cu as DrawRailValue, cv as DrawStatus, cw as PostgresX402ChannelStorage, cx as ReplayStoreBackend, cy as RevenueSkippedNoRailPayload, cz as RevenueSkippedNoRailReason, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, cA as Secp256k1AuthOpts, y as SignedRequestAudience, B as SignedRequestError, E as SignedRequestFailure, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, J as SignedRequestVerifier, cB as X402ChannelStorageOpts, cC as X402RelayLockHolder, cD as X402RelaySubmissionLock, cE as X402RelaySubmissionLockError, cF as allocateDrawValue, cG as clientCompatibilityAttributes, cH as clientCompatibilityMiddleware, cI as clientUpgradeRequired, M as createSignedRequestVerifier, cJ as parseClientCapabilities, cK as parseClientCompatibility, cL as parseDvmClient, cM as parseProtocolVersion, cN as requireClientCompatibility, cO as secp256k1Auth, cP as signedRequestInput, O as signedRequestStatementHeader } from '../step-cache-3cT4Shk0.js';
1
+ import { ab as CashuMode, bK as CreditDrainEnqueue, R as ResolvedCreditConfig, bL as DVMAuthScheme, z as SignedRequestDomain, bM as CreditLedgerLike, bN as X402RefundSettlementGate, bO as CreditSnapshot, bP as DrawResult, bQ as X402SettlementStatus, bR as X402UnresolvedRefund, bS as GrownDrawResult, bT as DrawResolution, bU as FundingRecord, X as FundingReceipt, bV as CreditInvoiceRecord, bW as InvoiceSettlement, bX as BlockedInvoiceCursor, bY as InvoiceReconciliation, bZ as InvoiceWriteOff, b_ as DrawRecord, b$ as StalePendingDrawCursor, c0 as TempoCreditLossEvidence, c1 as CreditLedgerQuerier, c2 as TempoCreditLoss, c3 as X402CreditLossEvidence, c4 as X402CreditLoss, c5 as DrainMethod, c6 as DrainRequestResult, c7 as BitcoinDepositLiability, bo as FundingLot, c8 as CreditDrainRecord, c9 as ChannelDrainCursor, ca as DrainWriteOff, cb as DrainReleaseResult, cc as DrainFulfilment, cd as DrainTransitionResult, Y as JobReceipt, a1 as Message, K as KVStore, F as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-CwM_Q8rK.js';
2
+ export { ce as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, cf as ClientCompatibility, cg as ClientCompatibilityEnv, ch as ClientCompatibilityGate, ci as ClientCompatibilityRequirement, cj as ClientSemVer, e as CreateSignedRequestVerifierOpts, ck as CreditFundingBasis, cl as CreditInvoiceStatus, cm as CreditLedger, cn as CreditLedgerError, co as CreditLedgerErrorCode, cp as CreditLedgerErrorDetails, cq as CreditLedgerPool, cr as CreditStatus, cs as DRAIN_DELIVERY_RESERVE_SATS, ct as DVM_PROTOCOL_VERSION, cu as DrainConflictReason, cv as DrawRailValue, cw as DrawStatus, cx as JobCostReportPayload, cy as PostgresX402ChannelStorage, cz as ReplayStoreBackend, cA as RevenueSkippedNoRailPayload, cB as RevenueSkippedNoRailReason, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, cC as Secp256k1AuthOpts, y as SignedRequestAudience, B as SignedRequestError, E as SignedRequestFailure, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, cD as X402ChannelStorageOpts, cE as X402RelayLockHolder, cF as X402RelaySubmissionLock, cG as X402RelaySubmissionLockError, cH as allocateDrawValue, cI as clientCompatibilityAttributes, cJ as clientCompatibilityMiddleware, cK as clientUpgradeRequired, N as createSignedRequestVerifier, cL as parseClientCapabilities, cM as parseClientCompatibility, cN as parseDvmClient, cO as parseProtocolVersion, cP as requireClientCompatibility, cQ as secp256k1Auth, cR as signedRequestInput, T as signedRequestStatementHeader } from '../step-cache-CwM_Q8rK.js';
3
3
  import { Pool } from 'pg';
4
- import { ak as CreditMenu, b as AppEnv, U as UpfrontPaymentOpts, h as PaymentInfo, al as ReceiptIssuer, am as LightningReceive, an as TempoSettlementReadiness, ao as DVMHostOpts } from '../credit-menu-C7zAJElJ.js';
5
- export { ap as BuildCreditMenuArgs, aq as BuilderIdentity, ar as CREDIT_ENVELOPE_KEYS, C as ConsumedCredentialStore, as as CreateX402BatchSettlementServerOpts, at as CreditEnvelope, au as CreditEnvelopeError, av as CreditFundCommitment, aw as CreditTerms, ax as DEFAULT_INVOICE_TTL_SECONDS, ay as DVMHost, az as JobManager, aA as JobManagerOpts, aB as LightningReceiveConfig, aC as MIN_INVOICE_TTL_SECONDS, aD as MemoryConsumedCredentialStore, aE as MemoryConsumedCredentialStoreOpts, aF as MemoryProcessedPaymentStore, aG as MemoryX402ExactSettlementStore, aH as MountOpts, aI as OwnerDisplay, aJ as PlatformReporterOpts, aK as PostgresProcessedPaymentStore, aL as PostgresX402ExactSettlementStore, aM as PriceFiat, aN as ProcessedPaymentQuerier, aO as ProcessedPaymentRail, aP as ProcessedPaymentRecord, aQ as ProcessedPaymentReplayError, aR as ProcessedPaymentStore, aS as X402BatchAcceptance, aT as X402BatchFunding, aU as X402BatchRefusal, aV as X402BatchSettlementServer, aW as X402ExactAcceptance, aX as X402ExactIntentConflictError, aY as X402ExactSettlementAttempt, aZ as X402ExactSettlementChainEvidence, a_ as X402ExactSettlementEffect, a$ as X402ExactSettlementEvidenceMissingError, b0 as X402ExactSettlementEvidenceReader, b1 as X402ExactSettlementIntent, b2 as X402ExactSettlementNotReadyError, b3 as X402ExactSettlementServer, b4 as X402ExactSettlementServerOpts, b5 as X402ExactSettlementStatus, b6 as X402ExactSettlementStore, b7 as X402SettlementChainEvidence, b8 as X402SettlementEvidenceReader, b9 as X402SettlementSubmissionError, ba as X402_BATCH_AUTO_SETTLEMENT, bb as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bc as X402_BATCH_SETTLEMENT_NETWORK, bd as attachCreditMenu, be as buildCreditMenu, bf as createDVMHost, bg as createX402BatchSettlementServer, bh as creditEnvelopeIgnoreFields, bi as drawSettlementRef, bj as extractCreditEnvelope, bk as fundingCommitment, bl as selectPrimaryCredit, bm as stripCreditEnvelope, bn as toCreditView } from '../credit-menu-C7zAJElJ.js';
4
+ import { ak as CreditMenu, b as AppEnv, U as UpfrontPaymentOpts, h as PaymentInfo, al as ReceiptIssuer, am as LightningReceive, an as TempoSettlementReadiness, ao as DVMHostOpts, ap as DVMServeResult } from '../credit-menu-B-e3vZGo.js';
5
+ export { aq as BuildCreditMenuArgs, ar as BuilderIdentity, as as CREDIT_ENVELOPE_KEYS, C as ConsumedCredentialStore, at as CreateX402BatchSettlementServerOpts, au as CreditEnvelope, av as CreditEnvelopeError, aw as CreditFundCommitment, ax as CreditTerms, ay as DEFAULT_INVOICE_TTL_SECONDS, az as DVMHost, aA as JobManager, aB as JobManagerOpts, aC as LightningReceiveConfig, aD as MIN_INVOICE_TTL_SECONDS, aE as MemoryConsumedCredentialStore, aF as MemoryConsumedCredentialStoreOpts, aG as MemoryProcessedPaymentStore, aH as MemoryX402ExactSettlementStore, aI as MountOpts, aJ as OwnerDisplay, aK as PaidJobCompletion, aL as PaymentMode, aM as PlatformReporterOpts, aN as PostgresProcessedPaymentStore, aO as PostgresX402ExactSettlementStore, aP as PriceFiat, aQ as ProcessedPaymentQuerier, aR as ProcessedPaymentRail, aS as ProcessedPaymentRecord, aT as ProcessedPaymentReplayError, aU as ProcessedPaymentStore, aV as X402BatchAcceptance, aW as X402BatchFunding, aX as X402BatchRefusal, aY as X402BatchSettlementServer, aZ as X402ExactAcceptance, a_ as X402ExactIntentConflictError, a$ as X402ExactSettlementAttempt, b0 as X402ExactSettlementChainEvidence, b1 as X402ExactSettlementEffect, b2 as X402ExactSettlementEvidenceMissingError, b3 as X402ExactSettlementEvidenceReader, b4 as X402ExactSettlementIntent, b5 as X402ExactSettlementNotReadyError, b6 as X402ExactSettlementServer, b7 as X402ExactSettlementServerOpts, b8 as X402ExactSettlementStatus, b9 as X402ExactSettlementStore, ba as X402SettlementChainEvidence, bb as X402SettlementEvidenceReader, bc as X402SettlementSubmissionError, bd as X402_BATCH_AUTO_SETTLEMENT, be as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bf as X402_BATCH_SETTLEMENT_NETWORK, bg as attachCreditMenu, bh as buildCreditMenu, bi as createDVMHost, bj as createX402BatchSettlementServer, bk as creditEnvelopeIgnoreFields, bl as drawSettlementRef, bm as extractCreditEnvelope, bn as fundingCommitment, bo as selectPrimaryCredit, bp as stripCreditEnvelope, bq as toCreditView } from '../credit-menu-B-e3vZGo.js';
6
6
  import { Context } from 'hono';
7
7
  import { z } from 'zod';
8
- import { F as FxFetcher } from '../fx-BF_SG2i0.js';
9
- import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-Bn23V3QU.js';
10
- export { a as JobStatus, b as JobStore, h as isStreamableJobStore } from '../job-store-Bn23V3QU.js';
8
+ import { F as FxFetcher } from '../fx-CGRJE8rm.js';
9
+ import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-Cnlv9pOx.js';
10
+ export { a as JobStatus, b as JobStore, h as isStreamableJobStore } from '../job-store-Cnlv9pOx.js';
11
11
  export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from '../ssrf-DbFkpDv0.js';
12
12
  import 'mppx';
13
13
  import '@x402/core/server';
14
14
  import '@x402/evm/batch-settlement/server';
15
15
  import 'viem';
16
16
  import '@x402/core/types';
17
- import '../lightning-backend-C04nH94l.js';
18
17
  import '@cashu/cashu-ts';
18
+ import '../lightning-backend-KvQM0YHi.js';
19
19
 
20
20
  /** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
21
21
  declare const IMPLICIT_CREDIT_TTL_MS: number;
@@ -265,6 +265,8 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
265
265
  private readonly tempoLosses;
266
266
  private readonly x402Losses;
267
267
  private x402Settlements?;
268
+ /** Internal disposable transaction snapshot. The caller must serialize every ledger access. */
269
+ forkForTransaction(): MemoryCreditLedger;
268
270
  /** See {@link CreditLedger.useX402SettlementGate} — same contract (internal-review). */
269
271
  useX402SettlementGate(gate: X402RefundSettlementGate): void;
270
272
  fund(args: Parameters<CreditLedgerLike["fund"]>[0]): Promise<CreditSnapshot>;
@@ -450,6 +452,20 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
450
452
  private acquireRequestIdClaim;
451
453
  releaseRequestIdClaim(claim: RequestIdClaim): Promise<void>;
452
454
  save(record: JobRecord): Promise<void>;
455
+ /** Persist a job while retaining its mount identity for cost-report recovery. */
456
+ saveForDvm(record: JobRecord, dvmId: string): Promise<void>;
457
+ private saveRecord;
458
+ /**
459
+ * Read terminal zero-revenue jobs whose latest declared-cost revision has
460
+ * not yet reached the durable reporter outbox.
461
+ */
462
+ listUnreportedTerminalCosts(args: {
463
+ dvmId: string;
464
+ limit: number;
465
+ afterJobId?: string;
466
+ }): Promise<JobRecord[]>;
467
+ /** Mark one revision only after its report has reached durable enqueue. */
468
+ markTerminalCostReported(jobId: string, costRevision: number): Promise<boolean>;
453
469
  delete(id: string): Promise<void>;
454
470
  listJobsForRetention(args: {
455
471
  lastActivityBeforeMs: number;
@@ -600,9 +616,6 @@ declare function hasInvalidRequestId(data: unknown): boolean;
600
616
  * exposed to the wiring-drift bug class fixed in internal-review/485/511, which was
601
617
  * about bypassing the host entirely. There is no migration to do.
602
618
  */
603
- declare function serve<State, InputSchema extends ZodLike | undefined = undefined>(descriptor: DVMDescriptor<State, InputSchema>, opts?: DVMHostOpts): Promise<{
604
- url: string;
605
- close: () => Promise<void>;
606
- }>;
619
+ declare function serve<State, InputSchema extends ZodLike | undefined = undefined>(descriptor: DVMDescriptor<State, InputSchema>, opts?: DVMHostOpts): Promise<DVMServeResult>;
607
620
 
608
- export { BlockedInvoiceCursor, CREDIT_REQUEST_SCHEMA, CreditInvoiceRecord, CreditLedgerLike, CreditLedgerQuerier, CreditMenu, type CreditRequest, type CreditRouteDeps, CreditSnapshot, DVMAuthScheme, DVMHostOpts, DrawRecord, DrawResolution, DrawResult, FundingRecord, GrownDrawResult, IMPLICIT_CREDIT_TTL_MS, type InitLockPool, InvoiceReconciliation, InvoiceSettlement, InvoiceWriteOff, JobRecord, LightningReceive, MemoryCreditLedger, PostgresJobStore, PostgresKVStore, PostgresReplayStore, type PostgresReplayStoreOpts, REQUEST_ID_FIELD, type ResolvedCashuOpts, SDK_INIT_ADVISORY_LOCK, SignedRequestDomain, SignedRequestReplayStore, StalePendingDrawCursor, StreamableJobStore, handleCreditRequest, hasInvalidRequestId, protocolEnvelopeIgnoreFields, requestIdFromEnvelope, resolveCashuOptsFromEnv, serve, stripProtocolEnvelope, withSdkInitLock };
621
+ export { BlockedInvoiceCursor, CREDIT_REQUEST_SCHEMA, CreditInvoiceRecord, CreditLedgerLike, CreditLedgerQuerier, CreditMenu, type CreditRequest, type CreditRouteDeps, CreditSnapshot, DVMAuthScheme, DVMHostOpts, DVMServeResult, DrawRecord, DrawResolution, DrawResult, FundingRecord, GrownDrawResult, IMPLICIT_CREDIT_TTL_MS, type InitLockPool, InvoiceReconciliation, InvoiceSettlement, InvoiceWriteOff, JobRecord, LightningReceive, MemoryCreditLedger, PostgresJobStore, PostgresKVStore, PostgresReplayStore, type PostgresReplayStoreOpts, REQUEST_ID_FIELD, type ResolvedCashuOpts, SDK_INIT_ADVISORY_LOCK, SignedRequestDomain, SignedRequestReplayStore, StalePendingDrawCursor, StreamableJobStore, handleCreditRequest, hasInvalidRequestId, protocolEnvelopeIgnoreFields, requestIdFromEnvelope, resolveCashuOptsFromEnv, serve, stripProtocolEnvelope, withSdkInitLock };
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-L4OYF4DQ.js";
4
4
  import {
5
5
  PostgresJobStore
6
- } from "../chunk-LLXV32HA.js";
6
+ } from "../chunk-SSSZUVWM.js";
7
7
  import {
8
8
  PostgresKVStore
9
9
  } from "../chunk-FROTD5XQ.js";
@@ -18,15 +18,15 @@ import {
18
18
  NwcBackend,
19
19
  NwcError,
20
20
  SpanWriter,
21
- isTestMintUrl,
22
21
  parseNwcUri,
23
22
  validateX402Env,
24
23
  withNwcPool
25
- } from "../chunk-EPNDZ5DH.js";
24
+ } from "../chunk-CEOAHV2I.js";
26
25
  import {
27
26
  MemoryKVStore
28
27
  } from "../chunk-RW5LP57K.js";
29
28
  import {
29
+ AccumulatorReplayError,
30
30
  CLIENT_COMPATIBILITY_HEADERS,
31
31
  CREDIT_ENVELOPE_KEYS,
32
32
  CREDIT_REQUEST_SCHEMA,
@@ -56,6 +56,7 @@ import {
56
56
  createPlatformTempoObserverHealth,
57
57
  createX402BatchSettlementServer,
58
58
  creditEnvelopeIgnoreFields,
59
+ devModeSkipsPaymentVerification,
59
60
  drawSettlementRef,
60
61
  extractCreditEnvelope,
61
62
  fundingCommitment,
@@ -77,7 +78,7 @@ import {
77
78
  stripProtocolEnvelope,
78
79
  toCreditView,
79
80
  unknownRouteNotFound
80
- } from "../chunk-3ZHMQCYP.js";
81
+ } from "../chunk-NJFOV36R.js";
81
82
  import {
82
83
  MemoryProcessedPaymentStore,
83
84
  PostgresProcessedPaymentStore,
@@ -86,7 +87,7 @@ import {
86
87
  import "../chunk-BQ2NMWKE.js";
87
88
  import {
88
89
  MemoryCreditLedger
89
- } from "../chunk-DBCLBYHP.js";
90
+ } from "../chunk-KVEHHC7W.js";
90
91
  import {
91
92
  SignedRequestError,
92
93
  createDefaultReplayStore,
@@ -95,11 +96,12 @@ import {
95
96
  } from "../chunk-H2MEFVH6.js";
96
97
  import {
97
98
  isStreamableJobStore
98
- } from "../chunk-4B56DEEV.js";
99
+ } from "../chunk-U6M3ATSG.js";
99
100
  import {
100
101
  generateEphemeralReceiptKey,
102
+ isTestMintUrl,
101
103
  receiptPubkeyFromSecret
102
- } from "../chunk-2K7E3N2D.js";
104
+ } from "../chunk-KXCKFIJI.js";
103
105
  import {
104
106
  X402_DEFAULT_FACILITATOR,
105
107
  X402_DEFAULT_NETWORK,
@@ -119,7 +121,7 @@ import {
119
121
  } from "../chunk-KXZUCCEY.js";
120
122
  import {
121
123
  initLoggers
122
- } from "../chunk-YDIYXGYL.js";
124
+ } from "../chunk-E4EVGPDX.js";
123
125
  import "../chunk-66HGCPBU.js";
124
126
  import "../chunk-FUJ36YDV.js";
125
127
  import "../chunk-27V2ILSR.js";
@@ -140,10 +142,12 @@ import {
140
142
  applyRetryToPool
141
143
  } from "../chunk-C3MTFLC6.js";
142
144
  import {
145
+ TEMPO_MODERATO_CHAIN_ID,
146
+ TEMPO_MODERATO_RPC,
143
147
  TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
144
- TEMPO_USDC_MAINNET,
145
- TempoSettlementReadiness
146
- } from "../chunk-5GFED3GJ.js";
148
+ TempoSettlementReadiness,
149
+ resolveTempoNetwork
150
+ } from "../chunk-NPIW5VR5.js";
147
151
 
148
152
  // src/sdk/server/cashu-env.ts
149
153
  async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
@@ -223,6 +227,69 @@ async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
223
227
  return { cashuMode, lockPubkey, lockPubkeyGraceSeconds, db, dvmId, canonicalDvmId };
224
228
  }
225
229
 
230
+ // src/sdk/server/payment-mode.ts
231
+ function resolvePaymentMode(opts) {
232
+ const active = (rail, configured, ready) => ({
233
+ status: !configured && !opts.paymentMethods?.includes(rail) ? "absent" : ready && (!opts.paymentMethods || opts.paymentMethods.includes(rail)) ? "verifying" : "unavailable",
234
+ testFunds: rail === "cashu" ? opts.mints?.length ? opts.mints.every(isTestMintUrl) : null : rail === "x402" ? opts.x402 ? ["base-sepolia", "eip155:84532"].includes(opts.x402.network) : null : opts.mpp?.tempoConfiguration ? opts.mpp.tempoConfiguration.chainId === TEMPO_MODERATO_CHAIN_ID : null
235
+ });
236
+ return {
237
+ mount: opts.mount,
238
+ verification: devModeSkipsPaymentVerification(opts) ? "skipped" : "required",
239
+ storage: opts.durable ? "durable" : "disposable",
240
+ rails: {
241
+ cashu: active("cashu", opts.mints !== void 0, opts.cashuReady),
242
+ x402: active("x402", !!opts.x402, !!opts.x402 && opts.x402Available),
243
+ tempo: active("tempo", !!opts.mpp, !!opts.mpp?.methods.some((method) => method.name === "tempo"))
244
+ }
245
+ };
246
+ }
247
+
248
+ // src/sdk/server/host.ts
249
+ import { randomUUID as randomUUID2 } from "crypto";
250
+
251
+ // src/sdk/server/disposable-cashu-store.ts
252
+ function createDisposableCashuStore() {
253
+ let current = new MemoryCreditLedger();
254
+ let tail = Promise.resolve();
255
+ const requests = /* @__PURE__ */ new Set();
256
+ const secrets = /* @__PURE__ */ new Set();
257
+ function exclusive(operation) {
258
+ const result = tail.then(operation);
259
+ tail = result.then(() => void 0, () => void 0);
260
+ return result;
261
+ }
262
+ const ledger = new Proxy(current, {
263
+ get(_target, key) {
264
+ const member = Reflect.get(current, key);
265
+ if (typeof member !== "function") return member;
266
+ if (key === "useX402SettlementGate") return member.bind(current);
267
+ return (...args) => exclusive(async () => {
268
+ const method = Reflect.get(current, key);
269
+ return await method.apply(current, args);
270
+ });
271
+ }
272
+ });
273
+ return {
274
+ ledger,
275
+ accumulator: {
276
+ commit(requestId, proofs, account) {
277
+ return exclusive(async () => {
278
+ const incoming = proofs.map((proof) => proof.secret);
279
+ if (requests.has(requestId) || new Set(incoming).size !== incoming.length || incoming.some((secret) => secrets.has(secret))) {
280
+ throw new AccumulatorReplayError("disposable", requestId);
281
+ }
282
+ const staged = current.forkForTransaction();
283
+ await account(staged);
284
+ current = staged;
285
+ requests.add(requestId);
286
+ for (const secret of incoming) secrets.add(secret);
287
+ });
288
+ }
289
+ }
290
+ };
291
+ }
292
+
226
293
  // src/sdk/server/host.ts
227
294
  import { serve as honoServe } from "@hono/node-server";
228
295
  import { Hono } from "hono";
@@ -1079,6 +1146,7 @@ function createDVMHost(opts = {}) {
1079
1146
  app.use("*", clientCompatibilityMiddleware());
1080
1147
  const routeClientCompatibility = opts.wrapRouteClientCompatibility?.(requireClientCompatibility) ?? requireClientCompatibility;
1081
1148
  const mounts = [];
1149
+ const paymentModes = [];
1082
1150
  const ownsPool = !opts.pool;
1083
1151
  let pgPool;
1084
1152
  let creditLedger;
@@ -1091,10 +1159,12 @@ function createDVMHost(opts = {}) {
1091
1159
  let pgStreamStore;
1092
1160
  let nodeServer;
1093
1161
  let spanWriter;
1162
+ let shutdownPromise;
1163
+ let serveAttempted = false;
1094
1164
  function mount(descriptor, mountOpts) {
1095
- mounts.push({ descriptor, prefix: mountOpts?.prefix });
1165
+ mounts.push({ descriptor, prefix: mountOpts?.prefix, bootCompleted: false });
1096
1166
  }
1097
- async function serveFn(serveOpts) {
1167
+ async function boot(serveOpts) {
1098
1168
  const env = opts.env ?? Object.fromEntries(
1099
1169
  Object.entries(process.env).filter(
1100
1170
  (entry) => entry[1] !== void 0
@@ -1130,7 +1200,7 @@ function createDVMHost(opts = {}) {
1130
1200
  });
1131
1201
  applyRetryToPool(pool, "dvm-host");
1132
1202
  pgPool = pool;
1133
- const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-TAONYLIF.js");
1203
+ const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-3RAXMNSY.js");
1134
1204
  const pgJobStore = new PostgresJobStore2(pool);
1135
1205
  pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
1136
1206
  jobStore = pgJobStore;
@@ -1143,11 +1213,25 @@ function createDVMHost(opts = {}) {
1143
1213
  kvBackend = "postgres";
1144
1214
  }
1145
1215
  }
1146
- const cashuOpts = await resolveCashuOptsFromEnv(env, pgPool, opts.cashuMode);
1147
1216
  const mintsFromEnv = envMaybe.DVMKIT_CASHU_MINTS?.split(",").map((m) => m.trim()).filter(Boolean);
1148
- let effectiveMints = opts.mints ?? mintsFromEnv;
1149
- if (cashuOpts.cashuMode === "p2pk-accumulator" && !cashuOpts.db) {
1150
- effectiveMints = void 0;
1217
+ const effectiveMints = opts.mints ?? mintsFromEnv;
1218
+ const disposableCashu = opts.devMode && !pgPool && (effectiveMints?.length ?? 0) > 0 ? createDisposableCashuStore() : void 0;
1219
+ if (disposableCashu && !effectiveMints.every(isTestMintUrl)) {
1220
+ throw new Error("Disposable development Cashu accepts only known test or loopback mints. Real or unknown mints require durable PostgreSQL storage.");
1221
+ }
1222
+ if (disposableCashu && opts.cashuMode === void 0) {
1223
+ console.log(JSON.stringify({ level: "info", message: "Cashu mode: p2pk-accumulator (default)" }));
1224
+ }
1225
+ const cashuOpts = disposableCashu ? {
1226
+ cashuMode: "p2pk-accumulator",
1227
+ lockPubkey: `02${generateEphemeralReceiptKey().pubkey}`,
1228
+ lockPubkeyGraceSeconds: 0,
1229
+ dvmId: randomUUID2(),
1230
+ canonicalDvmId: void 0,
1231
+ db: void 0
1232
+ } : await resolveCashuOptsFromEnv(env, pgPool, opts.cashuMode);
1233
+ if (envMaybe.BUILDER_LOCK_PRIVKEY) {
1234
+ throw new Error("BUILDER_LOCK_PRIVKEY must not be set on a DVM machine.");
1151
1235
  }
1152
1236
  if (!opts.devMode && effectiveMints && effectiveMints.length > 0 && envMaybe.DVMKIT_PLATFORM_URL) {
1153
1237
  const testMints = effectiveMints.filter(isTestMintUrl);
@@ -1207,7 +1291,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1207
1291
  let tempoChargeBackend = "user-supplied";
1208
1292
  const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
1209
1293
  if (!mpp && mppTempoRecipient) {
1210
- const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-MOBWGTWJ.js");
1294
+ const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-SPBOF5AM.js");
1211
1295
  tempoChargeBackend = pgPool ? "postgres" : "memory";
1212
1296
  let tempoCharge;
1213
1297
  if (pgPool) {
@@ -1240,11 +1324,14 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1240
1324
  tempoPayoutReader.listActive = (limit, cursor) => sessionStore.listActive(limit, cursor);
1241
1325
  pendingInits.push(sessionStore.init());
1242
1326
  const operator = privateKeyToAccount2(tempoOperatorKey);
1243
- const tempoCurrency = envMaybe.DVMKIT_TEMPO_CURRENCY ?? TEMPO_USDC_MAINNET;
1244
- const mainnetRpc = resolveRpcOverride(envMaybe.DVMKIT_TEMPO_RPC_URL).url;
1327
+ const tempoNetwork = resolveTempoNetwork(envMaybe);
1328
+ const tempoCurrency = tempoNetwork.currency;
1329
+ const selectedChain = tempoNetwork.chainId === tempoModerato.id ? tempoModerato : tempoNetwork.chainId === tempoMainnet.id ? tempoMainnet : { ...tempoNetwork.testnet ? tempoModerato : tempoMainnet, id: tempoNetwork.chainId };
1330
+ const bundledRpc = tempoNetwork.chainId === TEMPO_MODERATO_CHAIN_ID ? TEMPO_MODERATO_RPC : selectedChain.rpcUrls.default.http[0];
1331
+ const tempoRpc = resolveRpcOverride(envMaybe.DVMKIT_TEMPO_RPC_URL, bundledRpc).url;
1245
1332
  const publicClient = createPublicClient({
1246
- chain: tempoMainnet,
1247
- transport: http(mainnetRpc)
1333
+ chain: selectedChain,
1334
+ transport: http(tempoRpc)
1248
1335
  });
1249
1336
  if (envMaybe.DVMKIT_PLATFORM_URL) {
1250
1337
  if (!cashuOpts.dvmId) {
@@ -1258,7 +1345,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1258
1345
  pendingInits.push(readinessStore.init());
1259
1346
  tempoSettlementReadiness = new TempoSettlementReadiness({
1260
1347
  address: operator.address,
1261
- network: `eip155:${tempoMainnet.id}`,
1348
+ network: `eip155:${tempoNetwork.chainId}`,
1262
1349
  token: tempoCurrency,
1263
1350
  lowBalanceMicro: parseTempoSettlementFloor(envMaybe),
1264
1351
  stateStore: readinessStore,
@@ -1273,15 +1360,20 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1273
1360
  tempoSession = {
1274
1361
  store: sessionStore,
1275
1362
  account: operator,
1363
+ chainId: tempoNetwork.chainId,
1276
1364
  getClient: ({ chainId }) => {
1277
- const chain = chainId === tempoModerato.id ? tempoModerato : tempoMainnet;
1365
+ if (chainId !== void 0 && chainId !== tempoNetwork.chainId) {
1366
+ throw new Error(
1367
+ `Tempo session requested chain ${chainId}, but the host is configured for chain ${tempoNetwork.chainId}.`
1368
+ );
1369
+ }
1278
1370
  return createWalletClient({
1279
1371
  account: operator,
1280
- chain,
1372
+ chain: selectedChain,
1281
1373
  // Trimmed, so a blank DVMKIT_TEMPO_RPC_URL falls back to the
1282
1374
  // chain's bundled endpoint rather than becoming the transport
1283
1375
  // target (internal-review).
1284
- transport: http(resolveRpcOverride(envMaybe.DVMKIT_TEMPO_RPC_URL).url)
1376
+ transport: http(tempoRpc)
1285
1377
  });
1286
1378
  },
1287
1379
  settlementSchedule: { intervalMs: 24 * 60 * 60 * 1e3 },
@@ -1406,8 +1498,8 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1406
1498
  pendingInits.push(pgProcessed.init());
1407
1499
  processedPayments = pgProcessed;
1408
1500
  } else {
1409
- const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-OP24Z2KO.js");
1410
- creditLedger = new MemoryCreditLedger2();
1501
+ const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-MNUOTQO5.js");
1502
+ creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
1411
1503
  const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-HAA4SFNK.js");
1412
1504
  processedPayments = new MemoryProcessedPaymentStore2();
1413
1505
  }
@@ -1477,6 +1569,33 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1477
1569
  const descX402Support = descX402Health?.support();
1478
1570
  if (!bootX402Support && descX402Support) bootX402Support = descX402Support;
1479
1571
  const descMpp = descriptor.mpp ?? mpp;
1572
+ const x402Settleable = isConfiguredX402Settleable(
1573
+ descX402Support,
1574
+ descX402WithDualServe
1575
+ );
1576
+ if (descX402Support && !x402Settleable) {
1577
+ const message = `x402 network ${descX402Support.network} has no settleable kind at facilitator ${descX402Support.facilitator}. Use eip155:84532 (Base Sepolia) with x402.org for test funds, or a facilitator supporting your configured mainnet. No network was changed.`;
1578
+ if (failFast) throw new Error(message);
1579
+ console.warn(JSON.stringify({ level: "warn", event: "x402_network_unsupported", message }));
1580
+ }
1581
+ const paymentMode = resolvePaymentMode({
1582
+ mount: descriptor.name,
1583
+ devMode: opts.devMode,
1584
+ mints: effectiveMints,
1585
+ x402: descX402WithDualServe,
1586
+ mpp: descMpp,
1587
+ paymentMethods: opts.paymentMethods ?? descriptor.paymentMethods,
1588
+ cashuReady: !!cashuOpts.lockPubkey && !!(cashuOpts.db || disposableCashu) && !!effectiveMints?.length,
1589
+ x402Available: x402Settleable,
1590
+ durable: !!pgPool
1591
+ });
1592
+ paymentModes.push(paymentMode);
1593
+ console.log(JSON.stringify({
1594
+ level: "info",
1595
+ event: "payment_mode",
1596
+ ...paymentMode,
1597
+ ...disposableCashu ? { message: "Test funds only. Proofs, balances and jobs are lost on shutdown; the next boot uses a fresh Cashu lock identity." } : {}
1598
+ }));
1480
1599
  const {
1481
1600
  app: subApp,
1482
1601
  shutdown,
@@ -1488,6 +1607,8 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1488
1607
  mints: effectiveMints,
1489
1608
  jobStore,
1490
1609
  devMode: opts.devMode,
1610
+ onPaidJobCompleted: opts.onPaidJobCompleted,
1611
+ paymentMode,
1491
1612
  paymentMethods: opts.paymentMethods ?? descriptor.paymentMethods,
1492
1613
  x402: descX402WithDualServe,
1493
1614
  x402FacilitatorHealth: descX402Health,
@@ -1495,6 +1616,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1495
1616
  consumedCredentialStore: opts.consumedCredentialStore ?? sharedPgConsumedStore,
1496
1617
  adminCashuNonceStore: sharedPgConsumedStore,
1497
1618
  cashuMode: cashuOpts.cashuMode,
1619
+ disposableCashu: disposableCashu?.accumulator,
1498
1620
  lockPubkey: cashuOpts.lockPubkey,
1499
1621
  lockPubkeyGraceSeconds: cashuOpts.lockPubkeyGraceSeconds,
1500
1622
  canonicalDvmId: cashuOpts.canonicalDvmId,
@@ -1546,6 +1668,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1546
1668
  if (entry.descriptor.config.onBoot) {
1547
1669
  await entry.descriptor.config.onBoot(env);
1548
1670
  }
1671
+ entry.bootCompleted = true;
1549
1672
  }
1550
1673
  mark("onboot");
1551
1674
  logBootSummary({
@@ -1593,21 +1716,63 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1593
1716
  console.log(`DVM host running at ${url}`);
1594
1717
  resolvePromise({
1595
1718
  url,
1596
- async close() {
1597
- await shutdownInternal();
1719
+ paymentModes,
1720
+ close() {
1721
+ return shutdownInternal();
1598
1722
  }
1599
1723
  });
1600
1724
  });
1601
1725
  });
1602
1726
  }
1603
- async function shutdownInternal() {
1727
+ async function serveFn(serveOpts) {
1728
+ if (serveAttempted) {
1729
+ throw new Error("A DVM host can only serve once. Create a new host to retry after shutdown.");
1730
+ }
1731
+ serveAttempted = true;
1732
+ try {
1733
+ return await boot(serveOpts);
1734
+ } catch (bootError) {
1735
+ await shutdownInternal().catch(() => void 0);
1736
+ throw bootError;
1737
+ }
1738
+ }
1739
+ function shutdownInternal() {
1740
+ return shutdownPromise ??= performShutdown();
1741
+ }
1742
+ async function performShutdown() {
1743
+ const errors = [];
1744
+ const capture = async (operation) => {
1745
+ try {
1746
+ await operation();
1747
+ } catch (error) {
1748
+ errors.push(error);
1749
+ }
1750
+ };
1751
+ if (nodeServer) {
1752
+ const server = nodeServer;
1753
+ await capture(
1754
+ () => new Promise((resolve) => {
1755
+ const idleSweep = setInterval(() => {
1756
+ server.closeIdleConnections();
1757
+ }, IDLE_CONNECTION_SWEEP_MS);
1758
+ idleSweep.unref();
1759
+ server.close(() => {
1760
+ clearInterval(idleSweep);
1761
+ resolve();
1762
+ });
1763
+ server.closeIdleConnections();
1764
+ })
1765
+ );
1766
+ nodeServer = void 0;
1767
+ }
1604
1768
  if (spanWriter) {
1605
- await spanWriter.shutdown();
1769
+ const writer = spanWriter;
1606
1770
  spanWriter = void 0;
1771
+ await capture(() => writer.shutdown());
1607
1772
  }
1608
1773
  for (let i = mounts.length - 1; i >= 0; i--) {
1609
1774
  const entry = mounts[i];
1610
- if (entry.descriptor.config.onShutdown) {
1775
+ if (entry.bootCompleted && entry.descriptor.config.onShutdown) {
1611
1776
  try {
1612
1777
  await entry.descriptor.config.onShutdown();
1613
1778
  } catch (err) {
@@ -1617,34 +1782,27 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1617
1782
  );
1618
1783
  }
1619
1784
  }
1620
- entry.shutdown?.();
1621
- }
1622
- if (nodeServer) {
1623
- const server = nodeServer;
1624
- await new Promise((resolve) => {
1625
- const idleSweep = setInterval(() => {
1626
- server.closeIdleConnections();
1627
- }, IDLE_CONNECTION_SWEEP_MS);
1628
- idleSweep.unref();
1629
- server.close(() => {
1630
- clearInterval(idleSweep);
1631
- resolve();
1632
- });
1633
- server.closeIdleConnections();
1634
- });
1635
- nodeServer = void 0;
1785
+ await capture(() => entry.shutdown?.());
1636
1786
  }
1637
1787
  if (pgStreamStore && isStreamableJobStore(pgStreamStore)) {
1638
- await pgStreamStore.shutdownStreaming();
1788
+ await capture(() => pgStreamStore?.shutdownStreaming());
1639
1789
  }
1640
1790
  if (pgPool && ownsPool) {
1641
- await pgPool.end();
1791
+ const ownedPool = pgPool;
1792
+ await capture(() => ownedPool.end());
1642
1793
  }
1643
1794
  pgPool = void 0;
1644
1795
  creditLedger = void 0;
1645
1796
  processedPayments = void 0;
1646
- tempoSettlementReadiness?.stop();
1647
- tempoSettlementReadiness = void 0;
1797
+ if (tempoSettlementReadiness) {
1798
+ const readiness = tempoSettlementReadiness;
1799
+ tempoSettlementReadiness = void 0;
1800
+ await capture(() => readiness.stop());
1801
+ }
1802
+ if (errors.length === 1) throw errors[0];
1803
+ if (errors.length > 1) {
1804
+ throw new AggregateError(errors, `${String(errors.length)} host shutdown operations failed`);
1805
+ }
1648
1806
  }
1649
1807
  return {
1650
1808
  app,
@@ -1659,6 +1817,12 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1659
1817
  shutdown: shutdownInternal
1660
1818
  };
1661
1819
  }
1820
+ function isConfiguredX402Settleable(support, config) {
1821
+ if (!support || !config) return false;
1822
+ if (support.available) return true;
1823
+ const batch = config.batchSettlement;
1824
+ return !!batch && (support.batchSettlement || !!batch.selfRelay);
1825
+ }
1662
1826
  function mountNeedsFx(entry, hostRailConfigured) {
1663
1827
  const descriptor = entry.descriptor;
1664
1828
  if (descriptor.credit || descriptor.price) return true;
@@ -1837,7 +2001,7 @@ function logBootSummary(s) {
1837
2001
  console.log(` Tempo secret: ${rotState}`);
1838
2002
  }
1839
2003
  console.log(
1840
- ` x402: ${s.x402 ? `${s.x402.network} \u2192 ${s.x402.payTo}${s.x402Support?.available === false ? " (facilitator unavailable \u2014 omitted)" : ""}` : "(unconfigured)"}`
2004
+ ` x402: ${s.x402 ? `${s.x402.network} \u2192 ${s.x402.payTo}${s.x402Support?.available === false ? isConfiguredX402Settleable(s.x402Support, s.x402) ? " (exact unavailable \u2014 batch configured)" : " (no configured settleable path)" : ""}` : "(unconfigured)"}`
1841
2005
  );
1842
2006
  console.log(
1843
2007
  ` LN receive: ${s.lightningReceive ? `receive-only NWC (${s.lightningReceive.available() ? "reachable" : "unreachable \u2014 omitted from the funding menu"})` : "(unconfigured)"}`