@dvmkit/sdk 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/{chunk-JQ2Z3MIC.js → chunk-34H4ZKBM.js} +1 -1
  2. package/dist/{chunk-WMGXJQI3.js → chunk-5RGZN6WQ.js} +1 -1
  3. package/dist/{chunk-3KRFFLAT.js → chunk-C65P6MGZ.js} +1 -1
  4. package/dist/{chunk-AYEBQDAZ.js → chunk-DJRTYBEE.js} +1 -1
  5. package/dist/{chunk-B6T3FEVX.js → chunk-I5MXADJS.js} +1 -1
  6. package/dist/{chunk-IKMRT7O5.js → chunk-INYFUPXV.js} +1 -0
  7. package/dist/{chunk-QNAYENWA.js → chunk-NLMRNLKA.js} +10753 -10319
  8. package/dist/{chunk-62FI3NJF.js → chunk-NUDHO4HV.js} +4 -2
  9. package/dist/{chunk-VKFR5PCW.js → chunk-OTNHKRHA.js} +2 -2
  10. package/dist/{content-retention-Cxn-umvR.d.ts → content-retention-sUCPlA1J.d.ts} +1 -1
  11. package/dist/{credit-ledger-SBLDJCLE.js → credit-ledger-ZCJXJG6R.js} +2 -2
  12. package/dist/{credit-menu-CYjp3FA3.d.ts → credit-menu-D88XuTLU.d.ts} +135 -6
  13. package/dist/{fx-D2w3wCvY.d.ts → fx-QoVA2oBc.d.ts} +1 -1
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.js +14 -1
  16. package/dist/internal/caller.d.ts +6 -6
  17. package/dist/internal/caller.js +3 -3
  18. package/dist/internal/server.d.ts +7 -7
  19. package/dist/internal/server.js +8 -8
  20. package/dist/{job-store-Ci2ihiVr.d.ts → job-store-Dy-ogco6.d.ts} +1 -1
  21. package/dist/{lightning-backend-DMBY7PaJ.d.ts → lightning-backend-B2wMBR-x.d.ts} +1 -1
  22. package/dist/{memory-credit-ledger-DMIGIH2H.js → memory-credit-ledger-N4PZKTT5.js} +3 -3
  23. package/dist/server/index.d.ts +10 -10
  24. package/dist/server/index.js +9 -9
  25. package/dist/{step-cache-B_18RAPb.d.ts → step-cache-B83Y9T9p.d.ts} +31 -8
  26. package/dist/{tempo-session-store-N3TFZ26X.js → tempo-session-store-XJE6GIXN.js} +2 -2
  27. package/dist/testing/index.d.ts +3 -3
  28. package/dist/{usd-ROzdYbbm.d.ts → usd-g9kCw86F.d.ts} +1 -1
  29. package/dist/{x402-HVCUEWWU.js → x402-XLFD43RF.js} +4 -4
  30. package/package.json +1 -1
@@ -9,11 +9,13 @@ var X402_DEFAULT_FACILITATOR = "https://x402.org/facilitator";
9
9
  // src/lib/x402/spec.ts
10
10
  var X402_VERSION = 2;
11
11
  var X402_V1_VERSION = 1;
12
+ var DEFAULT_MAX_TIMEOUT_SECONDS = 60;
12
13
  var X402_DEFAULT_NETWORK = "eip155:8453";
13
14
  var X402_EXACT_SCHEME = "exact";
14
15
  var X402_BATCH_SETTLEMENT_SCHEME = "batch-settlement";
15
16
  function buildPaymentRequirements(opts) {
16
17
  const { x402Config, requiredUsdcMicro, resource, description, mimeType } = opts;
18
+ const maxTimeoutSeconds = opts.maxTimeoutSeconds ?? DEFAULT_MAX_TIMEOUT_SECONDS;
17
19
  const version = opts.version ?? X402_VERSION;
18
20
  const network = version === X402_V1_VERSION ? caip2ToX402Network(x402Config.network) : x402Config.network;
19
21
  const usdcContract = usdcContractByCaip2(x402Config.network);
@@ -27,7 +29,7 @@ function buildPaymentRequirements(opts) {
27
29
  amount: requiredUsdcMicro.toString(),
28
30
  payTo: x402Config.payTo,
29
31
  asset,
30
- maxTimeoutSeconds: 60,
32
+ maxTimeoutSeconds,
31
33
  extra
32
34
  };
33
35
  }
@@ -40,7 +42,7 @@ function buildPaymentRequirements(opts) {
40
42
  mimeType: mimeType ?? "application/json",
41
43
  payTo: x402Config.payTo,
42
44
  asset,
43
- maxTimeoutSeconds: 60,
45
+ maxTimeoutSeconds,
44
46
  ...Object.keys(extra).length > 0 ? { extra } : {}
45
47
  };
46
48
  }
@@ -2,14 +2,14 @@ import {
2
2
  createX402FacilitatorAuthHeaders,
3
3
  settleWithFacilitator,
4
4
  verifyWithFacilitator
5
- } from "./chunk-3KRFFLAT.js";
5
+ } from "./chunk-C65P6MGZ.js";
6
6
  import {
7
7
  buildPaymentRequirements,
8
8
  decodePayment,
9
9
  encodeSettleResponseHeader,
10
10
  exactEvmAuthorization,
11
11
  usdcToMsats
12
- } from "./chunk-62FI3NJF.js";
12
+ } from "./chunk-NUDHO4HV.js";
13
13
  import {
14
14
  callerLoggers
15
15
  } from "./chunk-66HGCPBU.js";
@@ -1,4 +1,4 @@
1
- import { b as JobStore, J as JobRecord } from './job-store-Ci2ihiVr.js';
1
+ import { b as JobStore, J as JobRecord } from './job-store-Dy-ogco6.js';
2
2
 
3
3
  /** Authenticated caller metadata; omitted fields on older services mean unknown. */
4
4
  interface JobContentMetadata {
@@ -10,11 +10,11 @@ import {
10
10
  isDrainMethod,
11
11
  isFundingRail,
12
12
  x402SettlementPending
13
- } from "./chunk-B6T3FEVX.js";
13
+ } from "./chunk-I5MXADJS.js";
14
14
  import "./chunk-YG7G4DPZ.js";
15
15
  import "./chunk-COYKJRMM.js";
16
16
  import "./chunk-5UC7TOQC.js";
17
- import "./chunk-IKMRT7O5.js";
17
+ import "./chunk-INYFUPXV.js";
18
18
  import "./chunk-BPYMEMQX.js";
19
19
  import "./chunk-H3GGFEE5.js";
20
20
  import "./chunk-ALTE7I6C.js";
@@ -1,11 +1,11 @@
1
- import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DMBY7PaJ.js';
2
- import { cr as HostingCleanupFence, dc as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, dd as X402SettlementIntent, af as PaymentRequirementsV2, de as HostedFundingReservation, bT as CreditLedgerQuerier, df as X402SettlementCursor, c1 as X402SettlementStatus, dg as X402SettlementWriteOff, bY as X402RefundSettlementGate, dh as X402FacilitatorAuth, di as X402BatchSettlementConfig, cO as PostgresX402ChannelStorage, dj as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dk as CreditDepositEnqueue, dl as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cB as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dm as CreditDrawReleaseEnqueue, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cQ as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cv as ClientCompatibilityGate, ct as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-B_18RAPb.js';
1
+ import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-B2wMBR-x.js';
2
+ import { cr as HostingCleanupFence, dc as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, dd as X402SettlementIntent, de as HostedFundingReservation, bT as CreditLedgerQuerier, df as X402SettlementCursor, c1 as X402SettlementStatus, dg as X402SettlementWriteOff, bY as X402RefundSettlementGate, dh as X402FacilitatorAuth, di as X402BatchSettlementConfig, cO as PostgresX402ChannelStorage, dj as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dk as CreditDepositEnqueue, dl as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cB as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dm as CreditDrawReleaseEnqueue, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cQ as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cv as ClientCompatibilityGate, ct as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-B83Y9T9p.js';
3
3
  import { ProofLike, SerializedDLEQ, Proof } from '@cashu/cashu-ts';
4
4
  import { Hono, Context } from 'hono';
5
5
  import { Pool } from 'pg';
6
- import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-D2w3wCvY.js';
6
+ import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-QoVA2oBc.js';
7
7
  import { Store, Challenge } from 'mppx';
8
- import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-Ci2ihiVr.js';
8
+ import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-Dy-ogco6.js';
9
9
  import { SettleResponse, SupportedResponse } from '@x402/core/types';
10
10
  import { Channel, AutoSettlementConfig } from '@x402/evm/batch-settlement/server';
11
11
  import { FacilitatorClient } from '@x402/core/server';
@@ -1163,7 +1163,7 @@ declare class MemoryProcessedPaymentStore implements ProcessedPaymentStore {
1163
1163
  */
1164
1164
  type AccumulatorRejectionCode = "missing_request_id" | "reserved_request_id" | "missing_lock_pubkey" | "not_p2pk_locked" | "wrong_lock_pubkey" | "lock_not_exclusive" | "proof_not_unspent" | "proof_pending" | "replay_rejected" | "request_id_reused" | "mint_unreachable" | "invalid_token";
1165
1165
 
1166
- type X402ExactSettlementStatus = "prepared" | "submitting" | "settled" | "local_committed" | "ambiguous" | "rejected" | "complete";
1166
+ type X402ExactSettlementStatus = "prepared" | "submitting" | "settled" | "local_committed" | "ambiguous" | "rejected" | "released" | "complete";
1167
1167
  /** Serializable local economic effect that follows an exact settlement. */
1168
1168
  interface X402ExactSettlementEffect {
1169
1169
  priceFiat: {
@@ -1239,6 +1239,15 @@ interface X402ExactSettlementAttempt {
1239
1239
  /** Persistence contract for exact x402 settlement recovery. */
1240
1240
  interface X402ExactSettlementStore {
1241
1241
  prepare(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<X402ExactSettlementIntent>;
1242
+ /**
1243
+ * Same binding checks as {@link prepare}, but reports whether this call
1244
+ * created the row. Concurrent callers presenting one authorization race to
1245
+ * insert it, so exactly one sees `inserted: true`.
1246
+ */
1247
+ claim(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<{
1248
+ intent: X402ExactSettlementIntent;
1249
+ inserted: boolean;
1250
+ }>;
1242
1251
  get(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent | undefined>;
1243
1252
  markSubmitting(args: {
1244
1253
  dvmId: string;
@@ -1259,6 +1268,16 @@ interface X402ExactSettlementStore {
1259
1268
  value?: T;
1260
1269
  replayed: boolean;
1261
1270
  }>;
1271
+ /**
1272
+ * Retire a `prepared` intent whose work did not succeed so it is never sent
1273
+ * for settlement. Returns false for any other status, which keeps a
1274
+ * submitted or settled authorization from being disowned.
1275
+ */
1276
+ release(args: {
1277
+ dvmId: string;
1278
+ intentId: string;
1279
+ reason: string;
1280
+ }): Promise<boolean>;
1262
1281
  markAdmissionComplete(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent>;
1263
1282
  list(args: {
1264
1283
  dvmId: string;
@@ -1274,6 +1293,10 @@ declare class PostgresX402ExactSettlementStore implements X402ExactSettlementSto
1274
1293
  constructor(pool: Pick<Pool, "query" | "connect">);
1275
1294
  init(): Promise<void>;
1276
1295
  prepare(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<X402ExactSettlementIntent>;
1296
+ claim(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<{
1297
+ intent: X402ExactSettlementIntent;
1298
+ inserted: boolean;
1299
+ }>;
1277
1300
  get(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent | undefined>;
1278
1301
  markSubmitting(args: {
1279
1302
  dvmId: string;
@@ -1294,6 +1317,11 @@ declare class PostgresX402ExactSettlementStore implements X402ExactSettlementSto
1294
1317
  value?: T;
1295
1318
  replayed: boolean;
1296
1319
  }>;
1320
+ release(args: {
1321
+ dvmId: string;
1322
+ intentId: string;
1323
+ reason: string;
1324
+ }): Promise<boolean>;
1297
1325
  markAdmissionComplete(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent>;
1298
1326
  list(args: {
1299
1327
  dvmId: string;
@@ -1310,6 +1338,10 @@ declare class MemoryX402ExactSettlementStore implements X402ExactSettlementStore
1310
1338
  private readonly authBindings;
1311
1339
  private readonly locks;
1312
1340
  prepare(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<X402ExactSettlementIntent>;
1341
+ claim(intent: Omit<X402ExactSettlementIntent, "status" | "createdAt" | "updatedAt" | "resolvedAt">): Promise<{
1342
+ intent: X402ExactSettlementIntent;
1343
+ inserted: boolean;
1344
+ }>;
1313
1345
  get(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent | undefined>;
1314
1346
  markSubmitting(args: {
1315
1347
  dvmId: string;
@@ -1330,6 +1362,11 @@ declare class MemoryX402ExactSettlementStore implements X402ExactSettlementStore
1330
1362
  value?: T;
1331
1363
  replayed: boolean;
1332
1364
  }>;
1365
+ release(args: {
1366
+ dvmId: string;
1367
+ intentId: string;
1368
+ reason: string;
1369
+ }): Promise<boolean>;
1333
1370
  markAdmissionComplete(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent>;
1334
1371
  list(args: {
1335
1372
  dvmId: string;
@@ -1402,6 +1439,61 @@ declare class X402ExactSettlementServer {
1402
1439
  effect?: X402ExactSettlementEffect;
1403
1440
  commit: (receipt: X402Receipt, tx?: ProcessedPaymentQuerier, effect?: X402ExactSettlementEffect) => Promise<T>;
1404
1441
  }): Promise<X402ExactAcceptance<T>>;
1442
+ /**
1443
+ * Verify an authorization and record it as `prepared` without settling it.
1444
+ * The caller must run {@link settlePrepared} once the work it pays for has
1445
+ * succeeded, or {@link release} when it has not. A presentation whose
1446
+ * intent already exists is reported as `replayed` and neither verified nor
1447
+ * prepared again, so one authorization admits one piece of work.
1448
+ */
1449
+ verifyAndPrepare(args: {
1450
+ paymentHeader: string;
1451
+ config: X402Config;
1452
+ requiredUsdcMicro: bigint;
1453
+ resource: string;
1454
+ exactVersions?: X402ExactVersionSupport;
1455
+ dvmId: string;
1456
+ effect: X402ExactSettlementEffect;
1457
+ /** Refuse, before any facilitator call, an authorization that expires sooner than this. */
1458
+ minValidSeconds: number;
1459
+ maxTimeoutSeconds: number;
1460
+ nowMs?: number;
1461
+ }): Promise<{
1462
+ outcome: "prepared";
1463
+ intentId: string;
1464
+ payload: PaymentPayload;
1465
+ requirements: PaymentRequirementsV1 | PaymentRequirementsV2;
1466
+ validBeforeMs: number;
1467
+ } | {
1468
+ outcome: "replayed";
1469
+ intentId: string;
1470
+ } | {
1471
+ outcome: "authorization_too_short";
1472
+ intentId: string;
1473
+ validBefore: string;
1474
+ } | {
1475
+ outcome: "rejected";
1476
+ intentId?: string;
1477
+ reason: string;
1478
+ }>;
1479
+ /** Settle an authorization recorded by {@link verifyAndPrepare} and commit its local effect. */
1480
+ settlePrepared<T>(args: {
1481
+ dvmId: string;
1482
+ intentId: string;
1483
+ payload: PaymentPayload;
1484
+ requirements: PaymentRequirementsV1 | PaymentRequirementsV2;
1485
+ config: X402Config;
1486
+ btcUsdRate: number;
1487
+ commit: (receipt: X402Receipt, tx?: ProcessedPaymentQuerier, effect?: X402ExactSettlementEffect) => Promise<T>;
1488
+ }): Promise<X402ExactAcceptance<T>>;
1489
+ /**
1490
+ * Abandon a prepared authorization whose work did not succeed. The
1491
+ * authorization is never sent to the facilitator, so it expires unspent.
1492
+ * Returns false when the intent is no longer `prepared`.
1493
+ */
1494
+ release(dvmId: string, intentId: string, reason: string): Promise<boolean>;
1495
+ private advance;
1496
+ get(dvmId: string, intentId: string): Promise<X402ExactSettlementIntent | undefined>;
1405
1497
  list(args: {
1406
1498
  dvmId: string;
1407
1499
  limit: number;
@@ -1424,6 +1516,28 @@ declare class X402ExactSettlementEvidenceMissingError extends Error {
1424
1516
  readonly intentId: string;
1425
1517
  constructor(intentId: string);
1426
1518
  }
1519
+ /** A verified authorization kept in memory until its job finishes. */
1520
+ interface HeldX402Authorization {
1521
+ payload: PaymentPayload;
1522
+ requirements: PaymentRequirementsV1 | PaymentRequirementsV2;
1523
+ config: X402Config;
1524
+ btcUsdRate: number;
1525
+ validBeforeMs: number;
1526
+ }
1527
+ /** How a finished job's deferred authorization ended. */
1528
+ type DeferredX402Outcome = "settled" | "unpaid";
1529
+ interface DeferredX402Settler {
1530
+ hold(intentId: string, held: HeldX402Authorization): void;
1531
+ /**
1532
+ * Settle the job's authorization. Resolves `settled` once the funding is
1533
+ * committed (also when an earlier call already did) and `unpaid` when the
1534
+ * payment is definitively not collected. Rejects while the outcome is still
1535
+ * unknown, so the caller retries.
1536
+ */
1537
+ settle(intentId: string): Promise<DeferredX402Outcome>;
1538
+ /** Give up the authorization without sending it to the facilitator. */
1539
+ release(intentId: string, reason: string): Promise<void>;
1540
+ }
1427
1541
 
1428
1542
  /** Exact successful chain action recovered for one ambiguous settlement attempt. */
1429
1543
  interface X402SettlementChainEvidence {
@@ -1909,6 +2023,15 @@ interface UpfrontPaymentOpts {
1909
2023
  x402ExactSettlement?: X402ExactSettlementServer;
1910
2024
  /** Exact generations the facilitator currently advertises. Defaults to both. */
1911
2025
  x402ExactVersions?: X402ExactVersionSupport;
2026
+ /**
2027
+ * Unsigned caller paying with exact x402: verify the authorization now and
2028
+ * send it for settlement only when the job succeeds. Requires
2029
+ * {@link x402ExactSettlement} and a credit ledger.
2030
+ */
2031
+ x402Deferred?: {
2032
+ maxRuntimeSeconds: number;
2033
+ settler: DeferredX402Settler;
2034
+ };
1912
2035
  /** Reusable channel acceptor. Only consulted for fund-only `/v1/credit` requests. */
1913
2036
  x402BatchSettlement?: X402BatchSettlementServer;
1914
2037
  /**
@@ -2287,7 +2410,7 @@ declare function verifyTempoSessionManagementCredential(args: {
2287
2410
  * here: the former is already complete, the latter is a challenge envelope, not
2288
2411
  * an error report.
2289
2412
  */
2290
- type PaymentErrorCode = "payment_invalid" | "x402_not_offered" | "payment_method_requires_signature" | "x402_settlement_ambiguous" | "cashu_unavailable" | "cashu_not_p2pk_locked" | "mint_health_pending" | "cashu_mint_sick" | "payment_insufficient" | "payment_unapplied" | "insufficient_credit" | "credit_expired" | "credit_unbacked" | "credit_not_found" | "tempo_channel_closing" | "settlement_pending" | "draw_conflict" | "funding_commitment_mismatch" | "credit_not_supported" | "one_shot_credit_not_supported" | "credit_below_min" | "below_rail_minimum" | "credit_over_max" | "credit_id_unavailable" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "drain_method_unsupported" | "tempo_channel_exit_required" | "x402_settlement_submission_failed" | X402SettlementReconciliationReason | "lightning_settlement_pending" | "lightning_invoice_expired" | "lightning_unavailable" | AccumulatorRejectionCode;
2413
+ type PaymentErrorCode = "payment_invalid" | "x402_not_offered" | "payment_method_requires_signature" | "payment_authorization_too_short" | "x402_settlement_ambiguous" | "cashu_unavailable" | "cashu_not_p2pk_locked" | "mint_health_pending" | "cashu_mint_sick" | "payment_insufficient" | "payment_unapplied" | "insufficient_credit" | "credit_expired" | "credit_unbacked" | "credit_not_found" | "tempo_channel_closing" | "settlement_pending" | "draw_conflict" | "funding_commitment_mismatch" | "credit_not_supported" | "one_shot_credit_not_supported" | "credit_below_min" | "below_rail_minimum" | "credit_over_max" | "credit_id_unavailable" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "drain_method_unsupported" | "tempo_channel_exit_required" | "x402_settlement_submission_failed" | X402SettlementReconciliationReason | "lightning_settlement_pending" | "lightning_invoice_expired" | "lightning_unavailable" | AccumulatorRejectionCode;
2291
2414
  /**
2292
2415
  * Per-code display, hint and retryability may be overridden for a particular
2293
2416
  * refusal. Keep the hint and retry decision consistent. Extra fields merge
@@ -2764,6 +2887,11 @@ interface JobManagerOpts {
2764
2887
  enqueueCreditDeposit?: CreditDepositEnqueue;
2765
2888
  /** Reporter outbox inserted atomically with a terminal draw release. */
2766
2889
  enqueueCreditDrawRelease?: CreditDrawReleaseEnqueue;
2890
+ /**
2891
+ * Settles or releases the x402 authorization behind an unsigned job once the
2892
+ * job is terminal. Absent on a DVM that takes no unsigned x402.
2893
+ */
2894
+ deferredX402?: DeferredX402Settler;
2767
2895
  /** Credit lifetime a top-up mints with, from the DVM's advertised `credit.ttl`. */
2768
2896
  creditTtlMs?: number;
2769
2897
  /**
@@ -3002,6 +3130,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
3002
3130
  private readonly jobStore;
3003
3131
  private readonly idleTimers;
3004
3132
  private readonly cleanupTimers;
3133
+ private readonly terminalReadRepairs;
3005
3134
  /** Cost revisions held only by a terminal handler owner until its durable merge succeeds. */
3006
3135
  private readonly terminalCostHandoffRetryTimers;
3007
3136
  /** Per-job NOTIFY unsubscribe handles for the durable-status watch. */
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-B_18RAPb.js';
1
+ import { C as Currency } from './step-cache-B83Y9T9p.js';
2
2
 
3
3
  /**
4
4
  * Quote-time FX snapshot. `rates` maps configured lowercase currency codes to
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-B_18RAPb.js';
2
- export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ as validateCurrency } from './step-cache-B_18RAPb.js';
3
- export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-D2w3wCvY.js';
4
- export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-ROzdYbbm.js';
5
- export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-Ci2ihiVr.js';
1
+ import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-B83Y9T9p.js';
2
+ export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ as validateCurrency } from './step-cache-B83Y9T9p.js';
3
+ export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-QoVA2oBc.js';
4
+ export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-g9kCw86F.js';
5
+ export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-Dy-ogco6.js';
6
6
  export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from './ssrf-dMooihtY.js';
7
7
  export { z } from 'zod';
8
8
  import 'hono';
package/dist/index.js CHANGED
@@ -148,6 +148,15 @@ function validateCapabilityPrice(price, capabilityName, currency) {
148
148
  }
149
149
  validatePriceLiteral(price, `configureDVM: capability "${capabilityName}" price`, "price");
150
150
  }
151
+ var MAX_RUNTIME_SECONDS_LIMIT = 600;
152
+ function validateMaxRuntimeSeconds(value, capabilityName) {
153
+ if (value === void 0) return;
154
+ if (!Number.isInteger(value) || value < 1 || value > MAX_RUNTIME_SECONDS_LIMIT) {
155
+ throw new Error(
156
+ `configureDVM: capability "${capabilityName}" maxRuntimeSeconds must be a whole number of seconds from 1 to ${MAX_RUNTIME_SECONDS_LIMIT}, got ${JSON.stringify(value)}`
157
+ );
158
+ }
159
+ }
151
160
  function collectTags(config) {
152
161
  const tagSet = /* @__PURE__ */ new Set();
153
162
  if (config.tag) tagSet.add(config.tag);
@@ -174,6 +183,7 @@ function buildCapabilityMap(config, currency) {
174
183
  const name = typeof config.capability === "string" ? config.capability : slugifyCapabilityName(config.name);
175
184
  validateCapabilityName(name);
176
185
  validateCapabilityPrice(config.price, name, currency);
186
+ validateMaxRuntimeSeconds(config.maxRuntimeSeconds, name);
177
187
  validateExampleAgainstInput(name, config.input, config.example);
178
188
  const entry = {
179
189
  name,
@@ -184,6 +194,7 @@ function buildCapabilityMap(config, currency) {
184
194
  price: config.price,
185
195
  onQuote: config.onQuote,
186
196
  rates: snapshotRates(config.rates),
197
+ maxRuntimeSeconds: config.maxRuntimeSeconds,
187
198
  onJob: config.onJob,
188
199
  onResponse: config.onResponse,
189
200
  onPayment: config.onPayment,
@@ -206,6 +217,7 @@ function buildExplicitCapabilities(capabilities, currency) {
206
217
  throw new Error(`configureDVM: capability "${name}" is missing required onJob handler`);
207
218
  }
208
219
  validateCapabilityPrice(cap.price, name, currency);
220
+ validateMaxRuntimeSeconds(cap.maxRuntimeSeconds, name);
209
221
  validateExampleAgainstInput(name, cap.input, cap.example);
210
222
  const entry = {
211
223
  name,
@@ -220,6 +232,7 @@ function buildExplicitCapabilities(capabilities, currency) {
220
232
  price: cap.price,
221
233
  onQuote: cap.onQuote,
222
234
  rates: snapshotRates(cap.rates),
235
+ maxRuntimeSeconds: cap.maxRuntimeSeconds,
223
236
  onJob: cap.onJob,
224
237
  onResponse: cap.onResponse,
225
238
  onPayment: cap.onPayment,
@@ -232,7 +245,7 @@ function buildExplicitCapabilities(capabilities, currency) {
232
245
  return out;
233
246
  }
234
247
  function flatPerCapFieldsSet(config) {
235
- return config.input !== void 0 || config.example !== void 0 || config.state !== void 0 || config.price !== void 0 || config.onQuote !== void 0 || config.rates !== void 0 || typeof config.onResponse === "function" || typeof config.onPayment === "function" || typeof config.onApproval === "function" || typeof config.onCancel === "function" || typeof config.onMessage === "function";
248
+ return config.input !== void 0 || config.example !== void 0 || config.state !== void 0 || config.price !== void 0 || config.onQuote !== void 0 || config.rates !== void 0 || config.maxRuntimeSeconds !== void 0 || typeof config.onResponse === "function" || typeof config.onPayment === "function" || typeof config.onApproval === "function" || typeof config.onCancel === "function" || typeof config.onMessage === "function";
236
249
  }
237
250
  function validateExampleAgainstInput(capName, input, example) {
238
251
  if (example === void 0) return;
@@ -1,7 +1,7 @@
1
- import { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-B_18RAPb.js';
2
- export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-B_18RAPb.js';
3
- import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-DMBY7PaJ.js';
4
- export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-DMBY7PaJ.js';
1
+ import { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-B83Y9T9p.js';
2
+ export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-B83Y9T9p.js';
3
+ import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-B2wMBR-x.js';
4
+ export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-B2wMBR-x.js';
5
5
  import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
6
6
  export { g as getWallet } from '../wallet-Dwjs5n_M.js';
7
7
  import { SimplePool } from 'nostr-tools/pool';
@@ -9,8 +9,8 @@ import { Session } from 'mppx/tempo';
9
9
  import { Pool } from 'pg';
10
10
  import { PaymentRequired as PaymentRequired$1 } from '@x402/core/types';
11
11
  import { ClientChannelStorage, BatchSettlementClientContext, BatchSettlementEvmScheme } from '@x402/evm/batch-settlement/client';
12
- export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-D2w3wCvY.js';
13
- export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-ROzdYbbm.js';
12
+ export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-QoVA2oBc.js';
13
+ export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-g9kCw86F.js';
14
14
  import 'hono';
15
15
  import 'mppx';
16
16
  import '@x402/core/server';
@@ -4,7 +4,7 @@ import {
4
4
  getX402Balance,
5
5
  isValidEvmPrivateKey,
6
6
  resolveX402Asset
7
- } from "../chunk-WMGXJQI3.js";
7
+ } from "../chunk-5RGZN6WQ.js";
8
8
  import {
9
9
  CAPABILITY_NAME_RE
10
10
  } from "../chunk-A262WVYX.js";
@@ -167,7 +167,7 @@ import {
167
167
  usdcDomainVersionFor,
168
168
  usdcToMsats,
169
169
  x402NetworkToCaip2
170
- } from "../chunk-62FI3NJF.js";
170
+ } from "../chunk-NUDHO4HV.js";
171
171
  import {
172
172
  RAIL_REFUNDABLE,
173
173
  SIGNED_REQUEST_AUTH_ID,
@@ -211,7 +211,7 @@ import {
211
211
  import {
212
212
  applyRetryToPool,
213
213
  withInitRetry
214
- } from "../chunk-IKMRT7O5.js";
214
+ } from "../chunk-INYFUPXV.js";
215
215
  import {
216
216
  DvmError,
217
217
  X402_NETWORKS,
@@ -1,22 +1,22 @@
1
1
  import { FacilitatorConfig } from '@x402/core/server';
2
- import { ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, aK as X402Config, aA as SettleResponse, aI as VerifyResponse, br as X402ExactVersionSupport, bs as X402Receipt, bt as TransactionalPayoutHook, bu as CashuMeltCompleted } from '../step-cache-B_18RAPb.js';
3
- export { bv as CreditDepositPayload, bw as CreditDrainPayload, bx as FundingLot, by as LotDebit, bz as LotDepletion, bA as MppxServer, bB as NON_CHANNEL_BITCOIN_RAILS, bC as NonChannelBitcoinRail, bD as PayoutReporter, bE as PostgresTempoSessionStore, bF as RevenueReporter, bG as SIGNED_ENVELOPE_FIELDS, bH as SIGNED_ENVELOPE_TYPES, bI as X402TrackedChannel, bJ as _testing, bK as createDefaultReplayStore, bL as depleteLots, bM as fifoOrder, bN as inKindDrawMsats, bO as isInKindDepletion, bP as isNonChannelBitcoinRail, bQ as lotOwedSats, bR as netOwedSats, bS as wrapMppx } from '../step-cache-B_18RAPb.js';
2
+ import { ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, aK as X402Config, aA as SettleResponse, aI as VerifyResponse, br as X402ExactVersionSupport, bs as X402Receipt, bt as TransactionalPayoutHook, bu as CashuMeltCompleted } from '../step-cache-B83Y9T9p.js';
3
+ export { bv as CreditDepositPayload, bw as CreditDrainPayload, bx as FundingLot, by as LotDebit, bz as LotDepletion, bA as MppxServer, bB as NON_CHANNEL_BITCOIN_RAILS, bC as NonChannelBitcoinRail, bD as PayoutReporter, bE as PostgresTempoSessionStore, bF as RevenueReporter, bG as SIGNED_ENVELOPE_FIELDS, bH as SIGNED_ENVELOPE_TYPES, bI as X402TrackedChannel, bJ as _testing, bK as createDefaultReplayStore, bL as depleteLots, bM as fifoOrder, bN as inKindDrawMsats, bO as isInKindDepletion, bP as isNonChannelBitcoinRail, bQ as lotOwedSats, bR as netOwedSats, bS as wrapMppx } from '../step-cache-B83Y9T9p.js';
4
4
  import { Hono } from 'hono';
5
5
  import { Env, BlankSchema } from 'hono/types';
6
6
  import { Pool } from 'pg';
7
7
  export { Pool } from 'pg';
8
8
  import { g as getWallet } from '../wallet-Dwjs5n_M.js';
9
- import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-CYjp3FA3.js';
10
- export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-CYjp3FA3.js';
11
- export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-Ci2ihiVr.js';
9
+ import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-D88XuTLU.js';
10
+ export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-D88XuTLU.js';
11
+ export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-Dy-ogco6.js';
12
12
  import { z } from 'zod';
13
- export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-DMBY7PaJ.js';
13
+ export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-B2wMBR-x.js';
14
14
  import 'mppx';
15
15
  import '@x402/evm/batch-settlement/server';
16
16
  import '@x402/core/types';
17
17
  import 'viem';
18
18
  import '@cashu/cashu-ts';
19
- import '../fx-D2w3wCvY.js';
19
+ import '../fx-QoVA2oBc.js';
20
20
 
21
21
  declare function verifyWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<VerifyResponse>;
22
22
  declare function settleWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<SettleResponse>;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  PostgresTempoSessionStore
3
- } from "../chunk-JQ2Z3MIC.js";
3
+ } from "../chunk-34H4ZKBM.js";
4
4
  import {
5
5
  verifyX402Payment
6
- } from "../chunk-VKFR5PCW.js";
6
+ } from "../chunk-OTNHKRHA.js";
7
7
  import {
8
8
  RevenueReporter
9
9
  } from "../chunk-CVN2YNMG.js";
@@ -61,7 +61,7 @@ import {
61
61
  verifyUpfrontPayment,
62
62
  x402RequiredUsdcMicro,
63
63
  x402SettledShare
64
- } from "../chunk-QNAYENWA.js";
64
+ } from "../chunk-NLMRNLKA.js";
65
65
  import "../chunk-XRLKGCAW.js";
66
66
  import {
67
67
  PayoutReporter
@@ -69,8 +69,8 @@ import {
69
69
  import {
70
70
  settleWithFacilitator,
71
71
  verifyWithFacilitator
72
- } from "../chunk-3KRFFLAT.js";
73
- import "../chunk-AYEBQDAZ.js";
72
+ } from "../chunk-C65P6MGZ.js";
73
+ import "../chunk-DJRTYBEE.js";
74
74
  import "../chunk-A6EY4K46.js";
75
75
  import {
76
76
  SIGNED_ENVELOPE_FIELDS,
@@ -94,7 +94,7 @@ import {
94
94
  import {
95
95
  toLockPubkey
96
96
  } from "../chunk-7RWE6ELV.js";
97
- import "../chunk-62FI3NJF.js";
97
+ import "../chunk-NUDHO4HV.js";
98
98
  import "../chunk-SXL44PL5.js";
99
99
  import "../chunk-QTKGFG3I.js";
100
100
  import "../chunk-FUJ36YDV.js";
@@ -110,11 +110,11 @@ import {
110
110
  isNonChannelBitcoinRail,
111
111
  lotOwedSats,
112
112
  netOwedSats
113
- } from "../chunk-B6T3FEVX.js";
113
+ } from "../chunk-I5MXADJS.js";
114
114
  import "../chunk-YG7G4DPZ.js";
115
115
  import "../chunk-COYKJRMM.js";
116
116
  import "../chunk-5UC7TOQC.js";
117
- import "../chunk-IKMRT7O5.js";
117
+ import "../chunk-INYFUPXV.js";
118
118
  import "../chunk-BPYMEMQX.js";
119
119
  import "../chunk-H3GGFEE5.js";
120
120
  import {
@@ -1,4 +1,4 @@
1
- import { a9 as Message, V as UpfrontPayment, an as FundingMethod, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, aC as StepRecord, a5 as MessageType } from './step-cache-B_18RAPb.js';
1
+ import { a9 as Message, V as UpfrontPayment, an as FundingMethod, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, aC as StepRecord, a5 as MessageType } from './step-cache-B83Y9T9p.js';
2
2
  import { ProofLike } from '@cashu/cashu-ts';
3
3
 
4
4
  type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
@@ -1,4 +1,4 @@
1
- import { $ as JsonValue } from './step-cache-B_18RAPb.js';
1
+ import { $ as JsonValue } from './step-cache-B83Y9T9p.js';
2
2
 
3
3
  declare const lockPubkeyBrand: unique symbol;
4
4
  /**
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MemoryCreditLedger
3
- } from "./chunk-AYEBQDAZ.js";
4
- import "./chunk-B6T3FEVX.js";
3
+ } from "./chunk-DJRTYBEE.js";
4
+ import "./chunk-I5MXADJS.js";
5
5
  import "./chunk-YG7G4DPZ.js";
6
6
  import "./chunk-COYKJRMM.js";
7
7
  import "./chunk-5UC7TOQC.js";
8
- import "./chunk-IKMRT7O5.js";
8
+ import "./chunk-INYFUPXV.js";
9
9
  import "./chunk-BPYMEMQX.js";
10
10
  import "./chunk-H3GGFEE5.js";
11
11
  import "./chunk-ALTE7I6C.js";