@dvmkit/sdk 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ITRSITFP.js → chunk-2I6NXIPG.js} +1 -1
- package/dist/{chunk-TKJBUFYY.js → chunk-33J3NQDZ.js} +1 -1
- package/dist/{chunk-7KQLPVV7.js → chunk-7NZRJPEP.js} +1 -1
- package/dist/{chunk-Z4FOPROB.js → chunk-BAHZK334.js} +2 -0
- package/dist/{chunk-D4FFS3IS.js → chunk-CRH6BMMG.js} +1 -1
- package/dist/{chunk-LDKV4UHI.js → chunk-CVT5LTAK.js} +1 -1
- package/dist/{chunk-EP7OVWI5.js → chunk-FOXGN4KQ.js} +1 -1
- package/dist/{chunk-VWIMQ5H5.js → chunk-G47UY3BK.js} +1 -1
- package/dist/{chunk-JLT2YIBS.js → chunk-GB2N4NG5.js} +2 -2
- package/dist/{chunk-E7ZBCT5U.js → chunk-I2H2XYQV.js} +1 -1
- package/dist/{chunk-3YFFZLW7.js → chunk-IUODXRQN.js} +2 -2
- package/dist/{chunk-566CFXGU.js → chunk-IVW5UMD3.js} +1 -1
- package/dist/{chunk-AFV77S4C.js → chunk-KVKJ7R5V.js} +81 -2
- package/dist/{chunk-A2YESDQM.js → chunk-LM6E4YHQ.js} +2 -2
- package/dist/{chunk-5JSPTVIK.js → chunk-LZFZGY7L.js} +1 -1
- package/dist/{chunk-FFRTAQUW.js → chunk-P5KQKLWL.js} +1 -1
- package/dist/{chunk-KJZVTWMX.js → chunk-PKLNMMKF.js} +52 -15
- package/dist/{chunk-M4NFYEEY.js → chunk-QRYGBKCR.js} +1 -1
- package/dist/{chunk-HNXMWHLU.js → chunk-R7FH7SHX.js} +1 -1
- package/dist/{chunk-NS2OMIU7.js → chunk-RQK7OFJO.js} +1 -1
- package/dist/{chunk-TWKQFIOW.js → chunk-YMMCRQ2H.js} +84 -14
- package/dist/{chunk-JFH34P3M.js → chunk-ZJRGORJ3.js} +359 -169
- package/dist/{chunk-HULU2UVM.js → chunk-ZO2ZAPG3.js} +1 -1
- package/dist/{content-retention-BcHNpP2F.d.ts → content-retention-BASsjgKw.d.ts} +1 -1
- package/dist/{credit-ledger-D3UUR2GW.js → credit-ledger-EZDZYLSK.js} +3 -3
- package/dist/{credit-menu-C-kmf61K.d.ts → credit-menu-B239nIY5.d.ts} +23 -9
- package/dist/{fx-hFlF4Cn8.d.ts → fx-BmvWGISH.d.ts} +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +12 -5
- package/dist/internal/caller.d.ts +11 -7
- package/dist/internal/caller.js +7 -7
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +21 -21
- package/dist/{job-store-DVCATwhU.d.ts → job-store-CA7u1nHV.d.ts} +22 -4
- package/dist/{lightning-backend-DXNVlVs9.d.ts → lightning-backend-BOcopzXk.d.ts} +1 -1
- package/dist/{memory-credit-ledger-SCXQO4HZ.js → memory-credit-ledger-REZGHPJP.js} +4 -4
- package/dist/{mpp-setup-JU3MT7QX.js → mpp-setup-RG5JDMIO.js} +3 -3
- package/dist/{payout-reporter-NXWQVKXW.js → payout-reporter-DDQ7FGRC.js} +2 -2
- package/dist/{postgres-consumed-credential-store-WXJLM6J7.js → postgres-consumed-credential-store-I4WTNVQZ.js} +1 -1
- package/dist/{postgres-job-store-ZVMAN6L2.js → postgres-job-store-IXTNWT4K.js} +3 -3
- package/dist/{postgres-replay-store-QJ4FG6AR.js → postgres-replay-store-3F5FCUXN.js} +2 -2
- package/dist/{pricing-KCLENT2C.js → pricing-HLYEGPXD.js} +3 -3
- package/dist/{revenue-reporter-HD4GMXGD.js → revenue-reporter-RIEHBKRA.js} +2 -2
- package/dist/server/index.d.ts +15 -12
- package/dist/server/index.js +28 -28
- package/dist/{step-cache-CoORQQ_Y.d.ts → step-cache-BCRHimiY.d.ts} +48 -9
- package/dist/{tempo-charge-store-7LTUAQHQ.js → tempo-charge-store-B5SYDCBK.js} +2 -2
- package/dist/{tempo-session-store-LYAIDR2B.js → tempo-session-store-FHW7N22I.js} +3 -3
- package/dist/testing/index.d.ts +7 -4
- package/dist/testing/index.js +7 -7
- package/dist/{usd-CeXGiyTC.d.ts → usd-B8_WMfHT.d.ts} +1 -1
- package/dist/{x402-RUJ4LUKF.js → x402-AY6P5KV4.js} +3 -3
- package/package.json +1 -1
|
@@ -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-YMMCRQ2H.js";
|
|
4
|
+
import "./chunk-KVKJ7R5V.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,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ag as CashuMode, bR as CreditLedgerQuerier, bS as CreditDrainEnqueue, bT as HostedSettlementReportObligations, R as ResolvedCreditConfig, bU as DVMAuthScheme, B as SignedRequestDomain, bV as CreditLedgerLike, bW as X402RefundSettlementGate, bX as CreditSnapshot, bY as CreditDrawRefundArgs, bZ as CreditDrawRefundResult, b_ as DrawResult, b$ as X402SettlementStatus, c0 as X402UnresolvedRefund, c1 as GrownDrawResult, c2 as DrawResolution, c3 as FundingRecord, c4 as CreditFundingEvidence, c5 as CreditInvoiceRecord, c6 as InvoiceSettlement, c7 as BlockedInvoiceCursor, c8 as InvoiceReconciliation, c9 as InvoiceWriteOff, ca as DrawRecord, cb as StalePendingDrawCursor, cc as TempoCreditLossEvidence, cd as TempoCreditLoss, ce as X402CreditLossEvidence, cf as X402CreditLoss, cg as DrainMethod, ch as DrainRequestResult, ci as BitcoinDepositLiability, bv as FundingLot, cj as CreditDrainRecord, ck as ChannelDrainCursor, cl as DrainWriteOff, cm as DrainTransitionResult, cn as DrainReleaseResult, co as DrainFulfilment, cp as HostingCleanupFence, aA as StepRecord, a2 as JobReceipt, a7 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-BCRHimiY.js';
|
|
2
|
+
export { cq as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, cr as ClientCompatibility, cs as ClientCompatibilityEnv, ct as ClientCompatibilityGate, cu as ClientCompatibilityRequirement, cv as ClientSemVer, f as CreateSignedRequestVerifierOpts, cw as CreditFundingBasis, cx as CreditInvoiceStatus, cy as CreditLedger, cz as CreditLedgerError, cA as CreditLedgerErrorCode, cB as CreditLedgerErrorDetails, cC as CreditLedgerPool, cD as CreditStatus, cE as DRAIN_DELIVERY_RESERVE_SATS, cF as DVM_PROTOCOL_VERSION, cG as DrainConflictReason, cH as DrawRailValue, cI as DrawStatus, cJ as HostedTempoCloseReportWriteOff, cK as JobCostReportPayload, cL as JobTerminalReportPayload, cM as PostgresX402ChannelStorage, cN as ReplayStoreBackend, cO as RevenueSkippedNoRailPayload, cP as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cQ as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cR as TempoDrainDecision, cS as TempoDrainDecisionArgs, cT as TempoDrainDecisionResult, cU as TempoDrainHoldReason, O as UpfrontPayment, cV as X402ChannelStorageOpts, cW as X402RelayLockHolder, cX as X402RelaySubmissionLock, cY as X402RelaySubmissionLockError, cZ as allocateDrawValue, c_ as clientCompatibilityAttributes, c$ as clientCompatibilityMiddleware, d0 as clientUpgradeRequired, T as createSignedRequestVerifier, d1 as parseClientCapabilities, d2 as parseClientCompatibility, d3 as parseDvmClient, d4 as parseProtocolVersion, d5 as requireClientCompatibility, d6 as retryHostedTempoCloseReport, d7 as secp256k1Auth, d8 as signedRequestInput, W as signedRequestStatementHeader, d9 as writeOffHostedTempoCloseReport } from '../step-cache-BCRHimiY.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-B239nIY5.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-B239nIY5.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-BmvWGISH.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-CA7u1nHV.js';
|
|
10
|
+
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-CA7u1nHV.js';
|
|
11
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-BASsjgKw.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-BASsjgKw.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-BOcopzXk.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. */
|
|
@@ -100,8 +100,8 @@ declare const CREDIT_REQUEST_SCHEMA: z.ZodObject<{
|
|
|
100
100
|
fund_id: z.ZodString;
|
|
101
101
|
commitment: z.ZodOptional<z.ZodString>;
|
|
102
102
|
method: z.ZodOptional<z.ZodEnum<{
|
|
103
|
-
lightning: "lightning";
|
|
104
103
|
tempo: "tempo";
|
|
104
|
+
lightning: "lightning";
|
|
105
105
|
}>>;
|
|
106
106
|
intent: z.ZodOptional<z.ZodEnum<{
|
|
107
107
|
charge: "charge";
|
|
@@ -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>;
|
|
@@ -482,7 +483,9 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
|
|
|
482
483
|
}>;
|
|
483
484
|
subscribeMessages(jobId: string, afterSeq: number, onMessage: (msg: Message) => void): Promise<() => void>;
|
|
484
485
|
subscribeNotifications(jobId: string, onNotify: () => void): Promise<() => void>;
|
|
485
|
-
getMessages(jobId: string, afterSeq: number
|
|
486
|
+
getMessages(jobId: string, afterSeq: number, options?: {
|
|
487
|
+
includeHeld?: boolean;
|
|
488
|
+
}): Promise<Message[]>;
|
|
486
489
|
initStreaming(): Promise<void>;
|
|
487
490
|
shutdownStreaming(): Promise<void>;
|
|
488
491
|
private dispatch;
|
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";
|
|
@@ -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-ZJRGORJ3.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-YMMCRQ2H.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-PKLNMMKF.js";
|
|
108
108
|
import {
|
|
109
109
|
ContentHoldError,
|
|
110
110
|
baselineContentExpiry,
|
|
111
111
|
contentMetadata,
|
|
112
112
|
isContentHoldStore
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-KVKJ7R5V.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-IXTNWT4K.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();
|
|
@@ -7,6 +7,28 @@ import { PaymentPayload as PaymentPayload$1, PaymentRequirements as PaymentRequi
|
|
|
7
7
|
import { Account, Client, Hex } from 'viem';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Original accepted job payment, fixed before handler execution. Snake_case is
|
|
12
|
+
* the wire shape. Absence means unknown, while `amount_msats: 0` is known zero.
|
|
13
|
+
* A credit-backed payment describes a pending hold at acceptance, not fresh
|
|
14
|
+
* funding or final settlement: completion settles it, failure/cancellation
|
|
15
|
+
* releases it. Later draw growth and settlement repricing do not change this fact.
|
|
16
|
+
*/
|
|
17
|
+
interface UpfrontPayment {
|
|
18
|
+
amount_msats: number;
|
|
19
|
+
/** Exact accepted draw in millionths of `currency`, when recorded. */
|
|
20
|
+
amount_micro?: number;
|
|
21
|
+
currency?: string;
|
|
22
|
+
/** Funding rail for a credit hold, or the accepted per-call rail. */
|
|
23
|
+
rail?: "cashu" | "x402" | "tempo" | "lightning";
|
|
24
|
+
/** Allocated rail-native atomic units, distinct from credit denomination. */
|
|
25
|
+
native_amount?: number;
|
|
26
|
+
native_asset?: string;
|
|
27
|
+
/** Together these identify credit consumption; neither is a spending credential. */
|
|
28
|
+
credit_id?: string;
|
|
29
|
+
draw_id?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
10
32
|
/** Auth identifier advertised by DVMs using audience-bound caller proofs. */
|
|
11
33
|
declare const SIGNED_REQUEST_AUTH_ID: "secp256k1-schnorr-v2";
|
|
12
34
|
/** Version of the canonical audience-bound caller statement. */
|
|
@@ -438,6 +460,8 @@ interface TextContent {
|
|
|
438
460
|
}
|
|
439
461
|
/** Provider prompt requesting input from the requester. */
|
|
440
462
|
interface PromptContent {
|
|
463
|
+
/** Caller response deadline in integer Unix milliseconds; absent on older servers. */
|
|
464
|
+
expires_at_ms?: number;
|
|
441
465
|
id: string;
|
|
442
466
|
text: string;
|
|
443
467
|
options?: string[];
|
|
@@ -467,6 +491,8 @@ interface ArtifactContent {
|
|
|
467
491
|
}
|
|
468
492
|
/** Provider requests payment to continue. */
|
|
469
493
|
interface PaymentRequestContent {
|
|
494
|
+
/** Caller response deadline in integer Unix milliseconds; absent on older servers. */
|
|
495
|
+
expires_at_ms?: number;
|
|
470
496
|
/** Exact outstanding balance charge, in integer micro-units. Use this message’s seq as request_seq. */
|
|
471
497
|
credit?: {
|
|
472
498
|
amount_micro: number;
|
|
@@ -5642,9 +5668,23 @@ interface SDKJobContext<State = Record<string, unknown>, Input = string> {
|
|
|
5642
5668
|
/**
|
|
5643
5669
|
* Cache the result of an async operation for durable replay.
|
|
5644
5670
|
*
|
|
5645
|
-
*
|
|
5646
|
-
*
|
|
5647
|
-
*
|
|
5671
|
+
* With a store supporting per-step writes (including Postgres), the result and
|
|
5672
|
+
* captured costs are persisted before this promise resolves. After three failed
|
|
5673
|
+
* write attempts, the SDK logs `step_persist_failed` and returns the result anyway.
|
|
5674
|
+
* Custom stores without that support persist steps at yield and terminal snapshots;
|
|
5675
|
+
* in-memory stores provide no durability across process death.
|
|
5676
|
+
*
|
|
5677
|
+
* Cached replay skips the body, but execution is at-least-once: a crash during the
|
|
5678
|
+
* body or between its side effect and persistence, or exhausted writes, can repeat
|
|
5679
|
+
* the action. For irreversible actions, use an external idempotency key stable
|
|
5680
|
+
* across replay, or check the external system for a prior result before acting.
|
|
5681
|
+
* @example
|
|
5682
|
+
* ```ts
|
|
5683
|
+
* const stepId = "reserve";
|
|
5684
|
+
* const reservation = await ctx.step(stepId, () =>
|
|
5685
|
+
* instrument.reserve({ idempotencyKey: `${ctx.jobId}:${stepId}` })
|
|
5686
|
+
* );
|
|
5687
|
+
* ```
|
|
5648
5688
|
*/
|
|
5649
5689
|
step<T>(id: string, fn: () => Promise<T>): Promise<T>;
|
|
5650
5690
|
/** Per-job typed state, auto-loaded and auto-persisted. */
|
|
@@ -6097,7 +6137,7 @@ interface DVMConfig<State = Record<string, unknown>, InputSchema extends ZodLike
|
|
|
6097
6137
|
example?: ExampleType<InputSchema>;
|
|
6098
6138
|
/** Per-job state shape and defaults. Flat shape only. */
|
|
6099
6139
|
state?: State;
|
|
6100
|
-
/**
|
|
6140
|
+
/** Caller answer/payment window from emission, in whole seconds (1–604800). Default: 3600. Processing time is excluded. */
|
|
6101
6141
|
idleTimeout?: number;
|
|
6102
6142
|
/**
|
|
6103
6143
|
* Seconds a job may sit in `processing`/`working` with no SDK liveness
|
|
@@ -6270,10 +6310,9 @@ interface StepRecord {
|
|
|
6270
6310
|
/**
|
|
6271
6311
|
* In-memory cache of step results for durable replay.
|
|
6272
6312
|
*
|
|
6273
|
-
*
|
|
6274
|
-
* step
|
|
6275
|
-
*
|
|
6276
|
-
* where they left off.
|
|
6313
|
+
* Completed records are persisted before a step returns when the store supports
|
|
6314
|
+
* per-step writes. serialize() also includes them in yield and terminal snapshots;
|
|
6315
|
+
* deserialize() restores them for replay without repeating completed bodies.
|
|
6277
6316
|
*/
|
|
6278
6317
|
declare class StepCache {
|
|
6279
6318
|
private cache;
|
|
@@ -6285,4 +6324,4 @@ declare class StepCache {
|
|
|
6285
6324
|
static deserialize(records: StepRecord[]): StepCache;
|
|
6286
6325
|
}
|
|
6287
6326
|
|
|
6288
|
-
export {
|
|
6327
|
+
export { X402_EXACT_SCHEME as $, type ApprovalContent as A, type SignedRequestDomain as B, type Currency as C, type DVMConfig as D, SignedRequestError as E, type SignedRequestFailure as F, type SignedRequestReplayStore as G, type SignedRequestSignOpts as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestStatementHeader as M, type SignedRequestVerifier as N, type UpfrontPayment as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, createSignedRequestVerifier as T, UnsupportedCurrencyError as U, isZodSchema as V, signedRequestStatementHeader as W, validateCurrency as X, type JsonValue as Y, type ZodLike as Z, X402_BATCH_SETTLEMENT_SCHEME as _, type DVMDescriptor as a, exactEvmAuthorization as a$, type DrawFundingReceipt as a0, type FundingReceipt as a1, type JobReceipt as a2, type MessageType as a3, type X402Version as a4, type MppxCredential as a5, type PaymentRequired as a6, type Message as a7, type MppxChallenge as a8, type ReceiptCredit as a9, type StepRecord as aA, type TextContent as aB, type UnsignedDrainReceipt as aC, type UnsignedDrawFundingReceipt as aD, type UnsignedFundingReceipt as aE, type UnsignedJobReceipt as aF, type VerifyResponse as aG, type WorkingContent as aH, type X402Config$1 as aI, type X402ResponseBody as aJ, type X402SelfRelayRpcFailureReason as aK, X402_DEFAULT_NETWORK as aL, X402_V1_VERSION as aM, X402_VERSION as aN, buildPaymentRequiredV2 as aO, buildPaymentRequirements as aP, caip2ToX402Network as aQ, canonicalRequestPath as aR, canonicaliseForSigning as aS, canonicalize as aT, chainIdFromCaip2 as aU, computeResultHash as aV, decodePayment as aW, decodePaymentRequiredHeader as aX, encodePayment as aY, encodePaymentRequiredHeader as aZ, encodeSettleResponseHeader as a_, type DrainReceipt as aa, type X402Wallet as ab, type PaymentRequirementsV1 as ac, type PaymentRequirementsV2 as ad, type BuildPaymentRequirementsOpts as ae, type CapabilityDescriptor as af, type CashuMode as ag, type CompleteContent as ah, type DrainReceiptEvent as ai, type ExactEvmPayload as aj, type ExactEvmPayloadAuthorization as ak, type FundingMethod as al, type MessageFrom as am, type PaymentPayload as an, type PaymentPayloadV1 as ao, type PaymentPayloadV2 as ap, type PaymentRequestContent as aq, type PaymentRequiredV2 as ar, type PaymentRequirements as as, type PromptContent as at, RAIL_REFUNDABLE as au, type ReceiptOutcome as av, type ReceiptPayment as aw, type ResourceInfo as ax, type SettleResponse as ay, StepCache as az, type ArtifactContent as b, type X402SettlementStatus as b$, isArtifactMessage as b0, isCancelMessage as b1, isCompleteMessage as b2, isDrainReceipt as b3, isDrawFundingReceipt as b4, isFundingReceipt as b5, isPaymentRequestMessage as b6, isPromptMessage as b7, isSignedJobReceipt as b8, isTextMessage as b9, type NonChannelBitcoinRail as bA, PayoutReporter as bB, PostgresTempoSessionStore as bC, RevenueReporter as bD, SIGNED_ENVELOPE_FIELDS as bE, SIGNED_ENVELOPE_TYPES as bF, type X402TrackedChannel as bG, _testing as bH, createDefaultReplayStore as bI, depleteLots as bJ, fifoOrder as bK, inKindDrawMsats as bL, isInKindDepletion as bM, isNonChannelBitcoinRail as bN, lotOwedSats as bO, netOwedSats as bP, wrapMppx as bQ, type CreditLedgerQuerier as bR, type CreditDrainEnqueue as bS, HostedSettlementReportObligations as bT, type DVMAuthScheme as bU, type CreditLedgerLike as bV, type X402RefundSettlementGate as bW, type CreditSnapshot as bX, type CreditDrawRefundArgs as bY, type CreditDrawRefundResult as bZ, type DrawResult as b_, isWorkingMessage as ba, paymentRequiredV2FromV1 as bb, signDrainReceipt as bc, signDrawFundingReceipt as bd, signFundingReceipt as be, signReceipt as bf, usdcContractByCaip2 as bg, usdcContractFor as bh, usdcDomainNameFor as bi, usdcDomainVersionFor as bj, verifyDrainReceipt as bk, verifyDrawFundingReceipt as bl, verifyFundingReceipt as bm, verifyReceipt as bn, x402NetworkToCaip2 as bo, type X402ExactVersionSupport as bp, type X402Receipt as bq, type TransactionalPayoutHook as br, type CashuMeltCompleted as bs, type CreditDepositPayload as bt, type CreditDrainPayload as bu, type FundingLot as bv, type LotDebit as bw, type LotDepletion as bx, type MppxServer as by, NON_CHANNEL_BITCOIN_RAILS as bz, type CancelContent as c, clientCompatibilityMiddleware as c$, type X402UnresolvedRefund as c0, type GrownDrawResult as c1, type DrawResolution as c2, type FundingRecord as c3, type CreditFundingEvidence as c4, type CreditInvoiceRecord as c5, type InvoiceSettlement as c6, type BlockedInvoiceCursor as c7, type InvoiceReconciliation as c8, type InvoiceWriteOff as c9, type CreditLedgerErrorCode as cA, type CreditLedgerErrorDetails as cB, type CreditLedgerPool as cC, type CreditStatus as cD, DRAIN_DELIVERY_RESERVE_SATS as cE, DVM_PROTOCOL_VERSION as cF, type DrainConflictReason as cG, type DrawRailValue as cH, type DrawStatus as cI, type HostedTempoCloseReportWriteOff as cJ, type JobCostReportPayload as cK, type JobTerminalReportPayload as cL, PostgresX402ChannelStorage as cM, type ReplayStoreBackend as cN, type RevenueSkippedNoRailPayload as cO, type RevenueSkippedNoRailReason as cP, type Secp256k1AuthOpts as cQ, type TempoDrainDecision as cR, type TempoDrainDecisionArgs as cS, type TempoDrainDecisionResult as cT, type TempoDrainHoldReason as cU, type X402ChannelStorageOpts as cV, type X402RelayLockHolder as cW, type X402RelaySubmissionLock as cX, X402RelaySubmissionLockError as cY, allocateDrawValue as cZ, clientCompatibilityAttributes as c_, type DrawRecord as ca, type StalePendingDrawCursor as cb, type TempoCreditLossEvidence as cc, type TempoCreditLoss as cd, type X402CreditLossEvidence as ce, type X402CreditLoss as cf, type DrainMethod as cg, type DrainRequestResult as ch, type BitcoinDepositLiability as ci, type CreditDrainRecord as cj, type ChannelDrainCursor as ck, type DrainWriteOff as cl, type DrainTransitionResult as cm, type DrainReleaseResult as cn, type DrainFulfilment as co, HostingCleanupFence as cp, CLIENT_COMPATIBILITY_HEADERS as cq, type ClientCompatibility as cr, type ClientCompatibilityEnv as cs, type ClientCompatibilityGate as ct, type ClientCompatibilityRequirement as cu, type ClientSemVer as cv, type CreditFundingBasis as cw, type CreditInvoiceStatus as cx, CreditLedger as cy, CreditLedgerError as cz, type CanonicalEnvelope as d, clientUpgradeRequired as d0, parseClientCapabilities as d1, parseClientCompatibility as d2, parseDvmClient as d3, parseProtocolVersion as d4, requireClientCompatibility as d5, retryHostedTempoCloseReport as d6, secp256k1Auth as d7, signedRequestInput as d8, writeOffHostedTempoCloseReport as d9, type HostedIntent as da, type X402SettlementIntent as db, type HostedFundingReservation as dc, type X402SettlementCursor as dd, type X402SettlementWriteOff as de, type X402FacilitatorAuth as df, type X402BatchSettlementConfig as dg, type X402PayoutObserver as dh, type CreditDepositEnqueue as di, type X402SettlementReconciliationReason as dj, type CreditDrawReleaseEnqueue as dk, type CapabilityRate as e, type CreateSignedRequestVerifierOpts as f, type CreditConfig as g, type CreditView as h, DEFAULT_CREDIT_MAX as i, DEFAULT_CREDIT_MIN as j, DEFAULT_CREDIT_TTL_SECONDS as k, DEFAULT_JOB_RETENTION_DAYS as l, type DVMRouteContext as m, type InputType as n, InvalidCurrencyError as o, type PaymentMethod as p, type PriceValue as q, type ProgressContent as r, type PromptOpts as s, type QuoteContext as t, type QuoteResult as u, type ResponseContent as v, type SDKPaymentRequestOpts as w, SIGNED_REQUEST_AUTH_ID as x, SIGNED_REQUEST_STATEMENT_VERSION as y, type SignedRequestAudience as z };
|
|
@@ -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 {
|
|
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-BASsjgKw.js';
|
|
2
|
+
import { a2 as JobReceipt, a7 as Message, a3 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-BCRHimiY.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-CA7u1nHV.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'mppx';
|
|
6
6
|
import '@x402/core/server';
|
|
@@ -72,7 +72,9 @@ declare class MemoryJobStore implements StreamableJobStore, ReceiptIssuingStore
|
|
|
72
72
|
}>;
|
|
73
73
|
subscribeMessages(jobId: string, afterSeq: number, onMessage: (msg: Message) => void): Promise<() => void>;
|
|
74
74
|
subscribeNotifications(jobId: string, onNotify: () => void): Promise<() => void>;
|
|
75
|
-
getMessages(jobId: string, afterSeq: number
|
|
75
|
+
getMessages(jobId: string, afterSeq: number, options?: {
|
|
76
|
+
includeHeld?: boolean;
|
|
77
|
+
}): Promise<Message[]>;
|
|
76
78
|
initStreaming(): Promise<void>;
|
|
77
79
|
shutdownStreaming(): Promise<void>;
|
|
78
80
|
/**
|
|
@@ -84,6 +86,7 @@ declare class MemoryJobStore implements StreamableJobStore, ReceiptIssuingStore
|
|
|
84
86
|
private terminateJob;
|
|
85
87
|
private allocateSeq;
|
|
86
88
|
private messagesFor;
|
|
89
|
+
private visibleMessages;
|
|
87
90
|
private notify;
|
|
88
91
|
private fireNotifyOnly;
|
|
89
92
|
}
|
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-PKLNMMKF.js";
|
|
8
8
|
import {
|
|
9
9
|
JobCancelledError
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-KVKJ7R5V.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) {
|