@dvmkit/sdk 0.7.0-rc.8 → 0.8.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 (57) hide show
  1. package/NOTICE +1 -1
  2. package/README.md +57 -261
  3. package/dist/{chunk-HG2CZPRJ.js → chunk-2I3OHMTY.js} +1 -1
  4. package/dist/{chunk-BDHJVTWA.js → chunk-55NKZQOC.js} +2 -2
  5. package/dist/{chunk-LQQ6H4UB.js → chunk-5CQKSLAU.js} +1 -1
  6. package/dist/{chunk-X5RY2G3C.js → chunk-5K5E6ME6.js} +1 -1
  7. package/dist/chunk-66HGCPBU.js +25 -0
  8. package/dist/{chunk-6RYCZLCK.js → chunk-6FEHRZO7.js} +1 -1
  9. package/dist/{chunk-XEOTTFLH.js → chunk-ATXDKX6F.js} +2 -2
  10. package/dist/{chunk-SX4WCPW7.js → chunk-BL6LRWXD.js} +2 -43
  11. package/dist/{chunk-FXDQMJQ2.js → chunk-DZQYQN2X.js} +31 -4
  12. package/dist/{chunk-FOJKZ4E7.js → chunk-EBCLWOKF.js} +1 -1
  13. package/dist/{chunk-KXWROQGK.js → chunk-FUJ36YDV.js} +1 -24
  14. package/dist/{chunk-KYCLHWKO.js → chunk-GB5XPAA5.js} +191 -5
  15. package/dist/{chunk-Z6EJOVIU.js → chunk-GSPV3UIM.js} +98 -51
  16. package/dist/{chunk-MYJOV4R4.js → chunk-I6PHA54S.js} +2 -2
  17. package/dist/chunk-IFWUWHTW.js +47 -0
  18. package/dist/{chunk-GDCIHJAR.js → chunk-P5WEZXJ2.js} +1 -1
  19. package/dist/{chunk-YK54BJ2L.js → chunk-PRSKC7AD.js} +1 -1
  20. package/dist/{chunk-KB7MEWBE.js → chunk-QPXI7YPH.js} +1 -1
  21. package/dist/{chunk-XO5EUHCW.js → chunk-RTFBVXCN.js} +2 -2
  22. package/dist/{chunk-BQP3LU2O.js → chunk-TFYY5APM.js} +1 -1
  23. package/dist/{chunk-WP7UX6RF.js → chunk-VYP6ADCS.js} +2 -2
  24. package/dist/{chunk-OFSOLHRX.js → chunk-WMGXJQI3.js} +1 -1
  25. package/dist/{chunk-3VFEX2Y3.js → chunk-X3JEME6P.js} +1 -1
  26. package/dist/{chunk-NUPEAWRM.js → chunk-XXLUIXPO.js} +1 -1
  27. package/dist/{chunk-BIZR5ORK.js → chunk-YPSJU3OH.js} +3 -3
  28. package/dist/{content-retention-U7dJM7Ph.d.ts → content-retention-D2K4MKNO.d.ts} +1 -1
  29. package/dist/{credit-ledger-SW4BGMNH.js → credit-ledger-AOU6S34N.js} +3 -3
  30. package/dist/{credit-menu-CUJdCfpt.d.ts → credit-menu-C-8g2cHT.d.ts} +5 -5
  31. package/dist/{fx-BvG2Wnjk.d.ts → fx-Ql4nvdbh.d.ts} +1 -1
  32. package/dist/index.d.ts +5 -5
  33. package/dist/index.js +4 -4
  34. package/dist/internal/caller.d.ts +10 -8
  35. package/dist/internal/caller.js +12 -9
  36. package/dist/internal/server.d.ts +7 -7
  37. package/dist/internal/server.js +22 -20
  38. package/dist/{job-store-DjgN2AOk.d.ts → job-store-DCvJQUX0.d.ts} +1 -1
  39. package/dist/{lightning-backend-DeasHNOP.d.ts → lightning-backend-CY5ML3km.d.ts} +1 -1
  40. package/dist/{memory-credit-ledger-E4C3VQE4.js → memory-credit-ledger-4HWYINKJ.js} +4 -4
  41. package/dist/{mpp-setup-BYKGEYFA.js → mpp-setup-2BKTPEK6.js} +4 -2
  42. package/dist/{payout-reporter-3UVWPGMO.js → payout-reporter-HQSIIBFL.js} +2 -2
  43. package/dist/{postgres-consumed-credential-store-EZ4KETWH.js → postgres-consumed-credential-store-R7DNU6CM.js} +1 -1
  44. package/dist/{postgres-job-store-3YBSGLYU.js → postgres-job-store-6VGFL6XE.js} +2 -2
  45. package/dist/{postgres-replay-store-GIYZS4LJ.js → postgres-replay-store-SY26NUCI.js} +2 -2
  46. package/dist/{pricing-DG5IJ5QF.js → pricing-H2RA4X2R.js} +3 -3
  47. package/dist/{revenue-reporter-E56J3NZK.js → revenue-reporter-X52GPZ5U.js} +2 -2
  48. package/dist/server/index.d.ts +10 -10
  49. package/dist/server/index.js +30 -28
  50. package/dist/{step-cache-C9JRSFhM.d.ts → step-cache-BOWAn_BH.d.ts} +32 -4
  51. package/dist/{tempo-charge-store-WTBIX2JX.js → tempo-charge-store-NKXJ2AXE.js} +2 -2
  52. package/dist/{tempo-session-store-AWIFUAA6.js → tempo-session-store-ZSDQIWSU.js} +3 -3
  53. package/dist/testing/index.d.ts +3 -3
  54. package/dist/testing/index.js +8 -6
  55. package/dist/{usd-DXDkHn_8.d.ts → usd-MAtMp3DB.d.ts} +1 -1
  56. package/dist/{x402-BN26TQZ6.js → x402-Q4S36NHQ.js} +6 -5
  57. package/package.json +18 -3
@@ -1,15 +1,15 @@
1
- import { ae as CashuMode, bL as CreditDrainEnqueue, bM as HostedSettlementReportObligations, R as ResolvedCreditConfig, bN as DVMAuthScheme, B as SignedRequestDomain, bO as CreditLedgerLike, bP as X402RefundSettlementGate, bQ as CreditSnapshot, bR as DrawResult, bS as X402SettlementStatus, bT as X402UnresolvedRefund, bU as GrownDrawResult, bV as DrawResolution, bW as FundingRecord, $ as FundingReceipt, bX as CreditInvoiceRecord, bY as InvoiceSettlement, bZ as BlockedInvoiceCursor, b_ as InvoiceReconciliation, b$ as InvoiceWriteOff, c0 as DrawRecord, c1 as StalePendingDrawCursor, c2 as TempoCreditLossEvidence, c3 as CreditLedgerQuerier, 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 DrainReleaseResult, ce as DrainFulfilment, cf as DrainTransitionResult, cg as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-C9JRSFhM.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 JobCostReportPayload, cB as JobTerminalReportPayload, cC as PostgresX402ChannelStorage, cD as ReplayStoreBackend, cE as RevenueSkippedNoRailPayload, cF as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cG as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cH as X402ChannelStorageOpts, cI as X402RelayLockHolder, cJ as X402RelaySubmissionLock, cK as X402RelaySubmissionLockError, cL as allocateDrawValue, cM as clientCompatibilityAttributes, cN as clientCompatibilityMiddleware, cO as clientUpgradeRequired, O as createSignedRequestVerifier, cP as parseClientCapabilities, cQ as parseClientCompatibility, cR as parseDvmClient, cS as parseProtocolVersion, cT as requireClientCompatibility, cU as secp256k1Auth, cV as signedRequestInput, V as signedRequestStatementHeader } from '../step-cache-C9JRSFhM.js';
1
+ import { ae as CashuMode, bL as CreditDrainEnqueue, bM as HostedSettlementReportObligations, R as ResolvedCreditConfig, bN as DVMAuthScheme, B as SignedRequestDomain, bO as CreditLedgerLike, bP as X402RefundSettlementGate, bQ as CreditSnapshot, bR as DrawResult, bS as X402SettlementStatus, bT as X402UnresolvedRefund, bU as GrownDrawResult, bV as DrawResolution, bW as FundingRecord, $ as FundingReceipt, bX as CreditInvoiceRecord, bY as InvoiceSettlement, bZ as BlockedInvoiceCursor, b_ as InvoiceReconciliation, b$ as InvoiceWriteOff, c0 as DrawRecord, c1 as StalePendingDrawCursor, c2 as TempoCreditLossEvidence, c3 as CreditLedgerQuerier, 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 DrainReleaseResult, ce as DrainFulfilment, cf as DrainTransitionResult, cg as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-BOWAn_BH.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 JobCostReportPayload, cB as JobTerminalReportPayload, cC as PostgresX402ChannelStorage, cD as ReplayStoreBackend, cE as RevenueSkippedNoRailPayload, cF as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cG as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cH as X402ChannelStorageOpts, cI as X402RelayLockHolder, cJ as X402RelaySubmissionLock, cK as X402RelaySubmissionLockError, cL as allocateDrawValue, cM as clientCompatibilityAttributes, cN as clientCompatibilityMiddleware, cO as clientUpgradeRequired, O as createSignedRequestVerifier, cP as parseClientCapabilities, cQ as parseClientCompatibility, cR as parseDvmClient, cS as parseProtocolVersion, cT as requireClientCompatibility, cU as secp256k1Auth, cV as signedRequestInput, V as signedRequestStatementHeader } from '../step-cache-BOWAn_BH.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-CUJdCfpt.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-CUJdCfpt.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-C-8g2cHT.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-C-8g2cHT.js';
6
6
  import { Context, Hono } from 'hono';
7
7
  import { z } from 'zod';
8
- import { F as FxFetcher } from '../fx-BvG2Wnjk.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-DjgN2AOk.js';
10
- export { a as JobStatus, h as isStreamableJobStore } from '../job-store-DjgN2AOk.js';
11
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-U7dJM7Ph.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-U7dJM7Ph.js';
8
+ import { F as FxFetcher } from '../fx-Ql4nvdbh.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-DCvJQUX0.js';
10
+ export { a as JobStatus, h as isStreamableJobStore } from '../job-store-DCvJQUX0.js';
11
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-D2K4MKNO.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-D2K4MKNO.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-DeasHNOP.js';
20
+ import '../lightning-backend-CY5ML3km.js';
21
21
  import '@cashu/cashu-ts';
22
22
 
23
23
  /** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PostgresReplayStore
3
- } from "../chunk-HG2CZPRJ.js";
3
+ } from "../chunk-2I3OHMTY.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-BDHJVTWA.js";
21
+ } from "../chunk-55NKZQOC.js";
22
22
  import {
23
23
  MemoryKVStore
24
24
  } from "../chunk-SDK6KDJN.js";
@@ -80,32 +80,32 @@ import {
80
80
  stripProtocolEnvelope,
81
81
  toCreditView,
82
82
  unknownRouteNotFound
83
- } from "../chunk-Z6EJOVIU.js";
83
+ } from "../chunk-GSPV3UIM.js";
84
84
  import {
85
85
  TEMPO_MODERATO_CHAIN_ID,
86
86
  TEMPO_MODERATO_RPC,
87
87
  TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
88
88
  TempoSettlementReadiness,
89
89
  resolveTempoNetwork
90
- } from "../chunk-KYCLHWKO.js";
91
- import "../chunk-3VFEX2Y3.js";
92
- import "../chunk-XEOTTFLH.js";
90
+ } from "../chunk-GB5XPAA5.js";
91
+ import "../chunk-X3JEME6P.js";
92
+ import "../chunk-ATXDKX6F.js";
93
93
  import {
94
94
  MemoryCreditLedger
95
- } from "../chunk-FOJKZ4E7.js";
95
+ } from "../chunk-EBCLWOKF.js";
96
96
  import {
97
97
  PostgresJobStore
98
- } from "../chunk-KB7MEWBE.js";
98
+ } from "../chunk-QPXI7YPH.js";
99
99
  import "../chunk-YG7G4DPZ.js";
100
100
  import {
101
101
  SignedRequestError,
102
102
  createDefaultReplayStore,
103
103
  createSignedRequestVerifier,
104
104
  signedRequestInput
105
- } from "../chunk-X5RY2G3C.js";
105
+ } from "../chunk-5K5E6ME6.js";
106
106
  import {
107
107
  isStreamableJobStore
108
- } from "../chunk-MYJOV4R4.js";
108
+ } from "../chunk-I6PHA54S.js";
109
109
  import {
110
110
  ContentHoldError,
111
111
  baselineContentExpiry,
@@ -116,7 +116,7 @@ import {
116
116
  IMPLICIT_CREDIT_TTL_MS,
117
117
  generateEphemeralReceiptKey,
118
118
  receiptPubkeyFromSecret
119
- } from "../chunk-XO5EUHCW.js";
119
+ } from "../chunk-RTFBVXCN.js";
120
120
  import {
121
121
  X402_DEFAULT_FACILITATOR,
122
122
  X402_DEFAULT_NETWORK,
@@ -128,13 +128,15 @@ import {
128
128
  SIGNED_REQUEST_STATEMENT_VERSION,
129
129
  signedRequestStatementHeader
130
130
  } from "../chunk-UKD3R2KU.js";
131
+ import "../chunk-IFWUWHTW.js";
131
132
  import {
132
133
  initLoggers
133
- } from "../chunk-SX4WCPW7.js";
134
- import "../chunk-KXWROQGK.js";
134
+ } from "../chunk-BL6LRWXD.js";
135
+ import "../chunk-FUJ36YDV.js";
136
+ import "../chunk-66HGCPBU.js";
135
137
  import "../chunk-BQJIFRAZ.js";
136
- import "../chunk-NUPEAWRM.js";
137
- import "../chunk-LQQ6H4UB.js";
138
+ import "../chunk-XXLUIXPO.js";
139
+ import "../chunk-5CQKSLAU.js";
138
140
  import {
139
141
  CreditLedger,
140
142
  CreditLedgerError,
@@ -142,16 +144,16 @@ import {
142
144
  PostgresX402ChannelStorage,
143
145
  X402RelaySubmissionLockError,
144
146
  allocateDrawValue
145
- } from "../chunk-WP7UX6RF.js";
147
+ } from "../chunk-VYP6ADCS.js";
146
148
  import {
147
149
  applyRetryToPool
148
- } from "../chunk-6RYCZLCK.js";
150
+ } from "../chunk-6FEHRZO7.js";
149
151
  import {
150
152
  assertSupportedX402Network
151
153
  } from "../chunk-BPYMEMQX.js";
152
154
  import {
153
155
  diagnosticConsole
154
- } from "../chunk-FXDQMJQ2.js";
156
+ } from "../chunk-DZQYQN2X.js";
155
157
  import {
156
158
  MemoryProcessedPaymentStore,
157
159
  PostgresProcessedPaymentStore,
@@ -1147,7 +1149,7 @@ function createDVMHost(opts = {}) {
1147
1149
  });
1148
1150
  applyRetryToPool(pool, "dvm-host");
1149
1151
  pgPool = pool;
1150
- const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-3YBSGLYU.js");
1152
+ const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-6VGFL6XE.js");
1151
1153
  const pgJobStore = new PostgresJobStore2(pool);
1152
1154
  pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
1153
1155
  jobStore = pgJobStore;
@@ -1240,11 +1242,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1240
1242
  let tempoChargeBackend = "user-supplied";
1241
1243
  const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
1242
1244
  if (!mpp && mppTempoRecipient) {
1243
- const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-BYKGEYFA.js");
1245
+ const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-2BKTPEK6.js");
1244
1246
  tempoChargeBackend = pgPool ? "postgres" : "memory";
1245
1247
  let tempoCharge;
1246
1248
  if (pgPool) {
1247
- const { PostgresTempoChargeStore } = await import("../tempo-charge-store-WTBIX2JX.js");
1249
+ const { PostgresTempoChargeStore } = await import("../tempo-charge-store-NKXJ2AXE.js");
1248
1250
  const chargeStore = new PostgresTempoChargeStore(pgPool);
1249
1251
  tempoChargeStore = chargeStore;
1250
1252
  pendingInits.push(chargeStore.init());
@@ -1264,7 +1266,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1264
1266
  { createPublicClient, createWalletClient, erc20Abi, http },
1265
1267
  { tempo: tempoMainnet, tempoModerato }
1266
1268
  ] = await Promise.all([
1267
- import("../tempo-session-store-AWIFUAA6.js"),
1269
+ import("../tempo-session-store-ZSDQIWSU.js"),
1268
1270
  import("viem/accounts"),
1269
1271
  import("viem"),
1270
1272
  import("viem/chains")
@@ -1417,7 +1419,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1417
1419
  }
1418
1420
  }
1419
1421
  const fxSource = envMaybe.DVMKIT_FX_SOURCE;
1420
- const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-DG5IJ5QF.js");
1422
+ const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-H2RA4X2R.js");
1421
1423
  const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
1422
1424
  const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
1423
1425
  if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
@@ -1427,7 +1429,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1427
1429
  assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
1428
1430
  let sharedPgReplayStore;
1429
1431
  if (pgPool) {
1430
- const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-GIYZS4LJ.js");
1432
+ const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-SY26NUCI.js");
1431
1433
  const store2 = new PostgresReplayStore2(pgPool);
1432
1434
  pendingInits.push(store2.init());
1433
1435
  sharedPgReplayStore = store2;
@@ -1455,13 +1457,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1455
1457
  }
1456
1458
  let sharedPgConsumedStore;
1457
1459
  if (pgPool) {
1458
- const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-EZ4KETWH.js");
1460
+ const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-R7DNU6CM.js");
1459
1461
  const consumedStore = new PostgresConsumedCredentialStore(pgPool);
1460
1462
  pendingInits.push(consumedStore.init());
1461
1463
  sharedPgConsumedStore = consumedStore;
1462
1464
  }
1463
1465
  if (pgPool) {
1464
- const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-SW4BGMNH.js");
1466
+ const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-AOU6S34N.js");
1465
1467
  const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
1466
1468
  pendingInits.push(pgLedger.init());
1467
1469
  creditLedger = pgLedger;
@@ -1470,7 +1472,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
1470
1472
  pendingInits.push(pgProcessed.init());
1471
1473
  processedPayments = pgProcessed;
1472
1474
  } else {
1473
- const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-E4C3VQE4.js");
1475
+ const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-4HWYINKJ.js");
1474
1476
  creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
1475
1477
  const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
1476
1478
  processedPayments = new MemoryProcessedPaymentStore2();
@@ -1971,7 +1973,7 @@ function logBootSummary(s) {
1971
1973
  diagnosticConsole.log(` Database: ${s.databaseConnected ? "connected" : "(not configured)"}`);
1972
1974
  diagnosticConsole.log(` Mints: ${s.mints && s.mints.length > 0 ? s.mints.join(", ") : "(none)"}`);
1973
1975
  diagnosticConsole.log(` Cashu mode: ${s.cashuOpts.cashuMode ?? "(disabled)"}`);
1974
- diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm}` : "(unconfigured)"}`);
1976
+ diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm ?? "(unset)"}` : "(unconfigured)"}`);
1975
1977
  if (s.mpp) {
1976
1978
  const rotState = !s.mppSecretState ? "single-key (no DB-backed rotation)" : s.mppSecretState.previous ? `dual-key (previous expires ${new Date(s.mppSecretState.previous.expiresAtMs).toISOString()})` : "active-only";
1977
1979
  diagnosticConsole.log(` Tempo secret: ${rotState}`);
@@ -1228,6 +1228,12 @@ declare class HostedSettlementReportObligations {
1228
1228
  }): Promise<HostedEffectReservation | null>;
1229
1229
  reserveTempo(channelId: string, operation: "settle" | "close", drainId?: string): Promise<HostedEffectReservation>;
1230
1230
  findPendingTempo(channelId: string, operation: "settle" | "close"): Promise<ObligationRow | undefined>;
1231
+ /** The original close obligation reserved for this drain, while its report is outstanding. */
1232
+ pendingTempoClose(channelId: string, drainId: string): Promise<{
1233
+ id: string;
1234
+ txHash: string | null;
1235
+ reservedAtMs: number;
1236
+ } | undefined>;
1231
1237
  submittedIds(rail: Rail, operation: Operation, txHash: string, batchId?: string): Promise<string[]>;
1232
1238
  refundClaimDelta(txHash: string, channelId: string): Promise<bigint>;
1233
1239
  assertReservedTempoClose(id: string, channelId: string): Promise<void>;
@@ -4519,7 +4525,8 @@ interface MppOpts {
4519
4525
  * of ours can reach the un-dual-keyed door — see `createDualKeyMppxFromOpts`.
4520
4526
  */
4521
4527
  interface MppxServer {
4522
- realm: string;
4528
+ /** Undefined when neither `Mppx.create` nor mppx's environment lookup names a realm. */
4529
+ realm?: string;
4523
4530
  methods: readonly Method.AnyServer[];
4524
4531
  /** Public, non-secret Tempo bindings resolved from the exact live method configuration. */
4525
4532
  tempoConfiguration?: {
@@ -4531,9 +4538,9 @@ interface MppxServer {
4531
4538
  };
4532
4539
  challenge: any;
4533
4540
  /**
4534
- * Re-validate and broadcast a credential, returning a receipt. mppx 0.8.x
4535
- * also exposes a non-mutating `validateCredential`; accepting payment is
4536
- * always the mutating path, so this is the only one the SDK binds.
4541
+ * Re-validate and broadcast a credential, returning a receipt. Accepting
4542
+ * payment is always this mutating path; `validateCredential` below is only
4543
+ * the hosted close's preflight.
4537
4544
  */
4538
4545
  broadcastCredential(credential: Credential.Credential | string, options?: any): Promise<Receipt.Receipt>;
4539
4546
  /** Non-mutating mppx HMAC, route, expiry and method preflight. */
@@ -4605,6 +4612,21 @@ interface MppxServer {
4605
4612
  getTempoSessionCloseIntent?: (channelId: string) => Promise<TempoSessionCloseRecord | null>;
4606
4613
  /** Read terminally consumed value for an exact cooperative-close challenge. */
4607
4614
  getTempoSessionSpent?: (channelId: string) => Promise<bigint>;
4615
+ /**
4616
+ * Refuse a cooperative close voucher that mppx's close would refuse before
4617
+ * submitting, using only the stored channel: no chain read and no write.
4618
+ * A hosted close runs it before reserving its settlement-report obligation,
4619
+ * so a voucher that could never broadcast does not leave a reservation behind.
4620
+ */
4621
+ assertTempoSessionCloseVoucher?: (voucher: {
4622
+ channelId: string;
4623
+ cumulativeAmount: bigint;
4624
+ signature: string;
4625
+ /** The credential's TIP-1034 channel descriptor, unchecked. */
4626
+ descriptor: unknown;
4627
+ /** The HMAC-verified challenge request the credential answers. */
4628
+ request: Record<string, unknown>;
4629
+ }) => Promise<void>;
4608
4630
  /**
4609
4631
  * Read the immutable chain binding of a stored channel, or `null`
4610
4632
  * when this DVM holds no such channel. What a close event must match before
@@ -4737,6 +4759,12 @@ interface TempoSessionChainOps {
4737
4759
  onSessionSettlement?: NonNullable<MppOpts["tempoSession"]>["onSessionSettlement"];
4738
4760
  }): Promise<Hex>;
4739
4761
  readChannelClose(client: Client, channelId: Hex, txHash: Hex): Promise<TempoChannelCloseAmounts>;
4762
+ /**
4763
+ * The transaction that emitted this channel's `ChannelClosed`, searched back
4764
+ * from the chain head no further than blocks older than `notBeforeMs`. Null
4765
+ * only when that whole range was searched and holds no close.
4766
+ */
4767
+ findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number): Promise<Hex | null>;
4740
4768
  }
4741
4769
  declare function attachTempoSessionRuntime(mppx: MppxServer, config: MppOpts["tempoSession"], chainOpOverrides?: Partial<TempoSessionChainOps>): MppxServer;
4742
4770
  /** Test-only seams for deterministic watcher coverage without a live Tempo RPC. */
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  PostgresTempoChargeStore
3
- } from "./chunk-BQP3LU2O.js";
3
+ } from "./chunk-TFYY5APM.js";
4
4
  import "./chunk-YG7G4DPZ.js";
5
- import "./chunk-FXDQMJQ2.js";
5
+ import "./chunk-DZQYQN2X.js";
6
6
  import "./chunk-COYKJRMM.js";
7
7
  export {
8
8
  PostgresTempoChargeStore
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  PostgresTempoSessionStore,
3
3
  assertMonotonicTransition
4
- } from "./chunk-GDCIHJAR.js";
4
+ } from "./chunk-P5WEZXJ2.js";
5
5
  import "./chunk-YG7G4DPZ.js";
6
- import "./chunk-6RYCZLCK.js";
7
- import "./chunk-FXDQMJQ2.js";
6
+ import "./chunk-6FEHRZO7.js";
7
+ import "./chunk-DZQYQN2X.js";
8
8
  import "./chunk-COYKJRMM.js";
9
9
  export {
10
10
  PostgresTempoSessionStore,
@@ -1,6 +1,6 @@
1
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-U7dJM7Ph.js';
2
- import { a0 as JobReceipt, a5 as Message, a1 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-C9JRSFhM.js';
3
- 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-DjgN2AOk.js';
1
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-D2K4MKNO.js';
2
+ import { a0 as JobReceipt, a5 as Message, a1 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-BOWAn_BH.js';
3
+ 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-DCvJQUX0.js';
4
4
  import 'hono';
5
5
  import 'mppx';
6
6
  import '@x402/core/server';
@@ -4,20 +4,22 @@ import {
4
4
  import {
5
5
  MemoryJobStore,
6
6
  createInstrumentedFetch
7
- } from "../chunk-MYJOV4R4.js";
7
+ } from "../chunk-I6PHA54S.js";
8
8
  import {
9
9
  JobCancelledError
10
10
  } from "../chunk-AFV77S4C.js";
11
11
  import {
12
12
  createNoopLogger
13
- } from "../chunk-SX4WCPW7.js";
14
- import "../chunk-KXWROQGK.js";
13
+ } from "../chunk-IFWUWHTW.js";
14
+ import "../chunk-BL6LRWXD.js";
15
+ import "../chunk-FUJ36YDV.js";
16
+ import "../chunk-66HGCPBU.js";
15
17
  import "../chunk-BQJIFRAZ.js";
16
- import "../chunk-NUPEAWRM.js";
18
+ import "../chunk-XXLUIXPO.js";
17
19
  import {
18
20
  validateCurrency
19
- } from "../chunk-LQQ6H4UB.js";
20
- import "../chunk-FXDQMJQ2.js";
21
+ } from "../chunk-5CQKSLAU.js";
22
+ import "../chunk-DZQYQN2X.js";
21
23
 
22
24
  // src/sdk/testing/test-context.ts
23
25
  function createTestContext(opts) {
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-C9JRSFhM.js';
1
+ import { C as Currency } from './step-cache-BOWAn_BH.js';
2
2
 
3
3
  /**
4
4
  * Thrown by `fiatToSatsCeil` / `satsToFiat` when the supplied `ratePerBtc` is
@@ -3,11 +3,11 @@ import {
3
3
  generateX402PrivateKey,
4
4
  getX402Balance,
5
5
  resolveX402Asset
6
- } from "./chunk-OFSOLHRX.js";
6
+ } from "./chunk-WMGXJQI3.js";
7
7
  import {
8
8
  verifyX402Payment
9
- } from "./chunk-BIZR5ORK.js";
10
- import "./chunk-XEOTTFLH.js";
9
+ } from "./chunk-YPSJU3OH.js";
10
+ import "./chunk-ATXDKX6F.js";
11
11
  import {
12
12
  X402_DEFAULT_FACILITATOR,
13
13
  X402_DEFAULT_NETWORK,
@@ -27,7 +27,8 @@ import {
27
27
  usdcContractByCaip2,
28
28
  x402NetworkToCaip2
29
29
  } from "./chunk-62FI3NJF.js";
30
- import "./chunk-KXWROQGK.js";
30
+ import "./chunk-FUJ36YDV.js";
31
+ import "./chunk-66HGCPBU.js";
31
32
  import {
32
33
  X402_NETWORKS,
33
34
  assertSupportedX402Network,
@@ -36,7 +37,7 @@ import {
36
37
  x402NetworkListForCopy,
37
38
  x402SupportedNetworksHint
38
39
  } from "./chunk-BPYMEMQX.js";
39
- import "./chunk-FXDQMJQ2.js";
40
+ import "./chunk-DZQYQN2X.js";
40
41
  export {
41
42
  X402_DEFAULT_FACILITATOR,
42
43
  X402_DEFAULT_NETWORK,
package/package.json CHANGED
@@ -1,7 +1,20 @@
1
1
  {
2
2
  "name": "@dvmkit/sdk",
3
- "version": "0.7.0-rc.8",
4
- "description": "SDK for building accountless, pay-per-use Digital Vending Machines",
3
+ "version": "0.8.0",
4
+ "description": "SDK for building Digital Vending Machines: pay-per-use HTTPS services AI agents can find, pay, and call with no account or API key",
5
+ "author": "DVM Technologies Ltd",
6
+ "keywords": [
7
+ "dvm",
8
+ "digital-vending-machine",
9
+ "ai-agents",
10
+ "agent-payments",
11
+ "pay-per-use",
12
+ "x402",
13
+ "cashu",
14
+ "lightning",
15
+ "mpp",
16
+ "hono"
17
+ ],
5
18
  "license": "Apache-2.0",
6
19
  "repository": {
7
20
  "type": "git",
@@ -44,6 +57,7 @@
44
57
  },
45
58
  "scripts": {
46
59
  "build": "NODE_OPTIONS=--max-old-space-size=6144 tsup --config tsup.config.ts && node scripts/write-internal-entry.mjs && node scripts/prune-sdk-dist.mjs",
60
+ "check:readme-quickstart": "node scripts/check-readme-quickstart.mjs",
47
61
  "check:api": "node scripts/check-api-surface.mjs && node scripts/generate-api-reference.mjs --check",
48
62
  "check:consumer": "node scripts/consumer-smoke.mjs",
49
63
  "install-published-release": "node scripts/install-published-release.mjs",
@@ -57,7 +71,8 @@
57
71
  "docs:api": "node scripts/generate-api-reference.mjs --write",
58
72
  "release:tag": "node scripts/release-tag.mjs",
59
73
  "test": "vitest run --config vitest.config.ts",
60
- "test:examples": "node --test examples/quickstart/handler.test.mjs examples/authenticated-route/handler.test.mjs examples/payments-and-lifecycle/handler.test.mjs",
74
+ "test:examples": "node --test examples/quickstart/handler.test.ts examples/authenticated-route/handler.test.ts examples/payments-and-lifecycle/handler.test.ts",
75
+ "test:server": "vitest run --config vitest.server.config.ts",
61
76
  "test:db": "vitest run --config vitest.db.config.ts",
62
77
  "typecheck": "tsc --noEmit",
63
78
  "typecheck:scripts": "tsc --noEmit --project tsconfig.scripts.json",