@dvmkit/sdk 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JQ2Z3MIC.js → chunk-34H4ZKBM.js} +1 -1
- package/dist/{chunk-WMGXJQI3.js → chunk-5RGZN6WQ.js} +1 -1
- package/dist/{chunk-Y6JJDOGO.js → chunk-6RJAE332.js} +17 -7
- package/dist/{chunk-3KRFFLAT.js → chunk-C65P6MGZ.js} +1 -1
- package/dist/{chunk-AYEBQDAZ.js → chunk-DJRTYBEE.js} +1 -1
- package/dist/{chunk-B6T3FEVX.js → chunk-I5MXADJS.js} +1 -1
- package/dist/{chunk-IKMRT7O5.js → chunk-INYFUPXV.js} +1 -0
- package/dist/{chunk-62FI3NJF.js → chunk-NUDHO4HV.js} +4 -2
- package/dist/{chunk-VKFR5PCW.js → chunk-OTNHKRHA.js} +2 -2
- package/dist/{chunk-A6EY4K46.js → chunk-QCZXKUS2.js} +45 -13
- package/dist/{chunk-QNAYENWA.js → chunk-RPJKEWRR.js} +14050 -13530
- package/dist/{content-retention-Cxn-umvR.d.ts → content-retention-C_TToHCi.d.ts} +1 -1
- package/dist/{credit-ledger-SBLDJCLE.js → credit-ledger-ZCJXJG6R.js} +2 -2
- package/dist/{credit-menu-CYjp3FA3.d.ts → credit-menu-BlODG4E7.d.ts} +144 -6
- package/dist/{fx-D2w3wCvY.d.ts → fx-QoVA2oBc.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +14 -1
- package/dist/internal/caller.d.ts +6 -6
- package/dist/internal/caller.js +3 -3
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +10 -10
- package/dist/{job-store-Ci2ihiVr.d.ts → job-store-D4-18IKm.d.ts} +5 -1
- package/dist/{lightning-backend-DMBY7PaJ.d.ts → lightning-backend-B2wMBR-x.d.ts} +1 -1
- package/dist/{memory-credit-ledger-DMIGIH2H.js → memory-credit-ledger-N4PZKTT5.js} +3 -3
- package/dist/{postgres-job-store-E5GXLRB4.js → postgres-job-store-QKN5LGAH.js} +1 -1
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +12 -12
- package/dist/{step-cache-B_18RAPb.d.ts → step-cache-B83Y9T9p.d.ts} +31 -8
- package/dist/{tempo-session-store-N3TFZ26X.js → tempo-session-store-XJE6GIXN.js} +2 -2
- package/dist/testing/index.d.ts +5 -3
- package/dist/testing/index.js +1 -1
- package/dist/{usd-ROzdYbbm.d.ts → usd-g9kCw86F.d.ts} +1 -1
- package/dist/{x402-HVCUEWWU.js → x402-XLFD43RF.js} +4 -4
- package/package.json +2 -2
package/dist/server/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ai as CashuMode, bT as CreditLedgerQuerier, bU as CreditDrainEnqueue, bV as HostedSettlementReportObligations, w as ResolvedCreditConfig, bW as DVMAuthScheme, F as SignedRequestDomain, bX as CreditLedgerLike, bY as X402RefundSettlementGate, bZ as CreditSnapshot, b_ as CreditDrawRefundArgs, b$ as CreditDrawRefundResult, c0 as DrawResult, c1 as X402SettlementStatus, c2 as X402UnresolvedRefund, c3 as GrownDrawResult, c4 as DrawResolution, c5 as FundingRecord, c6 as CreditFundingEvidence, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, c9 as BlockedInvoiceCursor, ca as InvoiceReconciliation, cb as InvoiceWriteOff, cc as DrawRecord, cd as StalePendingDrawCursor, ce as TempoCreditLossEvidence, cf as TempoCreditLoss, cg as X402CreditLossEvidence, ch as X402CreditLoss, ci as DrainMethod, cj as DrainRequestResult, ck as BitcoinDepositLiability, bx as FundingLot, cl as CreditDrainRecord, cm as ChannelDrainCursor, cn as DrainWriteOff, co as DrainTransitionResult, cp as DrainReleaseResult, cq as DrainFulfilment, cr as HostingCleanupFence, aC as StepRecord, a4 as JobReceipt, a9 as Message, K as KVStore, M as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-
|
|
2
|
-
export { cs as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ct as ClientCompatibility, cu as ClientCompatibilityEnv, cv as ClientCompatibilityGate, cw as ClientCompatibilityRequirement, cx as ClientSemVer, g as CreateSignedRequestVerifierOpts, cy as CreditFundingBasis, cz as CreditInvoiceStatus, cA as CreditLedger, cB as CreditLedgerError, cC as CreditLedgerErrorCode, cD as CreditLedgerErrorDetails, cE as CreditLedgerPool, cF as CreditStatus, cG as DRAIN_DELIVERY_RESERVE_SATS, cH as DVM_PROTOCOL_VERSION, cI as DrainConflictReason, cJ as DrawRailValue, cK as DrawStatus, cL as HostedTempoCloseReportWriteOff, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cO as PostgresX402ChannelStorage, cP as ReplayStoreBackend, cQ as RevenueSkippedNoRailPayload, cR as RevenueSkippedNoRailReason, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, cS as Secp256k1AuthOpts, E as SignedRequestAudience, G as SignedRequestError, H as SignedRequestFailure, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, cT as TempoDrainDecision, cU as TempoDrainDecisionArgs, cV as TempoDrainDecisionResult, cW as TempoDrainHoldReason, V as UpfrontPayment, cX as X402ChannelStorageOpts, cY as X402RelayLockHolder, cZ as X402RelaySubmissionLock, c_ as X402RelaySubmissionLockError, c$ as allocateDrawValue, d0 as clientCompatibilityAttributes, d1 as clientCompatibilityMiddleware, d2 as clientUpgradeRequired, W as createSignedRequestVerifier, d3 as parseClientCapabilities, d4 as parseClientCompatibility, d5 as parseDvmClient, d6 as parseProtocolVersion, d7 as requireClientCompatibility, d8 as retryHostedTempoCloseReport, d9 as secp256k1Auth, da as signedRequestInput, Y as signedRequestStatementHeader, db as writeOffHostedTempoCloseReport } from '../step-cache-
|
|
1
|
+
import { ai as CashuMode, bT as CreditLedgerQuerier, bU as CreditDrainEnqueue, bV as HostedSettlementReportObligations, w as ResolvedCreditConfig, bW as DVMAuthScheme, F as SignedRequestDomain, bX as CreditLedgerLike, bY as X402RefundSettlementGate, bZ as CreditSnapshot, b_ as CreditDrawRefundArgs, b$ as CreditDrawRefundResult, c0 as DrawResult, c1 as X402SettlementStatus, c2 as X402UnresolvedRefund, c3 as GrownDrawResult, c4 as DrawResolution, c5 as FundingRecord, c6 as CreditFundingEvidence, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, c9 as BlockedInvoiceCursor, ca as InvoiceReconciliation, cb as InvoiceWriteOff, cc as DrawRecord, cd as StalePendingDrawCursor, ce as TempoCreditLossEvidence, cf as TempoCreditLoss, cg as X402CreditLossEvidence, ch as X402CreditLoss, ci as DrainMethod, cj as DrainRequestResult, ck as BitcoinDepositLiability, bx as FundingLot, cl as CreditDrainRecord, cm as ChannelDrainCursor, cn as DrainWriteOff, co as DrainTransitionResult, cp as DrainReleaseResult, cq as DrainFulfilment, cr as HostingCleanupFence, aC as StepRecord, a4 as JobReceipt, a9 as Message, K as KVStore, M as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-B83Y9T9p.js';
|
|
2
|
+
export { cs as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ct as ClientCompatibility, cu as ClientCompatibilityEnv, cv as ClientCompatibilityGate, cw as ClientCompatibilityRequirement, cx as ClientSemVer, g as CreateSignedRequestVerifierOpts, cy as CreditFundingBasis, cz as CreditInvoiceStatus, cA as CreditLedger, cB as CreditLedgerError, cC as CreditLedgerErrorCode, cD as CreditLedgerErrorDetails, cE as CreditLedgerPool, cF as CreditStatus, cG as DRAIN_DELIVERY_RESERVE_SATS, cH as DVM_PROTOCOL_VERSION, cI as DrainConflictReason, cJ as DrawRailValue, cK as DrawStatus, cL as HostedTempoCloseReportWriteOff, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cO as PostgresX402ChannelStorage, cP as ReplayStoreBackend, cQ as RevenueSkippedNoRailPayload, cR as RevenueSkippedNoRailReason, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, cS as Secp256k1AuthOpts, E as SignedRequestAudience, G as SignedRequestError, H as SignedRequestFailure, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, cT as TempoDrainDecision, cU as TempoDrainDecisionArgs, cV as TempoDrainDecisionResult, cW as TempoDrainHoldReason, V as UpfrontPayment, cX as X402ChannelStorageOpts, cY as X402RelayLockHolder, cZ as X402RelaySubmissionLock, c_ as X402RelaySubmissionLockError, c$ as allocateDrawValue, d0 as clientCompatibilityAttributes, d1 as clientCompatibilityMiddleware, d2 as clientUpgradeRequired, W as createSignedRequestVerifier, d3 as parseClientCapabilities, d4 as parseClientCompatibility, d5 as parseDvmClient, d6 as parseProtocolVersion, d7 as requireClientCompatibility, d8 as retryHostedTempoCloseReport, d9 as secp256k1Auth, da as signedRequestInput, Y as signedRequestStatementHeader, db as writeOffHostedTempoCloseReport } from '../step-cache-B83Y9T9p.js';
|
|
3
3
|
import { Pool } from 'pg';
|
|
4
|
-
import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-
|
|
5
|
-
export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-
|
|
4
|
+
import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-BlODG4E7.js';
|
|
5
|
+
export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-BlODG4E7.js';
|
|
6
6
|
import { Context, Hono } from 'hono';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { F as FxFetcher } from '../fx-
|
|
9
|
-
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters, b as JobStore } from '../job-store-
|
|
10
|
-
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-
|
|
11
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
12
|
-
export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-
|
|
8
|
+
import { F as FxFetcher } from '../fx-QoVA2oBc.js';
|
|
9
|
+
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters, b as JobStore } from '../job-store-D4-18IKm.js';
|
|
10
|
+
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-D4-18IKm.js';
|
|
11
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-C_TToHCi.js';
|
|
12
|
+
export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-C_TToHCi.js';
|
|
13
13
|
export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from '../ssrf-dMooihtY.js';
|
|
14
14
|
import { Env, BlankSchema } from 'hono/types';
|
|
15
15
|
import 'mppx';
|
|
@@ -17,7 +17,7 @@ import '@x402/core/server';
|
|
|
17
17
|
import '@x402/evm/batch-settlement/server';
|
|
18
18
|
import '@x402/core/types';
|
|
19
19
|
import 'viem';
|
|
20
|
-
import '../lightning-backend-
|
|
20
|
+
import '../lightning-backend-B2wMBR-x.js';
|
|
21
21
|
import '@cashu/cashu-ts';
|
|
22
22
|
|
|
23
23
|
/** Default lifetime of a per-call implicit credit: 90 days before the ledger refuses new draws. */
|
|
@@ -472,6 +472,7 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
|
|
|
472
472
|
heartbeatActiveJobs(jobIds: string[], now: number): Promise<void>;
|
|
473
473
|
cancelStaleJob(jobId: string, expectedActivityBefore: number, reason: string, terminalStatus: "failed" | "cancelled"): Promise<boolean>;
|
|
474
474
|
cancelJob(jobId: string, reason: string): Promise<boolean>;
|
|
475
|
+
failJob(jobId: string, reason: string): Promise<boolean>;
|
|
475
476
|
cancelJobForHosting(jobId: string, reason: string): Promise<boolean>;
|
|
476
477
|
getCounters(jobId: string): Promise<JobCounters | undefined>;
|
|
477
478
|
claimForProcessing(jobId: string): Promise<boolean>;
|
package/dist/server/index.js
CHANGED
|
@@ -82,20 +82,20 @@ import {
|
|
|
82
82
|
toCreditView,
|
|
83
83
|
unknownRouteNotFound,
|
|
84
84
|
writeOffHostedTempoCloseReport
|
|
85
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-RPJKEWRR.js";
|
|
86
86
|
import {
|
|
87
87
|
MemoryProcessedPaymentStore,
|
|
88
88
|
PostgresProcessedPaymentStore,
|
|
89
89
|
ProcessedPaymentReplayError
|
|
90
90
|
} from "../chunk-XRLKGCAW.js";
|
|
91
91
|
import "../chunk-KRX7VNBG.js";
|
|
92
|
-
import "../chunk-
|
|
92
|
+
import "../chunk-C65P6MGZ.js";
|
|
93
93
|
import {
|
|
94
94
|
MemoryCreditLedger
|
|
95
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-DJRTYBEE.js";
|
|
96
96
|
import {
|
|
97
97
|
PostgresJobStore
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-QCZXKUS2.js";
|
|
99
99
|
import {
|
|
100
100
|
SignedRequestError,
|
|
101
101
|
createDefaultReplayStore,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
} from "../chunk-MXESSBXF.js";
|
|
105
105
|
import {
|
|
106
106
|
isStreamableJobStore
|
|
107
|
-
} from "../chunk-
|
|
107
|
+
} from "../chunk-6RJAE332.js";
|
|
108
108
|
import {
|
|
109
109
|
ContentHoldError,
|
|
110
110
|
baselineContentExpiry,
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
X402_DEFAULT_NETWORK,
|
|
122
122
|
resolveRpcOverride,
|
|
123
123
|
x402NetworkToCaip2
|
|
124
|
-
} from "../chunk-
|
|
124
|
+
} from "../chunk-NUDHO4HV.js";
|
|
125
125
|
import {
|
|
126
126
|
SIGNED_REQUEST_AUTH_ID,
|
|
127
127
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
PostgresX402ChannelStorage,
|
|
140
140
|
X402RelaySubmissionLockError,
|
|
141
141
|
allocateDrawValue
|
|
142
|
-
} from "../chunk-
|
|
142
|
+
} from "../chunk-I5MXADJS.js";
|
|
143
143
|
import "../chunk-YG7G4DPZ.js";
|
|
144
144
|
import {
|
|
145
145
|
SDK_INIT_ADVISORY_LOCK,
|
|
@@ -148,7 +148,7 @@ import {
|
|
|
148
148
|
import "../chunk-5UC7TOQC.js";
|
|
149
149
|
import {
|
|
150
150
|
applyRetryToPool
|
|
151
|
-
} from "../chunk-
|
|
151
|
+
} from "../chunk-INYFUPXV.js";
|
|
152
152
|
import {
|
|
153
153
|
assertSupportedX402Network
|
|
154
154
|
} from "../chunk-BPYMEMQX.js";
|
|
@@ -1193,7 +1193,7 @@ function createDVMHost(opts = {}) {
|
|
|
1193
1193
|
});
|
|
1194
1194
|
applyRetryToPool(pool, "dvm-host");
|
|
1195
1195
|
pgPool = pool;
|
|
1196
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1196
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-QKN5LGAH.js");
|
|
1197
1197
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1198
1198
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1199
1199
|
jobStore = pgJobStore;
|
|
@@ -1310,7 +1310,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1310
1310
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1311
1311
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1312
1312
|
] = await Promise.all([
|
|
1313
|
-
import("../tempo-session-store-
|
|
1313
|
+
import("../tempo-session-store-XJE6GIXN.js"),
|
|
1314
1314
|
import("viem/accounts"),
|
|
1315
1315
|
import("viem"),
|
|
1316
1316
|
import("viem/chains")
|
|
@@ -1507,7 +1507,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1507
1507
|
sharedPgConsumedStore = consumedStore;
|
|
1508
1508
|
}
|
|
1509
1509
|
if (pgPool) {
|
|
1510
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1510
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-ZCJXJG6R.js");
|
|
1511
1511
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1512
1512
|
pendingInits.push(pgLedger.init());
|
|
1513
1513
|
creditLedger = pgLedger;
|
|
@@ -1516,7 +1516,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1516
1516
|
pendingInits.push(pgProcessed.init());
|
|
1517
1517
|
processedPayments = pgProcessed;
|
|
1518
1518
|
} else {
|
|
1519
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1519
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-N4PZKTT5.js");
|
|
1520
1520
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1521
1521
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1522
1522
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -384,6 +384,12 @@ interface BuildPaymentRequirementsOpts {
|
|
|
384
384
|
description?: string;
|
|
385
385
|
mimeType?: string;
|
|
386
386
|
version?: X402Version;
|
|
387
|
+
/**
|
|
388
|
+
* Validity window, in seconds, a compliant client gives its authorization.
|
|
389
|
+
* Facilitators do not enforce it; a server that settles after the work must
|
|
390
|
+
* read the signed `validBefore` instead.
|
|
391
|
+
*/
|
|
392
|
+
maxTimeoutSeconds?: number;
|
|
387
393
|
}
|
|
388
394
|
/**
|
|
389
395
|
* V1 carries the resource URL in each requirement; v2 carries it in the outer
|
|
@@ -5467,14 +5473,17 @@ interface Secp256k1AuthOpts {
|
|
|
5467
5473
|
* `nonce` or `auth_statement`) when the job requires a per-call Cashu
|
|
5468
5474
|
* payment, and advertise `["secp256k1-schnorr-v2", "none"]` on `/v1/info#auth`. A body
|
|
5469
5475
|
* carrying any envelope field is verified as before and never falls back.
|
|
5470
|
-
* Unsigned calls take Cashu
|
|
5471
|
-
*
|
|
5472
|
-
*
|
|
5473
|
-
*
|
|
5474
|
-
*
|
|
5475
|
-
*
|
|
5476
|
-
*
|
|
5477
|
-
*
|
|
5476
|
+
* Unsigned calls take Cashu, plus exact x402 on a capability that sets
|
|
5477
|
+
* `maxRuntimeSeconds` when the DVM has Postgres: that payment is verified
|
|
5478
|
+
* before the job and sent for settlement only if the job succeeds, so a
|
|
5479
|
+
* failed or timed-out job costs the payer nothing. Their 402 and mid-job
|
|
5480
|
+
* asks offer no credit menu (mid-job asks offer Cashu alone), and any other
|
|
5481
|
+
* x402 payment, or a Tempo payment, is refused with
|
|
5482
|
+
* `payment_method_requires_signature` before any settlement. A Cashu token is
|
|
5483
|
+
* the payment, so a failed job keeping it is ordinary Cashu behaviour.
|
|
5484
|
+
* Tempo stays signed-only: a push-mode credential is already broadcast when
|
|
5485
|
+
* the DVM sees it. A DVM with neither unsigned rail serves no unsigned
|
|
5486
|
+
* calls. Signed callers keep every rail.
|
|
5478
5487
|
* Unsigned jobs run as the anonymous requester: the handler sees no
|
|
5479
5488
|
* `ctx.auth`, the input omits the envelope fields, prepaid credit and
|
|
5480
5489
|
* `request_id` recovery are refused, a payer whose response is lost recovers
|
|
@@ -6091,6 +6100,16 @@ interface CapabilityConfig<State = Record<string, unknown>, InputSchema extends
|
|
|
6091
6100
|
* change the quote itself.
|
|
6092
6101
|
*/
|
|
6093
6102
|
rates?: CapabilityRate[];
|
|
6103
|
+
/**
|
|
6104
|
+
* Longest this capability's handler may run, in whole seconds (1 to 600).
|
|
6105
|
+
* The SDK fails a job that is still running when the bound passes and aborts
|
|
6106
|
+
* `ctx.signal`. Setting it lets an unsigned caller pay this capability with
|
|
6107
|
+
* x402 on a DVM configured with `secp256k1Auth({ allowUnsignedPaid: true })`
|
|
6108
|
+
* and Postgres: the payment is verified before the job and settled only if
|
|
6109
|
+
* it succeeds, so the bound also sets how long an authorization must stay
|
|
6110
|
+
* valid. Leave it unset for long, multi-step or metered capabilities.
|
|
6111
|
+
*/
|
|
6112
|
+
maxRuntimeSeconds?: number;
|
|
6094
6113
|
/** Handle a newly submitted job for this capability (required). */
|
|
6095
6114
|
onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
|
|
6096
6115
|
/** Handle a client response to a prompt within a job of this capability. */
|
|
@@ -6124,6 +6143,8 @@ interface CapabilityDescriptor<State = unknown, InputSchema extends ZodLike | un
|
|
|
6124
6143
|
readonly onQuote?: QuoteConfig;
|
|
6125
6144
|
/** Rate card published on `/v1/info`. See `CapabilityConfig.rates`. */
|
|
6126
6145
|
readonly rates?: CapabilityRate[];
|
|
6146
|
+
/** Runtime bound in seconds. See `CapabilityConfig.maxRuntimeSeconds`. */
|
|
6147
|
+
readonly maxRuntimeSeconds?: number;
|
|
6127
6148
|
readonly onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
|
|
6128
6149
|
/** Handle a client response to a prompt. */
|
|
6129
6150
|
readonly onResponse?: (ctx: SDKJobContext<State, InputType<InputSchema>>, content: ResponseContent) => void | Promise<void>;
|
|
@@ -6266,6 +6287,8 @@ interface DVMConfig<State = Record<string, unknown>, InputSchema extends ZodLike
|
|
|
6266
6287
|
onQuote?: QuoteConfig;
|
|
6267
6288
|
/** Rate card published on `/v1/info`. Flat shape only — see `CapabilityConfig.rates`. */
|
|
6268
6289
|
rates?: CapabilityRate[];
|
|
6290
|
+
/** Runtime bound in seconds. Flat shape only — see `CapabilityConfig.maxRuntimeSeconds`. */
|
|
6291
|
+
maxRuntimeSeconds?: number;
|
|
6269
6292
|
/** Payment methods this DVM accepts. Default: derived from configured rails — adds "cashu" when `mints` is set, "x402" when `x402` is set, "tempo" when `tempo` is set. */
|
|
6270
6293
|
paymentMethods?: PaymentMethod[];
|
|
6271
6294
|
/** x402 stablecoin payment configuration (provider-side). */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore,
|
|
3
3
|
assertMonotonicTransition
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-34H4ZKBM.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-INYFUPXV.js";
|
|
8
8
|
import "./chunk-ALTE7I6C.js";
|
|
9
9
|
export {
|
|
10
10
|
PostgresTempoSessionStore,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
2
|
-
import { a4 as JobReceipt, a9 as Message, a5 as MessageType, K as KVStore, L as Logger, x as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-
|
|
3
|
-
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-
|
|
1
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-C_TToHCi.js';
|
|
2
|
+
import { a4 as JobReceipt, a9 as Message, a5 as MessageType, K as KVStore, L as Logger, x as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-B83Y9T9p.js';
|
|
3
|
+
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-D4-18IKm.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'mppx';
|
|
6
6
|
import '@x402/core/server';
|
|
@@ -21,6 +21,7 @@ declare class MemoryJobStore implements StreamableJobStore, ReceiptIssuingStore
|
|
|
21
21
|
private data;
|
|
22
22
|
private messages;
|
|
23
23
|
private nextSeq;
|
|
24
|
+
private outgoingAppends;
|
|
24
25
|
private messageSubscribers;
|
|
25
26
|
private notifySubscribers;
|
|
26
27
|
private reactivationLocks;
|
|
@@ -62,6 +63,7 @@ declare class MemoryJobStore implements StreamableJobStore, ReceiptIssuingStore
|
|
|
62
63
|
heartbeatActiveJobs(jobIds: string[], now: number): Promise<void>;
|
|
63
64
|
cancelStaleJob(jobId: string, expectedActivityBefore: number, reason: string, terminalStatus: "failed" | "cancelled"): Promise<boolean>;
|
|
64
65
|
cancelJob(jobId: string, reason: string): Promise<boolean>;
|
|
66
|
+
failJob(jobId: string, reason: string): Promise<boolean>;
|
|
65
67
|
getCounters(jobId: string): Promise<JobCounters | undefined>;
|
|
66
68
|
claimForProcessing(jobId: string): Promise<boolean>;
|
|
67
69
|
tryReactivationLock<T>(jobId: string, fn: () => Promise<T>): Promise<{
|
package/dist/testing/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
generateX402PrivateKey,
|
|
4
4
|
getX402Balance,
|
|
5
5
|
resolveX402Asset
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5RGZN6WQ.js";
|
|
7
7
|
import {
|
|
8
8
|
verifyX402Payment
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-OTNHKRHA.js";
|
|
10
|
+
import "./chunk-C65P6MGZ.js";
|
|
11
11
|
import {
|
|
12
12
|
X402_DEFAULT_FACILITATOR,
|
|
13
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
paymentRequiredV2FromV1,
|
|
27
27
|
usdcContractByCaip2,
|
|
28
28
|
x402NetworkToCaip2
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-NUDHO4HV.js";
|
|
30
30
|
import "./chunk-FUJ36YDV.js";
|
|
31
31
|
import {
|
|
32
32
|
X402_NETWORKS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"description": "SDK for building Digital Vending Machines: pay-per-use HTTPS services AI agents can find, pay, and call with no account or API key",
|
|
5
5
|
"author": "DVM Technologies Ltd",
|
|
6
6
|
"keywords": [
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"hono": "4.13.14",
|
|
93
93
|
"jose": "6.2.1",
|
|
94
94
|
"mppx": "0.8.15",
|
|
95
|
-
"nostr-tools": "2.
|
|
95
|
+
"nostr-tools": "2.25.4",
|
|
96
96
|
"proper-lockfile": "4.1.2",
|
|
97
97
|
"undici": "7.30.1",
|
|
98
98
|
"ws": "8.21.0",
|