@dvmkit/sdk 0.10.1 → 0.12.0-rc.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.
Files changed (57) hide show
  1. package/dist/{chunk-STJBBVNL.js → chunk-2VGMZ7VF.js} +487 -71
  2. package/dist/{chunk-3Q6FTZDB.js → chunk-3YFFZLW7.js} +2 -2
  3. package/dist/{chunk-VMHYGKWT.js → chunk-566CFXGU.js} +9 -1
  4. package/dist/chunk-5H7P3ORL.js +92 -0
  5. package/dist/{chunk-3R7NQA3Z.js → chunk-7KQLPVV7.js} +1 -1
  6. package/dist/{chunk-JNECYURT.js → chunk-D4FFS3IS.js} +1 -1
  7. package/dist/{chunk-VTHYQCDB.js → chunk-E7ZBCT5U.js} +1 -1
  8. package/dist/{chunk-MMGSYMIC.js → chunk-EP7OVWI5.js} +1 -1
  9. package/dist/{chunk-LDIPVPKI.js → chunk-FFRTAQUW.js} +1 -1
  10. package/dist/chunk-H3GGFEE5.js +57 -0
  11. package/dist/{chunk-M3T5JYDJ.js → chunk-HNXMWHLU.js} +1 -1
  12. package/dist/{chunk-UKD3R2KU.js → chunk-HW2UCOOC.js} +4 -55
  13. package/dist/{chunk-FFXXGCVG.js → chunk-ITRSITFP.js} +1 -1
  14. package/dist/{chunk-MU3IE434.js → chunk-JLT2YIBS.js} +267 -52
  15. package/dist/{chunk-KFCEXCZM.js → chunk-KJZVTWMX.js} +1 -1
  16. package/dist/{chunk-W3VGCNG6.js → chunk-LDKV4UHI.js} +1 -1
  17. package/dist/{chunk-AJ6UHXUA.js → chunk-M4NFYEEY.js} +1 -1
  18. package/dist/{chunk-MB6R4XPZ.js → chunk-NS2OMIU7.js} +15 -3
  19. package/dist/{chunk-YOSZIWC3.js → chunk-POYUX2NN.js} +149 -11
  20. package/dist/{chunk-VUGEEMLT.js → chunk-RPUFWIT4.js} +11 -89
  21. package/dist/{chunk-SYBFMHXQ.js → chunk-S7PIFHE4.js} +590 -67
  22. package/dist/{chunk-2OGBZPPJ.js → chunk-TWKQFIOW.js} +21 -3
  23. package/dist/{chunk-EWZFANHJ.js → chunk-VWIMQ5H5.js} +1 -1
  24. package/dist/{chunk-2XQLL6N6.js → chunk-WFCVS6QB.js} +2 -2
  25. package/dist/{chunk-QGNXYVBO.js → chunk-Z4FOPROB.js} +17 -0
  26. package/dist/{content-retention-CrILCNxk.d.ts → content-retention-a1yRdmhI.d.ts} +1 -1
  27. package/dist/{credit-ledger-4PZNAMDT.js → credit-ledger-MF23UKRJ.js} +6 -3
  28. package/dist/{credit-menu-BWsVqMh-.d.ts → credit-menu-B2T-O9oY.d.ts} +11 -4
  29. package/dist/{fx-BM5h4o5S.d.ts → fx-DLhscRUh.d.ts} +1 -1
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.js +6 -5
  32. package/dist/internal/caller.d.ts +8 -6
  33. package/dist/internal/caller.js +27 -22
  34. package/dist/internal/server.d.ts +7 -7
  35. package/dist/internal/server.js +24 -22
  36. package/dist/{job-store-92v8e1LQ.d.ts → job-store-B8Ijr5V6.d.ts} +3 -1
  37. package/dist/{lightning-backend-9oky_wJi.d.ts → lightning-backend-DmwMSgaM.d.ts} +1 -1
  38. package/dist/memory-credit-ledger-ERD764PS.js +14 -0
  39. package/dist/{mpp-setup-FURD45LI.js → mpp-setup-JU3MT7QX.js} +3 -3
  40. package/dist/{payout-reporter-HVJ6WUF3.js → payout-reporter-NXWQVKXW.js} +2 -2
  41. package/dist/{postgres-consumed-credential-store-WO6OCFXZ.js → postgres-consumed-credential-store-WXJLM6J7.js} +1 -1
  42. package/dist/{postgres-job-store-H45PRBLA.js → postgres-job-store-ZVMAN6L2.js} +2 -2
  43. package/dist/{postgres-replay-store-XXJSA457.js → postgres-replay-store-QJ4FG6AR.js} +2 -2
  44. package/dist/{pricing-X4XU5HXY.js → pricing-KCLENT2C.js} +3 -3
  45. package/dist/{revenue-reporter-EV3K5L6B.js → revenue-reporter-HD4GMXGD.js} +2 -2
  46. package/dist/server/index.d.ts +30 -12
  47. package/dist/server/index.js +32 -30
  48. package/dist/{step-cache--7yA5Ihr.d.ts → step-cache-DQqpwXa8.d.ts} +206 -47
  49. package/dist/{tempo-charge-store-5JOIYUIH.js → tempo-charge-store-7LTUAQHQ.js} +2 -2
  50. package/dist/{tempo-session-store-S6QMLQUA.js → tempo-session-store-LYAIDR2B.js} +3 -3
  51. package/dist/testing/index.d.ts +3 -3
  52. package/dist/testing/index.js +6 -6
  53. package/dist/{usd-C7lvLvLk.d.ts → usd-D5kk2nIT.d.ts} +1 -1
  54. package/dist/{x402-EN5LSOVM.js → x402-RUJ4LUKF.js} +3 -3
  55. package/package.json +1 -1
  56. package/recipes/postgres/financial-export-v1.sql +19 -5
  57. package/dist/memory-credit-ledger-RP7DT5IY.js +0 -11
@@ -20,10 +20,10 @@ import {
20
20
  parseMppMethodsAllowlist,
21
21
  resolveTempoNetwork,
22
22
  wrapMppx
23
- } from "./chunk-MU3IE434.js";
24
- import "./chunk-M3T5JYDJ.js";
23
+ } from "./chunk-JLT2YIBS.js";
24
+ import "./chunk-HNXMWHLU.js";
25
25
  import "./chunk-66HGCPBU.js";
26
- import "./chunk-QGNXYVBO.js";
26
+ import "./chunk-Z4FOPROB.js";
27
27
  export {
28
28
  MPPX_HMAC_MISMATCH_REASON,
29
29
  TEMPO_MAINNET_CHAIN_ID,
@@ -4,9 +4,9 @@ import {
4
4
  PayoutReporter,
5
5
  PostgresX402BatchStore,
6
6
  x402EarnedCeiling
7
- } from "./chunk-FFXXGCVG.js";
7
+ } from "./chunk-ITRSITFP.js";
8
8
  import "./chunk-COYKJRMM.js";
9
- import "./chunk-QGNXYVBO.js";
9
+ import "./chunk-Z4FOPROB.js";
10
10
  export {
11
11
  MemoryX402BatchStore,
12
12
  PAYOUT_SNAPSHOT_INTERVAL_MS,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-COYKJRMM.js";
4
4
  import {
5
5
  diagnosticConsole
6
- } from "./chunk-QGNXYVBO.js";
6
+ } from "./chunk-Z4FOPROB.js";
7
7
 
8
8
  // src/sdk/server/postgres-consumed-credential-store.ts
9
9
  var DEFAULT_TABLE_NAME = "consumed_credentials";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  PostgresJobStore
3
- } from "./chunk-2OGBZPPJ.js";
3
+ } from "./chunk-TWKQFIOW.js";
4
4
  import "./chunk-AFV77S4C.js";
5
5
  import "./chunk-BQJIFRAZ.js";
6
6
  import "./chunk-COYKJRMM.js";
7
- import "./chunk-QGNXYVBO.js";
7
+ import "./chunk-Z4FOPROB.js";
8
8
  export {
9
9
  PostgresJobStore
10
10
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  PostgresReplayStore
3
- } from "./chunk-EWZFANHJ.js";
3
+ } from "./chunk-VWIMQ5H5.js";
4
4
  import "./chunk-COYKJRMM.js";
5
- import "./chunk-QGNXYVBO.js";
5
+ import "./chunk-Z4FOPROB.js";
6
6
  export {
7
7
  PostgresReplayStore
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildUpfront
3
- } from "./chunk-JNECYURT.js";
3
+ } from "./chunk-D4FFS3IS.js";
4
4
  import {
5
5
  DEFAULT_FX_CURRENCIES,
6
6
  DEFAULT_FX_RATE_SOURCE,
@@ -22,8 +22,8 @@ import {
22
22
  satsToFiat,
23
23
  validateCurrency,
24
24
  warmFxSnapshot
25
- } from "./chunk-W3VGCNG6.js";
26
- import "./chunk-QGNXYVBO.js";
25
+ } from "./chunk-LDKV4UHI.js";
26
+ import "./chunk-Z4FOPROB.js";
27
27
  export {
28
28
  DEFAULT_FX_CURRENCIES,
29
29
  DEFAULT_FX_RATE_SOURCE,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RevenueReporter
3
- } from "./chunk-VMHYGKWT.js";
3
+ } from "./chunk-566CFXGU.js";
4
4
  import "./chunk-COYKJRMM.js";
5
- import "./chunk-QGNXYVBO.js";
5
+ import "./chunk-Z4FOPROB.js";
6
6
  export {
7
7
  RevenueReporter
8
8
  };
@@ -1,15 +1,15 @@
1
- import { ae as CashuMode, bL as CreditLedgerQuerier, bM as CreditDrainEnqueue, bN as HostedSettlementReportObligations, R as ResolvedCreditConfig, bO as DVMAuthScheme, B as SignedRequestDomain, bP as CreditLedgerLike, bQ as X402RefundSettlementGate, bR as CreditSnapshot, bS as DrawResult, bT as X402SettlementStatus, bU as X402UnresolvedRefund, bV as GrownDrawResult, bW as DrawResolution, bX as FundingRecord, $ as FundingReceipt, bY as CreditInvoiceRecord, bZ as InvoiceSettlement, b_ as BlockedInvoiceCursor, b$ as InvoiceReconciliation, c0 as InvoiceWriteOff, c1 as DrawRecord, c2 as StalePendingDrawCursor, c3 as TempoCreditLossEvidence, c4 as TempoCreditLoss, c5 as X402CreditLossEvidence, c6 as X402CreditLoss, c7 as DrainMethod, c8 as DrainRequestResult, c9 as BitcoinDepositLiability, bp as FundingLot, ca as CreditDrainRecord, cb as ChannelDrainCursor, cc as DrainWriteOff, cd as DrainTransitionResult, ce as DrainReleaseResult, cf as DrainFulfilment, cg as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache--7yA5Ihr.js';
2
- export { ch as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ci as ClientCompatibility, cj as ClientCompatibilityEnv, ck as ClientCompatibilityGate, cl as ClientCompatibilityRequirement, cm as ClientSemVer, f as CreateSignedRequestVerifierOpts, cn as CreditFundingBasis, co as CreditInvoiceStatus, cp as CreditLedger, cq as CreditLedgerError, cr as CreditLedgerErrorCode, cs as CreditLedgerErrorDetails, ct as CreditLedgerPool, cu as CreditStatus, cv as DRAIN_DELIVERY_RESERVE_SATS, cw as DVM_PROTOCOL_VERSION, cx as DrainConflictReason, cy as DrawRailValue, cz as DrawStatus, cA as HostedTempoCloseReportWriteOff, cB as JobCostReportPayload, cC as JobTerminalReportPayload, cD as PostgresX402ChannelStorage, cE as ReplayStoreBackend, cF as RevenueSkippedNoRailPayload, cG as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cH as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cI as X402ChannelStorageOpts, cJ as X402RelayLockHolder, cK as X402RelaySubmissionLock, cL as X402RelaySubmissionLockError, cM as allocateDrawValue, cN as clientCompatibilityAttributes, cO as clientCompatibilityMiddleware, cP as clientUpgradeRequired, O as createSignedRequestVerifier, cQ as parseClientCapabilities, cR as parseClientCompatibility, cS as parseDvmClient, cT as parseProtocolVersion, cU as requireClientCompatibility, cV as retryHostedTempoCloseReport, cW as secp256k1Auth, cX as signedRequestInput, V as signedRequestStatementHeader, cY as writeOffHostedTempoCloseReport } from '../step-cache--7yA5Ihr.js';
1
+ import { ae as CashuMode, bL as CreditLedgerQuerier, bM as CreditDrainEnqueue, bN as HostedSettlementReportObligations, R as ResolvedCreditConfig, bO as DVMAuthScheme, B as SignedRequestDomain, bP as CreditLedgerLike, bQ as X402RefundSettlementGate, bR as CreditSnapshot, bS as CreditDrawRefundArgs, bT as CreditDrawRefundResult, bU as DrawResult, bV as X402SettlementStatus, bW as X402UnresolvedRefund, bX as GrownDrawResult, bY as DrawResolution, bZ as FundingRecord, $ as FundingReceipt, b_ as CreditInvoiceRecord, b$ as InvoiceSettlement, c0 as BlockedInvoiceCursor, c1 as InvoiceReconciliation, c2 as InvoiceWriteOff, c3 as DrawRecord, c4 as StalePendingDrawCursor, c5 as TempoCreditLossEvidence, c6 as TempoCreditLoss, c7 as X402CreditLossEvidence, c8 as X402CreditLoss, c9 as DrainMethod, ca as DrainRequestResult, cb as BitcoinDepositLiability, bp as FundingLot, cc as CreditDrainRecord, cd as ChannelDrainCursor, ce as DrainWriteOff, cf as DrainTransitionResult, cg as DrainReleaseResult, ch as DrainFulfilment, ci as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-DQqpwXa8.js';
2
+ export { cj as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ck as ClientCompatibility, cl as ClientCompatibilityEnv, cm as ClientCompatibilityGate, cn as ClientCompatibilityRequirement, co as ClientSemVer, f as CreateSignedRequestVerifierOpts, cp as CreditFundingBasis, cq as CreditInvoiceStatus, cr as CreditLedger, cs as CreditLedgerError, ct as CreditLedgerErrorCode, cu as CreditLedgerErrorDetails, cv as CreditLedgerPool, cw as CreditStatus, cx as DRAIN_DELIVERY_RESERVE_SATS, cy as DVM_PROTOCOL_VERSION, cz as DrainConflictReason, cA as DrawRailValue, cB as DrawStatus, cC as HostedTempoCloseReportWriteOff, cD as JobCostReportPayload, cE as JobTerminalReportPayload, cF as PostgresX402ChannelStorage, cG as ReplayStoreBackend, cH as RevenueSkippedNoRailPayload, cI as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cJ as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cK as TempoDrainDecision, cL as TempoDrainDecisionArgs, cM as TempoDrainDecisionResult, cN as TempoDrainHoldReason, cO as X402ChannelStorageOpts, cP as X402RelayLockHolder, cQ as X402RelaySubmissionLock, cR as X402RelaySubmissionLockError, cS as allocateDrawValue, cT as clientCompatibilityAttributes, cU as clientCompatibilityMiddleware, cV as clientUpgradeRequired, O as createSignedRequestVerifier, cW as parseClientCapabilities, cX as parseClientCompatibility, cY as parseDvmClient, cZ as parseProtocolVersion, c_ as requireClientCompatibility, c$ as retryHostedTempoCloseReport, d0 as secp256k1Auth, d1 as signedRequestInput, V as signedRequestStatementHeader, d2 as writeOffHostedTempoCloseReport } from '../step-cache-DQqpwXa8.js';
3
3
  import { Pool } from 'pg';
4
- import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-BWsVqMh-.js';
5
- export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-BWsVqMh-.js';
4
+ import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-B2T-O9oY.js';
5
+ export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-B2T-O9oY.js';
6
6
  import { Context, Hono } from 'hono';
7
7
  import { z } from 'zod';
8
- import { F as FxFetcher } from '../fx-BM5h4o5S.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, b as JobStore } from '../job-store-92v8e1LQ.js';
10
- export { a as JobStatus, h as isStreamableJobStore } from '../job-store-92v8e1LQ.js';
11
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-CrILCNxk.js';
12
- export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-CrILCNxk.js';
8
+ import { F as FxFetcher } from '../fx-DLhscRUh.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, b as JobStore } from '../job-store-B8Ijr5V6.js';
10
+ export { a as JobStatus, h as isStreamableJobStore } from '../job-store-B8Ijr5V6.js';
11
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-a1yRdmhI.js';
12
+ export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-a1yRdmhI.js';
13
13
  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';
14
14
  import { Env, BlankSchema } from 'hono/types';
15
15
  import 'mppx';
@@ -17,7 +17,7 @@ import '@x402/core/server';
17
17
  import '@x402/evm/batch-settlement/server';
18
18
  import '@x402/core/types';
19
19
  import 'viem';
20
- import '../lightning-backend-9oky_wJi.js';
20
+ import '../lightning-backend-DmwMSgaM.js';
21
21
  import '@cashu/cashu-ts';
22
22
 
23
23
  /** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
@@ -208,7 +208,9 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
208
208
  * machine and drawing on another would `credit_not_found`.
209
209
  */
210
210
  readonly durable = false;
211
+ readonly tempoCreditLossEvidenceVersion = 1;
211
212
  private readonly credits;
213
+ private readonly refunds;
212
214
  private readonly fundings;
213
215
  private readonly invoices;
214
216
  private readonly tempoLosses;
@@ -218,6 +220,8 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
218
220
  forkForTransaction(): MemoryCreditLedger;
219
221
  useX402SettlementGate(gate: X402RefundSettlementGate): void;
220
222
  fund(args: Parameters<CreditLedgerLike["fund"]>[0]): Promise<CreditSnapshot>;
223
+ /** Development accounting parity; this non-durable store cannot mount admin refunds. */
224
+ refundDraw(args: CreditDrawRefundArgs): Promise<CreditDrawRefundResult>;
221
225
  draw(args: Parameters<CreditLedgerLike["draw"]>[0]): Promise<DrawResult>;
222
226
  blockingX402Refund(channelId: string | null | undefined, statuses: X402SettlementStatus[]): Promise<X402UnresolvedRefund | undefined>;
223
227
  private blockingRefundForCredit;
@@ -290,7 +294,8 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
290
294
  terminalizeTempoCredits(evidence: TempoCreditLossEvidence, _tx?: CreditLedgerQuerier): Promise<TempoCreditLoss[]>;
291
295
  listTempoCreditLosses(args?: {
292
296
  limit?: number;
293
- }): Promise<TempoCreditLoss[]>;
297
+ channelId?: string;
298
+ }, _tx?: CreditLedgerQuerier): Promise<TempoCreditLoss[]>;
294
299
  terminalizeX402Credit(evidence: X402CreditLossEvidence, _tx?: CreditLedgerQuerier): Promise<X402CreditLoss[]>;
295
300
  listX402CreditLosses(args?: {
296
301
  limit?: number;
@@ -318,6 +323,7 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
318
323
  createdBeforeMs: number;
319
324
  rail: "tempo";
320
325
  includeResolved?: boolean;
326
+ includeWrittenOff?: boolean;
321
327
  }): Promise<CreditDrainRecord[]>;
322
328
  writeOffDrain(args: {
323
329
  creditId: string;
@@ -333,6 +339,16 @@ declare class MemoryCreditLedger implements CreditLedgerLike {
333
339
  creditId: string;
334
340
  drainId: string;
335
341
  }): Promise<DrainTransitionResult>;
342
+ recordTempoDrainRefund(args: {
343
+ creditId: string;
344
+ drainId: string;
345
+ refundedNative: string | bigint;
346
+ }): Promise<void>;
347
+ recordTempoDrainPayment(args: {
348
+ creditId: string;
349
+ drainId: string;
350
+ }): Promise<void>;
351
+ private recordTempoDrainRefundEvidence;
336
352
  releaseDrain(args: {
337
353
  creditId: string;
338
354
  drainId: string;
@@ -413,6 +429,8 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
413
429
  * Read terminal zero-revenue jobs whose latest declared-cost revision has
414
430
  * not yet reached the durable reporter outbox. Keep the filter in step with
415
431
  * `idx_jobs_unreported_terminal_cost`, which bounds each pass to the backlog.
432
+ * Completed balance-paid work carries cost through revenue even when its
433
+ * allocated rail value is zero; its durable acceptance excludes a cost-only replay.
416
434
  */
417
435
  listUnreportedTerminalCosts(args: {
418
436
  dvmId: string;
@@ -600,4 +618,4 @@ interface WriteOffTempoCloseReportResponse {
600
618
  note: string;
601
619
  }
602
620
 
603
- export { BitcoinDepositLiability, BlockedInvoiceCursor, CREDIT_REQUEST_SCHEMA, ConsumedCredentialStore, ContentHoldHistory, ContentHoldMutation, CreditInvoiceRecord, CreditLedgerLike, CreditLedgerQuerier, CreditMenu, type CreditRequest, type CreditRouteDeps, CreditSnapshot, DVMAuthScheme, DVMHostOpts, DVMServeResult, DrawRecord, DrawResolution, DrawResult, FundingRecord, GrownDrawResult, IMPLICIT_CREDIT_TTL_MS, type InitLockPool, type InstallAdminContentRoutesOpts, InvoiceReconciliation, InvoiceSettlement, InvoiceWriteOff, JobRecord, JobStore, LightningReceive, MemoryCreditLedger, type PendingImplicitDrawGroup, type PendingImplicitDrawSummary, PostgresJobStore, PostgresKVStore, PostgresReplayStore, type PostgresReplayStoreOpts, REQUEST_ID_FIELD, type ResolvedCashuOpts, type RetryTempoCloseReportResponse, SDK_INIT_ADVISORY_LOCK, SignedRequestDomain, SignedRequestReplayStore, StalePendingDrawCursor, StreamableJobStore, type TempoCloseReportSummary, type TempoCloseReportsResponse, type WriteOffTempoCloseReportResponse, handleCreditRequest, hasInvalidRequestId, installAdminContentRoutes, protocolEnvelopeIgnoreFields, readPendingImplicitDraws, requestIdFromEnvelope, resolveCashuOptsFromEnv, serve, stripProtocolEnvelope, withSdkInitLock };
621
+ export { BitcoinDepositLiability, BlockedInvoiceCursor, CREDIT_REQUEST_SCHEMA, ConsumedCredentialStore, ContentHoldHistory, ContentHoldMutation, CreditDrawRefundArgs, CreditDrawRefundResult, CreditInvoiceRecord, CreditLedgerLike, CreditLedgerQuerier, CreditMenu, type CreditRequest, type CreditRouteDeps, CreditSnapshot, DVMAuthScheme, DVMHostOpts, DVMServeResult, DrawRecord, DrawResolution, DrawResult, FundingRecord, GrownDrawResult, IMPLICIT_CREDIT_TTL_MS, type InitLockPool, type InstallAdminContentRoutesOpts, InvoiceReconciliation, InvoiceSettlement, InvoiceWriteOff, JobRecord, JobStore, LightningReceive, MemoryCreditLedger, type PendingImplicitDrawGroup, type PendingImplicitDrawSummary, PostgresJobStore, PostgresKVStore, PostgresReplayStore, type PostgresReplayStoreOpts, REQUEST_ID_FIELD, type ResolvedCashuOpts, type RetryTempoCloseReportResponse, SDK_INIT_ADVISORY_LOCK, SignedRequestDomain, SignedRequestReplayStore, StalePendingDrawCursor, StreamableJobStore, type TempoCloseReportSummary, type TempoCloseReportsResponse, type WriteOffTempoCloseReportResponse, handleCreditRequest, hasInvalidRequestId, installAdminContentRoutes, protocolEnvelopeIgnoreFields, readPendingImplicitDraws, requestIdFromEnvelope, resolveCashuOptsFromEnv, serve, stripProtocolEnvelope, withSdkInitLock };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PostgresReplayStore
3
- } from "../chunk-EWZFANHJ.js";
3
+ } from "../chunk-VWIMQ5H5.js";
4
4
  import {
5
5
  PostgresKVStore
6
6
  } from "../chunk-V5ZRATJH.js";
@@ -18,7 +18,7 @@ import {
18
18
  parseNwcUri,
19
19
  validateX402Env,
20
20
  withNwcPool
21
- } from "../chunk-AJ6UHXUA.js";
21
+ } from "../chunk-M4NFYEEY.js";
22
22
  import {
23
23
  MemoryKVStore
24
24
  } from "../chunk-SDK6KDJN.js";
@@ -82,30 +82,29 @@ import {
82
82
  toCreditView,
83
83
  unknownRouteNotFound,
84
84
  writeOffHostedTempoCloseReport
85
- } from "../chunk-SYBFMHXQ.js";
85
+ } from "../chunk-S7PIFHE4.js";
86
86
  import {
87
87
  MemoryProcessedPaymentStore,
88
88
  PostgresProcessedPaymentStore,
89
89
  ProcessedPaymentReplayError
90
90
  } from "../chunk-XRLKGCAW.js";
91
- import "../chunk-FFXXGCVG.js";
92
- import "../chunk-VTHYQCDB.js";
91
+ import "../chunk-ITRSITFP.js";
92
+ import "../chunk-E7ZBCT5U.js";
93
93
  import {
94
94
  MemoryCreditLedger
95
- } from "../chunk-YOSZIWC3.js";
95
+ } from "../chunk-POYUX2NN.js";
96
96
  import {
97
97
  PostgresJobStore
98
- } from "../chunk-2OGBZPPJ.js";
99
- import "../chunk-YG7G4DPZ.js";
98
+ } from "../chunk-TWKQFIOW.js";
100
99
  import {
101
100
  SignedRequestError,
102
101
  createDefaultReplayStore,
103
102
  createSignedRequestVerifier,
104
103
  signedRequestInput
105
- } from "../chunk-2XQLL6N6.js";
104
+ } from "../chunk-WFCVS6QB.js";
106
105
  import {
107
106
  isStreamableJobStore
108
- } from "../chunk-KFCEXCZM.js";
107
+ } from "../chunk-KJZVTWMX.js";
109
108
  import {
110
109
  ContentHoldError,
111
110
  baselineContentExpiry,
@@ -116,7 +115,7 @@ import {
116
115
  IMPLICIT_CREDIT_TTL_MS,
117
116
  generateEphemeralReceiptKey,
118
117
  receiptPubkeyFromSecret
119
- } from "../chunk-VUGEEMLT.js";
118
+ } from "../chunk-RPUFWIT4.js";
120
119
  import {
121
120
  X402_DEFAULT_FACILITATOR,
122
121
  X402_DEFAULT_NETWORK,
@@ -127,12 +126,12 @@ import {
127
126
  SIGNED_REQUEST_AUTH_ID,
128
127
  SIGNED_REQUEST_STATEMENT_VERSION,
129
128
  signedRequestStatementHeader
130
- } from "../chunk-UKD3R2KU.js";
131
- import "../chunk-3R7NQA3Z.js";
129
+ } from "../chunk-HW2UCOOC.js";
130
+ import "../chunk-7KQLPVV7.js";
132
131
  import "../chunk-FUJ36YDV.js";
133
132
  import "../chunk-BQJIFRAZ.js";
134
- import "../chunk-JNECYURT.js";
135
- import "../chunk-W3VGCNG6.js";
133
+ import "../chunk-D4FFS3IS.js";
134
+ import "../chunk-LDKV4UHI.js";
136
135
  import {
137
136
  CreditLedger,
138
137
  CreditLedgerError,
@@ -140,31 +139,34 @@ import {
140
139
  PostgresX402ChannelStorage,
141
140
  X402RelaySubmissionLockError,
142
141
  allocateDrawValue
143
- } from "../chunk-STJBBVNL.js";
142
+ } from "../chunk-2VGMZ7VF.js";
143
+ import "../chunk-YG7G4DPZ.js";
144
144
  import {
145
145
  SDK_INIT_ADVISORY_LOCK,
146
146
  withSdkInitLock
147
147
  } from "../chunk-COYKJRMM.js";
148
+ import "../chunk-5H7P3ORL.js";
148
149
  import {
149
150
  applyRetryToPool
150
- } from "../chunk-MMGSYMIC.js";
151
+ } from "../chunk-EP7OVWI5.js";
151
152
  import {
152
153
  assertSupportedX402Network
153
154
  } from "../chunk-BPYMEMQX.js";
155
+ import "../chunk-H3GGFEE5.js";
154
156
  import {
155
157
  TEMPO_MODERATO_CHAIN_ID,
156
158
  TEMPO_MODERATO_RPC,
157
159
  TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
158
160
  TempoSettlementReadiness,
159
161
  resolveTempoNetwork
160
- } from "../chunk-MU3IE434.js";
162
+ } from "../chunk-JLT2YIBS.js";
161
163
  import {
162
164
  initLoggers
163
- } from "../chunk-M3T5JYDJ.js";
165
+ } from "../chunk-HNXMWHLU.js";
164
166
  import "../chunk-66HGCPBU.js";
165
167
  import {
166
168
  diagnosticConsole
167
- } from "../chunk-QGNXYVBO.js";
169
+ } from "../chunk-Z4FOPROB.js";
168
170
 
169
171
  // src/sdk/server/cashu-env.ts
170
172
  async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
@@ -1188,7 +1190,7 @@ function createDVMHost(opts = {}) {
1188
1190
  });
1189
1191
  applyRetryToPool(pool, "dvm-host");
1190
1192
  pgPool = pool;
1191
- const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-H45PRBLA.js");
1193
+ const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-ZVMAN6L2.js");
1192
1194
  const pgJobStore = new PostgresJobStore2(pool);
1193
1195
  pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
1194
1196
  jobStore = pgJobStore;
@@ -1281,11 +1283,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1281
1283
  let tempoChargeBackend = "user-supplied";
1282
1284
  const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
1283
1285
  if (!mpp && mppTempoRecipient) {
1284
- const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-FURD45LI.js");
1286
+ const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-JU3MT7QX.js");
1285
1287
  tempoChargeBackend = pgPool ? "postgres" : "memory";
1286
1288
  let tempoCharge;
1287
1289
  if (pgPool) {
1288
- const { PostgresTempoChargeStore } = await import("../tempo-charge-store-5JOIYUIH.js");
1290
+ const { PostgresTempoChargeStore } = await import("../tempo-charge-store-7LTUAQHQ.js");
1289
1291
  const chargeStore = new PostgresTempoChargeStore(pgPool);
1290
1292
  tempoChargeStore = chargeStore;
1291
1293
  pendingInits.push(chargeStore.init());
@@ -1305,7 +1307,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1305
1307
  { createPublicClient, createWalletClient, erc20Abi, http },
1306
1308
  { tempo: tempoMainnet, tempoModerato }
1307
1309
  ] = await Promise.all([
1308
- import("../tempo-session-store-S6QMLQUA.js"),
1310
+ import("../tempo-session-store-LYAIDR2B.js"),
1309
1311
  import("viem/accounts"),
1310
1312
  import("viem"),
1311
1313
  import("viem/chains")
@@ -1458,7 +1460,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1458
1460
  }
1459
1461
  }
1460
1462
  const fxSource = envMaybe.DVMKIT_FX_SOURCE;
1461
- const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-X4XU5HXY.js");
1463
+ const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-KCLENT2C.js");
1462
1464
  const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
1463
1465
  const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
1464
1466
  if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
@@ -1468,7 +1470,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1468
1470
  assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
1469
1471
  let sharedPgReplayStore;
1470
1472
  if (pgPool) {
1471
- const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-XXJSA457.js");
1473
+ const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-QJ4FG6AR.js");
1472
1474
  const store2 = new PostgresReplayStore2(pgPool);
1473
1475
  pendingInits.push(store2.init());
1474
1476
  sharedPgReplayStore = store2;
@@ -1496,13 +1498,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1496
1498
  }
1497
1499
  let sharedPgConsumedStore;
1498
1500
  if (pgPool) {
1499
- const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-WO6OCFXZ.js");
1501
+ const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-WXJLM6J7.js");
1500
1502
  const consumedStore = new PostgresConsumedCredentialStore(pgPool);
1501
1503
  pendingInits.push(consumedStore.init());
1502
1504
  sharedPgConsumedStore = consumedStore;
1503
1505
  }
1504
1506
  if (pgPool) {
1505
- const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-4PZNAMDT.js");
1507
+ const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-MF23UKRJ.js");
1506
1508
  const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
1507
1509
  pendingInits.push(pgLedger.init());
1508
1510
  creditLedger = pgLedger;
@@ -1511,7 +1513,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1511
1513
  pendingInits.push(pgProcessed.init());
1512
1514
  processedPayments = pgProcessed;
1513
1515
  } else {
1514
- const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-RP7DT5IY.js");
1516
+ const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-ERD764PS.js");
1515
1517
  creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
1516
1518
  const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
1517
1519
  processedPayments = new MemoryProcessedPaymentStore2();
@@ -1633,7 +1635,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1633
1635
  lockPubkey: cashuOpts.lockPubkey,
1634
1636
  lockPubkeyGraceSeconds: cashuOpts.lockPubkeyGraceSeconds,
1635
1637
  canonicalDvmId: cashuOpts.canonicalDvmId,
1636
- db: hostingControl ? pgPool : cashuOpts.db,
1638
+ db: pgPool ?? cashuOpts.db,
1637
1639
  hostingControl,
1638
1640
  hostingCleanupSingleMount: mounts.length === 1,
1639
1641
  hostingCleanupKnownRailStores: !mpp || tempoChargeBackend === "postgres",