@dvmkit/sdk 0.14.1 → 0.15.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.
- package/dist/{chunk-ITRSITFP.js → chunk-2I6NXIPG.js} +1 -1
- package/dist/{chunk-TKJBUFYY.js → chunk-33J3NQDZ.js} +1 -1
- package/dist/{chunk-7KQLPVV7.js → chunk-7NZRJPEP.js} +1 -1
- package/dist/{chunk-Z4FOPROB.js → chunk-BAHZK334.js} +2 -0
- package/dist/{chunk-D4FFS3IS.js → chunk-CRH6BMMG.js} +1 -1
- package/dist/{chunk-LDKV4UHI.js → chunk-CVT5LTAK.js} +1 -1
- package/dist/{chunk-EP7OVWI5.js → chunk-FOXGN4KQ.js} +1 -1
- package/dist/{chunk-VWIMQ5H5.js → chunk-G47UY3BK.js} +1 -1
- package/dist/{chunk-JLT2YIBS.js → chunk-GB2N4NG5.js} +2 -2
- package/dist/{chunk-E7ZBCT5U.js → chunk-I2H2XYQV.js} +1 -1
- package/dist/{chunk-3YFFZLW7.js → chunk-IUODXRQN.js} +2 -2
- package/dist/{chunk-566CFXGU.js → chunk-IVW5UMD3.js} +1 -1
- package/dist/{chunk-AFV77S4C.js → chunk-KVKJ7R5V.js} +81 -2
- package/dist/{chunk-A2YESDQM.js → chunk-LM6E4YHQ.js} +2 -2
- package/dist/{chunk-5JSPTVIK.js → chunk-LZFZGY7L.js} +1 -1
- package/dist/{chunk-FFRTAQUW.js → chunk-P5KQKLWL.js} +1 -1
- package/dist/{chunk-KJZVTWMX.js → chunk-PKLNMMKF.js} +52 -15
- package/dist/{chunk-M4NFYEEY.js → chunk-QRYGBKCR.js} +1 -1
- package/dist/{chunk-HNXMWHLU.js → chunk-R7FH7SHX.js} +1 -1
- package/dist/{chunk-NS2OMIU7.js → chunk-RQK7OFJO.js} +1 -1
- package/dist/{chunk-TWKQFIOW.js → chunk-YMMCRQ2H.js} +84 -14
- package/dist/{chunk-JFH34P3M.js → chunk-ZJRGORJ3.js} +359 -169
- package/dist/{chunk-HULU2UVM.js → chunk-ZO2ZAPG3.js} +1 -1
- package/dist/{content-retention-BcHNpP2F.d.ts → content-retention-BASsjgKw.d.ts} +1 -1
- package/dist/{credit-ledger-D3UUR2GW.js → credit-ledger-EZDZYLSK.js} +3 -3
- package/dist/{credit-menu-C-kmf61K.d.ts → credit-menu-B239nIY5.d.ts} +23 -9
- package/dist/{fx-hFlF4Cn8.d.ts → fx-BmvWGISH.d.ts} +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +12 -5
- package/dist/internal/caller.d.ts +11 -7
- package/dist/internal/caller.js +7 -7
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +21 -21
- package/dist/{job-store-DVCATwhU.d.ts → job-store-CA7u1nHV.d.ts} +22 -4
- package/dist/{lightning-backend-DXNVlVs9.d.ts → lightning-backend-BOcopzXk.d.ts} +1 -1
- package/dist/{memory-credit-ledger-SCXQO4HZ.js → memory-credit-ledger-REZGHPJP.js} +4 -4
- package/dist/{mpp-setup-JU3MT7QX.js → mpp-setup-RG5JDMIO.js} +3 -3
- package/dist/{payout-reporter-NXWQVKXW.js → payout-reporter-DDQ7FGRC.js} +2 -2
- package/dist/{postgres-consumed-credential-store-WXJLM6J7.js → postgres-consumed-credential-store-I4WTNVQZ.js} +1 -1
- package/dist/{postgres-job-store-ZVMAN6L2.js → postgres-job-store-IXTNWT4K.js} +3 -3
- package/dist/{postgres-replay-store-QJ4FG6AR.js → postgres-replay-store-3F5FCUXN.js} +2 -2
- package/dist/{pricing-KCLENT2C.js → pricing-HLYEGPXD.js} +3 -3
- package/dist/{revenue-reporter-HD4GMXGD.js → revenue-reporter-RIEHBKRA.js} +2 -2
- package/dist/server/index.d.ts +15 -12
- package/dist/server/index.js +28 -28
- package/dist/{step-cache-CoORQQ_Y.d.ts → step-cache-BCRHimiY.d.ts} +48 -9
- package/dist/{tempo-charge-store-7LTUAQHQ.js → tempo-charge-store-B5SYDCBK.js} +2 -2
- package/dist/{tempo-session-store-LYAIDR2B.js → tempo-session-store-FHW7N22I.js} +3 -3
- package/dist/testing/index.d.ts +7 -4
- package/dist/testing/index.js +7 -7
- package/dist/{usd-CeXGiyTC.d.ts → usd-B8_WMfHT.d.ts} +1 -1
- package/dist/{x402-RUJ4LUKF.js → x402-AY6P5KV4.js} +3 -3
- package/package.json +1 -1
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
isDrainMethod,
|
|
11
11
|
isFundingRail,
|
|
12
12
|
x402SettlementPending
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LM6E4YHQ.js";
|
|
14
14
|
import "./chunk-YG7G4DPZ.js";
|
|
15
15
|
import "./chunk-COYKJRMM.js";
|
|
16
16
|
import "./chunk-5UC7TOQC.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-FOXGN4KQ.js";
|
|
18
18
|
import "./chunk-BPYMEMQX.js";
|
|
19
19
|
import "./chunk-H3GGFEE5.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-BAHZK334.js";
|
|
21
21
|
export {
|
|
22
22
|
CreditLedger,
|
|
23
23
|
CreditLedgerError,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-
|
|
2
|
-
import {
|
|
1
|
+
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-BOcopzXk.js';
|
|
2
|
+
import { cp as HostingCleanupFence, da as HostedIntent, al as FundingMethod, p as PaymentMethod, bV as CreditLedgerLike, a7 as Message, O as UpfrontPayment, a1 as FundingReceipt, bX as CreditSnapshot, a2 as JobReceipt, S as SDKJobContext, az as StepCache, v as ResponseContent, P as PaymentContent, a3 as MessageType, bq as X402Receipt, aI as X402Config, bp as X402ExactVersionSupport, db as X402SettlementIntent, ad as PaymentRequirementsV2, dc as HostedFundingReservation, bR as CreditLedgerQuerier, dd as X402SettlementCursor, b$ as X402SettlementStatus, de as X402SettlementWriteOff, bW as X402RefundSettlementGate, df as X402FacilitatorAuth, dg as X402BatchSettlementConfig, cM as PostgresX402ChannelStorage, dh as X402PayoutObserver, bT as HostedSettlementReportObligations, bt as CreditDepositPayload, by as MppxServer, ag as CashuMode, di as CreditDepositEnqueue, dj as X402SettlementReconciliationReason, as as PaymentRequirements, c3 as FundingRecord, a5 as MppxCredential, b_ as DrawResult, cz as CreditLedgerError, a9 as ReceiptCredit, ai as DrainReceiptEvent, aa as DrainReceipt, a0 as DrawFundingReceipt, K as KVStore, z as SignedRequestAudience, dk as CreditDrawReleaseEnqueue, cK as JobCostReportPayload, cL as JobTerminalReportPayload, cO as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c5 as CreditInvoiceRecord, c6 as InvoiceSettlement, ct as ClientCompatibilityGate, cr as ClientCompatibility, bC as PostgresTempoSessionStore, bB as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-BCRHimiY.js';
|
|
3
3
|
import { ProofLike, SerializedDLEQ, Proof } from '@cashu/cashu-ts';
|
|
4
4
|
import { Hono, Context } from 'hono';
|
|
5
5
|
import { Pool } from 'pg';
|
|
6
|
-
import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-
|
|
6
|
+
import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-BmvWGISH.js';
|
|
7
7
|
import { Store, Challenge } from 'mppx';
|
|
8
|
-
import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-
|
|
8
|
+
import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-CA7u1nHV.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';
|
|
@@ -430,6 +430,8 @@ interface PaymentResolver {
|
|
|
430
430
|
reject: (reason: Error) => void;
|
|
431
431
|
}
|
|
432
432
|
interface ServerJob {
|
|
433
|
+
/** Runtime configuration; persisted deadlines live in the emitted messages. */
|
|
434
|
+
idleTimeoutMs?: number;
|
|
433
435
|
id: string;
|
|
434
436
|
tags: string[];
|
|
435
437
|
/**
|
|
@@ -475,6 +477,8 @@ interface ServerJob {
|
|
|
475
477
|
summary?: string;
|
|
476
478
|
messages: Message[];
|
|
477
479
|
seq: number;
|
|
480
|
+
/** Original acceptance snapshot; absent for historical records. INSERT-only. */
|
|
481
|
+
upfrontPayment?: UpfrontPayment;
|
|
478
482
|
paidMsats: number;
|
|
479
483
|
paymentMint?: string;
|
|
480
484
|
/** Rail of the most recent successful credit. Set on each credit branch in payment processing. */
|
|
@@ -1748,6 +1752,8 @@ interface CreateX402BatchSettlementServerOpts {
|
|
|
1748
1752
|
declare function createX402BatchSettlementServer(opts: CreateX402BatchSettlementServerOpts): Promise<X402BatchSettlementServer>;
|
|
1749
1753
|
|
|
1750
1754
|
interface PaymentInfo {
|
|
1755
|
+
/** Immutable acceptance fact, separate from cumulative job accounting. */
|
|
1756
|
+
upfrontPayment?: UpfrontPayment;
|
|
1751
1757
|
/**
|
|
1752
1758
|
* Rail value this payment contributes to the job, in millisatoshis.
|
|
1753
1759
|
*
|
|
@@ -2975,6 +2981,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
2975
2981
|
private readonly statusChecksQueued;
|
|
2976
2982
|
private readonly paymentAskSeqs;
|
|
2977
2983
|
private readonly reactivationAskSeqs;
|
|
2984
|
+
private readonly pendingPaymentMessages;
|
|
2978
2985
|
private readonly inputResumeTails;
|
|
2979
2986
|
private readonly claimedPaymentResumes;
|
|
2980
2987
|
private readonly sessionId;
|
|
@@ -3227,7 +3234,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3227
3234
|
* `artifact`'s NOTIFY silently drops the artifact.
|
|
3228
3235
|
*/
|
|
3229
3236
|
private wireMessageAppender;
|
|
3230
|
-
startIdleTimer(job: ServerJob): void;
|
|
3237
|
+
startIdleTimer(job: ServerJob, deadline?: number | undefined): void;
|
|
3231
3238
|
clearIdleTimer(id: string): void;
|
|
3232
3239
|
/** Cancel a job due to idle timeout. Exposed for the reactivation path's idle-expiry guard. */
|
|
3233
3240
|
cancelJobIdle(job: ServerJob): Promise<void>;
|
|
@@ -3236,8 +3243,11 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3236
3243
|
* • `awaiting-input` past `staleJobTimeoutMs` → `cancelled`
|
|
3237
3244
|
* (`stale_no_terminal_status`) — the caller never paid / responded.
|
|
3238
3245
|
* • `processing`/`working` past `processingWatchdogMs` → `failed`
|
|
3239
|
-
* (`worker_died_mid_job`) — the worker died mid-job.
|
|
3240
|
-
*
|
|
3246
|
+
* (`worker_died_mid_job`) — the worker died mid-job. Before claiming a
|
|
3247
|
+
* processing row, skip and heartbeat it if this manager still holds a live
|
|
3248
|
+
* `processing`/`working` job. After a process pause, the sweep may run before
|
|
3249
|
+
* the heartbeat timer; stale activity alone does not prove a local worker
|
|
3250
|
+
* died. Superseded handlers leave `_activeJobs` and receive no protection.
|
|
3241
3251
|
*
|
|
3242
3252
|
* Fires on a timer (wired in the constructor) and also callable on demand
|
|
3243
3253
|
* (tests, ops). The CAS in `cancelStaleJob` makes this safe to run
|
|
@@ -3245,6 +3255,8 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3245
3255
|
* JobManager owns so multi-mount hosts don't steal stuck rows from sibling
|
|
3246
3256
|
* descriptors — the local activeJobs teardown only makes sense on the
|
|
3247
3257
|
* JobManager that actually hosted the zombie handler.
|
|
3258
|
+
* Local liveness prevents this manager's claim; the activity CAS continues
|
|
3259
|
+
* to protect against other machines claiming a row refreshed after find.
|
|
3248
3260
|
*
|
|
3249
3261
|
* **Both cutoffs float off the wall clock.** Each is one
|
|
3250
3262
|
* `Date.now()` sample compared against `last_activity_at`, stamped from a
|
|
@@ -3469,8 +3481,9 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3469
3481
|
*/
|
|
3470
3482
|
claimAwaitingInputForReactivation(jobId: string): Promise<boolean>;
|
|
3471
3483
|
/**
|
|
3472
|
-
* Record an inbound client message durably via Tx B
|
|
3473
|
-
*
|
|
3484
|
+
* Record an inbound client message durably via Tx B. Payments stay outside
|
|
3485
|
+
* visible history until processPayment accepts them; other messages append
|
|
3486
|
+
* to `job.messages` immediately. Returns the DB-allocated seq
|
|
3474
3487
|
* (`null` when the store isn't streamable — non-Postgres test fallback).
|
|
3475
3488
|
*
|
|
3476
3489
|
* Status starts as `pending-verification`; a follow-up Tx C call
|
|
@@ -3548,6 +3561,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3548
3561
|
lockPubkeys?: LockPubkey[];
|
|
3549
3562
|
mintHealthTracker?: MintHealthTracker;
|
|
3550
3563
|
}): Promise<ProcessPaymentOutcome>;
|
|
3564
|
+
private processPaymentAndCredit;
|
|
3551
3565
|
/** Issue (or reuse) the signed draw funding receipt for a committed funding row; never throws. */
|
|
3552
3566
|
private drawFundingReceiptFor;
|
|
3553
3567
|
/**
|
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-
|
|
2
|
-
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CreateSignedRequestVerifierOpts, g as CreditConfig, h as CreditView, i as DEFAULT_CREDIT_MAX, j as DEFAULT_CREDIT_MIN, k as DEFAULT_CREDIT_TTL_SECONDS, l as DEFAULT_JOB_RETENTION_DAYS, m as DVMRouteContext, I as IncomingMessage, n as InputType, o as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, p as PaymentMethod, q as PriceValue, r as ProgressContent, s as PromptOpts, Q as QuoteConfig, t as QuoteContext, u as QuoteResult, R as ResolvedCreditConfig, v as ResponseContent, S as SDKJobContext, w as SDKPaymentRequestOpts, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, z as SignedRequestAudience, B as SignedRequestDomain, E as SignedRequestError, F as SignedRequestFailure, G as SignedRequestReplayStore, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, U as UnsupportedCurrencyError, O as
|
|
3
|
-
export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-
|
|
4
|
-
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-
|
|
5
|
-
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-
|
|
1
|
+
import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-BCRHimiY.js';
|
|
2
|
+
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CreateSignedRequestVerifierOpts, g as CreditConfig, h as CreditView, i as DEFAULT_CREDIT_MAX, j as DEFAULT_CREDIT_MIN, k as DEFAULT_CREDIT_TTL_SECONDS, l as DEFAULT_JOB_RETENTION_DAYS, m as DVMRouteContext, I as IncomingMessage, n as InputType, o as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, p as PaymentMethod, q as PriceValue, r as ProgressContent, s as PromptOpts, Q as QuoteConfig, t as QuoteContext, u as QuoteResult, R as ResolvedCreditConfig, v as ResponseContent, S as SDKJobContext, w as SDKPaymentRequestOpts, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, z as SignedRequestAudience, B as SignedRequestDomain, E as SignedRequestError, F as SignedRequestFailure, G as SignedRequestReplayStore, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, U as UnsupportedCurrencyError, O as UpfrontPayment, T as createSignedRequestVerifier, V as isZodSchema, W as signedRequestStatementHeader, X as validateCurrency } from './step-cache-BCRHimiY.js';
|
|
3
|
+
export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-BmvWGISH.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-B8_WMfHT.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-CA7u1nHV.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';
|
|
@@ -34,6 +34,7 @@ declare function buildUpfront(input: {
|
|
|
34
34
|
currency: string;
|
|
35
35
|
}): Upfront;
|
|
36
36
|
|
|
37
|
+
/** Configure a DVM; idleTimeout limits each caller answer/payment window (1–604800 seconds), not processing time. */
|
|
37
38
|
declare function configureDVM<State = Record<string, unknown>, InputSchema extends ZodLike | undefined = undefined>(config: DVMConfig<State, InputSchema>): DVMDescriptor<State, InputSchema>;
|
|
38
39
|
/** Check whether this SDK module instance created a value through `configureDVM`. */
|
|
39
40
|
declare function isConfiguredDVMDescriptor(value: unknown): value is DVMDescriptor<unknown, ZodLike | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
SignedRequestError,
|
|
12
12
|
createSignedRequestVerifier
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZO2ZAPG3.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_CREDIT_MAX,
|
|
16
16
|
DEFAULT_CREDIT_MIN,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-SXL44PL5.js";
|
|
24
24
|
import {
|
|
25
25
|
buildUpfront
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-CRH6BMMG.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_FX_CURRENCIES,
|
|
29
29
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
roundUsd,
|
|
42
42
|
satsToFiat,
|
|
43
43
|
validateCurrency
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CVT5LTAK.js";
|
|
45
45
|
import "./chunk-H3GGFEE5.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-BAHZK334.js";
|
|
47
47
|
|
|
48
48
|
// src/sdk/configure.ts
|
|
49
49
|
function configureDVM(config) {
|
|
@@ -60,7 +60,7 @@ function configureDVM(config) {
|
|
|
60
60
|
price: onlyCapability?.price,
|
|
61
61
|
inputSchema: onlyCapability?.input,
|
|
62
62
|
state: onlyCapability?.state ?? {},
|
|
63
|
-
idleTimeout: config.idleTimeout
|
|
63
|
+
idleTimeout: resolveIdleTimeout(config.idleTimeout),
|
|
64
64
|
processingWatchdog: config.processingWatchdog,
|
|
65
65
|
jobRetentionDays,
|
|
66
66
|
config,
|
|
@@ -74,6 +74,13 @@ function configureDVM(config) {
|
|
|
74
74
|
CONFIGURED_DVM_DESCRIPTORS.add(descriptor);
|
|
75
75
|
return Object.freeze(descriptor);
|
|
76
76
|
}
|
|
77
|
+
function resolveIdleTimeout(raw) {
|
|
78
|
+
const seconds = raw === void 0 ? 3600 : raw;
|
|
79
|
+
if (!Number.isInteger(seconds) || seconds < 1 || seconds > 604800) {
|
|
80
|
+
throw new Error(`configureDVM: idleTimeout must be an integer from 1 through 604800 seconds; received ${String(raw)}`);
|
|
81
|
+
}
|
|
82
|
+
return seconds;
|
|
83
|
+
}
|
|
77
84
|
function resolveJobRetentionDays(raw) {
|
|
78
85
|
const days = raw ?? DEFAULT_JOB_RETENTION_DAYS;
|
|
79
86
|
if (!Number.isSafeInteger(days) || days < 0 || days > Math.floor((Number.MAX_SAFE_INTEGER - Date.now()) / 864e5)) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { Y as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, _ as X402_BATCH_SETTLEMENT_SCHEME, $ as X402_EXACT_SCHEME, a0 as DrawFundingReceipt, a1 as FundingReceipt, a2 as JobReceipt$1, O as UpfrontPayment, a3 as MessageType, a4 as X402Version, a5 as MppxCredential, z as SignedRequestAudience, a6 as PaymentRequired, a7 as Message, a8 as MppxChallenge, a9 as ReceiptCredit, aa as DrainReceipt, C as Currency, ab as X402Wallet, ac as PaymentRequirementsV1, ad as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-BCRHimiY.js';
|
|
2
|
+
export { ae as BuildPaymentRequirementsOpts, af as CapabilityDescriptor, ag as CashuMode, ah as CompleteContent, ai as DrainReceiptEvent, aj as ExactEvmPayload, ak as ExactEvmPayloadAuthorization, al as FundingMethod, am as MessageFrom, an as PaymentPayload, ao as PaymentPayloadV1, ap as PaymentPayloadV2, aq as PaymentRequestContent, ar as PaymentRequiredV2, as as PaymentRequirements, at as PromptContent, au as RAIL_REFUNDABLE, av as ReceiptOutcome, aw as ReceiptPayment, ax as ResourceInfo, ay as SettleResponse, az as StepCache, aA as StepRecord, aB as TextContent, aC as UnsignedDrainReceipt, aD as UnsignedDrawFundingReceipt, aE as UnsignedFundingReceipt, aF as UnsignedJobReceipt, aG as VerifyResponse, aH as WorkingContent, aI as X402Config, aJ as X402ResponseBody, aK as X402SelfRelayRpcFailureReason, aL as X402_DEFAULT_NETWORK, aM as X402_V1_VERSION, aN as X402_VERSION, aO as buildPaymentRequiredV2, aP as buildPaymentRequirements, aQ as caip2ToX402Network, aR as canonicalRequestPath, aS as canonicaliseForSigning, aT as canonicalize, aU as chainIdFromCaip2, aV as computeResultHash, aW as decodePayment, aX as decodePaymentRequiredHeader, aY as encodePayment, aZ as encodePaymentRequiredHeader, a_ as encodeSettleResponseHeader, a$ as exactEvmAuthorization, b0 as isArtifactMessage, b1 as isCancelMessage, b2 as isCompleteMessage, b3 as isDrainReceipt, b4 as isDrawFundingReceipt, b5 as isFundingReceipt, b6 as isPaymentRequestMessage, b7 as isPromptMessage, b8 as isSignedJobReceipt, b9 as isTextMessage, ba as isWorkingMessage, bb as paymentRequiredV2FromV1, bc as signDrainReceipt, bd as signDrawFundingReceipt, be as signFundingReceipt, bf as signReceipt, bg as usdcContractByCaip2, bh as usdcContractFor, bi as usdcDomainNameFor, bj as usdcDomainVersionFor, bk as verifyDrainReceipt, bl as verifyDrawFundingReceipt, bm as verifyFundingReceipt, bn as verifyReceipt, bo as x402NetworkToCaip2 } from '../step-cache-BCRHimiY.js';
|
|
3
|
+
import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-BOcopzXk.js';
|
|
4
|
+
export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-BOcopzXk.js';
|
|
3
5
|
import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
|
|
4
6
|
export { g as getWallet } from '../wallet-Dwjs5n_M.js';
|
|
5
|
-
import { X as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, Y as X402_BATCH_SETTLEMENT_SCHEME, _ as X402_EXACT_SCHEME, $ as DrawFundingReceipt, a0 as FundingReceipt, a1 as JobReceipt$1, a2 as MessageType, a3 as X402Version, a4 as MppxCredential, z as SignedRequestAudience, a5 as PaymentRequired, a6 as Message, a7 as MppxChallenge, a8 as ReceiptCredit, a9 as DrainReceipt, C as Currency, aa as X402Wallet, ab as PaymentRequirementsV1, ac as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-CoORQQ_Y.js';
|
|
6
|
-
export { ad as BuildPaymentRequirementsOpts, ae as CapabilityDescriptor, af as CashuMode, ag as CompleteContent, ah as DrainReceiptEvent, ai as ExactEvmPayload, aj as ExactEvmPayloadAuthorization, ak as FundingMethod, al as MessageFrom, am as PaymentPayload, an as PaymentPayloadV1, ao as PaymentPayloadV2, ap as PaymentRequestContent, aq as PaymentRequiredV2, ar as PaymentRequirements, as as PromptContent, at as RAIL_REFUNDABLE, au as ReceiptOutcome, av as ReceiptPayment, aw as ResourceInfo, ax as SettleResponse, ay as StepCache, az as StepRecord, aA as TextContent, aB as UnsignedDrainReceipt, aC as UnsignedDrawFundingReceipt, aD as UnsignedFundingReceipt, aE as UnsignedJobReceipt, aF as VerifyResponse, aG as WorkingContent, aH as X402Config, aI as X402ResponseBody, aJ as X402SelfRelayRpcFailureReason, aK as X402_DEFAULT_NETWORK, aL as X402_V1_VERSION, aM as X402_VERSION, aN as buildPaymentRequiredV2, aO as buildPaymentRequirements, aP as caip2ToX402Network, aQ as canonicalRequestPath, aR as canonicaliseForSigning, aS as canonicalize, aT as chainIdFromCaip2, aU as computeResultHash, aV as decodePayment, aW as decodePaymentRequiredHeader, aX as encodePayment, aY as encodePaymentRequiredHeader, aZ as encodeSettleResponseHeader, a_ as exactEvmAuthorization, a$ as isArtifactMessage, b0 as isCancelMessage, b1 as isCompleteMessage, b2 as isDrainReceipt, b3 as isDrawFundingReceipt, b4 as isFundingReceipt, b5 as isPaymentRequestMessage, b6 as isPromptMessage, b7 as isSignedJobReceipt, b8 as isTextMessage, b9 as isWorkingMessage, ba as paymentRequiredV2FromV1, bb as signDrainReceipt, bc as signDrawFundingReceipt, bd as signFundingReceipt, be as signReceipt, bf as usdcContractByCaip2, bg as usdcContractFor, bh as usdcDomainNameFor, bi as usdcDomainVersionFor, bj as verifyDrainReceipt, bk as verifyDrawFundingReceipt, bl as verifyFundingReceipt, bm as verifyReceipt, bn as x402NetworkToCaip2 } from '../step-cache-CoORQQ_Y.js';
|
|
7
7
|
import { SimplePool } from 'nostr-tools/pool';
|
|
8
8
|
import { Session } from 'mppx/tempo';
|
|
9
9
|
import { Pool } from 'pg';
|
|
10
10
|
import { PaymentRequired as PaymentRequired$1 } from '@x402/core/types';
|
|
11
11
|
import { ClientChannelStorage, BatchSettlementClientContext, BatchSettlementEvmScheme } from '@x402/evm/batch-settlement/client';
|
|
12
|
-
export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-
|
|
13
|
-
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-
|
|
12
|
+
export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-BmvWGISH.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-B8_WMfHT.js';
|
|
14
14
|
import 'hono';
|
|
15
15
|
import 'mppx';
|
|
16
16
|
import '@x402/core/server';
|
|
@@ -1346,6 +1346,8 @@ interface CreditOpResult {
|
|
|
1346
1346
|
* response; that one is a single block inside it.
|
|
1347
1347
|
*/
|
|
1348
1348
|
interface JobReceipt {
|
|
1349
|
+
/** Original accepted payment/hold. Absent means unknown, never zero. */
|
|
1350
|
+
upfrontPayment?: UpfrontPayment;
|
|
1349
1351
|
jobId: string;
|
|
1350
1352
|
status: "completed" | "processing" | "payment-required" | "failed" | "cancelled" | "awaiting-input";
|
|
1351
1353
|
/** Tempo settlement transaction from the validated `Payment-Receipt` header. */
|
|
@@ -1421,6 +1423,8 @@ interface OutboundMessage {
|
|
|
1421
1423
|
content: Record<string, unknown>;
|
|
1422
1424
|
}
|
|
1423
1425
|
interface JobStatus {
|
|
1426
|
+
/** Original accepted payment/hold, unchanged by later payments or settlement. */
|
|
1427
|
+
upfrontPayment?: UpfrontPayment;
|
|
1424
1428
|
jobId: string;
|
|
1425
1429
|
status: "processing" | "completed" | "failed" | "awaiting-input" | "cancelled";
|
|
1426
1430
|
/** Human-readable summary of the completed job (one-liner; not the payload). Present when status is `completed`. */
|
|
@@ -6500,4 +6504,4 @@ declare class MemoryKVStore implements KVStore {
|
|
|
6500
6504
|
list(prefix?: string): Promise<string[]>;
|
|
6501
6505
|
}
|
|
6502
6506
|
|
|
6503
|
-
export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentRecentSpend, type AgentWallet, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetCheckResult, type BudgetLedger, type BudgetLedgerEntry, type BudgetSpendBreakdown, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, type CachedBtcRate, type CancelOptions, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type CompletedCreditHistoryPage, type CompletedCreditHistoryQuery, type CompletedCreditHistoryRecord, type CompletedRefundHistoryRecord, type ConfigDirModeResult, CreatedInvoice, type CreditDrainRail, type CreditFundRail, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DIAGNOSTIC_CATALOGUE_VERSION, DbTransport, type DeliveredResult, type DescribeOptions, type DiagnosticCapabilityAuthority, type DiagnosticIdentityAuthority, DrainReceipt, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, DrawFundingReceipt, type DrawFundingReceiptChecks, type DrawFundingReceiptVerifyResult, type DrawFundingRejection, DvmError, DvmX402ChannelStorage, type ExpiredCreditLossHistoryRecord, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, type FundValuation, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, JOB_IDENTITY_HEADER, type JobEnvelope, type JobIdentityHeaderResult, type JobPolicy, JobReceipt$1 as JobReceipt, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, MemoryKVStore, Message, type MessagePollOptions, MessageType, type MnemonicValidationResult, MppxChallenge, MppxCredential, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, PaymentRequired, PaymentRequirementsV1, PaymentRequirementsV2, type PendingDrain, type PendingFunding, type PendingMelt, type PendingMint, type PendingMintMintingState, type PendingSubmission, type PendingSubmissionAcceptedUnresolved, type PendingSubmissionContext, type PendingTempoChargeFunding, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailAsset, type RailFlag, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type RecordDrawFundingResult, type RecordSpendOptions, type RpcSource, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SendMessageResult, type SpanProjectionResult, type SpanRow, type SpanTransport, SpanWriter, type StatusOptions, type StoredCredit, type StoredCreditX402Binding, type StoredDrawFunding, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmitOptions, type SwapSendReserve, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_CHARGE_PENDING_STALE_MS, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, TEMPO_SESSION_UPDATED_REASON, type TempoAccount, type TempoChannelAssociation, type TempoChannelController, type TempoChannelDescriptor, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoChannelStoreContext, type TempoCredentialAccount, type TempoNetwork, type TempoSessionClientResolver, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletCredentialConfig, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, type X402VoucherPendingState, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, advanceTempoChannelExit, appendBudgetSpend, appendFundingReceipt, appendReceipt, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertNoRivalX402Voucher, assertSupportedX402Network, assertTempoSessionChallengeWithinAsk, assertTempoSessionDepositWithinCap, assertTempoSessionVoucherWithinAsk, assertX402ChannelPayer, assertX402RequirementDescribesChannel, attestedDvmIdentity, authenticatedBuilderPubkey, backupSecretFile, bindCashuTokenToSubmissionContext, bindDiagnosticCapabilityAuthority, bindDiagnosticIdentityAuthority, breakdownSince, buildAdminAuthHeader, buildAdminChallenge, builderLockPath, canReplaceExpiredX402Deposit, capFor, cashuSubmissionBindingFingerprint, cashuSubmissionBindingFromContext, checkBudgetForLedger, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingFunding, clearPendingTempoChargeFunding, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, computeSmartDenominations, costAnchor, coveringMintsForSpend, createDiagnosticCapabilityAuthority, createMintQuoteRetryState, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoChannelStore, createTempoCloseCredential, createTempoCreditSession, createTempoSessionPaymentFetch, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveAgentRefundSubkey, deriveAgentRefundSubkeyPubkey, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, dvmLocationIdentity, effectiveFundingMint, effectiveMints, ensureAddress, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, extendDiagnosticIdentityAuthority, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, findX402Channel, forgetCredit, formatStaleness, formatUsd, formatUsdcMicrounits, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, generateAgentMnemonic, generateEphemeralReceiptKey, generateX402PrivateKey, getBalance, getBalanceByMint, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isJobIdentityValue, isPublicRequestId, isSignableExactRequirement, isStablecoinFundRail, isStorableJobId, isValidEvmPrivateKey, issueRouterFeedbackClaim, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadBudgetLedger, loadCredit, loadCreditX402Binding, loadIdentities, loadImplicitCredits, loadPendingFunding, loadReceipt, loadReceipts, loadResumableTempoChargeFunding, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelAssociationByKey, loadTempoChannelController, loadTempoChannelEntry, loadWalletConfiguredMints, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markRefillDrainNoticed, markRefillRailUnavailable, maxAdvertisedMicro, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcTimeoutMs, offersTempoCreditCharge, offersTempoCreditFunding, offersTempoCreditSession, offersX402CreditChannel, offersX402CreditFlavour, offersX402CreditFunding, parseCreditMenu, parseCreditTerms, parseJobIdentityHeader, parseLnAddress, parseNwcUri, parseTraceparent, payInvoiceReconciling, pendingDrainById, pendingDrainFor, persistTempoOpenCredential, pinDimension, prepareP2PKMint, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, projectDiagnosticFields, projectEventName, projectSpanRow, providerProseSources, providerTextToString, randomTraceId, readAgentMnemonic, readCompletedCreditHistory, readFundValuation, readX402ChannelGuardFacts, readX402ChannelOnChain, receiptPubkeyFromSecret, receiveToAgentWallet, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordDrawFunding, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingFunding, recordPendingTempoChargeFunding, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordX402ChannelMetadata, redactUrl, redactUrlsInText, refundX402BatchChannel, rehydrateOutputData, repairConfigDirMode, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retirePendingX402Funding, retireTempoChannel, retireTempoChannelScope, retryMintQuoteOperation, saveAgentWallet, saveBudgetLedger, saveIdentities, selectProofsForSpend, serializeOutputData, setEmitter, settleDrainEvidence, sha256hex, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendEntry, swapFeeForProofs, swapSendReserve, tempoAccountFromConfig, tempoBalanceCheckHint, tempoChallengeAmountMicro, tempoChannelControlledBy, tempoChargeCredentialSettleable, tempoCredentialAmountMicro, tempoCredentialValidBefore, tempoDescriptorController, tempoSessionAssociationByKey, tempoSessionChallenge, tempoSessionChallengeChannelScope, tempoSessionChallengeMicro, tempoSessionCredentialChannelScope, tempoSessionCredentialCumulativeMicro, tempoSessionCumulativeCapMicro, tempoSessionPriorCumulativeMicro, tempoTokenReference, toAgentProof, toCashuProofs, transportErrorCode, tryResolveTempoAsset, unsignRequestData, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyDrawFundingReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowEnd, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, withholdsTempoCreditSession, withinAdvertisedTolerance, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402CreditFlavour, x402CreditFundingNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402InstrumentForFlavour, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingState, x402WalletFromConfig };
|
|
6507
|
+
export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentRecentSpend, type AgentWallet, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetCheckResult, type BudgetLedger, type BudgetLedgerEntry, type BudgetSpendBreakdown, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, type CachedBtcRate, type CancelOptions, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type CompletedCreditHistoryPage, type CompletedCreditHistoryQuery, type CompletedCreditHistoryRecord, type CompletedRefundHistoryRecord, type ConfigDirModeResult, CreatedInvoice, type CreditDrainRail, type CreditFundRail, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DIAGNOSTIC_CATALOGUE_VERSION, DbTransport, type DeliveredResult, type DescribeOptions, type DiagnosticCapabilityAuthority, type DiagnosticIdentityAuthority, DrainReceipt, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, DrawFundingReceipt, type DrawFundingReceiptChecks, type DrawFundingReceiptVerifyResult, type DrawFundingRejection, DvmError, DvmX402ChannelStorage, type ExpiredCreditLossHistoryRecord, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, type FundValuation, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, JOB_IDENTITY_HEADER, type JobEnvelope, type JobIdentityHeaderResult, type JobPolicy, JobReceipt$1 as JobReceipt, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, MemoryKVStore, Message, type MessagePollOptions, MessageType, type MnemonicValidationResult, MppxChallenge, MppxCredential, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, PaymentRequired, PaymentRequirementsV1, PaymentRequirementsV2, type PendingDrain, type PendingFunding, type PendingMelt, type PendingMint, type PendingMintMintingState, type PendingSubmission, type PendingSubmissionAcceptedUnresolved, type PendingSubmissionContext, type PendingTempoChargeFunding, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailAsset, type RailFlag, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type RecordDrawFundingResult, type RecordSpendOptions, type RpcSource, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SendMessageResult, type SpanProjectionResult, type SpanRow, type SpanTransport, SpanWriter, type StatusOptions, type StoredCredit, type StoredCreditX402Binding, type StoredDrawFunding, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmitOptions, type SwapSendReserve, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_CHARGE_PENDING_STALE_MS, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, TEMPO_SESSION_UPDATED_REASON, type TempoAccount, type TempoChannelAssociation, type TempoChannelController, type TempoChannelDescriptor, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoChannelStoreContext, type TempoCredentialAccount, type TempoNetwork, type TempoSessionClientResolver, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, UpfrontPayment, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletCredentialConfig, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, type X402VoucherPendingState, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, advanceTempoChannelExit, appendBudgetSpend, appendFundingReceipt, appendReceipt, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertNoRivalX402Voucher, assertSupportedX402Network, assertTempoSessionChallengeWithinAsk, assertTempoSessionDepositWithinCap, assertTempoSessionVoucherWithinAsk, assertX402ChannelPayer, assertX402RequirementDescribesChannel, attestedDvmIdentity, authenticatedBuilderPubkey, backupSecretFile, bindCashuTokenToSubmissionContext, bindDiagnosticCapabilityAuthority, bindDiagnosticIdentityAuthority, breakdownSince, buildAdminAuthHeader, buildAdminChallenge, builderLockPath, canReplaceExpiredX402Deposit, capFor, cashuSubmissionBindingFingerprint, cashuSubmissionBindingFromContext, checkBudgetForLedger, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingFunding, clearPendingTempoChargeFunding, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, computeSmartDenominations, costAnchor, coveringMintsForSpend, createDiagnosticCapabilityAuthority, createMintQuoteRetryState, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoChannelStore, createTempoCloseCredential, createTempoCreditSession, createTempoSessionPaymentFetch, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveAgentRefundSubkey, deriveAgentRefundSubkeyPubkey, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, dvmLocationIdentity, effectiveFundingMint, effectiveMints, ensureAddress, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, extendDiagnosticIdentityAuthority, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, findX402Channel, forgetCredit, formatStaleness, formatUsd, formatUsdcMicrounits, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, generateAgentMnemonic, generateEphemeralReceiptKey, generateX402PrivateKey, getBalance, getBalanceByMint, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isJobIdentityValue, isPublicRequestId, isSignableExactRequirement, isStablecoinFundRail, isStorableJobId, isValidEvmPrivateKey, issueRouterFeedbackClaim, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadBudgetLedger, loadCredit, loadCreditX402Binding, loadIdentities, loadImplicitCredits, loadPendingFunding, loadReceipt, loadReceipts, loadResumableTempoChargeFunding, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelAssociationByKey, loadTempoChannelController, loadTempoChannelEntry, loadWalletConfiguredMints, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markRefillDrainNoticed, markRefillRailUnavailable, maxAdvertisedMicro, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcTimeoutMs, offersTempoCreditCharge, offersTempoCreditFunding, offersTempoCreditSession, offersX402CreditChannel, offersX402CreditFlavour, offersX402CreditFunding, parseCreditMenu, parseCreditTerms, parseJobIdentityHeader, parseLnAddress, parseNwcUri, parseTraceparent, payInvoiceReconciling, pendingDrainById, pendingDrainFor, persistTempoOpenCredential, pinDimension, prepareP2PKMint, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, projectDiagnosticFields, projectEventName, projectSpanRow, providerProseSources, providerTextToString, randomTraceId, readAgentMnemonic, readCompletedCreditHistory, readFundValuation, readX402ChannelGuardFacts, readX402ChannelOnChain, receiptPubkeyFromSecret, receiveToAgentWallet, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordDrawFunding, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingFunding, recordPendingTempoChargeFunding, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordX402ChannelMetadata, redactUrl, redactUrlsInText, refundX402BatchChannel, rehydrateOutputData, repairConfigDirMode, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retirePendingX402Funding, retireTempoChannel, retireTempoChannelScope, retryMintQuoteOperation, saveAgentWallet, saveBudgetLedger, saveIdentities, selectProofsForSpend, serializeOutputData, setEmitter, settleDrainEvidence, sha256hex, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendEntry, swapFeeForProofs, swapSendReserve, tempoAccountFromConfig, tempoBalanceCheckHint, tempoChallengeAmountMicro, tempoChannelControlledBy, tempoChargeCredentialSettleable, tempoCredentialAmountMicro, tempoCredentialValidBefore, tempoDescriptorController, tempoSessionAssociationByKey, tempoSessionChallenge, tempoSessionChallengeChannelScope, tempoSessionChallengeMicro, tempoSessionCredentialChannelScope, tempoSessionCredentialCumulativeMicro, tempoSessionCumulativeCapMicro, tempoSessionPriorCumulativeMicro, tempoTokenReference, toAgentProof, toCashuProofs, transportErrorCode, tryResolveTempoAsset, unsignRequestData, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyDrawFundingReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowEnd, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, withholdsTempoCreditSession, withinAdvertisedTolerance, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402CreditFlavour, x402CreditFundingNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402InstrumentForFlavour, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingState, x402WalletFromConfig };
|
package/dist/internal/caller.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
sha256hex,
|
|
33
33
|
validateX402Env,
|
|
34
34
|
withNwcPool
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-QRYGBKCR.js";
|
|
36
36
|
import {
|
|
37
37
|
MemoryKVStore
|
|
38
38
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
withWalletLock,
|
|
135
135
|
writeAgentMnemonic,
|
|
136
136
|
writeIdentity
|
|
137
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-LZFZGY7L.js";
|
|
138
138
|
import {
|
|
139
139
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
140
140
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -178,7 +178,7 @@ import {
|
|
|
178
178
|
import {
|
|
179
179
|
createNoopLogger,
|
|
180
180
|
createStdoutLogger
|
|
181
|
-
} from "../chunk-
|
|
181
|
+
} from "../chunk-7NZRJPEP.js";
|
|
182
182
|
import {
|
|
183
183
|
redactUrl,
|
|
184
184
|
redactUrlsInText
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
InvalidUsdPriceError,
|
|
193
193
|
parseUsdPrice,
|
|
194
194
|
warmFxSnapshot
|
|
195
|
-
} from "../chunk-
|
|
195
|
+
} from "../chunk-CVT5LTAK.js";
|
|
196
196
|
import {
|
|
197
197
|
computeResultHash,
|
|
198
198
|
isDrainReceipt,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
import {
|
|
212
212
|
applyRetryToPool,
|
|
213
213
|
withInitRetry
|
|
214
|
-
} from "../chunk-
|
|
214
|
+
} from "../chunk-FOXGN4KQ.js";
|
|
215
215
|
import {
|
|
216
216
|
DvmError,
|
|
217
217
|
X402_NETWORKS,
|
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
randomTraceId,
|
|
239
239
|
setEmitter,
|
|
240
240
|
withTraceContext
|
|
241
|
-
} from "../chunk-
|
|
241
|
+
} from "../chunk-R7FH7SHX.js";
|
|
242
242
|
import "../chunk-66HGCPBU.js";
|
|
243
243
|
import {
|
|
244
244
|
DIAGNOSTIC_CATALOGUE_VERSION,
|
|
@@ -249,7 +249,7 @@ import {
|
|
|
249
249
|
projectDiagnosticFields,
|
|
250
250
|
projectEventName,
|
|
251
251
|
projectSpanRow
|
|
252
|
-
} from "../chunk-
|
|
252
|
+
} from "../chunk-BAHZK334.js";
|
|
253
253
|
|
|
254
254
|
// src/lib/budget-core.ts
|
|
255
255
|
function checkBudgetForLedger(ledger, opts) {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { FacilitatorConfig } from '@x402/core/server';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { an as PaymentPayload, ac as PaymentRequirementsV1, ad as PaymentRequirementsV2, aI as X402Config, ay as SettleResponse, aG as VerifyResponse, bp as X402ExactVersionSupport, bq as X402Receipt, br as TransactionalPayoutHook, bs as CashuMeltCompleted } from '../step-cache-BCRHimiY.js';
|
|
3
|
+
export { bt as CreditDepositPayload, bu as CreditDrainPayload, bv as FundingLot, bw as LotDebit, bx as LotDepletion, by as MppxServer, bz as NON_CHANNEL_BITCOIN_RAILS, bA as NonChannelBitcoinRail, bB as PayoutReporter, bC as PostgresTempoSessionStore, bD as RevenueReporter, bE as SIGNED_ENVELOPE_FIELDS, bF as SIGNED_ENVELOPE_TYPES, bG as X402TrackedChannel, bH as _testing, bI as createDefaultReplayStore, bJ as depleteLots, bK as fifoOrder, bL as inKindDrawMsats, bM as isInKindDepletion, bN as isNonChannelBitcoinRail, bO as lotOwedSats, bP as netOwedSats, bQ as wrapMppx } from '../step-cache-BCRHimiY.js';
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
5
|
import { Env, BlankSchema } from 'hono/types';
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
export { Pool } from 'pg';
|
|
8
8
|
import { g as getWallet } from '../wallet-Dwjs5n_M.js';
|
|
9
|
-
import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-
|
|
10
|
-
export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-
|
|
11
|
-
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-
|
|
9
|
+
import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-B239nIY5.js';
|
|
10
|
+
export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-B239nIY5.js';
|
|
11
|
+
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-CA7u1nHV.js';
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
-
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-
|
|
13
|
+
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-BOcopzXk.js';
|
|
14
14
|
import 'mppx';
|
|
15
15
|
import '@x402/evm/batch-settlement/server';
|
|
16
16
|
import '@x402/core/types';
|
|
17
17
|
import 'viem';
|
|
18
18
|
import '@cashu/cashu-ts';
|
|
19
|
-
import '../fx-
|
|
19
|
+
import '../fx-BmvWGISH.js';
|
|
20
20
|
|
|
21
21
|
declare function verifyWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<VerifyResponse>;
|
|
22
22
|
declare function settleWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<SettleResponse>;
|
package/dist/internal/server.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-RQK7OFJO.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyX402Payment
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-IUODXRQN.js";
|
|
7
7
|
import {
|
|
8
8
|
RevenueReporter
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-IVW5UMD3.js";
|
|
10
10
|
import {
|
|
11
11
|
PostgresTempoChargeStore
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-P5KQKLWL.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
15
15
|
MintHealthTracker,
|
|
@@ -61,27 +61,27 @@ import {
|
|
|
61
61
|
verifyUpfrontPayment,
|
|
62
62
|
x402RequiredUsdcMicro,
|
|
63
63
|
x402SettledShare
|
|
64
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-ZJRGORJ3.js";
|
|
65
65
|
import "../chunk-XRLKGCAW.js";
|
|
66
66
|
import {
|
|
67
67
|
PayoutReporter
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-2I6NXIPG.js";
|
|
69
69
|
import {
|
|
70
70
|
settleWithFacilitator,
|
|
71
71
|
verifyWithFacilitator
|
|
72
|
-
} from "../chunk-
|
|
73
|
-
import "../chunk-
|
|
74
|
-
import "../chunk-
|
|
72
|
+
} from "../chunk-I2H2XYQV.js";
|
|
73
|
+
import "../chunk-33J3NQDZ.js";
|
|
74
|
+
import "../chunk-YMMCRQ2H.js";
|
|
75
75
|
import {
|
|
76
76
|
SIGNED_ENVELOPE_FIELDS,
|
|
77
77
|
SIGNED_ENVELOPE_TYPES,
|
|
78
78
|
createDefaultReplayStore,
|
|
79
79
|
humanizeZodError
|
|
80
|
-
} from "../chunk-
|
|
80
|
+
} from "../chunk-ZO2ZAPG3.js";
|
|
81
81
|
import {
|
|
82
82
|
createInstrumentedFetch,
|
|
83
83
|
isStaleJobReapable
|
|
84
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-PKLNMMKF.js";
|
|
85
85
|
import {
|
|
86
86
|
JobCancelledError,
|
|
87
87
|
abortJob,
|
|
@@ -90,17 +90,17 @@ import {
|
|
|
90
90
|
isYieldMessage,
|
|
91
91
|
providerMessage,
|
|
92
92
|
toJobRecord
|
|
93
|
-
} from "../chunk-
|
|
93
|
+
} from "../chunk-KVKJ7R5V.js";
|
|
94
94
|
import {
|
|
95
95
|
toLockPubkey
|
|
96
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-LZFZGY7L.js";
|
|
97
97
|
import "../chunk-62FI3NJF.js";
|
|
98
98
|
import "../chunk-SXL44PL5.js";
|
|
99
|
-
import "../chunk-
|
|
99
|
+
import "../chunk-7NZRJPEP.js";
|
|
100
100
|
import "../chunk-FUJ36YDV.js";
|
|
101
101
|
import "../chunk-BQJIFRAZ.js";
|
|
102
|
-
import "../chunk-
|
|
103
|
-
import "../chunk-
|
|
102
|
+
import "../chunk-CRH6BMMG.js";
|
|
103
|
+
import "../chunk-CVT5LTAK.js";
|
|
104
104
|
import {
|
|
105
105
|
NON_CHANNEL_BITCOIN_RAILS,
|
|
106
106
|
depleteLots,
|
|
@@ -110,20 +110,20 @@ import {
|
|
|
110
110
|
isNonChannelBitcoinRail,
|
|
111
111
|
lotOwedSats,
|
|
112
112
|
netOwedSats
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-LM6E4YHQ.js";
|
|
114
114
|
import "../chunk-YG7G4DPZ.js";
|
|
115
115
|
import "../chunk-COYKJRMM.js";
|
|
116
116
|
import "../chunk-5UC7TOQC.js";
|
|
117
|
-
import "../chunk-
|
|
117
|
+
import "../chunk-FOXGN4KQ.js";
|
|
118
118
|
import "../chunk-BPYMEMQX.js";
|
|
119
119
|
import "../chunk-H3GGFEE5.js";
|
|
120
120
|
import {
|
|
121
121
|
_testing,
|
|
122
122
|
wrapMppx
|
|
123
|
-
} from "../chunk-
|
|
124
|
-
import "../chunk-
|
|
123
|
+
} from "../chunk-GB2N4NG5.js";
|
|
124
|
+
import "../chunk-R7FH7SHX.js";
|
|
125
125
|
import "../chunk-66HGCPBU.js";
|
|
126
|
-
import "../chunk-
|
|
126
|
+
import "../chunk-BAHZK334.js";
|
|
127
127
|
export {
|
|
128
128
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
129
129
|
JobCancelledError,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { a7 as Message, O as UpfrontPayment, al as FundingMethod, a1 as FundingReceipt, bX as CreditSnapshot, a2 as JobReceipt, aA as StepRecord, a3 as MessageType } from './step-cache-BCRHimiY.js';
|
|
1
2
|
import { ProofLike } from '@cashu/cashu-ts';
|
|
2
|
-
import { a6 as Message, ak as FundingMethod, a0 as FundingReceipt, bW as CreditSnapshot, a1 as JobReceipt, az as StepRecord, a2 as MessageType } from './step-cache-CoORQQ_Y.js';
|
|
3
3
|
|
|
4
4
|
type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
|
|
5
5
|
interface JobRecord {
|
|
@@ -69,6 +69,8 @@ interface JobRecord {
|
|
|
69
69
|
summary?: string;
|
|
70
70
|
messages: Message[];
|
|
71
71
|
seq: number;
|
|
72
|
+
/** Original acceptance snapshot; absent for historical records. INSERT-only. */
|
|
73
|
+
upfrontPayment?: UpfrontPayment;
|
|
72
74
|
paidMsats: number;
|
|
73
75
|
paymentMint?: string;
|
|
74
76
|
/** Rail of the most recent successful credit (cashu / x402 / tempo). */
|
|
@@ -357,6 +359,13 @@ interface JobStore {
|
|
|
357
359
|
* durable caller/fingerprint/job binding remains retained.
|
|
358
360
|
*/
|
|
359
361
|
releaseRequestIdClaim?(claim: RequestIdClaim): Promise<void>;
|
|
362
|
+
/**
|
|
363
|
+
* Durably add a completed step, including its costs, without rewriting the job snapshot.
|
|
364
|
+
* Existing step ids keep their first stored record. Implementations must preserve
|
|
365
|
+
* these records in later snapshots and reject missing, terminal or redacted jobs.
|
|
366
|
+
* Stores without this method retain yield-time step persistence.
|
|
367
|
+
*/
|
|
368
|
+
saveStep?(jobId: string, record: StepRecord): Promise<void>;
|
|
360
369
|
save(record: JobRecord): Promise<void>;
|
|
361
370
|
delete(id: string): Promise<void>;
|
|
362
371
|
}
|
|
@@ -503,8 +512,14 @@ interface StreamableJobStore extends JobStore {
|
|
|
503
512
|
* re-read counters when cross-machine credit lands.
|
|
504
513
|
*/
|
|
505
514
|
subscribeNotifications(jobId: string, onNotify: () => void): Promise<() => void>;
|
|
506
|
-
/**
|
|
507
|
-
|
|
515
|
+
/**
|
|
516
|
+
* Read verified history without advancing past a pending payment. Terminal
|
|
517
|
+
* output releases the cutoff. Snapshot reconstruction uses includeHeld to
|
|
518
|
+
* retain every verified message, independently of incremental delivery.
|
|
519
|
+
*/
|
|
520
|
+
getMessages(jobId: string, afterSeq: number, options?: {
|
|
521
|
+
includeHeld?: boolean;
|
|
522
|
+
}): Promise<Message[]>;
|
|
508
523
|
/**
|
|
509
524
|
* Find stale non-terminal jobs. Two status-aware
|
|
510
525
|
* cutoffs (both Unix ms): `processing`/`working` rows older than
|
|
@@ -530,7 +545,10 @@ interface StreamableJobStore extends JobStore {
|
|
|
530
545
|
* lands when the job is still non-terminal AND `last_activity_at <=
|
|
531
546
|
* expectedActivityBefore`. Returns true when this caller claimed the
|
|
532
547
|
* transition, false when another machine got there first OR the job's
|
|
533
|
-
* activity bumped (recovered).
|
|
548
|
+
* activity bumped (recovered). Caller cancellations additionally require a
|
|
549
|
+
* row whose outstanding stamped deadline has elapsed;
|
|
550
|
+
* processing failures remain governed by the activity cutoff.
|
|
551
|
+
* Mirrors `save`'s terminal cleanup by
|
|
534
552
|
* deleting incremental `job_messages` rows once the snapshot is final.
|
|
535
553
|
*/
|
|
536
554
|
cancelStaleJob(jobId: string, expectedActivityBefore: number, reason: string, terminalStatus: "failed" | "cancelled"): Promise<boolean>;
|