@dvmkit/sdk 0.9.0 → 0.10.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-GODOH2AF.js → chunk-2OGBZPPJ.js} +43 -21
- package/dist/{chunk-4VV7WACY.js → chunk-2XQLL6N6.js} +1 -1
- package/dist/{chunk-LCCG5HQM.js → chunk-3Q6FTZDB.js} +2 -2
- package/dist/{chunk-TRY7BJA4.js → chunk-3R7NQA3Z.js} +1 -1
- package/dist/{chunk-KGL3YMZA.js → chunk-AJ6UHXUA.js} +1 -1
- package/dist/{chunk-BAQRUYRL.js → chunk-EWZFANHJ.js} +1 -1
- package/dist/{chunk-K2MSIKMM.js → chunk-FFXXGCVG.js} +1 -1
- package/dist/{chunk-WLPLHXNP.js → chunk-JNECYURT.js} +1 -1
- package/dist/{chunk-TFDR2YP2.js → chunk-KFCEXCZM.js} +1 -1
- package/dist/{chunk-IYQQXEHV.js → chunk-LDIPVPKI.js} +1 -1
- package/dist/{chunk-QSZW2I5Y.js → chunk-M3T5JYDJ.js} +15 -8
- package/dist/{chunk-Q3VYRU5R.js → chunk-MB6R4XPZ.js} +1 -1
- package/dist/{chunk-IBX2ORBV.js → chunk-MMGSYMIC.js} +1 -1
- package/dist/{chunk-LFVIZH2G.js → chunk-MU3IE434.js} +278 -152
- package/dist/{chunk-OIP44KBB.js → chunk-QGNXYVBO.js} +47 -12
- package/dist/{chunk-YYRY32NR.js → chunk-STJBBVNL.js} +2 -2
- package/dist/{chunk-73C4JN2E.js → chunk-SYBFMHXQ.js} +381 -87
- package/dist/{chunk-WB3E7KE7.js → chunk-VMHYGKWT.js} +1 -1
- package/dist/{chunk-GAZBBMAA.js → chunk-VTHYQCDB.js} +1 -1
- package/dist/{chunk-LW7KZQHG.js → chunk-VUGEEMLT.js} +1 -1
- package/dist/{chunk-HC4I7LAV.js → chunk-W3VGCNG6.js} +1 -1
- package/dist/{chunk-ZBQKXAYK.js → chunk-YOSZIWC3.js} +1 -1
- package/dist/{content-retention-CVBYehRS.d.ts → content-retention-CrILCNxk.d.ts} +1 -1
- package/dist/{credit-ledger-CZQ56DYI.js → credit-ledger-4PZNAMDT.js} +3 -3
- package/dist/{credit-menu-QntEhZJS.d.ts → credit-menu-BWsVqMh-.d.ts} +6 -4
- package/dist/{fx-CMyNFenZ.d.ts → fx-BM5h4o5S.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/internal/caller.d.ts +7 -7
- package/dist/internal/caller.js +7 -7
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +20 -20
- package/dist/{job-store-qOD-FrQF.d.ts → job-store-92v8e1LQ.d.ts} +1 -1
- package/dist/{lightning-backend-DtdG6UT5.d.ts → lightning-backend-9oky_wJi.d.ts} +1 -1
- package/dist/{memory-credit-ledger-EMN7G3MO.js → memory-credit-ledger-RP7DT5IY.js} +4 -4
- package/dist/{mpp-setup-VW53KFPO.js → mpp-setup-FURD45LI.js} +3 -3
- package/dist/{payout-reporter-TZX2S7KG.js → payout-reporter-HVJ6WUF3.js} +2 -2
- package/dist/{postgres-consumed-credential-store-V464OAJB.js → postgres-consumed-credential-store-WO6OCFXZ.js} +1 -1
- package/dist/{postgres-job-store-27VOCSPO.js → postgres-job-store-H45PRBLA.js} +2 -2
- package/dist/{postgres-replay-store-7GJFAQXY.js → postgres-replay-store-XXJSA457.js} +2 -2
- package/dist/{pricing-NNMBNP7N.js → pricing-X4XU5HXY.js} +3 -3
- package/dist/{revenue-reporter-4EAVPWXS.js → revenue-reporter-EV3K5L6B.js} +2 -2
- package/dist/server/index.d.ts +75 -11
- package/dist/server/index.js +65 -27
- package/dist/{step-cache-B7svmPz3.d.ts → step-cache--7yA5Ihr.d.ts} +48 -6
- package/dist/{tempo-charge-store-2RPOJBM2.js → tempo-charge-store-5JOIYUIH.js} +2 -2
- package/dist/{tempo-session-store-LI3Q3A3U.js → tempo-session-store-S6QMLQUA.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +6 -6
- package/dist/{usd-D3izFz71.d.ts → usd-C7lvLvLk.d.ts} +1 -1
- package/dist/{x402-SL36LSOD.js → x402-EN5LSOVM.js} +3 -3
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ae as CashuMode, bL as
|
|
2
|
-
export { ch as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ci as ClientCompatibility, cj as ClientCompatibilityEnv, ck as ClientCompatibilityGate, cl as ClientCompatibilityRequirement, cm as ClientSemVer, f as CreateSignedRequestVerifierOpts, cn as CreditFundingBasis, co as CreditInvoiceStatus, cp as CreditLedger, cq as CreditLedgerError, cr as CreditLedgerErrorCode, cs as CreditLedgerErrorDetails, ct as CreditLedgerPool, cu as CreditStatus, cv as DRAIN_DELIVERY_RESERVE_SATS, cw as DVM_PROTOCOL_VERSION, cx as DrainConflictReason, cy as DrawRailValue, cz as DrawStatus, cA as
|
|
1
|
+
import { ae as CashuMode, bL as CreditLedgerQuerier, bM as CreditDrainEnqueue, bN as HostedSettlementReportObligations, R as ResolvedCreditConfig, bO as DVMAuthScheme, B as SignedRequestDomain, bP as CreditLedgerLike, bQ as X402RefundSettlementGate, bR as CreditSnapshot, bS as DrawResult, bT as X402SettlementStatus, bU as X402UnresolvedRefund, bV as GrownDrawResult, bW as DrawResolution, bX as FundingRecord, $ as FundingReceipt, bY as CreditInvoiceRecord, bZ as InvoiceSettlement, b_ as BlockedInvoiceCursor, b$ as InvoiceReconciliation, c0 as InvoiceWriteOff, c1 as DrawRecord, c2 as StalePendingDrawCursor, c3 as TempoCreditLossEvidence, c4 as TempoCreditLoss, c5 as X402CreditLossEvidence, c6 as X402CreditLoss, c7 as DrainMethod, c8 as DrainRequestResult, c9 as BitcoinDepositLiability, bp as FundingLot, ca as CreditDrainRecord, cb as ChannelDrainCursor, cc as DrainWriteOff, cd as DrainTransitionResult, ce as DrainReleaseResult, cf as DrainFulfilment, cg as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache--7yA5Ihr.js';
|
|
2
|
+
export { ch as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ci as ClientCompatibility, cj as ClientCompatibilityEnv, ck as ClientCompatibilityGate, cl as ClientCompatibilityRequirement, cm as ClientSemVer, f as CreateSignedRequestVerifierOpts, cn as CreditFundingBasis, co as CreditInvoiceStatus, cp as CreditLedger, cq as CreditLedgerError, cr as CreditLedgerErrorCode, cs as CreditLedgerErrorDetails, ct as CreditLedgerPool, cu as CreditStatus, cv as DRAIN_DELIVERY_RESERVE_SATS, cw as DVM_PROTOCOL_VERSION, cx as DrainConflictReason, cy as DrawRailValue, cz as DrawStatus, cA as HostedTempoCloseReportWriteOff, cB as JobCostReportPayload, cC as JobTerminalReportPayload, cD as PostgresX402ChannelStorage, cE as ReplayStoreBackend, cF as RevenueSkippedNoRailPayload, cG as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cH as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cI as X402ChannelStorageOpts, cJ as X402RelayLockHolder, cK as X402RelaySubmissionLock, cL as X402RelaySubmissionLockError, cM as allocateDrawValue, cN as clientCompatibilityAttributes, cO as clientCompatibilityMiddleware, cP as clientUpgradeRequired, O as createSignedRequestVerifier, cQ as parseClientCapabilities, cR as parseClientCompatibility, cS as parseDvmClient, cT as parseProtocolVersion, cU as requireClientCompatibility, cV as retryHostedTempoCloseReport, cW as secp256k1Auth, cX as signedRequestInput, V as signedRequestStatementHeader, cY as writeOffHostedTempoCloseReport } from '../step-cache--7yA5Ihr.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-BWsVqMh-.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-BWsVqMh-.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-BM5h4o5S.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-92v8e1LQ.js';
|
|
10
|
+
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-92v8e1LQ.js';
|
|
11
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-CrILCNxk.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-CrILCNxk.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-9oky_wJi.js';
|
|
21
21
|
import '@cashu/cashu-ts';
|
|
22
22
|
|
|
23
23
|
/** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
|
|
@@ -43,6 +43,35 @@ interface ResolvedCashuOpts {
|
|
|
43
43
|
*/
|
|
44
44
|
declare function resolveCashuOptsFromEnv(env: Record<string, string>, pool?: Pool, cashuModeHint?: CashuMode): Promise<ResolvedCashuOpts>;
|
|
45
45
|
|
|
46
|
+
interface PendingImplicitDrawGroup {
|
|
47
|
+
/** Null when historical funding has no recorded rail. */
|
|
48
|
+
rail: string | null;
|
|
49
|
+
currency: string;
|
|
50
|
+
drawCount: number;
|
|
51
|
+
/** Held amount in integer millionths of this group's currency. */
|
|
52
|
+
amountMicro: number;
|
|
53
|
+
/** Oldest pending draw's creation time, in epoch milliseconds. */
|
|
54
|
+
oldestDrawAt: number;
|
|
55
|
+
}
|
|
56
|
+
interface PendingImplicitDrawSummary {
|
|
57
|
+
drawCount: number;
|
|
58
|
+
/** Null when no implicit draws remain pending. */
|
|
59
|
+
oldestDrawAt: number | null;
|
|
60
|
+
byRailCurrency: PendingImplicitDrawGroup[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Read database-wide pending holds on implicit credits using a single SELECT. The supplied
|
|
64
|
+
* database must already have the SDK credit schema; this function never initializes it or
|
|
65
|
+
* starts a server. Database access supplies administrative authorization.
|
|
66
|
+
*
|
|
67
|
+
* Includes unfinished jobs and holds without a job record, regardless of stop reason. These
|
|
68
|
+
* funds remain held until settlement or release; this is not a total of payable refunds or
|
|
69
|
+
* all caller balances. No caller identifiers are returned. Unsafe integer totals throw.
|
|
70
|
+
*/
|
|
71
|
+
declare function readPendingImplicitDraws({ db, }: {
|
|
72
|
+
db: CreditLedgerQuerier;
|
|
73
|
+
}): Promise<PendingImplicitDrawSummary>;
|
|
74
|
+
|
|
46
75
|
/**
|
|
47
76
|
* Reporting is optional; an unwired host still runs the money transition.
|
|
48
77
|
*/
|
|
@@ -374,6 +403,7 @@ declare class PostgresJobStore implements StreamableJobStore, ReceiptIssuingStor
|
|
|
374
403
|
save(record: JobRecord): Promise<void>;
|
|
375
404
|
/** Persist a job while retaining its mount identity for cost-report recovery. */
|
|
376
405
|
saveForDvm(record: JobRecord, dvmId: string): Promise<void>;
|
|
406
|
+
private canRetrySnapshot;
|
|
377
407
|
private saveRecord;
|
|
378
408
|
/** Advance only after the reporter durably enqueued or deduplicated the event. */
|
|
379
409
|
markTerminalReported(jobId: string): Promise<void>;
|
|
@@ -536,4 +566,38 @@ interface InstallAdminContentRoutesOpts {
|
|
|
536
566
|
}
|
|
537
567
|
declare function installAdminContentRoutes<E extends Env = Env, S extends BlankSchema = BlankSchema>(app: Hono<E, S>, opts: InstallAdminContentRoutesOpts): void;
|
|
538
568
|
|
|
539
|
-
|
|
569
|
+
interface TempoCloseReportSummary {
|
|
570
|
+
obligation_id: string;
|
|
571
|
+
channel_id: string;
|
|
572
|
+
/** Potential builder payout, as a decimal string in native token units. */
|
|
573
|
+
amount_native: string;
|
|
574
|
+
status: "unmatched" | "no_report";
|
|
575
|
+
created_at_ms: number;
|
|
576
|
+
updated_at_ms: number;
|
|
577
|
+
delivered_at_ms: number | null;
|
|
578
|
+
/** Snapshot of the store's retry predicate; a later state change can still cause a conflict. */
|
|
579
|
+
retryable: boolean;
|
|
580
|
+
write_off_allowed: boolean;
|
|
581
|
+
/** True when a retained write-off decision exists, including after an explicit retry. */
|
|
582
|
+
written_off: boolean;
|
|
583
|
+
write_off_note: string | null;
|
|
584
|
+
written_off_at_ms: number | null;
|
|
585
|
+
}
|
|
586
|
+
interface TempoCloseReportsResponse {
|
|
587
|
+
reports: TempoCloseReportSummary[];
|
|
588
|
+
next_after?: string;
|
|
589
|
+
}
|
|
590
|
+
interface RetryTempoCloseReportResponse {
|
|
591
|
+
status: "reserved";
|
|
592
|
+
obligation_id: string;
|
|
593
|
+
}
|
|
594
|
+
interface WriteOffTempoCloseReportResponse {
|
|
595
|
+
status: "written_off";
|
|
596
|
+
obligation_id: string;
|
|
597
|
+
channel_id: string;
|
|
598
|
+
/** Builder payout abandoned, as a decimal string in native token units. */
|
|
599
|
+
amount_forgone_native: string;
|
|
600
|
+
note: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export { BitcoinDepositLiability, BlockedInvoiceCursor, CREDIT_REQUEST_SCHEMA, ConsumedCredentialStore, ContentHoldHistory, ContentHoldMutation, CreditInvoiceRecord, CreditLedgerLike, CreditLedgerQuerier, CreditMenu, type CreditRequest, type CreditRouteDeps, CreditSnapshot, DVMAuthScheme, DVMHostOpts, DVMServeResult, DrawRecord, DrawResolution, DrawResult, FundingRecord, GrownDrawResult, IMPLICIT_CREDIT_TTL_MS, type InitLockPool, type InstallAdminContentRoutesOpts, InvoiceReconciliation, InvoiceSettlement, InvoiceWriteOff, JobRecord, JobStore, LightningReceive, MemoryCreditLedger, type PendingImplicitDrawGroup, type PendingImplicitDrawSummary, PostgresJobStore, PostgresKVStore, PostgresReplayStore, type PostgresReplayStoreOpts, REQUEST_ID_FIELD, type ResolvedCashuOpts, type RetryTempoCloseReportResponse, SDK_INIT_ADVISORY_LOCK, SignedRequestDomain, SignedRequestReplayStore, StalePendingDrawCursor, StreamableJobStore, type TempoCloseReportSummary, type TempoCloseReportsResponse, type WriteOffTempoCloseReportResponse, handleCreditRequest, hasInvalidRequestId, installAdminContentRoutes, protocolEnvelopeIgnoreFields, readPendingImplicitDraws, requestIdFromEnvelope, resolveCashuOptsFromEnv, serve, stripProtocolEnvelope, withSdkInitLock };
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-EWZFANHJ.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-AJ6UHXUA.js";
|
|
22
22
|
import {
|
|
23
23
|
MemoryKVStore
|
|
24
24
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -82,30 +82,30 @@ import {
|
|
|
82
82
|
toCreditView,
|
|
83
83
|
unknownRouteNotFound,
|
|
84
84
|
writeOffHostedTempoCloseReport
|
|
85
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-SYBFMHXQ.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-FFXXGCVG.js";
|
|
92
|
+
import "../chunk-VTHYQCDB.js";
|
|
93
93
|
import {
|
|
94
94
|
MemoryCreditLedger
|
|
95
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-YOSZIWC3.js";
|
|
96
96
|
import {
|
|
97
97
|
PostgresJobStore
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-2OGBZPPJ.js";
|
|
99
99
|
import "../chunk-YG7G4DPZ.js";
|
|
100
100
|
import {
|
|
101
101
|
SignedRequestError,
|
|
102
102
|
createDefaultReplayStore,
|
|
103
103
|
createSignedRequestVerifier,
|
|
104
104
|
signedRequestInput
|
|
105
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-2XQLL6N6.js";
|
|
106
106
|
import {
|
|
107
107
|
isStreamableJobStore
|
|
108
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-KFCEXCZM.js";
|
|
109
109
|
import {
|
|
110
110
|
ContentHoldError,
|
|
111
111
|
baselineContentExpiry,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
IMPLICIT_CREDIT_TTL_MS,
|
|
117
117
|
generateEphemeralReceiptKey,
|
|
118
118
|
receiptPubkeyFromSecret
|
|
119
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-VUGEEMLT.js";
|
|
120
120
|
import {
|
|
121
121
|
X402_DEFAULT_FACILITATOR,
|
|
122
122
|
X402_DEFAULT_NETWORK,
|
|
@@ -128,11 +128,11 @@ import {
|
|
|
128
128
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
129
129
|
signedRequestStatementHeader
|
|
130
130
|
} from "../chunk-UKD3R2KU.js";
|
|
131
|
-
import "../chunk-
|
|
131
|
+
import "../chunk-3R7NQA3Z.js";
|
|
132
132
|
import "../chunk-FUJ36YDV.js";
|
|
133
133
|
import "../chunk-BQJIFRAZ.js";
|
|
134
|
-
import "../chunk-
|
|
135
|
-
import "../chunk-
|
|
134
|
+
import "../chunk-JNECYURT.js";
|
|
135
|
+
import "../chunk-W3VGCNG6.js";
|
|
136
136
|
import {
|
|
137
137
|
CreditLedger,
|
|
138
138
|
CreditLedgerError,
|
|
@@ -140,14 +140,14 @@ import {
|
|
|
140
140
|
PostgresX402ChannelStorage,
|
|
141
141
|
X402RelaySubmissionLockError,
|
|
142
142
|
allocateDrawValue
|
|
143
|
-
} from "../chunk-
|
|
143
|
+
} from "../chunk-STJBBVNL.js";
|
|
144
144
|
import {
|
|
145
145
|
SDK_INIT_ADVISORY_LOCK,
|
|
146
146
|
withSdkInitLock
|
|
147
147
|
} from "../chunk-COYKJRMM.js";
|
|
148
148
|
import {
|
|
149
149
|
applyRetryToPool
|
|
150
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-MMGSYMIC.js";
|
|
151
151
|
import {
|
|
152
152
|
assertSupportedX402Network
|
|
153
153
|
} from "../chunk-BPYMEMQX.js";
|
|
@@ -157,14 +157,14 @@ import {
|
|
|
157
157
|
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
158
158
|
TempoSettlementReadiness,
|
|
159
159
|
resolveTempoNetwork
|
|
160
|
-
} from "../chunk-
|
|
160
|
+
} from "../chunk-MU3IE434.js";
|
|
161
161
|
import {
|
|
162
162
|
initLoggers
|
|
163
|
-
} from "../chunk-
|
|
163
|
+
} from "../chunk-M3T5JYDJ.js";
|
|
164
164
|
import "../chunk-66HGCPBU.js";
|
|
165
165
|
import {
|
|
166
166
|
diagnosticConsole
|
|
167
|
-
} from "../chunk-
|
|
167
|
+
} from "../chunk-QGNXYVBO.js";
|
|
168
168
|
|
|
169
169
|
// src/sdk/server/cashu-env.ts
|
|
170
170
|
async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
@@ -245,6 +245,43 @@ async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
|
245
245
|
return { cashuMode, lockPubkey, lockPubkeyGraceSeconds, db, dvmId, canonicalDvmId };
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
// src/sdk/server/pending-implicit-draws.ts
|
|
249
|
+
async function readPendingImplicitDraws({
|
|
250
|
+
db
|
|
251
|
+
}) {
|
|
252
|
+
const { rows } = await db.query(`
|
|
253
|
+
SELECT c.rail, c.currency, COUNT(*)::text AS draw_count,
|
|
254
|
+
SUM(d.amount_micro)::text AS amount_micro,
|
|
255
|
+
MIN(d.created_at)::text AS oldest_draw_at
|
|
256
|
+
FROM credit_draws d
|
|
257
|
+
JOIN credits c ON c.credit_id = d.credit_id
|
|
258
|
+
WHERE d.status = 'pending' AND d.credit_id LIKE 'imp:%'
|
|
259
|
+
GROUP BY c.rail, c.currency
|
|
260
|
+
ORDER BY c.rail NULLS LAST, c.currency
|
|
261
|
+
`);
|
|
262
|
+
const byRailCurrency = rows.map((row) => ({
|
|
263
|
+
rail: row.rail,
|
|
264
|
+
currency: row.currency,
|
|
265
|
+
drawCount: safeInteger(row.draw_count),
|
|
266
|
+
amountMicro: safeInteger(row.amount_micro),
|
|
267
|
+
oldestDrawAt: safeInteger(row.oldest_draw_at)
|
|
268
|
+
}));
|
|
269
|
+
let count = 0n;
|
|
270
|
+
let oldestDrawAt = null;
|
|
271
|
+
for (const group of byRailCurrency) {
|
|
272
|
+
count += BigInt(group.drawCount);
|
|
273
|
+
oldestDrawAt = oldestDrawAt === null ? group.oldestDrawAt : Math.min(oldestDrawAt, group.oldestDrawAt);
|
|
274
|
+
}
|
|
275
|
+
return { drawCount: safeInteger(count.toString()), oldestDrawAt, byRailCurrency };
|
|
276
|
+
}
|
|
277
|
+
function safeInteger(value) {
|
|
278
|
+
const number = Number(value);
|
|
279
|
+
if (!/^\d+$/.test(value) || !Number.isSafeInteger(number)) {
|
|
280
|
+
throw new RangeError("pending implicit draws: aggregate outside nonnegative safe integer range");
|
|
281
|
+
}
|
|
282
|
+
return number;
|
|
283
|
+
}
|
|
284
|
+
|
|
248
285
|
// src/sdk/server/payment-mode.ts
|
|
249
286
|
function resolvePaymentMode(opts) {
|
|
250
287
|
const active = (rail, configured, ready) => ({
|
|
@@ -1151,7 +1188,7 @@ function createDVMHost(opts = {}) {
|
|
|
1151
1188
|
});
|
|
1152
1189
|
applyRetryToPool(pool, "dvm-host");
|
|
1153
1190
|
pgPool = pool;
|
|
1154
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1191
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-H45PRBLA.js");
|
|
1155
1192
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1156
1193
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1157
1194
|
jobStore = pgJobStore;
|
|
@@ -1244,11 +1281,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1244
1281
|
let tempoChargeBackend = "user-supplied";
|
|
1245
1282
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1246
1283
|
if (!mpp && mppTempoRecipient) {
|
|
1247
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1284
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-FURD45LI.js");
|
|
1248
1285
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1249
1286
|
let tempoCharge;
|
|
1250
1287
|
if (pgPool) {
|
|
1251
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1288
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-5JOIYUIH.js");
|
|
1252
1289
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1253
1290
|
tempoChargeStore = chargeStore;
|
|
1254
1291
|
pendingInits.push(chargeStore.init());
|
|
@@ -1268,7 +1305,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1268
1305
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1269
1306
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1270
1307
|
] = await Promise.all([
|
|
1271
|
-
import("../tempo-session-store-
|
|
1308
|
+
import("../tempo-session-store-S6QMLQUA.js"),
|
|
1272
1309
|
import("viem/accounts"),
|
|
1273
1310
|
import("viem"),
|
|
1274
1311
|
import("viem/chains")
|
|
@@ -1421,7 +1458,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1421
1458
|
}
|
|
1422
1459
|
}
|
|
1423
1460
|
const fxSource = envMaybe.DVMKIT_FX_SOURCE;
|
|
1424
|
-
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-
|
|
1461
|
+
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-X4XU5HXY.js");
|
|
1425
1462
|
const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
|
|
1426
1463
|
const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
|
|
1427
1464
|
if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
|
|
@@ -1431,7 +1468,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1431
1468
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1432
1469
|
let sharedPgReplayStore;
|
|
1433
1470
|
if (pgPool) {
|
|
1434
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1471
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-XXJSA457.js");
|
|
1435
1472
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1436
1473
|
pendingInits.push(store2.init());
|
|
1437
1474
|
sharedPgReplayStore = store2;
|
|
@@ -1459,13 +1496,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1459
1496
|
}
|
|
1460
1497
|
let sharedPgConsumedStore;
|
|
1461
1498
|
if (pgPool) {
|
|
1462
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1499
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-WO6OCFXZ.js");
|
|
1463
1500
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1464
1501
|
pendingInits.push(consumedStore.init());
|
|
1465
1502
|
sharedPgConsumedStore = consumedStore;
|
|
1466
1503
|
}
|
|
1467
1504
|
if (pgPool) {
|
|
1468
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1505
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-4PZNAMDT.js");
|
|
1469
1506
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1470
1507
|
pendingInits.push(pgLedger.init());
|
|
1471
1508
|
creditLedger = pgLedger;
|
|
@@ -1474,7 +1511,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1474
1511
|
pendingInits.push(pgProcessed.init());
|
|
1475
1512
|
processedPayments = pgProcessed;
|
|
1476
1513
|
} else {
|
|
1477
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1514
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-RP7DT5IY.js");
|
|
1478
1515
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1479
1516
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1480
1517
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -2166,6 +2203,7 @@ export {
|
|
|
2166
2203
|
parseDvmClient,
|
|
2167
2204
|
parseProtocolVersion,
|
|
2168
2205
|
protocolEnvelopeIgnoreFields,
|
|
2206
|
+
readPendingImplicitDraws,
|
|
2169
2207
|
requestIdFromEnvelope,
|
|
2170
2208
|
requireClientCompatibility,
|
|
2171
2209
|
resolveCashuOptsFromEnv,
|
|
@@ -1261,6 +1261,28 @@ declare class HostedSettlementReportObligations {
|
|
|
1261
1261
|
tempoCloseAmountAtStake(id: string): Promise<string>;
|
|
1262
1262
|
/** Stop automatic searches without declaring a possibly missing payout discharged. */
|
|
1263
1263
|
markTempoCloseUnmatched(id: string): Promise<boolean>;
|
|
1264
|
+
listTempoCloseReports(args: {
|
|
1265
|
+
limit: number;
|
|
1266
|
+
after?: {
|
|
1267
|
+
createdAtMs: number;
|
|
1268
|
+
obligationId: string;
|
|
1269
|
+
};
|
|
1270
|
+
all?: boolean;
|
|
1271
|
+
}): Promise<{
|
|
1272
|
+
id: string;
|
|
1273
|
+
channelId: string;
|
|
1274
|
+
amountNative: string;
|
|
1275
|
+
status: "unmatched" | "no_report";
|
|
1276
|
+
createdAtMs: number;
|
|
1277
|
+
updatedAtMs: number;
|
|
1278
|
+
deliveredAtMs: number | null;
|
|
1279
|
+
retryable: boolean;
|
|
1280
|
+
writeOffAllowed: boolean;
|
|
1281
|
+
writtenOff: boolean;
|
|
1282
|
+
writeOffNote: string | null;
|
|
1283
|
+
writtenOffAtMs: number | null;
|
|
1284
|
+
}[]>;
|
|
1285
|
+
hasTempoCloseReport(id: string): Promise<boolean>;
|
|
1264
1286
|
writeOffTempoClose(id: string, note: string): Promise<{
|
|
1265
1287
|
channelId: string;
|
|
1266
1288
|
amount: string;
|
|
@@ -1276,6 +1298,8 @@ declare class HostedSettlementReportObligations {
|
|
|
1276
1298
|
reservedAtMs: number;
|
|
1277
1299
|
searchBefore: bigint | null;
|
|
1278
1300
|
} | undefined>;
|
|
1301
|
+
/** A recorded close transaction remains refund evidence after its report is delivered. */
|
|
1302
|
+
tempoCloseTransaction(channelId: string, drainId: string): Promise<string | undefined>;
|
|
1279
1303
|
/**
|
|
1280
1304
|
* Where the next search for this close obligation's transaction resumes. It
|
|
1281
1305
|
* lives on the obligation, not the drain's close intent, because releasing
|
|
@@ -1337,13 +1361,24 @@ declare function retryHostedTempoCloseReport(args: {
|
|
|
1337
1361
|
scope: string;
|
|
1338
1362
|
obligationId: string;
|
|
1339
1363
|
}): Promise<boolean>;
|
|
1340
|
-
|
|
1341
|
-
|
|
1364
|
+
interface HostedTempoCloseReportWriteOff {
|
|
1365
|
+
channelId: string;
|
|
1366
|
+
/** Builder payout abandoned, as a decimal string in native token units. */
|
|
1367
|
+
amountForgoneNative: string;
|
|
1368
|
+
}
|
|
1369
|
+
interface WriteOffHostedTempoCloseReportArgs {
|
|
1342
1370
|
db: Pool;
|
|
1343
1371
|
dvmId: string;
|
|
1344
1372
|
scope: string;
|
|
1345
1373
|
obligationId: string;
|
|
1346
1374
|
note: string;
|
|
1375
|
+
}
|
|
1376
|
+
/** Forgo an unmatched builder payout report; includeDetails returns the amount without another read. */
|
|
1377
|
+
declare function writeOffHostedTempoCloseReport(args: WriteOffHostedTempoCloseReportArgs & {
|
|
1378
|
+
includeDetails: true;
|
|
1379
|
+
}): Promise<HostedTempoCloseReportWriteOff | false>;
|
|
1380
|
+
declare function writeOffHostedTempoCloseReport(args: WriteOffHostedTempoCloseReportArgs & {
|
|
1381
|
+
includeDetails?: false;
|
|
1347
1382
|
}): Promise<boolean>;
|
|
1348
1383
|
|
|
1349
1384
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
@@ -4544,6 +4579,9 @@ interface TempoDrainFinalization {
|
|
|
4544
4579
|
outcome: "payer_exit" | "cooperative_close";
|
|
4545
4580
|
creditUnbacked: boolean;
|
|
4546
4581
|
}
|
|
4582
|
+
type TempoCloseRecovery = string | null | {
|
|
4583
|
+
outcome: "refund_unproven";
|
|
4584
|
+
};
|
|
4547
4585
|
type TempoDrainFinalizer = (drain: CreditDrainRecord, evidence: TempoDrainFinalization) => Promise<boolean>;
|
|
4548
4586
|
/**
|
|
4549
4587
|
* Options for assembling an Mppx server handle from explicit recipient strings
|
|
@@ -4720,8 +4758,12 @@ interface MppxServer {
|
|
|
4720
4758
|
releaseTempoSessionCloseIntent?<value>(channelId: string, drainId: string, operation: (tx: CreditLedgerQuerier) => Promise<value>): Promise<value>;
|
|
4721
4759
|
/** Persist a confirmed cooperative-close transaction before draining the ledger. */
|
|
4722
4760
|
confirmTempoSessionClose?: (channelId: string, drainId: string, reference: string) => Promise<string>;
|
|
4723
|
-
/**
|
|
4724
|
-
|
|
4761
|
+
/**
|
|
4762
|
+
* Recover a close result after a process failure between chain and ledger commits.
|
|
4763
|
+
* Supplying the credit ID checks the durable drain status and requires a
|
|
4764
|
+
* proven refund before completing a finalized channel through the ledger.
|
|
4765
|
+
*/
|
|
4766
|
+
recoverTempoSessionClose?: (channelId: string, drainId: string, creditId?: string) => Promise<TempoCloseRecovery>;
|
|
4725
4767
|
/**
|
|
4726
4768
|
* Read a channel's close intent without touching it.
|
|
4727
4769
|
*
|
|
@@ -4887,7 +4929,7 @@ interface TempoSessionChainOps {
|
|
|
4887
4929
|
* chain head when omitted) down to blocks older than `notBeforeMs`. One call searches a bounded number of
|
|
4888
4930
|
* windows; `paused` names the block the next call resumes from.
|
|
4889
4931
|
*/
|
|
4890
|
-
findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number, startBlock?: bigint): Promise<TempoChannelCloseSearch>;
|
|
4932
|
+
findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number, startBlock?: bigint, deadlineMs?: number | (() => number)): Promise<TempoChannelCloseSearch>;
|
|
4891
4933
|
}
|
|
4892
4934
|
type TempoChannelCloseSearch =
|
|
4893
4935
|
/** A `ChannelClosed` log, with the address that sent its transaction. */
|
|
@@ -5987,4 +6029,4 @@ declare class StepCache {
|
|
|
5987
6029
|
static deserialize(records: StepRecord[]): StepCache;
|
|
5988
6030
|
}
|
|
5989
6031
|
|
|
5990
|
-
export { type FundingReceipt 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, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type
|
|
6032
|
+
export { type FundingReceipt 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, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type InvoiceReconciliation as b$, isDrainReceipt as b0, isFundingReceipt as b1, isPaymentRequestMessage as b2, isPromptMessage as b3, isSignedJobReceipt as b4, isTextMessage as b5, isWorkingMessage as b6, paymentRequiredV2FromV1 as b7, signDrainReceipt as b8, signFundingReceipt as b9, type X402TrackedChannel as bA, _testing as bB, createDefaultReplayStore as bC, depleteLots as bD, fifoOrder as bE, inKindDrawMsats as bF, isInKindDepletion as bG, isNonChannelBitcoinRail as bH, lotOwedSats as bI, netOwedSats as bJ, wrapMppx as bK, type CreditLedgerQuerier as bL, type CreditDrainEnqueue as bM, HostedSettlementReportObligations as bN, type DVMAuthScheme as bO, type CreditLedgerLike as bP, type X402RefundSettlementGate as bQ, type CreditSnapshot as bR, type DrawResult as bS, type X402SettlementStatus as bT, type X402UnresolvedRefund as bU, type GrownDrawResult as bV, type DrawResolution as bW, type FundingRecord as bX, type CreditInvoiceRecord as bY, type InvoiceSettlement as bZ, type BlockedInvoiceCursor as b_, signReceipt as ba, usdcContractByCaip2 as bb, usdcContractFor as bc, usdcDomainNameFor as bd, usdcDomainVersionFor as be, verifyDrainReceipt as bf, verifyFundingReceipt as bg, verifyReceipt as bh, x402NetworkToCaip2 as bi, type X402ExactVersionSupport as bj, type X402Receipt as bk, type TransactionalPayoutHook as bl, type CashuMeltCompleted as bm, type CreditDepositPayload as bn, type CreditDrainPayload as bo, type FundingLot as bp, type LotDebit as bq, type LotDepletion as br, type MppxServer as bs, NON_CHANNEL_BITCOIN_RAILS as bt, type NonChannelBitcoinRail as bu, PayoutReporter as bv, PostgresTempoSessionStore as bw, RevenueReporter as bx, SIGNED_ENVELOPE_FIELDS as by, SIGNED_ENVELOPE_TYPES as bz, type CancelContent as c, type HostedFundingReservation as c$, type InvoiceWriteOff as c0, type DrawRecord as c1, type StalePendingDrawCursor as c2, type TempoCreditLossEvidence as c3, type TempoCreditLoss as c4, type X402CreditLossEvidence as c5, type X402CreditLoss as c6, type DrainMethod as c7, type DrainRequestResult as c8, type BitcoinDepositLiability as c9, type HostedTempoCloseReportWriteOff as cA, type JobCostReportPayload as cB, type JobTerminalReportPayload as cC, PostgresX402ChannelStorage as cD, type ReplayStoreBackend as cE, type RevenueSkippedNoRailPayload as cF, type RevenueSkippedNoRailReason as cG, type Secp256k1AuthOpts as cH, type X402ChannelStorageOpts as cI, type X402RelayLockHolder as cJ, type X402RelaySubmissionLock as cK, X402RelaySubmissionLockError as cL, allocateDrawValue as cM, clientCompatibilityAttributes as cN, clientCompatibilityMiddleware as cO, clientUpgradeRequired as cP, parseClientCapabilities as cQ, parseClientCompatibility as cR, parseDvmClient as cS, parseProtocolVersion as cT, requireClientCompatibility as cU, retryHostedTempoCloseReport as cV, secp256k1Auth as cW, signedRequestInput as cX, writeOffHostedTempoCloseReport as cY, type HostedIntent as cZ, type X402SettlementIntent as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainTransitionResult as cd, type DrainReleaseResult as ce, type DrainFulfilment as cf, HostingCleanupFence as cg, CLIENT_COMPATIBILITY_HEADERS as ch, type ClientCompatibility as ci, type ClientCompatibilityEnv as cj, type ClientCompatibilityGate as ck, type ClientCompatibilityRequirement as cl, type ClientSemVer as cm, type CreditFundingBasis as cn, type CreditInvoiceStatus as co, CreditLedger as cp, CreditLedgerError as cq, type CreditLedgerErrorCode as cr, type CreditLedgerErrorDetails as cs, type CreditLedgerPool as ct, type CreditStatus as cu, DRAIN_DELIVERY_RESERVE_SATS as cv, DVM_PROTOCOL_VERSION as cw, type DrainConflictReason as cx, type DrawRailValue as cy, type DrawStatus as cz, type CanonicalEnvelope as d, type X402SettlementCursor as d0, type X402SettlementWriteOff as d1, type X402FacilitatorAuth as d2, type X402BatchSettlementConfig as d3, type X402PayoutObserver as d4, type CreditDepositEnqueue as d5, type X402SettlementReconciliationReason as d6, type CreditDrawReleaseEnqueue as d7, 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-LDIPVPKI.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
5
|
import "./chunk-COYKJRMM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-QGNXYVBO.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-MB6R4XPZ.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-MMGSYMIC.js";
|
|
8
|
+
import "./chunk-QGNXYVBO.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 { a0 as JobReceipt, a5 as Message, a1 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-CrILCNxk.js';
|
|
2
|
+
import { a0 as JobReceipt, a5 as Message, a1 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache--7yA5Ihr.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-92v8e1LQ.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-KFCEXCZM.js";
|
|
8
8
|
import {
|
|
9
9
|
JobCancelledError
|
|
10
10
|
} from "../chunk-AFV77S4C.js";
|
|
11
11
|
import {
|
|
12
12
|
createNoopLogger
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-3R7NQA3Z.js";
|
|
14
14
|
import "../chunk-FUJ36YDV.js";
|
|
15
15
|
import "../chunk-BQJIFRAZ.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-JNECYURT.js";
|
|
17
17
|
import {
|
|
18
18
|
validateCurrency
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-W3VGCNG6.js";
|
|
20
|
+
import "../chunk-M3T5JYDJ.js";
|
|
21
21
|
import "../chunk-66HGCPBU.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-QGNXYVBO.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-3Q6FTZDB.js";
|
|
10
|
+
import "./chunk-VTHYQCDB.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-QGNXYVBO.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.
|
|
3
|
+
"version": "0.10.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": [
|