@dvmkit/sdk 0.14.1 → 0.14.2
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-AFV77S4C.js → chunk-FL6Q3JNJ.js} +25 -0
- 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-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-TWKQFIOW.js → chunk-PJAKJD2U.js} +55 -7
- package/dist/{chunk-M4NFYEEY.js → chunk-QRYGBKCR.js} +1 -1
- package/dist/{chunk-KJZVTWMX.js → chunk-R3FSW66G.js} +15 -4
- package/dist/{chunk-HNXMWHLU.js → chunk-R7FH7SHX.js} +1 -1
- package/dist/{chunk-NS2OMIU7.js → chunk-RQK7OFJO.js} +1 -1
- package/dist/{chunk-JFH34P3M.js → chunk-VG74TVFF.js} +265 -148
- package/dist/{chunk-HULU2UVM.js → chunk-ZO2ZAPG3.js} +1 -1
- package/dist/{content-retention-BcHNpP2F.d.ts → content-retention-DA2mlW31.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-BXHL3jHA.d.ts} +14 -7
- package/dist/{fx-hFlF4Cn8.d.ts → fx-UnO-P6Cj.d.ts} +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +12 -5
- package/dist/internal/caller.d.ts +6 -6
- 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-AxjHh5Gp.d.ts} +12 -2
- package/dist/{lightning-backend-DXNVlVs9.d.ts → lightning-backend-C5_GKiKR.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-VDSDXCHR.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 +11 -10
- package/dist/server/index.js +28 -28
- package/dist/{step-cache-CoORQQ_Y.d.ts → step-cache-MA3hpa7F.d.ts} +25 -8
- 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 +3 -3
- package/dist/testing/index.js +7 -7
- package/dist/{usd-CeXGiyTC.d.ts → usd-CLGrKw9p.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 { co as HostingCleanupFence, d9 as HostedIntent, ak as FundingMethod, p as PaymentMethod, bU as CreditLedgerLike, a6 as Message, a0 as FundingReceipt, bW as CreditSnapshot, a1 as JobReceipt, S as SDKJobContext, ay as StepCache, v as ResponseContent, P as PaymentContent, a2 as MessageType, bp as X402Receipt, aH as X402Config, bo as X402ExactVersionSupport, da as X402SettlementIntent, ac as PaymentRequirementsV2, db as HostedFundingReservation, bQ as CreditLedgerQuerier, dc as X402SettlementCursor, b_ as X402SettlementStatus, dd as X402SettlementWriteOff, bV as X402RefundSettlementGate, de as X402FacilitatorAuth, df as X402BatchSettlementConfig, cL as PostgresX402ChannelStorage, dg as X402PayoutObserver, bS as HostedSettlementReportObligations, bs as CreditDepositPayload, bx as MppxServer, af as CashuMode, dh as CreditDepositEnqueue, di as X402SettlementReconciliationReason, ar as PaymentRequirements, c2 as FundingRecord, a4 as MppxCredential, bZ as DrawResult, cy as CreditLedgerError, a8 as ReceiptCredit, ah as DrainReceiptEvent, a9 as DrainReceipt, $ as DrawFundingReceipt, K as KVStore, z as SignedRequestAudience, dj as CreditDrawReleaseEnqueue, cJ as JobCostReportPayload, cK as JobTerminalReportPayload, cN as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c4 as CreditInvoiceRecord, c5 as InvoiceSettlement, cs as ClientCompatibilityGate, cq as ClientCompatibility, bB as PostgresTempoSessionStore, bA as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-
|
|
1
|
+
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-C5_GKiKR.js';
|
|
2
|
+
import { co as HostingCleanupFence, d9 as HostedIntent, ak as FundingMethod, p as PaymentMethod, bU as CreditLedgerLike, a6 as Message, a0 as FundingReceipt, bW as CreditSnapshot, a1 as JobReceipt, S as SDKJobContext, ay as StepCache, v as ResponseContent, P as PaymentContent, a2 as MessageType, bp as X402Receipt, aH as X402Config, bo as X402ExactVersionSupport, da as X402SettlementIntent, ac as PaymentRequirementsV2, db as HostedFundingReservation, bQ as CreditLedgerQuerier, dc as X402SettlementCursor, b_ as X402SettlementStatus, dd as X402SettlementWriteOff, bV as X402RefundSettlementGate, de as X402FacilitatorAuth, df as X402BatchSettlementConfig, cL as PostgresX402ChannelStorage, dg as X402PayoutObserver, bS as HostedSettlementReportObligations, bs as CreditDepositPayload, bx as MppxServer, af as CashuMode, dh as CreditDepositEnqueue, di as X402SettlementReconciliationReason, ar as PaymentRequirements, c2 as FundingRecord, a4 as MppxCredential, bZ as DrawResult, cy as CreditLedgerError, a8 as ReceiptCredit, ah as DrainReceiptEvent, a9 as DrainReceipt, $ as DrawFundingReceipt, K as KVStore, z as SignedRequestAudience, dj as CreditDrawReleaseEnqueue, cJ as JobCostReportPayload, cK as JobTerminalReportPayload, cN as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c4 as CreditInvoiceRecord, c5 as InvoiceSettlement, cs as ClientCompatibilityGate, cq as ClientCompatibility, bB as PostgresTempoSessionStore, bA as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-MA3hpa7F.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-UnO-P6Cj.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-AxjHh5Gp.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
|
/**
|
|
@@ -3227,7 +3229,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3227
3229
|
* `artifact`'s NOTIFY silently drops the artifact.
|
|
3228
3230
|
*/
|
|
3229
3231
|
private wireMessageAppender;
|
|
3230
|
-
startIdleTimer(job: ServerJob): void;
|
|
3232
|
+
startIdleTimer(job: ServerJob, deadline?: number | undefined): void;
|
|
3231
3233
|
clearIdleTimer(id: string): void;
|
|
3232
3234
|
/** Cancel a job due to idle timeout. Exposed for the reactivation path's idle-expiry guard. */
|
|
3233
3235
|
cancelJobIdle(job: ServerJob): Promise<void>;
|
|
@@ -3236,8 +3238,11 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3236
3238
|
* • `awaiting-input` past `staleJobTimeoutMs` → `cancelled`
|
|
3237
3239
|
* (`stale_no_terminal_status`) — the caller never paid / responded.
|
|
3238
3240
|
* • `processing`/`working` past `processingWatchdogMs` → `failed`
|
|
3239
|
-
* (`worker_died_mid_job`) — the worker died mid-job.
|
|
3240
|
-
*
|
|
3241
|
+
* (`worker_died_mid_job`) — the worker died mid-job. Before claiming a
|
|
3242
|
+
* processing row, skip and heartbeat it if this manager still holds a live
|
|
3243
|
+
* `processing`/`working` job. After a process pause, the sweep may run before
|
|
3244
|
+
* the heartbeat timer; stale activity alone does not prove a local worker
|
|
3245
|
+
* died. Superseded handlers leave `_activeJobs` and receive no protection.
|
|
3241
3246
|
*
|
|
3242
3247
|
* Fires on a timer (wired in the constructor) and also callable on demand
|
|
3243
3248
|
* (tests, ops). The CAS in `cancelStaleJob` makes this safe to run
|
|
@@ -3245,6 +3250,8 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3245
3250
|
* JobManager owns so multi-mount hosts don't steal stuck rows from sibling
|
|
3246
3251
|
* descriptors — the local activeJobs teardown only makes sense on the
|
|
3247
3252
|
* JobManager that actually hosted the zombie handler.
|
|
3253
|
+
* Local liveness prevents this manager's claim; the activity CAS continues
|
|
3254
|
+
* to protect against other machines claiming a row refreshed after find.
|
|
3248
3255
|
*
|
|
3249
3256
|
* **Both cutoffs float off the wall clock.** Each is one
|
|
3250
3257
|
* `Date.now()` sample compared against `last_activity_at`, stamped from a
|
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 createSignedRequestVerifier, T as isZodSchema, V as signedRequestStatementHeader, W as validateCurrency } from './step-cache-
|
|
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-MA3hpa7F.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 createSignedRequestVerifier, T as isZodSchema, V as signedRequestStatementHeader, W as validateCurrency } from './step-cache-MA3hpa7F.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-UnO-P6Cj.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-CLGrKw9p.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-AxjHh5Gp.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 { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-
|
|
2
|
-
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-
|
|
1
|
+
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-C5_GKiKR.js';
|
|
2
|
+
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-C5_GKiKR.js';
|
|
3
3
|
import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
|
|
4
4
|
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-
|
|
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-
|
|
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-MA3hpa7F.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-MA3hpa7F.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-UnO-P6Cj.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-CLGrKw9p.js';
|
|
14
14
|
import 'hono';
|
|
15
15
|
import 'mppx';
|
|
16
16
|
import '@x402/core/server';
|
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 { am as PaymentPayload, ab as PaymentRequirementsV1, ac as PaymentRequirementsV2, aH as X402Config, ax as SettleResponse, aF as VerifyResponse, bo as X402ExactVersionSupport, bp as X402Receipt, bq as TransactionalPayoutHook, br as CashuMeltCompleted } from '../step-cache-
|
|
3
|
-
export { bs as CreditDepositPayload, bt as CreditDrainPayload, bu as FundingLot, bv as LotDebit, bw as LotDepletion, bx as MppxServer, by as NON_CHANNEL_BITCOIN_RAILS, bz as NonChannelBitcoinRail, bA as PayoutReporter, bB as PostgresTempoSessionStore, bC as RevenueReporter, bD as SIGNED_ENVELOPE_FIELDS, bE as SIGNED_ENVELOPE_TYPES, bF as X402TrackedChannel, bG as _testing, bH as createDefaultReplayStore, bI as depleteLots, bJ as fifoOrder, bK as inKindDrawMsats, bL as isInKindDepletion, bM as isNonChannelBitcoinRail, bN as lotOwedSats, bO as netOwedSats, bP as wrapMppx } from '../step-cache-
|
|
2
|
+
import { am as PaymentPayload, ab as PaymentRequirementsV1, ac as PaymentRequirementsV2, aH as X402Config, ax as SettleResponse, aF as VerifyResponse, bo as X402ExactVersionSupport, bp as X402Receipt, bq as TransactionalPayoutHook, br as CashuMeltCompleted } from '../step-cache-MA3hpa7F.js';
|
|
3
|
+
export { bs as CreditDepositPayload, bt as CreditDrainPayload, bu as FundingLot, bv as LotDebit, bw as LotDepletion, bx as MppxServer, by as NON_CHANNEL_BITCOIN_RAILS, bz as NonChannelBitcoinRail, bA as PayoutReporter, bB as PostgresTempoSessionStore, bC as RevenueReporter, bD as SIGNED_ENVELOPE_FIELDS, bE as SIGNED_ENVELOPE_TYPES, bF as X402TrackedChannel, bG as _testing, bH as createDefaultReplayStore, bI as depleteLots, bJ as fifoOrder, bK as inKindDrawMsats, bL as isInKindDepletion, bM as isNonChannelBitcoinRail, bN as lotOwedSats, bO as netOwedSats, bP as wrapMppx } from '../step-cache-MA3hpa7F.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-BXHL3jHA.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-BXHL3jHA.js';
|
|
11
|
+
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-AxjHh5Gp.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-C5_GKiKR.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-UnO-P6Cj.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-VG74TVFF.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-PJAKJD2U.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-R3FSW66G.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-FL6Q3JNJ.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
1
|
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-
|
|
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-MA3hpa7F.js';
|
|
3
3
|
|
|
4
4
|
type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
|
|
5
5
|
interface JobRecord {
|
|
@@ -357,6 +357,13 @@ interface JobStore {
|
|
|
357
357
|
* durable caller/fingerprint/job binding remains retained.
|
|
358
358
|
*/
|
|
359
359
|
releaseRequestIdClaim?(claim: RequestIdClaim): Promise<void>;
|
|
360
|
+
/**
|
|
361
|
+
* Durably add a completed step, including its costs, without rewriting the job snapshot.
|
|
362
|
+
* Existing step ids keep their first stored record. Implementations must preserve
|
|
363
|
+
* these records in later snapshots and reject missing, terminal or redacted jobs.
|
|
364
|
+
* Stores without this method retain yield-time step persistence.
|
|
365
|
+
*/
|
|
366
|
+
saveStep?(jobId: string, record: StepRecord): Promise<void>;
|
|
360
367
|
save(record: JobRecord): Promise<void>;
|
|
361
368
|
delete(id: string): Promise<void>;
|
|
362
369
|
}
|
|
@@ -530,7 +537,10 @@ interface StreamableJobStore extends JobStore {
|
|
|
530
537
|
* lands when the job is still non-terminal AND `last_activity_at <=
|
|
531
538
|
* expectedActivityBefore`. Returns true when this caller claimed the
|
|
532
539
|
* transition, false when another machine got there first OR the job's
|
|
533
|
-
* activity bumped (recovered).
|
|
540
|
+
* activity bumped (recovered). Caller cancellations additionally require a
|
|
541
|
+
* row whose outstanding stamped deadline has elapsed;
|
|
542
|
+
* processing failures remain governed by the activity cutoff.
|
|
543
|
+
* Mirrors `save`'s terminal cleanup by
|
|
534
544
|
* deleting incremental `job_messages` rows once the snapshot is final.
|
|
535
545
|
*/
|
|
536
546
|
cancelStaleJob(jobId: string, expectedActivityBefore: number, reason: string, terminalStatus: "failed" | "cancelled"): Promise<boolean>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemoryCreditLedger
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-33J3NQDZ.js";
|
|
4
|
+
import "./chunk-LM6E4YHQ.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
7
|
import "./chunk-5UC7TOQC.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-FOXGN4KQ.js";
|
|
9
9
|
import "./chunk-BPYMEMQX.js";
|
|
10
10
|
import "./chunk-H3GGFEE5.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-BAHZK334.js";
|
|
12
12
|
export {
|
|
13
13
|
MemoryCreditLedger
|
|
14
14
|
};
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
parseMppMethodsAllowlist,
|
|
21
21
|
resolveTempoNetwork,
|
|
22
22
|
wrapMppx
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-GB2N4NG5.js";
|
|
24
|
+
import "./chunk-R7FH7SHX.js";
|
|
25
25
|
import "./chunk-66HGCPBU.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-BAHZK334.js";
|
|
27
27
|
export {
|
|
28
28
|
MPPX_HMAC_MISMATCH_REASON,
|
|
29
29
|
TEMPO_MAINNET_CHAIN_ID,
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
PayoutReporter,
|
|
5
5
|
PostgresX402BatchStore,
|
|
6
6
|
x402EarnedCeiling
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2I6NXIPG.js";
|
|
8
8
|
import "./chunk-COYKJRMM.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-BAHZK334.js";
|
|
10
10
|
export {
|
|
11
11
|
MemoryX402BatchStore,
|
|
12
12
|
PAYOUT_SNAPSHOT_INTERVAL_MS,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresJobStore
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PJAKJD2U.js";
|
|
4
|
+
import "./chunk-FL6Q3JNJ.js";
|
|
5
5
|
import "./chunk-BQJIFRAZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-BAHZK334.js";
|
|
8
8
|
export {
|
|
9
9
|
PostgresJobStore
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildUpfront
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CRH6BMMG.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_FX_CURRENCIES,
|
|
6
6
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
satsToFiat,
|
|
23
23
|
validateCurrency,
|
|
24
24
|
warmFxSnapshot
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-CVT5LTAK.js";
|
|
26
|
+
import "./chunk-BAHZK334.js";
|
|
27
27
|
export {
|
|
28
28
|
DEFAULT_FX_CURRENCIES,
|
|
29
29
|
DEFAULT_FX_RATE_SOURCE,
|