@dvmkit/sdk 0.8.1 → 0.10.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 (52) hide show
  1. package/dist/{chunk-ILBSZMJL.js → chunk-2XQLL6N6.js} +1 -1
  2. package/dist/{chunk-UVS7MRJX.js → chunk-3Q6FTZDB.js} +2 -2
  3. package/dist/{chunk-OP7VCGQR.js → chunk-3R7NQA3Z.js} +1 -1
  4. package/dist/{chunk-RSNC5T6C.js → chunk-AJ6UHXUA.js} +1 -1
  5. package/dist/{chunk-ALWVJ2RB.js → chunk-EWZFANHJ.js} +3 -3
  6. package/dist/{chunk-J5J63WDC.js → chunk-FFXXGCVG.js} +3 -3
  7. package/dist/{chunk-UDJNZ3UG.js → chunk-JNECYURT.js} +1 -1
  8. package/dist/{chunk-IHQUBATH.js → chunk-KFCEXCZM.js} +3 -3
  9. package/dist/{chunk-NA2KOR6G.js → chunk-LDIPVPKI.js} +3 -3
  10. package/dist/{chunk-IOQIXRGM.js → chunk-M3T5JYDJ.js} +15 -8
  11. package/dist/{chunk-UWGBI5WK.js → chunk-MB6R4XPZ.js} +3 -3
  12. package/dist/{chunk-7PM4R4GD.js → chunk-MMGSYMIC.js} +1 -1
  13. package/dist/{chunk-QKE5NDPF.js → chunk-MU3IE434.js} +348 -80
  14. package/dist/{chunk-BFGQG4WY.js → chunk-QGNXYVBO.js} +52 -12
  15. package/dist/{chunk-JIZ4ZIXX.js → chunk-QNKK7SPY.js} +652 -245
  16. package/dist/{chunk-FM6QAGJC.js → chunk-STJBBVNL.js} +24 -8
  17. package/dist/{chunk-NU5RWJ5B.js → chunk-VMHYGKWT.js} +3 -3
  18. package/dist/{chunk-AVV5SYGO.js → chunk-VTHYQCDB.js} +1 -1
  19. package/dist/{chunk-ZEPJF4JC.js → chunk-VUGEEMLT.js} +4 -4
  20. package/dist/{chunk-2U6LAASN.js → chunk-W3VGCNG6.js} +1 -1
  21. package/dist/{chunk-G3MPHW5I.js → chunk-Y6DO5WSO.js} +3 -3
  22. package/dist/{chunk-AGE5XZKE.js → chunk-YOSZIWC3.js} +17 -4
  23. package/dist/{content-retention-B7ddtJ2y.d.ts → content-retention-CrILCNxk.d.ts} +1 -1
  24. package/dist/{credit-ledger-KIQIE6I6.js → credit-ledger-4PZNAMDT.js} +4 -4
  25. package/dist/{credit-menu-BH3g9GQa.d.ts → credit-menu-VwX_6KM7.d.ts} +4 -4
  26. package/dist/{fx-DN26_J7o.d.ts → fx-BM5h4o5S.d.ts} +1 -1
  27. package/dist/index.d.ts +5 -5
  28. package/dist/index.js +4 -4
  29. package/dist/internal/caller.d.ts +7 -7
  30. package/dist/internal/caller.js +16 -16
  31. package/dist/internal/server.d.ts +7 -7
  32. package/dist/internal/server.js +26 -26
  33. package/dist/{job-store-Cq21JT37.d.ts → job-store-92v8e1LQ.d.ts} +1 -1
  34. package/dist/{lightning-backend-S8F8nf8q.d.ts → lightning-backend-9oky_wJi.d.ts} +1 -1
  35. package/dist/{memory-credit-ledger-ATYFAYBG.js → memory-credit-ledger-RP7DT5IY.js} +5 -5
  36. package/dist/{mpp-setup-ZTORW3VF.js → mpp-setup-FURD45LI.js} +5 -3
  37. package/dist/{payout-reporter-NN6K2IVQ.js → payout-reporter-HVJ6WUF3.js} +2 -2
  38. package/dist/{postgres-consumed-credential-store-XJTE5PCA.js → postgres-consumed-credential-store-WO6OCFXZ.js} +3 -3
  39. package/dist/{postgres-job-store-AR6ZJUQV.js → postgres-job-store-FSRUPYH2.js} +2 -2
  40. package/dist/{postgres-replay-store-33K33QV7.js → postgres-replay-store-XXJSA457.js} +2 -2
  41. package/dist/{pricing-G5IN5YJE.js → pricing-X4XU5HXY.js} +3 -3
  42. package/dist/{revenue-reporter-KDUZLD5F.js → revenue-reporter-EV3K5L6B.js} +2 -2
  43. package/dist/server/index.d.ts +78 -11
  44. package/dist/server/index.js +87 -45
  45. package/dist/{step-cache-CR12EZ1Q.d.ts → step-cache--7yA5Ihr.d.ts} +99 -12
  46. package/dist/{tempo-charge-store-XEGJYM3G.js → tempo-charge-store-5JOIYUIH.js} +2 -2
  47. package/dist/{tempo-session-store-3WTDOO7H.js → tempo-session-store-S6QMLQUA.js} +3 -3
  48. package/dist/testing/index.d.ts +3 -3
  49. package/dist/testing/index.js +7 -7
  50. package/dist/{usd-s_VZ_eS7.d.ts → usd-C7lvLvLk.d.ts} +1 -1
  51. package/dist/{x402-HQ5GRQZU.js → x402-EN5LSOVM.js} +4 -4
  52. package/package.json +1 -1
@@ -1138,7 +1138,7 @@ declare class PostgresX402ChannelStorage implements ChannelStorage {
1138
1138
  type Query = Pick<Pool | PoolClient, "query">;
1139
1139
  type Rail = "x402" | "tempo";
1140
1140
  type Operation = "claim" | "refund" | "settle" | "close";
1141
- type State = "reserved" | "observed" | "report_queued" | "delivered" | "no_report";
1141
+ type State = "reserved" | "observed" | "report_queued" | "delivered" | "no_report" | "exhausted" | "unmatched";
1142
1142
  interface ObligationRow {
1143
1143
  id: string;
1144
1144
  source_key: string;
@@ -1229,9 +1229,9 @@ declare class HostedSettlementReportObligations {
1229
1229
  reserveTempo(channelId: string, operation: "settle" | "close", drainId?: string): Promise<HostedEffectReservation>;
1230
1230
  /**
1231
1231
  * Retire a close reservation that never recorded a transaction and reserve
1232
- * the drain's next attempt, in one transaction, so the drain always keeps one
1233
- * outstanding close obligation. A close from the retired attempt that lands
1234
- * late is a close of the same channel: `recordSubmitted` on the retired row
1232
+ * the drain's next attempt in one transaction. At the retry cap the final
1233
+ * row becomes terminal `exhausted` and remains claimable by a late landing.
1234
+ * A close from the retired attempt that lands late is the same channel's close: `recordSubmitted` on the retired row
1235
1235
  * writes it onto the successor, and recovery attaches it there if that
1236
1236
  * attempt never got to write, so it is reported once.
1237
1237
  *
@@ -1242,6 +1242,7 @@ declare class HostedSettlementReportObligations {
1242
1242
  releaseStaleTempoClose(id: string, channelId: string, drainId: string, limits: {
1243
1243
  staleAfterMs: number;
1244
1244
  maxReleases: number;
1245
+ onExhausted?: (tx: PoolClient) => Promise<void>;
1245
1246
  }): Promise<{
1246
1247
  outcome: "reserved";
1247
1248
  id: string;
@@ -1257,15 +1258,48 @@ declare class HostedSettlementReportObligations {
1257
1258
  * on its own: no cooperative close of ours can land on a finalized channel.
1258
1259
  */
1259
1260
  resolveTempoCloseExit(id: string): Promise<boolean>;
1261
+ tempoCloseAmountAtStake(id: string): Promise<string>;
1262
+ /** Stop automatic searches without declaring a possibly missing payout discharged. */
1263
+ markTempoCloseUnmatched(id: string): Promise<boolean>;
1264
+ listTempoCloseReports(args: {
1265
+ limit: number;
1266
+ after?: {
1267
+ createdAtMs: number;
1268
+ obligationId: string;
1269
+ };
1270
+ all?: boolean;
1271
+ }): Promise<{
1272
+ id: string;
1273
+ channelId: string;
1274
+ amountNative: string;
1275
+ status: "unmatched" | "no_report";
1276
+ createdAtMs: number;
1277
+ updatedAtMs: number;
1278
+ deliveredAtMs: number | null;
1279
+ retryable: boolean;
1280
+ writeOffAllowed: boolean;
1281
+ writtenOff: boolean;
1282
+ writeOffNote: string | null;
1283
+ writtenOffAtMs: number | null;
1284
+ }[]>;
1285
+ hasTempoCloseReport(id: string): Promise<boolean>;
1286
+ writeOffTempoClose(id: string, note: string): Promise<{
1287
+ channelId: string;
1288
+ amount: string;
1289
+ } | undefined>;
1290
+ reopenTempoClose(id: string): Promise<boolean>;
1260
1291
  private reserveTempoIn;
1261
1292
  findPendingTempo(channelId: string, operation: "settle" | "close"): Promise<ObligationRow | undefined>;
1262
1293
  /** The original close obligation reserved for this drain, while its report is outstanding. */
1263
1294
  pendingTempoClose(channelId: string, drainId: string): Promise<{
1264
1295
  id: string;
1296
+ state: State;
1265
1297
  txHash: string | null;
1266
1298
  reservedAtMs: number;
1267
1299
  searchBefore: bigint | null;
1268
1300
  } | undefined>;
1301
+ /** A recorded close transaction remains refund evidence after its report is delivered. */
1302
+ tempoCloseTransaction(channelId: string, drainId: string): Promise<string | undefined>;
1269
1303
  /**
1270
1304
  * Where the next search for this close obligation's transaction resumes. It
1271
1305
  * lives on the obligation, not the drain's close intent, because releasing
@@ -1282,8 +1316,8 @@ declare class HostedSettlementReportObligations {
1282
1316
  recordSubmitted(id: string, txHash: string): Promise<void>;
1283
1317
  /**
1284
1318
  * Close reservations that never recorded a transaction, oldest first. Each
1285
- * one owes a payout report only if its close lands, so it stays unresolved
1286
- * until a reconcile reads how its channel finalized.
1319
+ * one owes a payout report if its close lands. Exhausted attempts remain
1320
+ * observable for late landings; unmatched searches require an explicit retry.
1287
1321
  */
1288
1322
  unsubmittedTempoCloses(limit?: number): Promise<Array<{
1289
1323
  id: string;
@@ -1320,6 +1354,32 @@ declare class HostedSettlementReportObligations {
1320
1354
  private lockIdentity;
1321
1355
  private insert;
1322
1356
  }
1357
+ /** Restart a terminal close-report search after the operator repairs incomplete RPC history. */
1358
+ declare function retryHostedTempoCloseReport(args: {
1359
+ db: Pool;
1360
+ dvmId: string;
1361
+ scope: string;
1362
+ obligationId: string;
1363
+ }): Promise<boolean>;
1364
+ interface HostedTempoCloseReportWriteOff {
1365
+ channelId: string;
1366
+ /** Builder payout abandoned, as a decimal string in native token units. */
1367
+ amountForgoneNative: string;
1368
+ }
1369
+ interface WriteOffHostedTempoCloseReportArgs {
1370
+ db: Pool;
1371
+ dvmId: string;
1372
+ scope: string;
1373
+ obligationId: string;
1374
+ note: string;
1375
+ }
1376
+ /** Forgo an unmatched builder payout report; includeDetails returns the amount without another read. */
1377
+ declare function writeOffHostedTempoCloseReport(args: WriteOffHostedTempoCloseReportArgs & {
1378
+ includeDetails: true;
1379
+ }): Promise<HostedTempoCloseReportWriteOff | false>;
1380
+ declare function writeOffHostedTempoCloseReport(args: WriteOffHostedTempoCloseReportArgs & {
1381
+ includeDetails?: false;
1382
+ }): Promise<boolean>;
1323
1383
 
1324
1384
  type JsonValue = string | number | boolean | null | JsonValue[] | {
1325
1385
  [key: string]: JsonValue;
@@ -3268,6 +3328,12 @@ declare class CreditLedger {
3268
3328
  drainId: string;
3269
3329
  tx?: CreditLedgerQuerier;
3270
3330
  }): Promise<void>;
3331
+ /** Keep the debit and close intent while the caller uses its timed channel exit. */
3332
+ requireTempoDrainExit(args: {
3333
+ creditId: string;
3334
+ drainId: string;
3335
+ tx?: CreditLedgerQuerier;
3336
+ }): Promise<DrainTransitionResult>;
3271
3337
  /**
3272
3338
  * Cancel an unfulfilled Tempo cooperative drain and restore the exact
3273
3339
  * balance plus rail basis it removed (`pending -> released`). This is only
@@ -3656,6 +3722,11 @@ interface CreditLedgerLike {
3656
3722
  drainId: string;
3657
3723
  tx?: CreditLedgerQuerier;
3658
3724
  }): Promise<void>;
3725
+ requireTempoDrainExit?(args: {
3726
+ creditId: string;
3727
+ drainId: string;
3728
+ tx?: CreditLedgerQuerier;
3729
+ }): Promise<DrainTransitionResult>;
3659
3730
  releaseDrain(args: {
3660
3731
  creditId: string;
3661
3732
  drainId: string;
@@ -3759,8 +3830,10 @@ type DrainMethod = "cashu" | "x402" | "tempo";
3759
3830
  * `pending → sent` (builder batch job shipped the send-back). MPP either
3760
3831
  * reaches `sent` through cooperative close or `released` with its exact basis
3761
3832
  * restored when chain reconciliation proves that close cannot complete.
3833
+ * `exit_required` ends cooperative attempts without restoring the debit;
3834
+ * a late confirmed close can still fulfill it as `sent`.
3762
3835
  */
3763
- type DrainStatus = "pending" | "parked" | "picked_up" | "sent" | "released";
3836
+ type DrainStatus = "pending" | "parked" | "picked_up" | "sent" | "released" | "exit_required";
3764
3837
  /**
3765
3838
  * The sats a DVM owes back on undrawn non-channel Bitcoin credit —
3766
3839
  * the deposit pot inside the hub's balance, which the operator's sweep may
@@ -4500,6 +4573,16 @@ declare class PostgresTempoSessionStore implements Store.AtomicStore {
4500
4573
  private updateInTransaction;
4501
4574
  }
4502
4575
 
4576
+ interface TempoDrainFinalization {
4577
+ reference: string;
4578
+ refundedNative: bigint;
4579
+ outcome: "payer_exit" | "cooperative_close";
4580
+ creditUnbacked: boolean;
4581
+ }
4582
+ type TempoCloseRecovery = string | null | {
4583
+ outcome: "refund_unproven";
4584
+ };
4585
+ type TempoDrainFinalizer = (drain: CreditDrainRecord, evidence: TempoDrainFinalization) => Promise<boolean>;
4503
4586
  /**
4504
4587
  * Options for assembling an Mppx server handle from explicit recipient strings
4505
4588
  * and the surrounding environment. The SDK boundary owns env reads so DVM
@@ -4675,8 +4758,12 @@ interface MppxServer {
4675
4758
  releaseTempoSessionCloseIntent?<value>(channelId: string, drainId: string, operation: (tx: CreditLedgerQuerier) => Promise<value>): Promise<value>;
4676
4759
  /** Persist a confirmed cooperative-close transaction before draining the ledger. */
4677
4760
  confirmTempoSessionClose?: (channelId: string, drainId: string, reference: string) => Promise<string>;
4678
- /** Recover a close result after a process failure between chain and ledger commits. */
4679
- recoverTempoSessionClose?: (channelId: string, drainId: string) => Promise<string | null>;
4761
+ /**
4762
+ * Recover a close result after a process failure between chain and ledger commits.
4763
+ * Supplying the credit ID checks the durable drain status and requires a
4764
+ * proven refund before completing a finalized channel through the ledger.
4765
+ */
4766
+ recoverTempoSessionClose?: (channelId: string, drainId: string, creditId?: string) => Promise<TempoCloseRecovery>;
4680
4767
  /**
4681
4768
  * Read a channel's close intent without touching it.
4682
4769
  *
@@ -4741,7 +4828,7 @@ interface MppxServer {
4741
4828
  /** Reconcile one channel to chain state before deciding how its drain proceeds. */
4742
4829
  getTempoSessionDrainState?: (channelId: string) => Promise<TempoSessionDrainState>;
4743
4830
  /** Bind the credit ledger that must be terminalized when Tempo backing is lost. */
4744
- useTempoCreditLedger?: (ledger: CreditLedgerLike) => void;
4831
+ useTempoCreditLedger?: (ledger: CreditLedgerLike, finalizeDrain?: TempoDrainFinalizer) => void;
4745
4832
  }
4746
4833
  /** What a `ChannelClosed` event split the escrow into. Atomic token units. */
4747
4834
  interface TempoChannelCloseAmounts {
@@ -4842,7 +4929,7 @@ interface TempoSessionChainOps {
4842
4929
  * chain head when omitted) down to blocks older than `notBeforeMs`. One call searches a bounded number of
4843
4930
  * windows; `paused` names the block the next call resumes from.
4844
4931
  */
4845
- findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number, startBlock?: bigint): Promise<TempoChannelCloseSearch>;
4932
+ findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number, startBlock?: bigint, deadlineMs?: number | (() => number)): Promise<TempoChannelCloseSearch>;
4846
4933
  }
4847
4934
  type TempoChannelCloseSearch =
4848
4935
  /** A `ChannelClosed` log, with the address that sent its transaction. */
@@ -5942,4 +6029,4 @@ declare class StepCache {
5942
6029
  static deserialize(records: StepRecord[]): StepCache;
5943
6030
  }
5944
6031
 
5945
- export { type FundingReceipt as $, type ApprovalContent as A, type SignedRequestDomain as B, type Currency as C, type DVMConfig as D, SignedRequestError as E, type SignedRequestFailure as F, type SignedRequestReplayStore as G, type SignedRequestSignOpts as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestStatementHeader as M, type SignedRequestVerifier as N, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type InvoiceWriteOff as b$, isDrainReceipt as b0, isFundingReceipt as b1, isPaymentRequestMessage as b2, isPromptMessage as b3, isSignedJobReceipt as b4, isTextMessage as b5, isWorkingMessage as b6, paymentRequiredV2FromV1 as b7, signDrainReceipt as b8, signFundingReceipt as b9, type X402TrackedChannel as bA, _testing as bB, createDefaultReplayStore as bC, depleteLots as bD, fifoOrder as bE, inKindDrawMsats as bF, isInKindDepletion as bG, isNonChannelBitcoinRail as bH, lotOwedSats as bI, netOwedSats as bJ, wrapMppx as bK, type CreditDrainEnqueue as bL, HostedSettlementReportObligations as bM, type DVMAuthScheme as bN, type CreditLedgerLike as bO, type X402RefundSettlementGate as bP, type CreditSnapshot as bQ, type DrawResult as bR, type X402SettlementStatus as bS, type X402UnresolvedRefund as bT, type GrownDrawResult as bU, type DrawResolution as bV, type FundingRecord as bW, type CreditInvoiceRecord as bX, type InvoiceSettlement as bY, type BlockedInvoiceCursor as bZ, type InvoiceReconciliation as b_, signReceipt as ba, usdcContractByCaip2 as bb, usdcContractFor as bc, usdcDomainNameFor as bd, usdcDomainVersionFor as be, verifyDrainReceipt as bf, verifyFundingReceipt as bg, verifyReceipt as bh, x402NetworkToCaip2 as bi, type X402ExactVersionSupport as bj, type X402Receipt as bk, type TransactionalPayoutHook as bl, type CashuMeltCompleted as bm, type CreditDepositPayload as bn, type CreditDrainPayload as bo, type FundingLot as bp, type LotDebit as bq, type LotDepletion as br, type MppxServer as bs, NON_CHANNEL_BITCOIN_RAILS as bt, type NonChannelBitcoinRail as bu, PayoutReporter as bv, PostgresTempoSessionStore as bw, RevenueReporter as bx, SIGNED_ENVELOPE_FIELDS as by, SIGNED_ENVELOPE_TYPES as bz, type CancelContent as c, type X402FacilitatorAuth as c$, type DrawRecord as c0, type StalePendingDrawCursor as c1, type TempoCreditLossEvidence as c2, type CreditLedgerQuerier as c3, type TempoCreditLoss as c4, type X402CreditLossEvidence as c5, type X402CreditLoss as c6, type DrainMethod as c7, type DrainRequestResult as c8, type BitcoinDepositLiability as c9, type JobCostReportPayload as cA, type JobTerminalReportPayload as cB, PostgresX402ChannelStorage as cC, type ReplayStoreBackend as cD, type RevenueSkippedNoRailPayload as cE, type RevenueSkippedNoRailReason as cF, type Secp256k1AuthOpts as cG, type X402ChannelStorageOpts as cH, type X402RelayLockHolder as cI, type X402RelaySubmissionLock as cJ, X402RelaySubmissionLockError as cK, allocateDrawValue as cL, clientCompatibilityAttributes as cM, clientCompatibilityMiddleware as cN, clientUpgradeRequired as cO, parseClientCapabilities as cP, parseClientCompatibility as cQ, parseDvmClient as cR, parseProtocolVersion as cS, requireClientCompatibility as cT, secp256k1Auth as cU, signedRequestInput as cV, type HostedIntent as cW, type X402SettlementIntent as cX, type HostedFundingReservation as cY, type X402SettlementCursor as cZ, type X402SettlementWriteOff as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainReleaseResult as cd, type DrainFulfilment as ce, type DrainTransitionResult as cf, HostingCleanupFence as cg, CLIENT_COMPATIBILITY_HEADERS as ch, type ClientCompatibility as ci, type ClientCompatibilityEnv as cj, type ClientCompatibilityGate as ck, type ClientCompatibilityRequirement as cl, type ClientSemVer as cm, type CreditFundingBasis as cn, type CreditInvoiceStatus as co, CreditLedger as cp, CreditLedgerError as cq, type CreditLedgerErrorCode as cr, type CreditLedgerErrorDetails as cs, type CreditLedgerPool as ct, type CreditStatus as cu, DRAIN_DELIVERY_RESERVE_SATS as cv, DVM_PROTOCOL_VERSION as cw, type DrainConflictReason as cx, type DrawRailValue as cy, type DrawStatus as cz, type CanonicalEnvelope as d, type X402BatchSettlementConfig as d0, type X402PayoutObserver as d1, type CreditDepositEnqueue as d2, type X402SettlementReconciliationReason as d3, type CreditDrawReleaseEnqueue as d4, type CapabilityRate as e, type CreateSignedRequestVerifierOpts as f, type CreditConfig as g, type CreditView as h, DEFAULT_CREDIT_MAX as i, DEFAULT_CREDIT_MIN as j, DEFAULT_CREDIT_TTL_SECONDS as k, DEFAULT_JOB_RETENTION_DAYS as l, type DVMRouteContext as m, type InputType as n, InvalidCurrencyError as o, type PaymentMethod as p, type PriceValue as q, type ProgressContent as r, type PromptOpts as s, type QuoteContext as t, type QuoteResult as u, type ResponseContent as v, type SDKPaymentRequestOpts as w, SIGNED_REQUEST_AUTH_ID as x, SIGNED_REQUEST_STATEMENT_VERSION as y, type SignedRequestAudience as z };
6032
+ export { type FundingReceipt as $, type ApprovalContent as A, type SignedRequestDomain as B, type Currency as C, type DVMConfig as D, SignedRequestError as E, type SignedRequestFailure as F, type SignedRequestReplayStore as G, type SignedRequestSignOpts as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestStatementHeader as M, type SignedRequestVerifier as N, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type InvoiceReconciliation as b$, isDrainReceipt as b0, isFundingReceipt as b1, isPaymentRequestMessage as b2, isPromptMessage as b3, isSignedJobReceipt as b4, isTextMessage as b5, isWorkingMessage as b6, paymentRequiredV2FromV1 as b7, signDrainReceipt as b8, signFundingReceipt as b9, type X402TrackedChannel as bA, _testing as bB, createDefaultReplayStore as bC, depleteLots as bD, fifoOrder as bE, inKindDrawMsats as bF, isInKindDepletion as bG, isNonChannelBitcoinRail as bH, lotOwedSats as bI, netOwedSats as bJ, wrapMppx as bK, type CreditLedgerQuerier as bL, type CreditDrainEnqueue as bM, HostedSettlementReportObligations as bN, type DVMAuthScheme as bO, type CreditLedgerLike as bP, type X402RefundSettlementGate as bQ, type CreditSnapshot as bR, type DrawResult as bS, type X402SettlementStatus as bT, type X402UnresolvedRefund as bU, type GrownDrawResult as bV, type DrawResolution as bW, type FundingRecord as bX, type CreditInvoiceRecord as bY, type InvoiceSettlement as bZ, type BlockedInvoiceCursor as b_, signReceipt as ba, usdcContractByCaip2 as bb, usdcContractFor as bc, usdcDomainNameFor as bd, usdcDomainVersionFor as be, verifyDrainReceipt as bf, verifyFundingReceipt as bg, verifyReceipt as bh, x402NetworkToCaip2 as bi, type X402ExactVersionSupport as bj, type X402Receipt as bk, type TransactionalPayoutHook as bl, type CashuMeltCompleted as bm, type CreditDepositPayload as bn, type CreditDrainPayload as bo, type FundingLot as bp, type LotDebit as bq, type LotDepletion as br, type MppxServer as bs, NON_CHANNEL_BITCOIN_RAILS as bt, type NonChannelBitcoinRail as bu, PayoutReporter as bv, PostgresTempoSessionStore as bw, RevenueReporter as bx, SIGNED_ENVELOPE_FIELDS as by, SIGNED_ENVELOPE_TYPES as bz, type CancelContent as c, type HostedFundingReservation as c$, type InvoiceWriteOff as c0, type DrawRecord as c1, type StalePendingDrawCursor as c2, type TempoCreditLossEvidence as c3, type TempoCreditLoss as c4, type X402CreditLossEvidence as c5, type X402CreditLoss as c6, type DrainMethod as c7, type DrainRequestResult as c8, type BitcoinDepositLiability as c9, type HostedTempoCloseReportWriteOff as cA, type JobCostReportPayload as cB, type JobTerminalReportPayload as cC, PostgresX402ChannelStorage as cD, type ReplayStoreBackend as cE, type RevenueSkippedNoRailPayload as cF, type RevenueSkippedNoRailReason as cG, type Secp256k1AuthOpts as cH, type X402ChannelStorageOpts as cI, type X402RelayLockHolder as cJ, type X402RelaySubmissionLock as cK, X402RelaySubmissionLockError as cL, allocateDrawValue as cM, clientCompatibilityAttributes as cN, clientCompatibilityMiddleware as cO, clientUpgradeRequired as cP, parseClientCapabilities as cQ, parseClientCompatibility as cR, parseDvmClient as cS, parseProtocolVersion as cT, requireClientCompatibility as cU, retryHostedTempoCloseReport as cV, secp256k1Auth as cW, signedRequestInput as cX, writeOffHostedTempoCloseReport as cY, type HostedIntent as cZ, type X402SettlementIntent as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainTransitionResult as cd, type DrainReleaseResult as ce, type DrainFulfilment as cf, HostingCleanupFence as cg, CLIENT_COMPATIBILITY_HEADERS as ch, type ClientCompatibility as ci, type ClientCompatibilityEnv as cj, type ClientCompatibilityGate as ck, type ClientCompatibilityRequirement as cl, type ClientSemVer as cm, type CreditFundingBasis as cn, type CreditInvoiceStatus as co, CreditLedger as cp, CreditLedgerError as cq, type CreditLedgerErrorCode as cr, type CreditLedgerErrorDetails as cs, type CreditLedgerPool as ct, type CreditStatus as cu, DRAIN_DELIVERY_RESERVE_SATS as cv, DVM_PROTOCOL_VERSION as cw, type DrainConflictReason as cx, type DrawRailValue as cy, type DrawStatus as cz, type CanonicalEnvelope as d, type X402SettlementCursor as d0, type X402SettlementWriteOff as d1, type X402FacilitatorAuth as d2, type X402BatchSettlementConfig as d3, type X402PayoutObserver as d4, type CreditDepositEnqueue as d5, type X402SettlementReconciliationReason as d6, type CreditDrawReleaseEnqueue as d7, type CapabilityRate as e, type CreateSignedRequestVerifierOpts as f, type CreditConfig as g, type CreditView as h, DEFAULT_CREDIT_MAX as i, DEFAULT_CREDIT_MIN as j, DEFAULT_CREDIT_TTL_SECONDS as k, DEFAULT_JOB_RETENTION_DAYS as l, type DVMRouteContext as m, type InputType as n, InvalidCurrencyError as o, type PaymentMethod as p, type PriceValue as q, type ProgressContent as r, type PromptOpts as s, type QuoteContext as t, type QuoteResult as u, type ResponseContent as v, type SDKPaymentRequestOpts as w, SIGNED_REQUEST_AUTH_ID as x, SIGNED_REQUEST_STATEMENT_VERSION as y, type SignedRequestAudience as z };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  PostgresTempoChargeStore
3
- } from "./chunk-NA2KOR6G.js";
3
+ } from "./chunk-LDIPVPKI.js";
4
4
  import "./chunk-YG7G4DPZ.js";
5
- import "./chunk-BFGQG4WY.js";
6
5
  import "./chunk-COYKJRMM.js";
6
+ import "./chunk-QGNXYVBO.js";
7
7
  export {
8
8
  PostgresTempoChargeStore
9
9
  };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  PostgresTempoSessionStore,
3
3
  assertMonotonicTransition
4
- } from "./chunk-UWGBI5WK.js";
4
+ } from "./chunk-MB6R4XPZ.js";
5
5
  import "./chunk-YG7G4DPZ.js";
6
- import "./chunk-7PM4R4GD.js";
7
- import "./chunk-BFGQG4WY.js";
8
6
  import "./chunk-COYKJRMM.js";
7
+ import "./chunk-MMGSYMIC.js";
8
+ import "./chunk-QGNXYVBO.js";
9
9
  export {
10
10
  PostgresTempoSessionStore,
11
11
  assertMonotonicTransition
@@ -1,6 +1,6 @@
1
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-B7ddtJ2y.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-CR12EZ1Q.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-Cq21JT37.js';
1
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-CrILCNxk.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--7yA5Ihr.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-92v8e1LQ.js';
4
4
  import 'hono';
5
5
  import 'mppx';
6
6
  import '@x402/core/server';
@@ -4,22 +4,22 @@ import {
4
4
  import {
5
5
  MemoryJobStore,
6
6
  createInstrumentedFetch
7
- } from "../chunk-IHQUBATH.js";
7
+ } from "../chunk-KFCEXCZM.js";
8
8
  import {
9
9
  JobCancelledError
10
10
  } from "../chunk-AFV77S4C.js";
11
11
  import {
12
12
  createNoopLogger
13
- } from "../chunk-OP7VCGQR.js";
14
- import "../chunk-IOQIXRGM.js";
13
+ } from "../chunk-3R7NQA3Z.js";
15
14
  import "../chunk-FUJ36YDV.js";
16
- import "../chunk-66HGCPBU.js";
17
15
  import "../chunk-BQJIFRAZ.js";
18
- import "../chunk-UDJNZ3UG.js";
16
+ import "../chunk-JNECYURT.js";
19
17
  import {
20
18
  validateCurrency
21
- } from "../chunk-2U6LAASN.js";
22
- import "../chunk-BFGQG4WY.js";
19
+ } from "../chunk-W3VGCNG6.js";
20
+ import "../chunk-M3T5JYDJ.js";
21
+ import "../chunk-66HGCPBU.js";
22
+ import "../chunk-QGNXYVBO.js";
23
23
 
24
24
  // src/sdk/testing/test-context.ts
25
25
  function createTestContext(opts) {
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-CR12EZ1Q.js';
1
+ import { C as Currency } from './step-cache--7yA5Ihr.js';
2
2
 
3
3
  /**
4
4
  * Thrown by `fiatToSatsCeil` / `satsToFiat` when the supplied `ratePerBtc` is
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-WMGXJQI3.js";
7
7
  import {
8
8
  verifyX402Payment
9
- } from "./chunk-UVS7MRJX.js";
10
- import "./chunk-AVV5SYGO.js";
9
+ } from "./chunk-3Q6FTZDB.js";
10
+ import "./chunk-VTHYQCDB.js";
11
11
  import {
12
12
  X402_DEFAULT_FACILITATOR,
13
13
  X402_DEFAULT_NETWORK,
@@ -28,7 +28,6 @@ import {
28
28
  x402NetworkToCaip2
29
29
  } from "./chunk-62FI3NJF.js";
30
30
  import "./chunk-FUJ36YDV.js";
31
- import "./chunk-66HGCPBU.js";
32
31
  import {
33
32
  X402_NETWORKS,
34
33
  assertSupportedX402Network,
@@ -37,7 +36,8 @@ import {
37
36
  x402NetworkListForCopy,
38
37
  x402SupportedNetworksHint
39
38
  } from "./chunk-BPYMEMQX.js";
40
- import "./chunk-BFGQG4WY.js";
39
+ import "./chunk-66HGCPBU.js";
40
+ import "./chunk-QGNXYVBO.js";
41
41
  export {
42
42
  X402_DEFAULT_FACILITATOR,
43
43
  X402_DEFAULT_NETWORK,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvmkit/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.10.0",
4
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
5
  "author": "DVM Technologies Ltd",
6
6
  "keywords": [