@dvmkit/sdk 0.14.0 → 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-TVI4V7GF.js → chunk-LBMHV2DK.js} +80 -19
- 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 +13 -6
- package/dist/internal/caller.d.ts +14 -8
- 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 +29 -29
- 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
package/dist/server/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { af as CashuMode, bQ as CreditLedgerQuerier, bR as CreditDrainEnqueue, bS as HostedSettlementReportObligations, R as ResolvedCreditConfig, bT as DVMAuthScheme, B as SignedRequestDomain, bU as CreditLedgerLike, bV as X402RefundSettlementGate, bW as CreditSnapshot, bX as CreditDrawRefundArgs, bY as CreditDrawRefundResult, bZ as DrawResult, b_ as X402SettlementStatus, b$ as X402UnresolvedRefund, c0 as GrownDrawResult, c1 as DrawResolution, c2 as FundingRecord, c3 as CreditFundingEvidence, c4 as CreditInvoiceRecord, c5 as InvoiceSettlement, c6 as BlockedInvoiceCursor, c7 as InvoiceReconciliation, c8 as InvoiceWriteOff, c9 as DrawRecord, ca as StalePendingDrawCursor, cb as TempoCreditLossEvidence, cc as TempoCreditLoss, cd as X402CreditLossEvidence, ce as X402CreditLoss, cf as DrainMethod, cg as DrainRequestResult, ch as BitcoinDepositLiability, bu as FundingLot, ci as CreditDrainRecord, cj as ChannelDrainCursor, ck as DrainWriteOff, cl as DrainTransitionResult, cm as DrainReleaseResult, cn as DrainFulfilment, co as HostingCleanupFence, a1 as JobReceipt, a6 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-
|
|
2
|
-
export { cp as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, cq as ClientCompatibility, cr as ClientCompatibilityEnv, cs as ClientCompatibilityGate, ct as ClientCompatibilityRequirement, cu as ClientSemVer, f as CreateSignedRequestVerifierOpts, cv as CreditFundingBasis, cw as CreditInvoiceStatus, cx as CreditLedger, cy as CreditLedgerError, cz as CreditLedgerErrorCode, cA as CreditLedgerErrorDetails, cB as CreditLedgerPool, cC as CreditStatus, cD as DRAIN_DELIVERY_RESERVE_SATS, cE as DVM_PROTOCOL_VERSION, cF as DrainConflictReason, cG as DrawRailValue, cH as DrawStatus, cI as HostedTempoCloseReportWriteOff, cJ as JobCostReportPayload, cK as JobTerminalReportPayload, cL as PostgresX402ChannelStorage, cM as ReplayStoreBackend, cN as RevenueSkippedNoRailPayload, cO as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cP as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cQ as TempoDrainDecision, cR as TempoDrainDecisionArgs, cS as TempoDrainDecisionResult, cT as TempoDrainHoldReason, cU as X402ChannelStorageOpts, cV as X402RelayLockHolder, cW as X402RelaySubmissionLock, cX as X402RelaySubmissionLockError, cY as allocateDrawValue, cZ as clientCompatibilityAttributes, c_ as clientCompatibilityMiddleware, c$ as clientUpgradeRequired, O as createSignedRequestVerifier, d0 as parseClientCapabilities, d1 as parseClientCompatibility, d2 as parseDvmClient, d3 as parseProtocolVersion, d4 as requireClientCompatibility, d5 as retryHostedTempoCloseReport, d6 as secp256k1Auth, d7 as signedRequestInput, V as signedRequestStatementHeader, d8 as writeOffHostedTempoCloseReport } from '../step-cache-
|
|
1
|
+
import { af as CashuMode, bQ as CreditLedgerQuerier, bR as CreditDrainEnqueue, bS as HostedSettlementReportObligations, R as ResolvedCreditConfig, bT as DVMAuthScheme, B as SignedRequestDomain, bU as CreditLedgerLike, bV as X402RefundSettlementGate, bW as CreditSnapshot, bX as CreditDrawRefundArgs, bY as CreditDrawRefundResult, bZ as DrawResult, b_ as X402SettlementStatus, b$ as X402UnresolvedRefund, c0 as GrownDrawResult, c1 as DrawResolution, c2 as FundingRecord, c3 as CreditFundingEvidence, c4 as CreditInvoiceRecord, c5 as InvoiceSettlement, c6 as BlockedInvoiceCursor, c7 as InvoiceReconciliation, c8 as InvoiceWriteOff, c9 as DrawRecord, ca as StalePendingDrawCursor, cb as TempoCreditLossEvidence, cc as TempoCreditLoss, cd as X402CreditLossEvidence, ce as X402CreditLoss, cf as DrainMethod, cg as DrainRequestResult, ch as BitcoinDepositLiability, bu as FundingLot, ci as CreditDrainRecord, cj as ChannelDrainCursor, ck as DrainWriteOff, cl as DrainTransitionResult, cm as DrainReleaseResult, cn as DrainFulfilment, co as HostingCleanupFence, az as StepRecord, a1 as JobReceipt, a6 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-MA3hpa7F.js';
|
|
2
|
+
export { cp as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, cq as ClientCompatibility, cr as ClientCompatibilityEnv, cs as ClientCompatibilityGate, ct as ClientCompatibilityRequirement, cu as ClientSemVer, f as CreateSignedRequestVerifierOpts, cv as CreditFundingBasis, cw as CreditInvoiceStatus, cx as CreditLedger, cy as CreditLedgerError, cz as CreditLedgerErrorCode, cA as CreditLedgerErrorDetails, cB as CreditLedgerPool, cC as CreditStatus, cD as DRAIN_DELIVERY_RESERVE_SATS, cE as DVM_PROTOCOL_VERSION, cF as DrainConflictReason, cG as DrawRailValue, cH as DrawStatus, cI as HostedTempoCloseReportWriteOff, cJ as JobCostReportPayload, cK as JobTerminalReportPayload, cL as PostgresX402ChannelStorage, cM as ReplayStoreBackend, cN as RevenueSkippedNoRailPayload, cO as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cP as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cQ as TempoDrainDecision, cR as TempoDrainDecisionArgs, cS as TempoDrainDecisionResult, cT as TempoDrainHoldReason, cU as X402ChannelStorageOpts, cV as X402RelayLockHolder, cW as X402RelaySubmissionLock, cX as X402RelaySubmissionLockError, cY as allocateDrawValue, cZ as clientCompatibilityAttributes, c_ as clientCompatibilityMiddleware, c$ as clientUpgradeRequired, O as createSignedRequestVerifier, d0 as parseClientCapabilities, d1 as parseClientCompatibility, d2 as parseDvmClient, d3 as parseProtocolVersion, d4 as requireClientCompatibility, d5 as retryHostedTempoCloseReport, d6 as secp256k1Auth, d7 as signedRequestInput, V as signedRequestStatementHeader, d8 as writeOffHostedTempoCloseReport } from '../step-cache-MA3hpa7F.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-BXHL3jHA.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-BXHL3jHA.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-UnO-P6Cj.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-AxjHh5Gp.js';
|
|
10
|
+
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-AxjHh5Gp.js';
|
|
11
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-DA2mlW31.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-DA2mlW31.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-C5_GKiKR.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. */
|
|
@@ -420,6 +420,7 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
|
|
|
420
420
|
resumeRequestId(claim: RequestIdClaim): Promise<RequestIdClaimResult | undefined>;
|
|
421
421
|
private acquireRequestIdClaim;
|
|
422
422
|
releaseRequestIdClaim(claim: RequestIdClaim): Promise<void>;
|
|
423
|
+
saveStep(jobId: string, record: StepRecord): Promise<void>;
|
|
423
424
|
save(record: JobRecord): Promise<void>;
|
|
424
425
|
/** Persist a job while retaining its mount identity for cost-report recovery. */
|
|
425
426
|
saveForDvm(record: JobRecord, dvmId: string): Promise<void>;
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-G47UY3BK.js";
|
|
4
4
|
import {
|
|
5
5
|
PostgresKVStore
|
|
6
6
|
} from "../chunk-V5ZRATJH.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
assertSafeUrl,
|
|
10
10
|
createPinnedFetch,
|
|
11
11
|
envFlag
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-LBMHV2DK.js";
|
|
13
13
|
import {
|
|
14
14
|
HttpTransport,
|
|
15
15
|
NwcBackend,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseNwcUri,
|
|
19
19
|
validateX402Env,
|
|
20
20
|
withNwcPool
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-QRYGBKCR.js";
|
|
22
22
|
import {
|
|
23
23
|
MemoryKVStore
|
|
24
24
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -82,40 +82,40 @@ import {
|
|
|
82
82
|
toCreditView,
|
|
83
83
|
unknownRouteNotFound,
|
|
84
84
|
writeOffHostedTempoCloseReport
|
|
85
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-VG74TVFF.js";
|
|
86
86
|
import {
|
|
87
87
|
MemoryProcessedPaymentStore,
|
|
88
88
|
PostgresProcessedPaymentStore,
|
|
89
89
|
ProcessedPaymentReplayError
|
|
90
90
|
} from "../chunk-XRLKGCAW.js";
|
|
91
|
-
import "../chunk-
|
|
92
|
-
import "../chunk-
|
|
91
|
+
import "../chunk-2I6NXIPG.js";
|
|
92
|
+
import "../chunk-I2H2XYQV.js";
|
|
93
93
|
import {
|
|
94
94
|
MemoryCreditLedger
|
|
95
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-33J3NQDZ.js";
|
|
96
96
|
import {
|
|
97
97
|
PostgresJobStore
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-PJAKJD2U.js";
|
|
99
99
|
import {
|
|
100
100
|
SignedRequestError,
|
|
101
101
|
createDefaultReplayStore,
|
|
102
102
|
createSignedRequestVerifier,
|
|
103
103
|
signedRequestInput
|
|
104
|
-
} from "../chunk-
|
|
104
|
+
} from "../chunk-ZO2ZAPG3.js";
|
|
105
105
|
import {
|
|
106
106
|
isStreamableJobStore
|
|
107
|
-
} from "../chunk-
|
|
107
|
+
} from "../chunk-R3FSW66G.js";
|
|
108
108
|
import {
|
|
109
109
|
ContentHoldError,
|
|
110
110
|
baselineContentExpiry,
|
|
111
111
|
contentMetadata,
|
|
112
112
|
isContentHoldStore
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-FL6Q3JNJ.js";
|
|
114
114
|
import {
|
|
115
115
|
IMPLICIT_CREDIT_TTL_MS,
|
|
116
116
|
generateEphemeralReceiptKey,
|
|
117
117
|
receiptPubkeyFromSecret
|
|
118
|
-
} from "../chunk-
|
|
118
|
+
} from "../chunk-LZFZGY7L.js";
|
|
119
119
|
import {
|
|
120
120
|
X402_DEFAULT_FACILITATOR,
|
|
121
121
|
X402_DEFAULT_NETWORK,
|
|
@@ -127,11 +127,11 @@ import {
|
|
|
127
127
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
128
128
|
signedRequestStatementHeader
|
|
129
129
|
} from "../chunk-SXL44PL5.js";
|
|
130
|
-
import "../chunk-
|
|
130
|
+
import "../chunk-7NZRJPEP.js";
|
|
131
131
|
import "../chunk-FUJ36YDV.js";
|
|
132
132
|
import "../chunk-BQJIFRAZ.js";
|
|
133
|
-
import "../chunk-
|
|
134
|
-
import "../chunk-
|
|
133
|
+
import "../chunk-CRH6BMMG.js";
|
|
134
|
+
import "../chunk-CVT5LTAK.js";
|
|
135
135
|
import {
|
|
136
136
|
CreditLedger,
|
|
137
137
|
CreditLedgerError,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
PostgresX402ChannelStorage,
|
|
140
140
|
X402RelaySubmissionLockError,
|
|
141
141
|
allocateDrawValue
|
|
142
|
-
} from "../chunk-
|
|
142
|
+
} from "../chunk-LM6E4YHQ.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-FOXGN4KQ.js";
|
|
152
152
|
import {
|
|
153
153
|
assertSupportedX402Network
|
|
154
154
|
} from "../chunk-BPYMEMQX.js";
|
|
@@ -159,14 +159,14 @@ import {
|
|
|
159
159
|
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
160
160
|
TempoSettlementReadiness,
|
|
161
161
|
resolveTempoNetwork
|
|
162
|
-
} from "../chunk-
|
|
162
|
+
} from "../chunk-GB2N4NG5.js";
|
|
163
163
|
import {
|
|
164
164
|
initLoggers
|
|
165
|
-
} from "../chunk-
|
|
165
|
+
} from "../chunk-R7FH7SHX.js";
|
|
166
166
|
import "../chunk-66HGCPBU.js";
|
|
167
167
|
import {
|
|
168
168
|
diagnosticConsole
|
|
169
|
-
} from "../chunk-
|
|
169
|
+
} from "../chunk-BAHZK334.js";
|
|
170
170
|
|
|
171
171
|
// src/sdk/server/cashu-env.ts
|
|
172
172
|
async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
@@ -1190,7 +1190,7 @@ function createDVMHost(opts = {}) {
|
|
|
1190
1190
|
});
|
|
1191
1191
|
applyRetryToPool(pool, "dvm-host");
|
|
1192
1192
|
pgPool = pool;
|
|
1193
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1193
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-VDSDXCHR.js");
|
|
1194
1194
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1195
1195
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1196
1196
|
jobStore = pgJobStore;
|
|
@@ -1283,11 +1283,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1283
1283
|
let tempoChargeBackend = "user-supplied";
|
|
1284
1284
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1285
1285
|
if (!mpp && mppTempoRecipient) {
|
|
1286
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1286
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-RG5JDMIO.js");
|
|
1287
1287
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1288
1288
|
let tempoCharge;
|
|
1289
1289
|
if (pgPool) {
|
|
1290
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1290
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-B5SYDCBK.js");
|
|
1291
1291
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1292
1292
|
tempoChargeStore = chargeStore;
|
|
1293
1293
|
pendingInits.push(chargeStore.init());
|
|
@@ -1307,7 +1307,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1307
1307
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1308
1308
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1309
1309
|
] = await Promise.all([
|
|
1310
|
-
import("../tempo-session-store-
|
|
1310
|
+
import("../tempo-session-store-FHW7N22I.js"),
|
|
1311
1311
|
import("viem/accounts"),
|
|
1312
1312
|
import("viem"),
|
|
1313
1313
|
import("viem/chains")
|
|
@@ -1460,7 +1460,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
const fxSource = envMaybe.DVMKIT_FX_SOURCE;
|
|
1463
|
-
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-
|
|
1463
|
+
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-HLYEGPXD.js");
|
|
1464
1464
|
const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
|
|
1465
1465
|
const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
|
|
1466
1466
|
if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
|
|
@@ -1470,7 +1470,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1470
1470
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1471
1471
|
let sharedPgReplayStore;
|
|
1472
1472
|
if (pgPool) {
|
|
1473
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1473
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-3F5FCUXN.js");
|
|
1474
1474
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1475
1475
|
pendingInits.push(store2.init());
|
|
1476
1476
|
sharedPgReplayStore = store2;
|
|
@@ -1498,13 +1498,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1498
1498
|
}
|
|
1499
1499
|
let sharedPgConsumedStore;
|
|
1500
1500
|
if (pgPool) {
|
|
1501
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1501
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-I4WTNVQZ.js");
|
|
1502
1502
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1503
1503
|
pendingInits.push(consumedStore.init());
|
|
1504
1504
|
sharedPgConsumedStore = consumedStore;
|
|
1505
1505
|
}
|
|
1506
1506
|
if (pgPool) {
|
|
1507
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1507
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-EZDZYLSK.js");
|
|
1508
1508
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1509
1509
|
pendingInits.push(pgLedger.init());
|
|
1510
1510
|
creditLedger = pgLedger;
|
|
@@ -1513,7 +1513,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1513
1513
|
pendingInits.push(pgProcessed.init());
|
|
1514
1514
|
processedPayments = pgProcessed;
|
|
1515
1515
|
} else {
|
|
1516
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1516
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-REZGHPJP.js");
|
|
1517
1517
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1518
1518
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1519
1519
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -438,6 +438,8 @@ interface TextContent {
|
|
|
438
438
|
}
|
|
439
439
|
/** Provider prompt requesting input from the requester. */
|
|
440
440
|
interface PromptContent {
|
|
441
|
+
/** Caller response deadline in integer Unix milliseconds; absent on older servers. */
|
|
442
|
+
expires_at_ms?: number;
|
|
441
443
|
id: string;
|
|
442
444
|
text: string;
|
|
443
445
|
options?: string[];
|
|
@@ -467,6 +469,8 @@ interface ArtifactContent {
|
|
|
467
469
|
}
|
|
468
470
|
/** Provider requests payment to continue. */
|
|
469
471
|
interface PaymentRequestContent {
|
|
472
|
+
/** Caller response deadline in integer Unix milliseconds; absent on older servers. */
|
|
473
|
+
expires_at_ms?: number;
|
|
470
474
|
/** Exact outstanding balance charge, in integer micro-units. Use this message’s seq as request_seq. */
|
|
471
475
|
credit?: {
|
|
472
476
|
amount_micro: number;
|
|
@@ -5642,9 +5646,23 @@ interface SDKJobContext<State = Record<string, unknown>, Input = string> {
|
|
|
5642
5646
|
/**
|
|
5643
5647
|
* Cache the result of an async operation for durable replay.
|
|
5644
5648
|
*
|
|
5645
|
-
*
|
|
5646
|
-
*
|
|
5647
|
-
*
|
|
5649
|
+
* With a store supporting per-step writes (including Postgres), the result and
|
|
5650
|
+
* captured costs are persisted before this promise resolves. After three failed
|
|
5651
|
+
* write attempts, the SDK logs `step_persist_failed` and returns the result anyway.
|
|
5652
|
+
* Custom stores without that support persist steps at yield and terminal snapshots;
|
|
5653
|
+
* in-memory stores provide no durability across process death.
|
|
5654
|
+
*
|
|
5655
|
+
* Cached replay skips the body, but execution is at-least-once: a crash during the
|
|
5656
|
+
* body or between its side effect and persistence, or exhausted writes, can repeat
|
|
5657
|
+
* the action. For irreversible actions, use an external idempotency key stable
|
|
5658
|
+
* across replay, or check the external system for a prior result before acting.
|
|
5659
|
+
* @example
|
|
5660
|
+
* ```ts
|
|
5661
|
+
* const stepId = "reserve";
|
|
5662
|
+
* const reservation = await ctx.step(stepId, () =>
|
|
5663
|
+
* instrument.reserve({ idempotencyKey: `${ctx.jobId}:${stepId}` })
|
|
5664
|
+
* );
|
|
5665
|
+
* ```
|
|
5648
5666
|
*/
|
|
5649
5667
|
step<T>(id: string, fn: () => Promise<T>): Promise<T>;
|
|
5650
5668
|
/** Per-job typed state, auto-loaded and auto-persisted. */
|
|
@@ -6097,7 +6115,7 @@ interface DVMConfig<State = Record<string, unknown>, InputSchema extends ZodLike
|
|
|
6097
6115
|
example?: ExampleType<InputSchema>;
|
|
6098
6116
|
/** Per-job state shape and defaults. Flat shape only. */
|
|
6099
6117
|
state?: State;
|
|
6100
|
-
/**
|
|
6118
|
+
/** Caller answer/payment window from emission, in whole seconds (1–604800). Default: 3600. Processing time is excluded. */
|
|
6101
6119
|
idleTimeout?: number;
|
|
6102
6120
|
/**
|
|
6103
6121
|
* Seconds a job may sit in `processing`/`working` with no SDK liveness
|
|
@@ -6270,10 +6288,9 @@ interface StepRecord {
|
|
|
6270
6288
|
/**
|
|
6271
6289
|
* In-memory cache of step results for durable replay.
|
|
6272
6290
|
*
|
|
6273
|
-
*
|
|
6274
|
-
* step
|
|
6275
|
-
*
|
|
6276
|
-
* where they left off.
|
|
6291
|
+
* Completed records are persisted before a step returns when the store supports
|
|
6292
|
+
* per-step writes. serialize() also includes them in yield and terminal snapshots;
|
|
6293
|
+
* deserialize() restores them for replay without repeating completed bodies.
|
|
6277
6294
|
*/
|
|
6278
6295
|
declare class StepCache {
|
|
6279
6296
|
private cache;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoChargeStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P5KQKLWL.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
5
|
import "./chunk-COYKJRMM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-BAHZK334.js";
|
|
7
7
|
export {
|
|
8
8
|
PostgresTempoChargeStore
|
|
9
9
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore,
|
|
3
3
|
assertMonotonicTransition
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RQK7OFJO.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FOXGN4KQ.js";
|
|
8
|
+
import "./chunk-BAHZK334.js";
|
|
9
9
|
export {
|
|
10
10
|
PostgresTempoSessionStore,
|
|
11
11
|
assertMonotonicTransition
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
2
|
-
import { a1 as JobReceipt, a6 as Message, a2 as MessageType, K as KVStore, L as Logger, v 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-DA2mlW31.js';
|
|
2
|
+
import { a1 as JobReceipt, a6 as Message, a2 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-MA3hpa7F.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-AxjHh5Gp.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'mppx';
|
|
6
6
|
import '@x402/core/server';
|
package/dist/testing/index.js
CHANGED
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MemoryJobStore,
|
|
6
6
|
createInstrumentedFetch
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-R3FSW66G.js";
|
|
8
8
|
import {
|
|
9
9
|
JobCancelledError
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-FL6Q3JNJ.js";
|
|
11
11
|
import {
|
|
12
12
|
createNoopLogger
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-7NZRJPEP.js";
|
|
14
14
|
import "../chunk-FUJ36YDV.js";
|
|
15
15
|
import "../chunk-BQJIFRAZ.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-CRH6BMMG.js";
|
|
17
17
|
import {
|
|
18
18
|
validateCurrency
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-CVT5LTAK.js";
|
|
20
|
+
import "../chunk-R7FH7SHX.js";
|
|
21
21
|
import "../chunk-66HGCPBU.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-BAHZK334.js";
|
|
23
23
|
|
|
24
24
|
// src/sdk/testing/test-context.ts
|
|
25
25
|
function createTestContext(opts) {
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-WMGXJQI3.js";
|
|
7
7
|
import {
|
|
8
8
|
verifyX402Payment
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-IUODXRQN.js";
|
|
10
|
+
import "./chunk-I2H2XYQV.js";
|
|
11
11
|
import {
|
|
12
12
|
X402_DEFAULT_FACILITATOR,
|
|
13
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
x402SupportedNetworksHint
|
|
38
38
|
} from "./chunk-BPYMEMQX.js";
|
|
39
39
|
import "./chunk-66HGCPBU.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-BAHZK334.js";
|
|
41
41
|
export {
|
|
42
42
|
X402_DEFAULT_FACILITATOR,
|
|
43
43
|
X402_DEFAULT_NETWORK,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/sdk",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
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": [
|