@dvmkit/sdk 0.1.0-rc.4 → 0.1.0-rc.6
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-F2L6KIMD.js → chunk-5URG56JJ.js} +5 -143
- package/dist/{chunk-EDU6COY2.js → chunk-7AKBC4PW.js} +754 -150
- package/dist/chunk-ANFX5HEG.js +186 -0
- package/dist/{chunk-4UVRXDNY.js → chunk-CMDI3ENK.js} +342 -176
- package/dist/{chunk-GJD7PVWY.js → chunk-FJDCFHW5.js} +26 -12
- package/dist/{chunk-AAJNGQMC.js → chunk-JGGI65I3.js} +1 -1
- package/dist/{chunk-2K6UXDAN.js → chunk-KSQEFVFJ.js} +623 -691
- package/dist/{chunk-XYTSDAPH.js → chunk-LDTWX7JW.js} +1 -1
- package/dist/chunk-MKI6OVW4.js +194 -0
- package/dist/{chunk-AZBXSXQT.js → chunk-P4RUVDU7.js} +1 -0
- package/dist/chunk-TSWKITGR.js +772 -0
- package/dist/{credit-menu-ClA1JyYW.d.ts → credit-menu-CYkETVM4.d.ts} +22 -3
- package/dist/{fx-ptKVFOwq.d.ts → fx-Pf4Ey4f_.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/internal/index.d.ts +4974 -85
- package/dist/internal/index.js +3742 -167
- package/dist/{job-store-DxFqDPYq.d.ts → job-store-BtCaLnvJ.d.ts} +23 -1
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +8 -21
- package/dist/tempo-lifecycle-SQL3KLEZ.js +13 -0
- package/dist/tempo-wallet-QOLEIPCV.js +31 -0
- package/dist/testing/index.d.ts +1 -1
- package/dist/{usd-Cha_j80I.d.ts → usd-D7fW2S7I.d.ts} +1 -1
- package/dist/{x402-XXFQQAAD.js → x402-FTG2GRAQ.js} +6 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono, Context } from 'hono';
|
|
2
2
|
import { Pool } from 'pg';
|
|
3
|
-
import { X as JsonValue,
|
|
4
|
-
import { F as FxFetcher, b as FxRateSnapshot } from './fx-
|
|
3
|
+
import { X as JsonValue, bR as CreditLedgerLike, b_ as CreditInvoiceRecord, d3 as CreditDepositEnqueue, b$ as InvoiceSettlement, Z as ZodLike, a as DVMDescriptor, K as KVStore, o as JobStore, ah as CashuMode, at as MppxServer, aa as X402Config, p as PaymentMethod, cu as ClientCompatibilityGate, a2 as Message, ap as FundingMethod, Y as FundingReceipt, bT as CreditSnapshot, d4 as TopUpCapUnenforcedReason, _ as JobReceipt, cn as AppendOutgoingOptions, S as SDKJobContext, aQ as StepCache, v as ResponseContent, P as PaymentContent, J as JobRecord, a3 as MessageType, ac as X402Receipt, ab as X402ExactVersionSupport, d5 as X402SettlementIntent, aE as PaymentRequirementsV2, c6 as CreditLedgerQuerier, d6 as X402SettlementCursor, bV as X402SettlementStatus, d7 as X402SettlementWriteOff, bS as X402RefundSettlementGate, d8 as X402FacilitatorAuth, d9 as X402BatchSettlementConfig, cK as PostgresX402ChannelStorage, da as X402PayoutObserver, db as X402SettlementReconciliationReason, aC as PaymentRequirements, a1 as MppxCredential, aj as CreditDepositPayload, bU as DrawResult, cA as CreditLedgerError, a7 as ReceiptCredit, al as DrainReceiptEvent, ak as DrainReceipt, z as SignedRequestAudience, dc as CreditDrawReleaseEnqueue, cM as RevenueSkippedNoRailPayload, cs as ClientCompatibility, aF as PayoutReporter, R as ResolvedCreditConfig, g as CreditView } from './job-store-BtCaLnvJ.js';
|
|
4
|
+
import { F as FxFetcher, b as FxRateSnapshot } from './fx-Pf4Ey4f_.js';
|
|
5
5
|
import { ProofLike, SerializedDLEQ } from '@cashu/cashu-ts';
|
|
6
6
|
import { Challenge } from 'mppx';
|
|
7
7
|
import { SettleResponse, SupportedResponse } from '@x402/core/types';
|
|
@@ -347,6 +347,25 @@ declare function checkMintHealth(mintUrl: string, opts?: CheckMintHealthOptions)
|
|
|
347
347
|
* *selection* only, so a mint that can still melt stays loadable for cash-out.
|
|
348
348
|
*/
|
|
349
349
|
declare function canSwap(nuts: Record<string, unknown>): boolean;
|
|
350
|
+
/** Whether `sats` falls inside a mint's advertised limits, and which end it broke. */
|
|
351
|
+
type AmountBoundsVerdict = "ok" | "below_min" | "above_max";
|
|
352
|
+
/**
|
|
353
|
+
* Judge one amount against one direction's limits. The single predicate both
|
|
354
|
+
* `dvm wallet fund` (mint selection, pre-quote refusal) and
|
|
355
|
+
* `dvm wallet cash-out` (per-leg sizing) ask, so the two commands can't drift
|
|
356
|
+
* on what "out of range" means.
|
|
357
|
+
*/
|
|
358
|
+
declare function amountBoundsVerdict(sats: number, bounds?: MintAmountBounds): AmountBoundsVerdict;
|
|
359
|
+
/**
|
|
360
|
+
* Assert that a mint's NUT-06 `nuts` object advertises all required capabilities.
|
|
361
|
+
* Two-phase check:
|
|
362
|
+
* 1. Dict-level — each NUT in `requiredNuts` must be present and not have
|
|
363
|
+
* `supported: false`. Throws naming the missing NUT numbers and mint URL.
|
|
364
|
+
* 2. Method-level — NUT-4 and NUT-5 must each advertise a `bolt11`/`sat`
|
|
365
|
+
* entry in their `methods` array (covers NUT-23). Throws naming the
|
|
366
|
+
* missing method.
|
|
367
|
+
*/
|
|
368
|
+
declare function assertNutSupport(mintUrl: string, nuts: Record<string, unknown>, requiredNuts?: readonly number[]): void;
|
|
350
369
|
|
|
351
370
|
/** A Lightning invoice created by the backend. */
|
|
352
371
|
interface CreatedInvoice {
|
|
@@ -5073,4 +5092,4 @@ declare function attachCreditMenu(body: Record<string, unknown>, menu: CreditMen
|
|
|
5073
5092
|
*/
|
|
5074
5093
|
declare function toCreditTerms(menu: CreditMenu): CreditTerms;
|
|
5075
5094
|
|
|
5076
|
-
export {
|
|
5095
|
+
export { buildPaymentErrorResponse as $, type AccumulatorPool as A, type BuilderIdentityKeypair as B, type CreatedInvoice as C, type X402SettlementRepair as D, type X402SettlementRepairRefusal as E, type FiatDenomination as F, type X402SettlementRepaired as G, type X402WedgedSettlement as H, type InvoiceStatus as I, JobCancelledError as J, type X402WedgedSettlementPage as K, type LightningBackend as L, type MintAmountBounds as M, X402_BATCH_SETTLEMENT_MAINNET_NETWORK as N, abortJob as O, PAYMENT_PROOF_KEYS as P, amountBoundsVerdict as Q, type ReporterBannerOpts as R, type SDKServerOpts as S, type TempoChannelReport as T, type UpfrontPaymentOpts as U, type VerifiedIncomingPayment as V, applyPaymentInfoToJob as W, type X402BatchChannelObservation as X, assertNutSupport as Y, assertRevenueReporterReady as Z, buildAttestation as _, type LightningPayment as a, type MemoryConsumedCredentialStoreOpts as a$, canSwap as a0, checkMintHealth as a1, clearAccumulatorForDvm as a2, createDVMServer as a3, creditDepositPayload as a4, derivedFundCreditId as a5, devModeSkipsPaymentVerification as a6, fromJobRecord as a7, fundedMicroFor as a8, generateIdentity as a9, verifyAttestation as aA, verifyIncomingPayment as aB, verifyTempoSessionManagementCredential as aC, verifyUpfrontPayment as aD, writeIdentity as aE, x402RequiredUsdcMicro as aF, x402SettledShare as aG, type CreditMenu as aH, ReceiptIssuer as aI, LightningReceive as aJ, TempoSettlementReadiness as aK, type DVMHostOpts as aL, type BuildCreditMenuArgs as aM, type BuilderIdentity as aN, CREDIT_ENVELOPE_KEYS as aO, type CreateX402BatchSettlementServerOpts as aP, type CreditEnvelope as aQ, CreditEnvelopeError as aR, type CreditFundCommitment as aS, type CreditTerms as aT, DEFAULT_INVOICE_TTL_SECONDS as aU, type DVMHost as aV, JobManager as aW, type JobManagerOpts as aX, type LightningReceiveConfig as aY, MIN_INVOICE_TTL_SECONDS as aZ, MemoryConsumedCredentialStore as a_, hasPaymentProof as aa, hashCapabilities as ab, hashLockKey as ac, implicitCreditId as ad, initWalletAccumulatorTable as ae, insertAccumulatorRows as af, isDerivedCreditId as ag, isTerminal as ah, isYieldMessage as ai, issueUpfrontChallenges as aj, loadIdentitySecret as ak, toLockPubkey as al, msatsToFiatMicro as am, paymentErrorBody as an, pinAskFiat as ao, priceFiatMicro as ap, processIncomingPayment as aq, providerMessage as ar, repairX402ExactSettlementEffect as as, resolveFxSnapshot as at, resolvePriceFiat as au, revenueReporterBannerState as av, signAttestation as aw, toCreditTerms as ax, toJobRecord as ay, unknownRouteNotFound as az, type LightningWalletInfo as b, MemoryProcessedPaymentStore as b0, MemoryX402ExactSettlementStore as b1, type MountOpts as b2, type OwnerDisplay as b3, type PlatformReporterOpts as b4, PostgresProcessedPaymentStore as b5, PostgresX402ExactSettlementStore as b6, type PriceFiat as b7, type ProcessedPaymentQuerier as b8, type ProcessedPaymentRail as b9, attachCreditMenu as bA, buildCreditMenu as bB, createDVMHost as bC, createX402BatchSettlementServer as bD, creditEnvelopeIgnoreFields as bE, drawSettlementRef as bF, extractCreditEnvelope as bG, fundingCommitment as bH, selectPrimaryCredit as bI, stripCreditEnvelope as bJ, toCreditView as bK, type ProcessedPaymentRecord as ba, ProcessedPaymentReplayError as bb, type ProcessedPaymentStore as bc, type X402BatchAcceptance as bd, type X402BatchFunding as be, type X402BatchRefusal as bf, type X402BatchSettlementServer as bg, type X402ExactAcceptance as bh, X402ExactIntentConflictError as bi, type X402ExactSettlementAttempt as bj, type X402ExactSettlementChainEvidence as bk, type X402ExactSettlementEffect as bl, X402ExactSettlementEvidenceMissingError as bm, type X402ExactSettlementEvidenceReader as bn, type X402ExactSettlementIntent as bo, X402ExactSettlementNotReadyError as bp, X402ExactSettlementServer as bq, type X402ExactSettlementServerOpts as br, type X402ExactSettlementStatus as bs, type X402ExactSettlementStore as bt, type X402SettlementChainEvidence as bu, type X402SettlementEvidenceReader as bv, X402SettlementSubmissionError as bw, X402_BATCH_AUTO_SETTLEMENT as bx, X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS as by, X402_BATCH_SETTLEMENT_NETWORK as bz, type LockPubkey as c, type AccumulatorQuerier as d, type ConsumedCredentialStore as e, type MintHealthCheckResult as f, type AppEnv as g, type AttestationPayload as h, type CheckMintHealthOptions as i, type CreditFundingReport as j, type FiatDenominationFailure as k, type FundOnlyRequest as l, type IncomingPaymentOpts as m, MintHealthTracker as n, type PaymentErrorCode as o, type PaymentErrorDetail as p, type PaymentInfo as q, type ResolvedFx as r, type RevenueBootCheckOpts as s, type ServerJob as t, type ShortPayForfeit as u, type TempoObserverHealth as v, TempoSessionChannelMismatchError as w, type VerifyIncomingSnapshot as x, X402FacilitatorHealth as y, type X402SettlementEvidenceOutcome as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './job-store-
|
|
2
|
-
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DVMRouteContext, I as IncomingMessage, l as InputType, m as InvalidCurrencyError, J as JobRecord, n as JobStatus, o as JobStore, K as KVStore, L as Logger, P as PaymentContent, p as PaymentMethod, q as PriceValue, r as ProgressContent, s as PromptOpts, Q as QuoteConfig, t as QuoteContext, u as QuoteResult, R as ResolvedCreditConfig, v as ResponseContent, S as SDKJobContext, w as SDKPaymentRequestOpts, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, z as SignedRequestAudience, B as SignedRequestDomain, E as SignedRequestError, F as SignedRequestFailure, G as SignedRequestReplayStore, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, U as UnsupportedCurrencyError, O as createSignedRequestVerifier, T as isZodSchema, V as signedRequestStatementHeader, W as validateCurrency } from './job-store-
|
|
3
|
-
export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-
|
|
4
|
-
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-
|
|
1
|
+
import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './job-store-BtCaLnvJ.js';
|
|
2
|
+
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DVMRouteContext, I as IncomingMessage, l as InputType, m as InvalidCurrencyError, J as JobRecord, n as JobStatus, o as JobStore, K as KVStore, L as Logger, P as PaymentContent, p as PaymentMethod, q as PriceValue, r as ProgressContent, s as PromptOpts, Q as QuoteConfig, t as QuoteContext, u as QuoteResult, R as ResolvedCreditConfig, v as ResponseContent, S as SDKJobContext, w as SDKPaymentRequestOpts, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, z as SignedRequestAudience, B as SignedRequestDomain, E as SignedRequestError, F as SignedRequestFailure, G as SignedRequestReplayStore, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, U as UnsupportedCurrencyError, O as createSignedRequestVerifier, T as isZodSchema, V as signedRequestStatementHeader, W as validateCurrency } from './job-store-BtCaLnvJ.js';
|
|
3
|
+
export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-Pf4Ey4f_.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-D7fW2S7I.js';
|
|
5
5
|
export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from './ssrf-DbFkpDv0.js';
|
|
6
6
|
export { z } from 'zod';
|
|
7
7
|
import '@cashu/cashu-ts';
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
configureDVM,
|
|
9
9
|
isConfiguredDVMDescriptor
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LDTWX7JW.js";
|
|
11
11
|
import {
|
|
12
12
|
DEFAULT_CREDIT_MAX,
|
|
13
13
|
DEFAULT_CREDIT_MIN,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
createSignedRequestVerifier,
|
|
19
19
|
isZodSchema,
|
|
20
20
|
signedRequestStatementHeader
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-P4RUVDU7.js";
|
|
22
22
|
import {
|
|
23
23
|
DEFAULT_FX_CURRENCIES,
|
|
24
24
|
DEFAULT_FX_RATE_SOURCE,
|