@dvmkit/sdk 0.4.0-rc.1 → 0.6.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 (43) hide show
  1. package/README.md +100 -0
  2. package/dist/{chunk-TXX4GOUB.js → chunk-7ZUKL4IV.js} +1 -1
  3. package/dist/chunk-AFV77S4C.js +258 -0
  4. package/dist/{chunk-2VGWYG4P.js → chunk-B2IROPQF.js} +446 -81
  5. package/dist/chunk-BQJIFRAZ.js +36 -0
  6. package/dist/{chunk-PB4FYZET.js → chunk-EQLA4FFY.js} +54 -4
  7. package/dist/{chunk-74PUEZJ4.js → chunk-GFY5FRX3.js} +1 -1
  8. package/dist/{chunk-O3QDFPKM.js → chunk-HCLVYZUZ.js} +2 -2
  9. package/dist/{chunk-K2YX2VRA.js → chunk-HHBDBMEO.js} +170 -43
  10. package/dist/{chunk-O5AT6S5T.js → chunk-IV6Q7NRW.js} +25 -195
  11. package/dist/{chunk-W2EQGDF5.js → chunk-LE74UEV7.js} +49 -8
  12. package/dist/{chunk-CE7XEHYC.js → chunk-N5RZ5HVB.js} +1 -1
  13. package/dist/chunk-OFVV37XC.js +57 -0
  14. package/dist/{chunk-5LR6P7WN.js → chunk-OQA7IHI4.js} +133 -213
  15. package/dist/{chunk-3MHE725Z.js → chunk-PAIM66YA.js} +90 -1
  16. package/dist/{chunk-6DOGTAHA.js → chunk-QR2EF2NI.js} +9 -43
  17. package/dist/{chunk-KXZUCCEY.js → chunk-RCM3P2HE.js} +5 -56
  18. package/dist/{chunk-R4DQZFAL.js → chunk-UOCZXO2Z.js} +3 -3
  19. package/dist/content-retention-BTGSQRfP.d.ts +78 -0
  20. package/dist/{credit-menu-B8_p_vUz.d.ts → credit-menu-BAsrRu3z.d.ts} +98 -5
  21. package/dist/{fx-DuaYHvVn.d.ts → fx-BgDmyTdd.d.ts} +1 -1
  22. package/dist/index.d.ts +5 -5
  23. package/dist/index.js +4 -3
  24. package/dist/internal/caller.d.ts +90 -22
  25. package/dist/internal/caller.js +40 -40
  26. package/dist/internal/index.js +1 -1
  27. package/dist/internal/server.d.ts +8 -99
  28. package/dist/internal/server.js +15 -11
  29. package/dist/{job-store-D6Rjj5Oi.d.ts → job-store-BVeF5_Jq.d.ts} +1 -1
  30. package/dist/{lightning-backend-BaeCPmx7.d.ts → lightning-backend-40fIzz1W.d.ts} +1 -1
  31. package/dist/{postgres-consumed-credential-store-CUQJKRSL.js → postgres-consumed-credential-store-BUVCAPLS.js} +13 -0
  32. package/dist/{postgres-job-store-VLXLWXUQ.js → postgres-job-store-VHLQBJZC.js} +3 -1
  33. package/dist/server/index.d.ts +28 -10
  34. package/dist/server/index.js +24 -10
  35. package/dist/{step-cache-Bi43A0JN.d.ts → step-cache-CPdH1hei.d.ts} +3 -3
  36. package/dist/{tempo-lifecycle-OTHV757Y.js → tempo-lifecycle-ZBBLFBMH.js} +5 -4
  37. package/dist/{tempo-wallet-32JWQZKQ.js → tempo-wallet-B5XXV3YH.js} +1 -1
  38. package/dist/testing/index.d.ts +9 -2
  39. package/dist/testing/index.js +6 -3
  40. package/dist/{usd-AZPVq4eU.d.ts → usd-AWlrwlM5.d.ts} +1 -1
  41. package/dist/{x402-CEDHGZDI.js → x402-R6HPBY5D.js} +5 -4
  42. package/package.json +3 -2
  43. package/recipes/postgres/financial-export-v1.sql +137 -0
@@ -1,3 +1,7 @@
1
+ import {
2
+ canonicaliseForSigning
3
+ } from "./chunk-OFVV37XC.js";
4
+
1
5
  // src/sdk/types.ts
2
6
  function isZodSchema(value) {
3
7
  return typeof value === "object" && value !== null && "_zod" in value && "parse" in value && "safeParse" in value;
@@ -10,59 +14,7 @@ var RAIL_REFUNDABLE = {
10
14
  var DEFAULT_CREDIT_MIN = "$0.10";
11
15
  var DEFAULT_CREDIT_MAX = "$5.00";
12
16
  var DEFAULT_CREDIT_TTL_SECONDS = 30 * 24 * 60 * 60;
13
- var DEFAULT_JOB_RETENTION_DAYS = 90;
14
-
15
- // src/lib/cast-auth/canonical-json.ts
16
- function canonicalize(value) {
17
- return JSON.stringify(sortDeep(value));
18
- }
19
- function canonicaliseForSigning(value) {
20
- return new TextEncoder().encode(canonicalize(value));
21
- }
22
- function sortDeep(value) {
23
- if (value === null) return null;
24
- if (typeof value === "string" || typeof value === "boolean") return value;
25
- if (typeof value === "number") {
26
- if (!Number.isFinite(value)) {
27
- throw new TypeError(`canonicalize: non-finite number is not JSON-serialisable`);
28
- }
29
- return value;
30
- }
31
- if (Array.isArray(value)) return value.map(sortDeep);
32
- if (typeof value === "object") {
33
- const sorted = {};
34
- for (const key of Object.keys(value).sort()) {
35
- const v = value[key];
36
- if (v === void 0) continue;
37
- sorted[key] = sortDeep(v);
38
- }
39
- return sorted;
40
- }
41
- throw new TypeError(`canonicalize: unsupported value of type ${typeof value}`);
42
- }
43
-
44
- // src/lib/cast-auth/verify.ts
45
- import { schnorr } from "@noble/curves/secp256k1.js";
46
- function verifyCanonicalSignedRequest(payload, signatureHex, pubkeyHex) {
47
- if (!/^[0-9a-f]{64}$/i.test(pubkeyHex) || !/^[0-9a-f]{128}$/i.test(signatureHex)) {
48
- return false;
49
- }
50
- const data = canonicaliseForSigning(payload);
51
- const signature = hexToBytes(signatureHex);
52
- const pubkey = hexToBytes(pubkeyHex);
53
- try {
54
- return schnorr.verify(signature, data, pubkey);
55
- } catch {
56
- return false;
57
- }
58
- }
59
- function hexToBytes(hex) {
60
- const out = new Uint8Array(hex.length / 2);
61
- for (let i = 0; i < out.length; i++) {
62
- out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
63
- }
64
- return out;
65
- }
17
+ var DEFAULT_JOB_RETENTION_DAYS = 730;
66
18
 
67
19
  // src/lib/signed-request-statement.ts
68
20
  var SIGNED_REQUEST_AUTH_ID = "secp256k1-schnorr-v2";
@@ -129,9 +81,6 @@ export {
129
81
  DEFAULT_CREDIT_MAX,
130
82
  DEFAULT_CREDIT_TTL_SECONDS,
131
83
  DEFAULT_JOB_RETENTION_DAYS,
132
- canonicalize,
133
- canonicaliseForSigning,
134
- verifyCanonicalSignedRequest,
135
84
  SIGNED_REQUEST_AUTH_ID,
136
85
  SIGNED_REQUEST_STATEMENT_VERSION,
137
86
  signedRequestStatementHeader,
@@ -2,19 +2,19 @@ import {
2
2
  connectedTempoAccount,
3
3
  tempoBalanceCheckHint,
4
4
  tempoTokenReference
5
- } from "./chunk-74PUEZJ4.js";
5
+ } from "./chunk-GFY5FRX3.js";
6
6
  import {
7
7
  fundingReachableAt,
8
8
  listCredits,
9
9
  maxAdvertisedMicro,
10
10
  normalizeCreditEndpoint,
11
11
  withinAdvertisedTolerance
12
- } from "./chunk-2VGWYG4P.js";
12
+ } from "./chunk-B2IROPQF.js";
13
13
  import {
14
14
  costAnchor,
15
15
  formatUsd,
16
16
  formatUsdcMicrounits
17
- } from "./chunk-3MHE725Z.js";
17
+ } from "./chunk-PAIM66YA.js";
18
18
  import {
19
19
  IDENTITIES_FILE,
20
20
  TEMPO_CHANNELS_FILE,
@@ -0,0 +1,78 @@
1
+ import { b as JobStore, J as JobRecord } from './job-store-BVeF5_Jq.js';
2
+
3
+ /** Authenticated caller metadata; omitted fields on older services mean unknown. */
4
+ interface JobContentMetadata {
5
+ content_expires_at: number | null;
6
+ content_available: boolean;
7
+ }
8
+ /** Admin-only history; reasons and signer identities never appear on caller responses. */
9
+ interface ContentHoldsResponse extends JobContentMetadata {
10
+ job_id: string;
11
+ baseline_content_expires_at: number | null;
12
+ holds: (ContentHold & {
13
+ review_overdue: boolean;
14
+ })[];
15
+ events: ContentHoldEvent[];
16
+ }
17
+ interface ContentHoldEvent {
18
+ id: string;
19
+ hold_id: string;
20
+ job_id: string;
21
+ action: "placed" | "renewed" | "cleared";
22
+ actor: string;
23
+ reason: string;
24
+ at: number;
25
+ review_due_at: number;
26
+ }
27
+ interface ContentHold {
28
+ id: string;
29
+ job_id: string;
30
+ purpose: "support" | "dispute";
31
+ reason: string;
32
+ actor: string;
33
+ created_at: number;
34
+ review_due_at: number;
35
+ cleared_at: number | null;
36
+ }
37
+ interface ContentHoldHistory {
38
+ holds: ContentHold[];
39
+ events: ContentHoldEvent[];
40
+ }
41
+ type ContentHoldMutation = {
42
+ action: "placed";
43
+ purpose: "support" | "dispute";
44
+ reason: string;
45
+ review_due_at: number;
46
+ actor: string;
47
+ at: number;
48
+ } | {
49
+ action: "renewed";
50
+ hold_id: string;
51
+ reason: string;
52
+ review_due_at: number;
53
+ actor: string;
54
+ at: number;
55
+ } | {
56
+ action: "cleared";
57
+ hold_id: string;
58
+ reason: string;
59
+ actor: string;
60
+ at: number;
61
+ };
62
+ /** Mutations and redaction must serialize on the same job, including across processes. */
63
+ interface ContentHoldStore extends JobStore {
64
+ getContentSnapshot(jobId: string, dvmId?: string): Promise<{
65
+ job: JobRecord;
66
+ history: ContentHoldHistory;
67
+ } | undefined>;
68
+ mutateContentHold(jobId: string, mutation: ContentHoldMutation, dvmId?: string): Promise<ContentHoldHistory>;
69
+ }
70
+ declare class ContentHoldError extends Error {
71
+ readonly code: "job_not_found" | "content_unavailable" | "hold_not_active";
72
+ constructor(code: "job_not_found" | "content_unavailable" | "hold_not_active");
73
+ }
74
+ declare function isContentHoldStore(store: JobStore): store is ContentHoldStore;
75
+ declare function contentMetadata(job: Pick<JobRecord, "status" | "lastActivityAt" | "redactedAt">, retentionDays: number, holds?: ContentHold[]): JobContentMetadata;
76
+ declare function baselineContentExpiry(job: Pick<JobRecord, "status" | "lastActivityAt">, retentionDays: number): number | null;
77
+
78
+ export { type ContentHoldHistory as C, type JobContentMetadata as J, type ContentHoldMutation as a, type ContentHold as b, ContentHoldError as c, type ContentHoldEvent as d, type ContentHoldStore as e, type ContentHoldsResponse as f, baselineContentExpiry as g, contentMetadata as h, isContentHoldStore as i };
@@ -1,11 +1,11 @@
1
- import { cf as HostingCleanupFence, cV as HostedIntent, ah as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a1 as Message, X as FundingReceipt, bP as CreditSnapshot, Y as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a2 as MessageType, bj as X402Receipt, aE as X402Config, bi as X402ExactVersionSupport, cW as X402SettlementIntent, aq as PaymentRequirementsV2, cX as HostedFundingReservation, c2 as CreditLedgerQuerier, cY as X402SettlementCursor, bR as X402SettlementStatus, cZ as X402SettlementWriteOff, bO as X402RefundSettlementGate, c_ as X402FacilitatorAuth, c$ as X402BatchSettlementConfig, cB as PostgresX402ChannelStorage, d0 as X402PayoutObserver, bL as HostedSettlementReportObligations, br as MppxServer, ab as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, ao as PaymentRequirements, a0 as MppxCredential, bm as CreditDepositPayload, bQ as DrawResult, cp as CreditLedgerError, a6 as ReceiptCredit, ae as DrainReceiptEvent, ad as DrainReceipt, K as KVStore, y as SignedRequestAudience, d3 as CreditDrawReleaseEnqueue, cz as JobCostReportPayload, cA as JobTerminalReportPayload, cD as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, bW as CreditInvoiceRecord, bX as InvoiceSettlement, cj as ClientCompatibilityGate, ch as ClientCompatibility, bv as PostgresTempoSessionStore, bu as PayoutReporter, R as ResolvedCreditConfig, g as CreditView } from './step-cache-Bi43A0JN.js';
1
+ import { g as LockPubkey, f as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-40fIzz1W.js';
2
+ import { cf as HostingCleanupFence, cV as HostedIntent, ah as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a1 as Message, X as FundingReceipt, bP as CreditSnapshot, Y as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a2 as MessageType, bj as X402Receipt, aE as X402Config, bi as X402ExactVersionSupport, cW as X402SettlementIntent, aq as PaymentRequirementsV2, cX as HostedFundingReservation, c2 as CreditLedgerQuerier, cY as X402SettlementCursor, bR as X402SettlementStatus, cZ as X402SettlementWriteOff, bO as X402RefundSettlementGate, c_ as X402FacilitatorAuth, c$ as X402BatchSettlementConfig, cB as PostgresX402ChannelStorage, d0 as X402PayoutObserver, bL as HostedSettlementReportObligations, br as MppxServer, ac as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, ao as PaymentRequirements, a0 as MppxCredential, bm as CreditDepositPayload, bQ as DrawResult, cp as CreditLedgerError, a7 as ReceiptCredit, ae as DrainReceiptEvent, a6 as DrainReceipt, K as KVStore, y as SignedRequestAudience, d3 as CreditDrawReleaseEnqueue, cz as JobCostReportPayload, cA as JobTerminalReportPayload, cD as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, bW as CreditInvoiceRecord, bX as InvoiceSettlement, cj as ClientCompatibilityGate, ch as ClientCompatibility, bv as PostgresTempoSessionStore, bu as PayoutReporter, R as ResolvedCreditConfig, g as CreditView } from './step-cache-CPdH1hei.js';
2
3
  import { ProofLike, SerializedDLEQ, Proof } from '@cashu/cashu-ts';
3
4
  import { Hono, Context } from 'hono';
4
5
  import { Pool } from 'pg';
5
- import { b as FxRateSnapshot, F as FxFetcher } from './fx-DuaYHvVn.js';
6
+ import { b as FxRateSnapshot, F as FxFetcher } from './fx-BgDmyTdd.js';
6
7
  import { Store, Challenge } from 'mppx';
7
- import { g as LockPubkey, f as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-BaeCPmx7.js';
8
- import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-D6Rjj5Oi.js';
8
+ import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-BVeF5_Jq.js';
9
9
  import { SettleResponse, SupportedResponse } from '@x402/core/types';
10
10
  import { Channel, AutoSettlementConfig } from '@x402/evm/batch-settlement/server';
11
11
  import { FacilitatorClient } from '@x402/core/server';
@@ -195,6 +195,8 @@ declare function hashLockKey(input: string): bigint;
195
195
  * `pendingMppChallengeIds`.
196
196
  */
197
197
  interface ConsumedCredentialStore {
198
+ /** Atomically consume a nonce only if no unexpired mark exists. */
199
+ consume?(realm: string, challengeId: string, ttlSeconds: number): Promise<boolean>;
198
200
  /** True iff `(realm, challengeId)` was marked and the entry has not expired. */
199
201
  has(realm: string, challengeId: string): Promise<boolean>;
200
202
  /** Mark `(realm, challengeId)` as consumed for `ttlSeconds`. */
@@ -219,9 +221,100 @@ declare class MemoryConsumedCredentialStore implements ConsumedCredentialStore {
219
221
  private readonly data;
220
222
  constructor(opts?: MemoryConsumedCredentialStoreOpts);
221
223
  has(realm: string, challengeId: string): Promise<boolean>;
224
+ consume(realm: string, challengeId: string, ttlSeconds: number): Promise<boolean>;
222
225
  mark(realm: string, challengeId: string, ttlSeconds: number): Promise<void>;
223
226
  }
224
227
 
228
+ /**
229
+ * Snapshot of a DVM's published lock-pubkey state at a point in time. `current`
230
+ * is what the SDK advertises as `cashu.lock_pubkeys[0]`; `retired` are the
231
+ * pubkeys inside the rotation grace window plus legacy sentinel-0 entries
232
+ * kept until explicitly cleaned up. Both halves are needed by the
233
+ * receive path (accept proofs locked to any entry) and the admin auth verifier
234
+ * (accept signatures from any entry during grace).
235
+ */
236
+ interface LockPubkeyState {
237
+ current: LockPubkey;
238
+ retired: {
239
+ pubkey: LockPubkey;
240
+ retiredAtMs: number;
241
+ }[];
242
+ }
243
+ /**
244
+ * Lazy accessor for the DVM's lock-pubkey state. Threaded through the SDK
245
+ * server so call sites (info handler, accept flow, admin auth) read the fresh
246
+ * state on every invocation — rotation propagation has to be visible without
247
+ * a process restart.
248
+ */
249
+ type LockPubkeyStateLoader = () => Promise<LockPubkeyState>;
250
+ type LockPubkeyPool = AccumulatorPool;
251
+ /**
252
+ * Create the `dvm_lock_pubkeys` table if absent. Each row is one entry in a
253
+ * DVM's lock-pubkey lifecycle: `retired_at_ms IS NULL` is the current pubkey,
254
+ * any non-null value is a retired pubkey that the rotation walker can still
255
+ * derive privkeys for. One current row per `dvm_id` is enforced via a partial
256
+ * unique index — keeps `rotateLockPubkey` honest under concurrent calls.
257
+ */
258
+ declare function initLockPubkeyTable(db: LockPubkeyPool): Promise<void>;
259
+ /**
260
+ * Idempotent first-boot seed. Inserts `pubkey` as the current row for `dvmId`
261
+ * only when no current row exists. Reseeding with a different pubkey is a
262
+ * no-op — once the DB has state, `rotateLockPubkey` is the only sanctioned
263
+ * mutator, so a stale `DVMKIT_CASHU_LOCK_PUBKEY` env on a redeploy can't
264
+ * silently reset the DVM's view of "what's current".
265
+ *
266
+ * Also backfills any distinct `lock_pubkey` values found in
267
+ * `wallet_accumulator` for this DVM that aren't yet in `dvm_lock_pubkeys`,
268
+ * inserting them as retired rows with `retired_at_ms = 0` — the
269
+ * "long-retired-still-meltable" sentinel. This handles legacy batches
270
+ * that would otherwise trip the monitor's `orphan_lock_pubkey` alarm every
271
+ * tick. Sentinel-0 rows are exempt from grace-window filtering and
272
+ * `pruneRetired` so they stay visible until the operator melts the legacy
273
+ * batches and the receive path keeps accepting in-flight tokens locked to
274
+ * them.
275
+ *
276
+ * `ON CONFLICT DO NOTHING` protects concurrent seeds invoked reentrantly from
277
+ * one guarded callback. Nested calls bypass the queue to avoid deadlock, so
278
+ * both inserts can pass `WHERE NOT EXISTS` before either commits.
279
+ */
280
+ declare function seedLockPubkeyState(db: LockPubkeyPool, dvmId: string, pubkey: string, now?: number): Promise<void>;
281
+ /**
282
+ * Read the active lock-pubkey state for a DVM. Retired rows older than the
283
+ * grace window are filtered out; aged-out rows linger physically until
284
+ * `pruneRetired` deletes them on a monitor tick. Sentinel-0 rows (the
285
+ * `retired_at_ms = 0` legacy backfill from `seedLockPubkeyState`) are always
286
+ * included regardless of grace. Throws when no current row exists — the SDK's
287
+ * accept/info/admin paths must not run before `seedLockPubkeyState` has been
288
+ * called.
289
+ */
290
+ declare function loadLockPubkeyState(db: AccumulatorQuerier, dvmId: string, graceMs: number, now?: number): Promise<LockPubkeyState>;
291
+ /**
292
+ * Atomically demote the current pubkey to retired (stamping `retired_at_ms`)
293
+ * and insert `newPubkey` as the new current row. Wrapped in a transaction so
294
+ * the partial unique index never has two current rows visible mid-rotation.
295
+ * Returns the post-rotation state filtered by the supplied grace window.
296
+ */
297
+ declare function rotateLockPubkey(db: LockPubkeyPool, dvmId: string, newPubkey: string, graceMs: number, now?: number): Promise<LockPubkeyState>;
298
+ /**
299
+ * Delete retired rows whose `retired_at_ms` is older than `now - graceMs`.
300
+ * Called from the monitor tick so aged-out entries don't accumulate.
301
+ * `wallet_accumulator` rows pointing at those pubkeys remain meltable (the
302
+ * builder can still derive the privkey from the mnemonic + rotation_index) —
303
+ * pruning only affects what the DVM advertises and accepts.
304
+ *
305
+ * Sentinel-0 rows (the legacy backfill from `seedLockPubkeyState`) are
306
+ * exempted from pruning — they exist precisely so the monitor keeps treating
307
+ * legacy `wallet_accumulator` batches as retired-still-meltable rather than
308
+ * orphan.
309
+ */
310
+ declare function pruneRetired(db: AccumulatorQuerier, dvmId: string, graceMs: number, now?: number): Promise<number>;
311
+ /**
312
+ * Default rotation grace window in seconds. Override through
313
+ * `SDKServerOpts.lockPubkeyGraceSeconds`.
314
+ */
315
+ declare const DEFAULT_LOCK_PUBKEY_GRACE_SECONDS = 86400;
316
+ declare function activePubkeySet(state: LockPubkeyState): LockPubkey[];
317
+
225
318
  /** Effective boot-time payment configuration for one mounted DVM. Health may change later. */
226
319
  interface PaymentMode {
227
320
  mount: string;
@@ -4539,4 +4632,4 @@ declare function attachCreditMenu(body: Record<string, unknown>, menu: CreditMen
4539
4632
  */
4540
4633
  declare function toCreditTerms(menu: CreditMenu): CreditTerms;
4541
4634
 
4542
- export { isDerivedCreditId as $, type AccumulatorPool as A, assertRevenueReporterReady as B, type ConsumedCredentialStore as C, buildPaymentErrorResponse as D, clearAccumulatorForDvm as E, type FiatDenomination as F, createDVMServer as G, creditDepositPayload as H, type IncomingPaymentOpts as I, JobCancelledError as J, derivedFundCreditId as K, devModeSkipsPaymentVerification as L, MintHealthTracker as M, fromJobRecord as N, fundedMicroFor as O, PAYMENT_PROOF_KEYS as P, hasPaymentProof as Q, type ReporterBannerOpts as R, type SDKServerOpts as S, type TempoChannelReport as T, type UpfrontPaymentOpts as U, type VerifiedIncomingPayment as V, hashLockKey as W, type X402BatchChannelObservation as X, implicitCreditId as Y, initWalletAccumulatorTable as Z, insertAccumulatorRows as _, type AccumulatorQuerier as a, type X402BatchAcceptance as a$, isTerminal as a0, isYieldMessage as a1, issueUpfrontChallenges as a2, msatsToFiatMicro as a3, paymentErrorBody as a4, pinAskFiat as a5, priceFiatMicro as a6, processIncomingPayment as a7, providerMessage as a8, repairX402ExactSettlementEffect as a9, type DVMHost as aA, type HostingClosureCommand as aB, type HostingClosureEvidence as aC, type HostingControlCommand as aD, type HostingControlConfig as aE, type HostingControlStatus as aF, JobManager as aG, type JobManagerOpts as aH, type LightningReceiveConfig as aI, MIN_INVOICE_TTL_SECONDS as aJ, MemoryConsumedCredentialStore as aK, type MemoryConsumedCredentialStoreOpts as aL, MemoryProcessedPaymentStore as aM, MemoryX402ExactSettlementStore as aN, type MountOpts as aO, type OwnerDisplay as aP, type PaidJobCompletion as aQ, type PaymentMode as aR, type PlatformReporterOpts as aS, PostgresProcessedPaymentStore as aT, PostgresX402ExactSettlementStore as aU, type PriceFiat as aV, type ProcessedPaymentQuerier as aW, type ProcessedPaymentRail as aX, type ProcessedPaymentRecord as aY, ProcessedPaymentReplayError as aZ, type ProcessedPaymentStore as a_, resolveFxSnapshot as aa, resolvePriceFiat as ab, revenueReporterBannerState as ac, toCreditTerms as ad, toJobRecord as ae, unknownRouteNotFound as af, verifyIncomingPayment as ag, verifyTempoSessionManagementCredential as ah, verifyUpfrontPayment as ai, x402RequiredUsdcMicro as aj, x402SettledShare as ak, type CreditMenu as al, ReceiptIssuer as am, LightningReceive as an, TempoSettlementReadiness as ao, type DVMHostOpts as ap, type DVMServeResult as aq, type BuildCreditMenuArgs as ar, type BuilderIdentity as as, CREDIT_ENVELOPE_KEYS as at, type CreateX402BatchSettlementServerOpts as au, type CreditEnvelope as av, CreditEnvelopeError as aw, type CreditFundCommitment as ax, type CreditTerms as ay, DEFAULT_INVOICE_TTL_SECONDS as az, type AppEnv as b, type X402BatchFunding as b0, type X402BatchRefusal as b1, type X402BatchSettlementServer as b2, type X402ExactAcceptance as b3, X402ExactIntentConflictError as b4, type X402ExactSettlementAttempt as b5, type X402ExactSettlementChainEvidence as b6, type X402ExactSettlementEffect as b7, X402ExactSettlementEvidenceMissingError as b8, type X402ExactSettlementEvidenceReader as b9, type X402ExactSettlementIntent as ba, X402ExactSettlementNotReadyError as bb, X402ExactSettlementServer as bc, type X402ExactSettlementServerOpts as bd, type X402ExactSettlementStatus as be, type X402ExactSettlementStore as bf, type X402SettlementChainEvidence as bg, type X402SettlementEvidenceReader as bh, X402SettlementSubmissionError as bi, X402_BATCH_AUTO_SETTLEMENT as bj, X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS as bk, X402_BATCH_SETTLEMENT_NETWORK as bl, attachCreditMenu as bm, buildCreditMenu as bn, createDVMHost as bo, createX402BatchSettlementServer as bp, creditEnvelopeIgnoreFields as bq, drawSettlementRef as br, extractCreditEnvelope as bs, fundingCommitment as bt, selectPrimaryCredit as bu, signHostingClosure as bv, signHostingControl as bw, stripCreditEnvelope as bx, toCreditView as by, type CreditFundingReport as c, type FiatDenominationFailure as d, type FundOnlyRequest as e, type PaymentErrorCode as f, type PaymentErrorDetail as g, type PaymentInfo as h, PostgresTempoChargeStore as i, type ResolvedFx as j, type RevenueBootCheckOpts as k, type ServerJob as l, type ShortPayForfeit as m, type TempoObserverHealth as n, TempoSessionChannelMismatchError as o, type VerifyIncomingSnapshot as p, X402FacilitatorHealth as q, type X402SettlementEvidenceOutcome as r, type X402SettlementRepair as s, type X402SettlementRepairRefusal as t, type X402SettlementRepaired as u, type X402WedgedSettlement as v, type X402WedgedSettlementPage as w, X402_BATCH_SETTLEMENT_MAINNET_NETWORK as x, abortJob as y, applyPaymentInfoToJob as z };
4635
+ export { hashLockKey as $, type AccumulatorPool as A, activePubkeySet as B, type ConsumedCredentialStore as C, DEFAULT_LOCK_PUBKEY_GRACE_SECONDS as D, applyPaymentInfoToJob as E, type FiatDenomination as F, assertRevenueReporterReady as G, buildPaymentErrorResponse as H, type IncomingPaymentOpts as I, JobCancelledError as J, clearAccumulatorForDvm as K, type LockPubkeyStateLoader as L, MintHealthTracker as M, createDVMServer as N, creditDepositPayload as O, PAYMENT_PROOF_KEYS as P, derivedFundCreditId as Q, type ReporterBannerOpts as R, type SDKServerOpts as S, type TempoChannelReport as T, type UpfrontPaymentOpts as U, type VerifiedIncomingPayment as V, devModeSkipsPaymentVerification as W, type X402BatchChannelObservation as X, fromJobRecord as Y, fundedMicroFor as Z, hasPaymentProof as _, type AppEnv as a, type PlatformReporterOpts as a$, implicitCreditId as a0, initLockPubkeyTable as a1, initWalletAccumulatorTable as a2, insertAccumulatorRows as a3, isDerivedCreditId as a4, isTerminal as a5, isYieldMessage as a6, issueUpfrontChallenges as a7, loadLockPubkeyState as a8, msatsToFiatMicro as a9, type BuildCreditMenuArgs as aA, type BuilderIdentity as aB, CREDIT_ENVELOPE_KEYS as aC, type CreateX402BatchSettlementServerOpts as aD, type CreditEnvelope as aE, CreditEnvelopeError as aF, type CreditFundCommitment as aG, type CreditTerms as aH, DEFAULT_INVOICE_TTL_SECONDS as aI, type DVMHost as aJ, type HostingClosureCommand as aK, type HostingClosureEvidence as aL, type HostingControlCommand as aM, type HostingControlConfig as aN, type HostingControlStatus as aO, JobManager as aP, type JobManagerOpts as aQ, type LightningReceiveConfig as aR, MIN_INVOICE_TTL_SECONDS as aS, MemoryConsumedCredentialStore as aT, type MemoryConsumedCredentialStoreOpts as aU, MemoryProcessedPaymentStore as aV, MemoryX402ExactSettlementStore as aW, type MountOpts as aX, type OwnerDisplay as aY, type PaidJobCompletion as aZ, type PaymentMode as a_, paymentErrorBody as aa, pinAskFiat as ab, priceFiatMicro as ac, processIncomingPayment as ad, providerMessage as ae, pruneRetired as af, repairX402ExactSettlementEffect as ag, resolveFxSnapshot as ah, resolvePriceFiat as ai, revenueReporterBannerState as aj, rotateLockPubkey as ak, seedLockPubkeyState as al, toCreditTerms as am, toJobRecord as an, unknownRouteNotFound as ao, verifyIncomingPayment as ap, verifyTempoSessionManagementCredential as aq, verifyUpfrontPayment as ar, x402RequiredUsdcMicro as as, x402SettledShare as at, type CreditMenu as au, ReceiptIssuer as av, LightningReceive as aw, TempoSettlementReadiness as ax, type DVMHostOpts as ay, type DVMServeResult as az, type CreditFundingReport as b, PostgresProcessedPaymentStore as b0, PostgresX402ExactSettlementStore as b1, type PriceFiat as b2, type ProcessedPaymentQuerier as b3, type ProcessedPaymentRail as b4, type ProcessedPaymentRecord as b5, ProcessedPaymentReplayError as b6, type ProcessedPaymentStore as b7, type X402BatchAcceptance as b8, type X402BatchFunding as b9, drawSettlementRef as bA, extractCreditEnvelope as bB, fundingCommitment as bC, selectPrimaryCredit as bD, signHostingClosure as bE, signHostingControl as bF, stripCreditEnvelope as bG, toCreditView as bH, type X402BatchRefusal as ba, type X402BatchSettlementServer as bb, type X402ExactAcceptance as bc, X402ExactIntentConflictError as bd, type X402ExactSettlementAttempt as be, type X402ExactSettlementChainEvidence as bf, type X402ExactSettlementEffect as bg, X402ExactSettlementEvidenceMissingError as bh, type X402ExactSettlementEvidenceReader as bi, type X402ExactSettlementIntent as bj, X402ExactSettlementNotReadyError as bk, X402ExactSettlementServer as bl, type X402ExactSettlementServerOpts as bm, type X402ExactSettlementStatus as bn, type X402ExactSettlementStore as bo, type X402SettlementChainEvidence as bp, type X402SettlementEvidenceReader as bq, X402SettlementSubmissionError as br, X402_BATCH_AUTO_SETTLEMENT as bs, X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS as bt, X402_BATCH_SETTLEMENT_NETWORK as bu, attachCreditMenu as bv, buildCreditMenu as bw, createDVMHost as bx, createX402BatchSettlementServer as by, creditEnvelopeIgnoreFields as bz, type FiatDenominationFailure as c, type FundOnlyRequest as d, type LockPubkeyPool as e, type LockPubkeyState as f, type PaymentErrorCode as g, type PaymentErrorDetail as h, type PaymentInfo as i, PostgresTempoChargeStore as j, type ResolvedFx as k, type RevenueBootCheckOpts as l, type ServerJob as m, type ShortPayForfeit as n, type TempoObserverHealth as o, TempoSessionChannelMismatchError as p, type VerifyIncomingSnapshot as q, X402FacilitatorHealth as r, type X402SettlementEvidenceOutcome as s, type X402SettlementRepair as t, type X402SettlementRepairRefusal as u, type X402SettlementRepaired as v, type X402WedgedSettlement as w, type X402WedgedSettlementPage as x, X402_BATCH_SETTLEMENT_MAINNET_NETWORK as y, abortJob as z };
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-Bi43A0JN.js';
1
+ import { C as Currency } from './step-cache-CPdH1hei.js';
2
2
 
3
3
  /**
4
4
  * Quote-time FX snapshot. `rates` maps configured lowercase currency codes to
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-Bi43A0JN.js';
2
- export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DEFAULT_JOB_RETENTION_DAYS, l as DVMRouteContext, I as IncomingMessage, m as InputType, n as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, o as PaymentMethod, p as PriceValue, q as ProgressContent, r as PromptOpts, Q as QuoteConfig, s as QuoteContext, t as QuoteResult, R as ResolvedCreditConfig, u as ResponseContent, S as SDKJobContext, v as SDKPaymentRequestOpts, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, y as SignedRequestAudience, z as SignedRequestDomain, B as SignedRequestError, E as SignedRequestFailure, F as SignedRequestReplayStore, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, U as UnsupportedCurrencyError, N as createSignedRequestVerifier, O as isZodSchema, T as signedRequestStatementHeader, V as validateCurrency } from './step-cache-Bi43A0JN.js';
3
- export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-DuaYHvVn.js';
4
- export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-AZPVq4eU.js';
5
- export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-D6Rjj5Oi.js';
1
+ import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-CPdH1hei.js';
2
+ export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DEFAULT_JOB_RETENTION_DAYS, l as DVMRouteContext, I as IncomingMessage, m as InputType, n as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, o as PaymentMethod, p as PriceValue, q as ProgressContent, r as PromptOpts, Q as QuoteConfig, s as QuoteContext, t as QuoteResult, R as ResolvedCreditConfig, u as ResponseContent, S as SDKJobContext, v as SDKPaymentRequestOpts, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, y as SignedRequestAudience, z as SignedRequestDomain, B as SignedRequestError, E as SignedRequestFailure, F as SignedRequestReplayStore, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, U as UnsupportedCurrencyError, N as createSignedRequestVerifier, O as isZodSchema, T as signedRequestStatementHeader, V as validateCurrency } from './step-cache-CPdH1hei.js';
3
+ export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-BgDmyTdd.js';
4
+ export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-AWlrwlM5.js';
5
+ export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-BVeF5_Jq.js';
6
6
  export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from './ssrf-dMooihtY.js';
7
7
  export { z } from 'zod';
8
8
  import 'hono';
package/dist/index.js CHANGED
@@ -7,11 +7,11 @@ import {
7
7
  import {
8
8
  configureDVM,
9
9
  isConfiguredDVMDescriptor
10
- } from "./chunk-O3QDFPKM.js";
10
+ } from "./chunk-HCLVYZUZ.js";
11
11
  import {
12
12
  SignedRequestError,
13
13
  createSignedRequestVerifier
14
- } from "./chunk-CE7XEHYC.js";
14
+ } from "./chunk-N5RZ5HVB.js";
15
15
  import {
16
16
  DEFAULT_CREDIT_MAX,
17
17
  DEFAULT_CREDIT_MIN,
@@ -21,7 +21,8 @@ import {
21
21
  SIGNED_REQUEST_STATEMENT_VERSION,
22
22
  isZodSchema,
23
23
  signedRequestStatementHeader
24
- } from "./chunk-KXZUCCEY.js";
24
+ } from "./chunk-RCM3P2HE.js";
25
+ import "./chunk-OFVV37XC.js";
25
26
  import {
26
27
  DEFAULT_FX_CURRENCIES,
27
28
  DEFAULT_FX_RATE_SOURCE,