@dvmkit/sdk 0.10.1 → 0.12.0-rc.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-STJBBVNL.js → chunk-2VGMZ7VF.js} +487 -71
- package/dist/{chunk-3Q6FTZDB.js → chunk-3YFFZLW7.js} +2 -2
- package/dist/{chunk-VMHYGKWT.js → chunk-566CFXGU.js} +9 -1
- package/dist/chunk-5H7P3ORL.js +92 -0
- package/dist/{chunk-3R7NQA3Z.js → chunk-7KQLPVV7.js} +1 -1
- package/dist/{chunk-JNECYURT.js → chunk-D4FFS3IS.js} +1 -1
- package/dist/{chunk-VTHYQCDB.js → chunk-E7ZBCT5U.js} +1 -1
- package/dist/{chunk-MMGSYMIC.js → chunk-EP7OVWI5.js} +1 -1
- package/dist/{chunk-LDIPVPKI.js → chunk-FFRTAQUW.js} +1 -1
- package/dist/chunk-H3GGFEE5.js +57 -0
- package/dist/{chunk-M3T5JYDJ.js → chunk-HNXMWHLU.js} +1 -1
- package/dist/{chunk-UKD3R2KU.js → chunk-HW2UCOOC.js} +4 -55
- package/dist/{chunk-FFXXGCVG.js → chunk-ITRSITFP.js} +1 -1
- package/dist/{chunk-MU3IE434.js → chunk-JLT2YIBS.js} +267 -52
- package/dist/{chunk-KFCEXCZM.js → chunk-KJZVTWMX.js} +1 -1
- package/dist/{chunk-W3VGCNG6.js → chunk-LDKV4UHI.js} +1 -1
- package/dist/{chunk-AJ6UHXUA.js → chunk-M4NFYEEY.js} +1 -1
- package/dist/{chunk-MB6R4XPZ.js → chunk-NS2OMIU7.js} +15 -3
- package/dist/{chunk-YOSZIWC3.js → chunk-POYUX2NN.js} +149 -11
- package/dist/{chunk-VUGEEMLT.js → chunk-RPUFWIT4.js} +11 -89
- package/dist/{chunk-SYBFMHXQ.js → chunk-S7PIFHE4.js} +590 -67
- package/dist/{chunk-2OGBZPPJ.js → chunk-TWKQFIOW.js} +21 -3
- package/dist/{chunk-EWZFANHJ.js → chunk-VWIMQ5H5.js} +1 -1
- package/dist/{chunk-2XQLL6N6.js → chunk-WFCVS6QB.js} +2 -2
- package/dist/{chunk-QGNXYVBO.js → chunk-Z4FOPROB.js} +17 -0
- package/dist/{content-retention-CrILCNxk.d.ts → content-retention-a1yRdmhI.d.ts} +1 -1
- package/dist/{credit-ledger-4PZNAMDT.js → credit-ledger-MF23UKRJ.js} +6 -3
- package/dist/{credit-menu-BWsVqMh-.d.ts → credit-menu-B2T-O9oY.d.ts} +11 -4
- package/dist/{fx-BM5h4o5S.d.ts → fx-DLhscRUh.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -5
- package/dist/internal/caller.d.ts +8 -6
- package/dist/internal/caller.js +27 -22
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +24 -22
- package/dist/{job-store-92v8e1LQ.d.ts → job-store-B8Ijr5V6.d.ts} +3 -1
- package/dist/{lightning-backend-9oky_wJi.d.ts → lightning-backend-DmwMSgaM.d.ts} +1 -1
- package/dist/memory-credit-ledger-ERD764PS.js +14 -0
- package/dist/{mpp-setup-FURD45LI.js → mpp-setup-JU3MT7QX.js} +3 -3
- package/dist/{payout-reporter-HVJ6WUF3.js → payout-reporter-NXWQVKXW.js} +2 -2
- package/dist/{postgres-consumed-credential-store-WO6OCFXZ.js → postgres-consumed-credential-store-WXJLM6J7.js} +1 -1
- package/dist/{postgres-job-store-H45PRBLA.js → postgres-job-store-ZVMAN6L2.js} +2 -2
- package/dist/{postgres-replay-store-XXJSA457.js → postgres-replay-store-QJ4FG6AR.js} +2 -2
- package/dist/{pricing-X4XU5HXY.js → pricing-KCLENT2C.js} +3 -3
- package/dist/{revenue-reporter-EV3K5L6B.js → revenue-reporter-HD4GMXGD.js} +2 -2
- package/dist/server/index.d.ts +30 -12
- package/dist/server/index.js +32 -30
- package/dist/{step-cache--7yA5Ihr.d.ts → step-cache-DQqpwXa8.d.ts} +206 -47
- package/dist/{tempo-charge-store-5JOIYUIH.js → tempo-charge-store-7LTUAQHQ.js} +2 -2
- package/dist/{tempo-session-store-S6QMLQUA.js → tempo-session-store-LYAIDR2B.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +6 -6
- package/dist/{usd-C7lvLvLk.d.ts → usd-D5kk2nIT.d.ts} +1 -1
- package/dist/{x402-EN5LSOVM.js → x402-RUJ4LUKF.js} +3 -3
- package/package.json +1 -1
- package/recipes/postgres/financial-export-v1.sql +19 -5
- package/dist/memory-credit-ledger-RP7DT5IY.js +0 -11
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-COYKJRMM.js";
|
|
8
8
|
import {
|
|
9
9
|
diagnosticConsole
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z4FOPROB.js";
|
|
11
11
|
|
|
12
12
|
// src/sdk/server/postgres-job-store.ts
|
|
13
13
|
import { createHash } from "crypto";
|
|
@@ -151,6 +151,14 @@ var PostgresJobStore = class {
|
|
|
151
151
|
await withSdkInitLock(this.pool, () => this.createTables());
|
|
152
152
|
}
|
|
153
153
|
async createTables() {
|
|
154
|
+
await this.pool.query(`CREATE TABLE IF NOT EXISTS credit_balance_payments (
|
|
155
|
+
payment_id TEXT PRIMARY KEY,
|
|
156
|
+
fingerprint TEXT NOT NULL,
|
|
157
|
+
job_id TEXT NOT NULL,
|
|
158
|
+
request_seq BIGINT NOT NULL,
|
|
159
|
+
response JSONB NOT NULL,
|
|
160
|
+
UNIQUE(job_id, request_seq)
|
|
161
|
+
)`);
|
|
154
162
|
await this.pool.query(`
|
|
155
163
|
CREATE TABLE IF NOT EXISTS jobs (
|
|
156
164
|
id TEXT PRIMARY KEY,
|
|
@@ -719,6 +727,8 @@ var PostgresJobStore = class {
|
|
|
719
727
|
* Read terminal zero-revenue jobs whose latest declared-cost revision has
|
|
720
728
|
* not yet reached the durable reporter outbox. Keep the filter in step with
|
|
721
729
|
* `idx_jobs_unreported_terminal_cost`, which bounds each pass to the backlog.
|
|
730
|
+
* Completed balance-paid work carries cost through revenue even when its
|
|
731
|
+
* allocated rail value is zero; its durable acceptance excludes a cost-only replay.
|
|
722
732
|
*/
|
|
723
733
|
async listUnreportedTerminalCosts(args) {
|
|
724
734
|
const { rows } = await this.pool.query(
|
|
@@ -729,7 +739,9 @@ var PostgresJobStore = class {
|
|
|
729
739
|
AND (cost_reported_revision IS NULL OR cost_reported_revision < cost_revision)
|
|
730
740
|
AND (
|
|
731
741
|
status IN ('failed', 'cancelled')
|
|
732
|
-
OR (status = 'completed' AND paid_msats = 0
|
|
742
|
+
OR (status = 'completed' AND paid_msats = 0 AND NOT EXISTS (
|
|
743
|
+
SELECT 1 FROM credit_balance_payments p WHERE p.job_id=jobs.id
|
|
744
|
+
))
|
|
733
745
|
)
|
|
734
746
|
AND ($2::text IS NULL OR id > $2)
|
|
735
747
|
ORDER BY id
|
|
@@ -1201,7 +1213,12 @@ var PostgresJobStore = class {
|
|
|
1201
1213
|
}
|
|
1202
1214
|
async getCounters(jobId) {
|
|
1203
1215
|
const { rows } = await this.pool.query(
|
|
1204
|
-
|
|
1216
|
+
`SELECT status, paid_msats, pending_payment_msats, summary,
|
|
1217
|
+
EXISTS (SELECT 1 FROM credit_balance_payments p WHERE p.job_id=jobs.id
|
|
1218
|
+
AND p.request_seq=(SELECT MAX(m.seq) FROM job_messages m WHERE m.job_id=jobs.id
|
|
1219
|
+
AND m.data->>'type'='payment-request' AND m.data->>'from'='provider'
|
|
1220
|
+
AND m.status='verified')) AS balance_payment_satisfied
|
|
1221
|
+
FROM jobs WHERE id = $1`,
|
|
1205
1222
|
[jobId]
|
|
1206
1223
|
);
|
|
1207
1224
|
if (rows.length === 0) return void 0;
|
|
@@ -1450,6 +1467,7 @@ function requestIdAdvisoryLockKey(requesterPubkey, requestId) {
|
|
|
1450
1467
|
function rowToCounters(row) {
|
|
1451
1468
|
return {
|
|
1452
1469
|
status: row.status,
|
|
1470
|
+
...row.balance_payment_satisfied && { balancePaymentSatisfied: true },
|
|
1453
1471
|
paidMsats: Number(row.paid_msats),
|
|
1454
1472
|
pendingPaymentMsats: row.pending_payment_msats == null ? void 0 : Number(row.pending_payment_msats),
|
|
1455
1473
|
summary: row.summary ?? void 0
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
signedRequestHeaderMatchesDomain,
|
|
5
5
|
signedRequestStatementHeader,
|
|
6
6
|
testOnlySignedRequestDomain
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HW2UCOOC.js";
|
|
8
8
|
import {
|
|
9
9
|
diagnosticConsole
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z4FOPROB.js";
|
|
11
11
|
|
|
12
12
|
// src/sdk/server/zod-error.ts
|
|
13
13
|
function humanizeZodError(err, opts) {
|
|
@@ -405,9 +405,13 @@ var diagnostic_catalogue_v1_default = {
|
|
|
405
405
|
"tempo_close_observer_tick",
|
|
406
406
|
"tempo_credential_rejected",
|
|
407
407
|
"tempo_deposit_registration_alert_failed",
|
|
408
|
+
"tempo_drain_booked_as_refunded",
|
|
409
|
+
"tempo_drain_hold_reason_write_failed",
|
|
408
410
|
"tempo_drain_refund_below_debit",
|
|
411
|
+
"tempo_drain_refund_evidence_write_failed",
|
|
409
412
|
"tempo_drain_refund_forecast_below_debit",
|
|
410
413
|
"tempo_drain_refund_forecast_unavailable",
|
|
414
|
+
"tempo_drain_released",
|
|
411
415
|
"tempo_drain_written_off",
|
|
412
416
|
"tempo_observer_health_unavailable",
|
|
413
417
|
"tempo_observer_scan_failed",
|
|
@@ -546,6 +550,7 @@ var diagnostic_catalogue_v1_default = {
|
|
|
546
550
|
"/admin/cashu/rotate-lock-pubkey",
|
|
547
551
|
"/admin/credit/bitcoin-liability",
|
|
548
552
|
"/admin/credit/blocked-invoices",
|
|
553
|
+
"/admin/credit/book-tempo-drain",
|
|
549
554
|
"/admin/credit/mark-drain-sent",
|
|
550
555
|
"/admin/credit/park-drain",
|
|
551
556
|
"/admin/credit/pending-drains",
|
|
@@ -553,6 +558,7 @@ var diagnostic_catalogue_v1_default = {
|
|
|
553
558
|
"/admin/credit/reconcile-tempo-drain",
|
|
554
559
|
"/admin/credit/reconcile-x402-exact-settlement",
|
|
555
560
|
"/admin/credit/reconcile-x402-settlement",
|
|
561
|
+
"/admin/credit/release-tempo-drain",
|
|
556
562
|
"/admin/credit/retry-tempo-close-report",
|
|
557
563
|
"/admin/credit/tempo-close-reports",
|
|
558
564
|
"/admin/credit/tempo-drains",
|
|
@@ -1344,6 +1350,17 @@ function projectField(key, value, dataset, authority, identityAuthority, eventNa
|
|
|
1344
1350
|
if (key === "prior_status")
|
|
1345
1351
|
return typeof value === "string" && TEMPO_CLOSE_REPORT_PRIOR_STATUSES.has(value) ? value : void 0;
|
|
1346
1352
|
const closeReportEvent = eventName === "tempo_session_close_report_written_off" || eventName === "tempo_session_close_report_reopened";
|
|
1353
|
+
const drainDecisionEvent = eventName === "tempo_drain_booked_as_refunded" || eventName === "tempo_drain_released";
|
|
1354
|
+
if (drainDecisionEvent) {
|
|
1355
|
+
if (key === "drain_reference")
|
|
1356
|
+
return typeof value === "string" && /^sha256:[0-9a-f]{64}$/.test(value) ? value : void 0;
|
|
1357
|
+
if (key === "credit_id" || key === "drain_id")
|
|
1358
|
+
return typeof value === "string" && /^[a-zA-Z0-9_.:-]{1,512}$/.test(value) ? value : void 0;
|
|
1359
|
+
if (key === "channel_id")
|
|
1360
|
+
return typeof value === "string" && /^0x[0-9a-fA-F]{64}$/.test(value) ? value : void 0;
|
|
1361
|
+
if (key === "amount_native")
|
|
1362
|
+
return value === null || typeof value === "string" && DECIMAL_RE.test(value) ? value : void 0;
|
|
1363
|
+
}
|
|
1347
1364
|
const payerExitEvent = eventName === "tempo_session_close_exit_resolved";
|
|
1348
1365
|
if (closeReportEvent || payerExitEvent) {
|
|
1349
1366
|
if (key === "obligation_id")
|
|
@@ -10,11 +10,14 @@ import {
|
|
|
10
10
|
isDrainMethod,
|
|
11
11
|
isFundingRail,
|
|
12
12
|
x402SettlementPending
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2VGMZ7VF.js";
|
|
14
|
+
import "./chunk-YG7G4DPZ.js";
|
|
14
15
|
import "./chunk-COYKJRMM.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-5H7P3ORL.js";
|
|
17
|
+
import "./chunk-EP7OVWI5.js";
|
|
16
18
|
import "./chunk-BPYMEMQX.js";
|
|
17
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-H3GGFEE5.js";
|
|
20
|
+
import "./chunk-Z4FOPROB.js";
|
|
18
21
|
export {
|
|
19
22
|
CreditLedger,
|
|
20
23
|
CreditLedgerError,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-
|
|
2
|
-
import {
|
|
1
|
+
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DmwMSgaM.js';
|
|
2
|
+
import { ci as HostingCleanupFence, d3 as HostedIntent, aj as FundingMethod, p as PaymentMethod, bP as CreditLedgerLike, a5 as Message, $ as FundingReceipt, bR as CreditSnapshot, a0 as JobReceipt, S as SDKJobContext, ax as StepCache, v as ResponseContent, P as PaymentContent, a1 as MessageType, bk as X402Receipt, aF as X402Config, bj as X402ExactVersionSupport, d4 as X402SettlementIntent, ab as PaymentRequirementsV2, d5 as HostedFundingReservation, bL as CreditLedgerQuerier, d6 as X402SettlementCursor, bV as X402SettlementStatus, d7 as X402SettlementWriteOff, bQ as X402RefundSettlementGate, d8 as X402FacilitatorAuth, d9 as X402BatchSettlementConfig, cF as PostgresX402ChannelStorage, da as X402PayoutObserver, bN as HostedSettlementReportObligations, bn as CreditDepositPayload, bs as MppxServer, ae as CashuMode, db as CreditDepositEnqueue, dc as X402SettlementReconciliationReason, aq as PaymentRequirements, a3 as MppxCredential, bU as DrawResult, cs as CreditLedgerError, a7 as ReceiptCredit, ag as DrainReceiptEvent, a8 as DrainReceipt, K as KVStore, z as SignedRequestAudience, dd as CreditDrawReleaseEnqueue, cD as JobCostReportPayload, cE as JobTerminalReportPayload, cH as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, b_ as CreditInvoiceRecord, b$ as InvoiceSettlement, cm as ClientCompatibilityGate, ck as ClientCompatibility, bw as PostgresTempoSessionStore, bv as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-DQqpwXa8.js';
|
|
3
3
|
import { ProofLike, SerializedDLEQ, Proof } from '@cashu/cashu-ts';
|
|
4
4
|
import { Hono, Context } from 'hono';
|
|
5
5
|
import { Pool } from 'pg';
|
|
6
|
-
import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-
|
|
6
|
+
import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-DLhscRUh.js';
|
|
7
7
|
import { Store, Challenge } from 'mppx';
|
|
8
|
-
import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-
|
|
8
|
+
import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-B8Ijr5V6.js';
|
|
9
9
|
import { SettleResponse, SupportedResponse } from '@x402/core/types';
|
|
10
10
|
import { Channel, AutoSettlementConfig } from '@x402/evm/batch-settlement/server';
|
|
11
11
|
import { FacilitatorClient } from '@x402/core/server';
|
|
@@ -2932,6 +2932,8 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
2932
2932
|
private readonly statusChecksInFlight;
|
|
2933
2933
|
/** Job ids that were notified mid-re-read and must be re-checked. */
|
|
2934
2934
|
private readonly statusChecksQueued;
|
|
2935
|
+
private readonly paymentAskSeqs;
|
|
2936
|
+
private readonly reactivationAskSeqs;
|
|
2935
2937
|
private readonly inputResumeTails;
|
|
2936
2938
|
private readonly claimedPaymentResumes;
|
|
2937
2939
|
private readonly sessionId;
|
|
@@ -3084,6 +3086,8 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3084
3086
|
dispatchMessage(job: ServerJob, type: MessageType, content: unknown): Promise<void>;
|
|
3085
3087
|
private queueInputResume;
|
|
3086
3088
|
private claimLocalInput;
|
|
3089
|
+
private claimInputForAsk;
|
|
3090
|
+
private adoptPaymentMetadata;
|
|
3087
3091
|
private resumeClaimedPayment;
|
|
3088
3092
|
private dispatchMessageNow;
|
|
3089
3093
|
/**
|
|
@@ -3606,6 +3610,7 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
|
|
|
3606
3610
|
* fall back on is a slice of the credit's rail value at a ratio pinned
|
|
3607
3611
|
* whenever that credit was funded, so it cannot safely fund a new ask.
|
|
3608
3612
|
*/
|
|
3613
|
+
private hasAcceptedBalancePayment;
|
|
3609
3614
|
private resolveDrawPool;
|
|
3610
3615
|
/** Internal: structured warn for the one path that can't price a drawn job's pool. */
|
|
3611
3616
|
private warnDrawPool;
|
|
@@ -4499,6 +4504,8 @@ declare function unknownRouteNotFound(c: Context): Response;
|
|
|
4499
4504
|
* whitelists this shape so later caller-specific menu fields cannot leak into /v1/info.
|
|
4500
4505
|
*/
|
|
4501
4506
|
interface CreditTerms {
|
|
4507
|
+
/** Signed balance payments on the job messages endpoint are supported. */
|
|
4508
|
+
balance_payment?: true;
|
|
4502
4509
|
/** Smallest funding accepted, in 1e-6 units of `currency`. */
|
|
4503
4510
|
min_micro: number;
|
|
4504
4511
|
/** Largest residual balance a caller may hold, in 1e-6 units of `currency`. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache
|
|
2
|
-
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CreateSignedRequestVerifierOpts, g as CreditConfig, h as CreditView, i as DEFAULT_CREDIT_MAX, j as DEFAULT_CREDIT_MIN, k as DEFAULT_CREDIT_TTL_SECONDS, l as DEFAULT_JOB_RETENTION_DAYS, m as DVMRouteContext, I as IncomingMessage, n as InputType, o as InvalidCurrencyError, J as JobCost, 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 './step-cache
|
|
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, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g 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-
|
|
5
|
-
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-
|
|
1
|
+
import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-DQqpwXa8.js';
|
|
2
|
+
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CreateSignedRequestVerifierOpts, g as CreditConfig, h as CreditView, i as DEFAULT_CREDIT_MAX, j as DEFAULT_CREDIT_MIN, k as DEFAULT_CREDIT_TTL_SECONDS, l as DEFAULT_JOB_RETENTION_DAYS, m as DVMRouteContext, I as IncomingMessage, n as InputType, o as InvalidCurrencyError, J as JobCost, 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 './step-cache-DQqpwXa8.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, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-DLhscRUh.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-D5kk2nIT.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-B8Ijr5V6.js';
|
|
6
6
|
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';
|
|
7
7
|
export { z } from 'zod';
|
|
8
8
|
import 'hono';
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
SignedRequestError,
|
|
12
12
|
createSignedRequestVerifier
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WFCVS6QB.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_CREDIT_MAX,
|
|
16
16
|
DEFAULT_CREDIT_MIN,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
21
21
|
isZodSchema,
|
|
22
22
|
signedRequestStatementHeader
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HW2UCOOC.js";
|
|
24
24
|
import {
|
|
25
25
|
buildUpfront
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-D4FFS3IS.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_FX_CURRENCIES,
|
|
29
29
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -41,8 +41,9 @@ import {
|
|
|
41
41
|
roundUsd,
|
|
42
42
|
satsToFiat,
|
|
43
43
|
validateCurrency
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
} from "./chunk-LDKV4UHI.js";
|
|
45
|
+
import "./chunk-H3GGFEE5.js";
|
|
46
|
+
import "./chunk-Z4FOPROB.js";
|
|
46
47
|
|
|
47
48
|
// src/sdk/configure.ts
|
|
48
49
|
function configureDVM(config) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-
|
|
2
|
-
export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-
|
|
1
|
+
import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-DmwMSgaM.js';
|
|
2
|
+
export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-DmwMSgaM.js';
|
|
3
3
|
import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
|
|
4
4
|
export { g as getWallet } from '../wallet-Dwjs5n_M.js';
|
|
5
|
-
import { X as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, Y as X402_BATCH_SETTLEMENT_SCHEME, _ as X402_EXACT_SCHEME, $ as FundingReceipt, a0 as JobReceipt$1, a1 as MessageType, a2 as X402Version, a3 as MppxCredential, z as SignedRequestAudience, a4 as PaymentRequired, a5 as Message, a6 as MppxChallenge, a7 as ReceiptCredit, a8 as DrainReceipt, C as Currency, a9 as X402Wallet, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache
|
|
6
|
-
export { ac as BuildPaymentRequirementsOpts, ad as CapabilityDescriptor, ae as CashuMode, af as CompleteContent, ag as DrainReceiptEvent, ah as ExactEvmPayload, ai as ExactEvmPayloadAuthorization, aj as FundingMethod, ak as MessageFrom, al as PaymentPayload, am as PaymentPayloadV1, an as PaymentPayloadV2, ao as PaymentRequestContent, ap as PaymentRequiredV2, aq as PaymentRequirements, ar as PromptContent, as as RAIL_REFUNDABLE, at as ReceiptOutcome, au as ReceiptPayment, av as ResourceInfo, aw as SettleResponse, ax as StepCache, ay as StepRecord, az as TextContent, aA as UnsignedDrainReceipt, aB as UnsignedFundingReceipt, aC as UnsignedJobReceipt, aD as VerifyResponse, aE as WorkingContent, aF as X402Config, aG as X402ResponseBody, aH as X402SelfRelayRpcFailureReason, aI as X402_DEFAULT_NETWORK, aJ as X402_V1_VERSION, aK as X402_VERSION, aL as buildPaymentRequiredV2, aM as buildPaymentRequirements, aN as caip2ToX402Network, aO as canonicalRequestPath, aP as canonicaliseForSigning, aQ as canonicalize, aR as chainIdFromCaip2, aS as computeResultHash, aT as decodePayment, aU as decodePaymentRequiredHeader, aV as encodePayment, aW as encodePaymentRequiredHeader, aX as encodeSettleResponseHeader, aY as exactEvmAuthorization, aZ as isArtifactMessage, a_ as isCancelMessage, a$ as isCompleteMessage, b0 as isDrainReceipt, b1 as isFundingReceipt, b2 as isPaymentRequestMessage, b3 as isPromptMessage, b4 as isSignedJobReceipt, b5 as isTextMessage, b6 as isWorkingMessage, b7 as paymentRequiredV2FromV1, b8 as signDrainReceipt, b9 as signFundingReceipt, ba as signReceipt, bb as usdcContractByCaip2, bc as usdcContractFor, bd as usdcDomainNameFor, be as usdcDomainVersionFor, bf as verifyDrainReceipt, bg as verifyFundingReceipt, bh as verifyReceipt, bi as x402NetworkToCaip2 } from '../step-cache
|
|
5
|
+
import { X as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, Y as X402_BATCH_SETTLEMENT_SCHEME, _ as X402_EXACT_SCHEME, $ as FundingReceipt, a0 as JobReceipt$1, a1 as MessageType, a2 as X402Version, a3 as MppxCredential, z as SignedRequestAudience, a4 as PaymentRequired, a5 as Message, a6 as MppxChallenge, a7 as ReceiptCredit, a8 as DrainReceipt, C as Currency, a9 as X402Wallet, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-DQqpwXa8.js';
|
|
6
|
+
export { ac as BuildPaymentRequirementsOpts, ad as CapabilityDescriptor, ae as CashuMode, af as CompleteContent, ag as DrainReceiptEvent, ah as ExactEvmPayload, ai as ExactEvmPayloadAuthorization, aj as FundingMethod, ak as MessageFrom, al as PaymentPayload, am as PaymentPayloadV1, an as PaymentPayloadV2, ao as PaymentRequestContent, ap as PaymentRequiredV2, aq as PaymentRequirements, ar as PromptContent, as as RAIL_REFUNDABLE, at as ReceiptOutcome, au as ReceiptPayment, av as ResourceInfo, aw as SettleResponse, ax as StepCache, ay as StepRecord, az as TextContent, aA as UnsignedDrainReceipt, aB as UnsignedFundingReceipt, aC as UnsignedJobReceipt, aD as VerifyResponse, aE as WorkingContent, aF as X402Config, aG as X402ResponseBody, aH as X402SelfRelayRpcFailureReason, aI as X402_DEFAULT_NETWORK, aJ as X402_V1_VERSION, aK as X402_VERSION, aL as buildPaymentRequiredV2, aM as buildPaymentRequirements, aN as caip2ToX402Network, aO as canonicalRequestPath, aP as canonicaliseForSigning, aQ as canonicalize, aR as chainIdFromCaip2, aS as computeResultHash, aT as decodePayment, aU as decodePaymentRequiredHeader, aV as encodePayment, aW as encodePaymentRequiredHeader, aX as encodeSettleResponseHeader, aY as exactEvmAuthorization, aZ as isArtifactMessage, a_ as isCancelMessage, a$ as isCompleteMessage, b0 as isDrainReceipt, b1 as isFundingReceipt, b2 as isPaymentRequestMessage, b3 as isPromptMessage, b4 as isSignedJobReceipt, b5 as isTextMessage, b6 as isWorkingMessage, b7 as paymentRequiredV2FromV1, b8 as signDrainReceipt, b9 as signFundingReceipt, ba as signReceipt, bb as usdcContractByCaip2, bc as usdcContractFor, bd as usdcDomainNameFor, be as usdcDomainVersionFor, bf as verifyDrainReceipt, bg as verifyFundingReceipt, bh as verifyReceipt, bi as x402NetworkToCaip2 } from '../step-cache-DQqpwXa8.js';
|
|
7
7
|
import { SimplePool } from 'nostr-tools/pool';
|
|
8
8
|
import { Session } from 'mppx/tempo';
|
|
9
9
|
import { Pool } from 'pg';
|
|
10
10
|
import { PaymentRequired as PaymentRequired$1 } from '@x402/core/types';
|
|
11
11
|
import { ClientChannelStorage, BatchSettlementClientContext, BatchSettlementEvmScheme } from '@x402/evm/batch-settlement/client';
|
|
12
|
-
export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-
|
|
13
|
-
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-
|
|
12
|
+
export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-DLhscRUh.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-D5kk2nIT.js';
|
|
14
14
|
import 'hono';
|
|
15
15
|
import 'mppx';
|
|
16
16
|
import '@x402/core/server';
|
|
@@ -1099,6 +1099,8 @@ interface Quote {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
/** Public prepaid-credit terms advertised on `/v1/info`. Snake_case: wire shape. */
|
|
1101
1101
|
interface CreditTerms {
|
|
1102
|
+
/** Signed balance payments on the job messages endpoint are supported. */
|
|
1103
|
+
balance_payment?: true;
|
|
1102
1104
|
/** Smallest funding accepted, in 1e-6 units of `currency`. */
|
|
1103
1105
|
min_micro: number;
|
|
1104
1106
|
/** Largest residual balance a caller may hold, in 1e-6 units of `currency`. */
|
package/dist/internal/caller.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
sha256hex,
|
|
33
33
|
validateX402Env,
|
|
34
34
|
withNwcPool
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-M4NFYEEY.js";
|
|
36
36
|
import {
|
|
37
37
|
MemoryKVStore
|
|
38
38
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -81,7 +81,6 @@ import {
|
|
|
81
81
|
canSwap,
|
|
82
82
|
checkMintHealth,
|
|
83
83
|
checkReceiptAttestation,
|
|
84
|
-
computeResultHash,
|
|
85
84
|
costAnchor,
|
|
86
85
|
createMonotonicClock,
|
|
87
86
|
deleteAgentMnemonic,
|
|
@@ -105,11 +104,8 @@ import {
|
|
|
105
104
|
getLastKnownBtcRate,
|
|
106
105
|
getWallet,
|
|
107
106
|
hashCapabilities,
|
|
108
|
-
isDrainReceipt,
|
|
109
|
-
isFundingReceipt,
|
|
110
107
|
isJobIdentityValue,
|
|
111
108
|
isPublicRequestId,
|
|
112
|
-
isSignedJobReceipt,
|
|
113
109
|
isStorableJobId,
|
|
114
110
|
isX402SettlementReconciliationReason,
|
|
115
111
|
loadAgentWallet,
|
|
@@ -125,25 +121,19 @@ import {
|
|
|
125
121
|
repairConfigDirMode,
|
|
126
122
|
saveAgentWallet,
|
|
127
123
|
signAttestation,
|
|
128
|
-
signDrainReceipt,
|
|
129
|
-
signFundingReceipt,
|
|
130
|
-
signReceipt,
|
|
131
124
|
toLockPubkey,
|
|
132
125
|
validateAgentMnemonic,
|
|
133
126
|
verifyAttestation,
|
|
134
127
|
verifyChallenge,
|
|
135
|
-
verifyDrainReceipt,
|
|
136
128
|
verifyDrainReceiptChain,
|
|
137
|
-
verifyFundingReceipt,
|
|
138
129
|
verifyFundingReceiptChain,
|
|
139
130
|
verifyJobReceipt,
|
|
140
|
-
verifyReceipt,
|
|
141
131
|
walletExists,
|
|
142
132
|
weakestReceiptVerdict,
|
|
143
133
|
withWalletLock,
|
|
144
134
|
writeAgentMnemonic,
|
|
145
135
|
writeIdentity
|
|
146
|
-
} from "../chunk-
|
|
136
|
+
} from "../chunk-RPUFWIT4.js";
|
|
147
137
|
import {
|
|
148
138
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
149
139
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -182,15 +172,12 @@ import {
|
|
|
182
172
|
SIGNED_REQUEST_AUTH_ID,
|
|
183
173
|
canonicalRequestPath,
|
|
184
174
|
canonicalSignedRequestStatement,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
signedRequestStatementHeader,
|
|
188
|
-
verifyCanonicalSignedRequest
|
|
189
|
-
} from "../chunk-UKD3R2KU.js";
|
|
175
|
+
signedRequestStatementHeader
|
|
176
|
+
} from "../chunk-HW2UCOOC.js";
|
|
190
177
|
import {
|
|
191
178
|
createNoopLogger,
|
|
192
179
|
createStdoutLogger
|
|
193
|
-
} from "../chunk-
|
|
180
|
+
} from "../chunk-7KQLPVV7.js";
|
|
194
181
|
import {
|
|
195
182
|
redactUrl,
|
|
196
183
|
redactUrlsInText
|
|
@@ -204,11 +191,23 @@ import {
|
|
|
204
191
|
InvalidUsdPriceError,
|
|
205
192
|
parseUsdPrice,
|
|
206
193
|
warmFxSnapshot
|
|
207
|
-
} from "../chunk-
|
|
194
|
+
} from "../chunk-LDKV4UHI.js";
|
|
195
|
+
import {
|
|
196
|
+
computeResultHash,
|
|
197
|
+
isDrainReceipt,
|
|
198
|
+
isFundingReceipt,
|
|
199
|
+
isSignedJobReceipt,
|
|
200
|
+
signDrainReceipt,
|
|
201
|
+
signFundingReceipt,
|
|
202
|
+
signReceipt,
|
|
203
|
+
verifyDrainReceipt,
|
|
204
|
+
verifyFundingReceipt,
|
|
205
|
+
verifyReceipt
|
|
206
|
+
} from "../chunk-5H7P3ORL.js";
|
|
208
207
|
import {
|
|
209
208
|
applyRetryToPool,
|
|
210
209
|
withInitRetry
|
|
211
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-EP7OVWI5.js";
|
|
212
211
|
import {
|
|
213
212
|
DvmError,
|
|
214
213
|
X402_NETWORKS,
|
|
@@ -222,6 +221,11 @@ import {
|
|
|
222
221
|
x402NetworkListForCopy,
|
|
223
222
|
x402SupportedNetworksHint
|
|
224
223
|
} from "../chunk-BPYMEMQX.js";
|
|
224
|
+
import {
|
|
225
|
+
canonicaliseForSigning,
|
|
226
|
+
canonicalize,
|
|
227
|
+
verifyCanonicalSignedRequest
|
|
228
|
+
} from "../chunk-H3GGFEE5.js";
|
|
225
229
|
import {
|
|
226
230
|
currentContext,
|
|
227
231
|
initLoggers,
|
|
@@ -230,7 +234,7 @@ import {
|
|
|
230
234
|
randomTraceId,
|
|
231
235
|
setEmitter,
|
|
232
236
|
withTraceContext
|
|
233
|
-
} from "../chunk-
|
|
237
|
+
} from "../chunk-HNXMWHLU.js";
|
|
234
238
|
import "../chunk-66HGCPBU.js";
|
|
235
239
|
import {
|
|
236
240
|
DIAGNOSTIC_CATALOGUE_VERSION,
|
|
@@ -241,7 +245,7 @@ import {
|
|
|
241
245
|
projectDiagnosticFields,
|
|
242
246
|
projectEventName,
|
|
243
247
|
projectSpanRow
|
|
244
|
-
} from "../chunk-
|
|
248
|
+
} from "../chunk-Z4FOPROB.js";
|
|
245
249
|
|
|
246
250
|
// src/lib/budget-core.ts
|
|
247
251
|
function checkBudgetForLedger(ledger, opts) {
|
|
@@ -1094,6 +1098,7 @@ function parseCreditTerms(raw) {
|
|
|
1094
1098
|
const x402 = credit.x402 === void 0 ? void 0 : parseCreditX402Terms(credit.x402);
|
|
1095
1099
|
if (credit.x402 !== void 0 && !x402) return void 0;
|
|
1096
1100
|
return {
|
|
1101
|
+
...credit.balance_payment === true && { balance_payment: true },
|
|
1097
1102
|
min_micro: credit.min_micro,
|
|
1098
1103
|
max_micro: credit.max_micro,
|
|
1099
1104
|
ttl_ms: credit.ttl_ms,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { FacilitatorConfig } from '@x402/core/server';
|
|
2
|
-
import { al as PaymentPayload, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, aF as X402Config, aw as SettleResponse, aD as VerifyResponse, bj as X402ExactVersionSupport, bk as X402Receipt, bl as TransactionalPayoutHook, bm as CashuMeltCompleted } from '../step-cache
|
|
3
|
-
export { bn as CreditDepositPayload, bo as CreditDrainPayload, bp as FundingLot, bq as LotDebit, br as LotDepletion, bs as MppxServer, bt as NON_CHANNEL_BITCOIN_RAILS, bu as NonChannelBitcoinRail, bv as PayoutReporter, bw as PostgresTempoSessionStore, bx as RevenueReporter, by as SIGNED_ENVELOPE_FIELDS, bz as SIGNED_ENVELOPE_TYPES, bA as X402TrackedChannel, bB as _testing, bC as createDefaultReplayStore, bD as depleteLots, bE as fifoOrder, bF as inKindDrawMsats, bG as isInKindDepletion, bH as isNonChannelBitcoinRail, bI as lotOwedSats, bJ as netOwedSats, bK as wrapMppx } from '../step-cache
|
|
2
|
+
import { al as PaymentPayload, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, aF as X402Config, aw as SettleResponse, aD as VerifyResponse, bj as X402ExactVersionSupport, bk as X402Receipt, bl as TransactionalPayoutHook, bm as CashuMeltCompleted } from '../step-cache-DQqpwXa8.js';
|
|
3
|
+
export { bn as CreditDepositPayload, bo as CreditDrainPayload, bp as FundingLot, bq as LotDebit, br as LotDepletion, bs as MppxServer, bt as NON_CHANNEL_BITCOIN_RAILS, bu as NonChannelBitcoinRail, bv as PayoutReporter, bw as PostgresTempoSessionStore, bx as RevenueReporter, by as SIGNED_ENVELOPE_FIELDS, bz as SIGNED_ENVELOPE_TYPES, bA as X402TrackedChannel, bB as _testing, bC as createDefaultReplayStore, bD as depleteLots, bE as fifoOrder, bF as inKindDrawMsats, bG as isInKindDepletion, bH as isNonChannelBitcoinRail, bI as lotOwedSats, bJ as netOwedSats, bK as wrapMppx } from '../step-cache-DQqpwXa8.js';
|
|
4
4
|
import { Hono } from 'hono';
|
|
5
5
|
import { Env, BlankSchema } from 'hono/types';
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
export { Pool } from 'pg';
|
|
8
8
|
import { g as getWallet } from '../wallet-Dwjs5n_M.js';
|
|
9
|
-
import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-
|
|
10
|
-
export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-
|
|
11
|
-
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-
|
|
9
|
+
import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-B2T-O9oY.js';
|
|
10
|
+
export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-B2T-O9oY.js';
|
|
11
|
+
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-B8Ijr5V6.js';
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
-
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-
|
|
13
|
+
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-DmwMSgaM.js';
|
|
14
14
|
import 'mppx';
|
|
15
15
|
import '@x402/evm/batch-settlement/server';
|
|
16
16
|
import '@x402/core/types';
|
|
17
17
|
import 'viem';
|
|
18
18
|
import '@cashu/cashu-ts';
|
|
19
|
-
import '../fx-
|
|
19
|
+
import '../fx-DLhscRUh.js';
|
|
20
20
|
|
|
21
21
|
declare function verifyWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<VerifyResponse>;
|
|
22
22
|
declare function settleWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<SettleResponse>;
|
package/dist/internal/server.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NS2OMIU7.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyX402Payment
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-3YFFZLW7.js";
|
|
7
7
|
import {
|
|
8
8
|
RevenueReporter
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-566CFXGU.js";
|
|
10
10
|
import {
|
|
11
11
|
PostgresTempoChargeStore
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-FFRTAQUW.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
15
15
|
MintHealthTracker,
|
|
@@ -61,28 +61,27 @@ import {
|
|
|
61
61
|
verifyUpfrontPayment,
|
|
62
62
|
x402RequiredUsdcMicro,
|
|
63
63
|
x402SettledShare
|
|
64
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-S7PIFHE4.js";
|
|
65
65
|
import "../chunk-XRLKGCAW.js";
|
|
66
66
|
import {
|
|
67
67
|
PayoutReporter
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-ITRSITFP.js";
|
|
69
69
|
import {
|
|
70
70
|
settleWithFacilitator,
|
|
71
71
|
verifyWithFacilitator
|
|
72
|
-
} from "../chunk-
|
|
73
|
-
import "../chunk-
|
|
74
|
-
import "../chunk-
|
|
75
|
-
import "../chunk-YG7G4DPZ.js";
|
|
72
|
+
} from "../chunk-E7ZBCT5U.js";
|
|
73
|
+
import "../chunk-POYUX2NN.js";
|
|
74
|
+
import "../chunk-TWKQFIOW.js";
|
|
76
75
|
import {
|
|
77
76
|
SIGNED_ENVELOPE_FIELDS,
|
|
78
77
|
SIGNED_ENVELOPE_TYPES,
|
|
79
78
|
createDefaultReplayStore,
|
|
80
79
|
humanizeZodError
|
|
81
|
-
} from "../chunk-
|
|
80
|
+
} from "../chunk-WFCVS6QB.js";
|
|
82
81
|
import {
|
|
83
82
|
createInstrumentedFetch,
|
|
84
83
|
isStaleJobReapable
|
|
85
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-KJZVTWMX.js";
|
|
86
85
|
import {
|
|
87
86
|
JobCancelledError,
|
|
88
87
|
abortJob,
|
|
@@ -94,14 +93,14 @@ import {
|
|
|
94
93
|
} from "../chunk-AFV77S4C.js";
|
|
95
94
|
import {
|
|
96
95
|
toLockPubkey
|
|
97
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-RPUFWIT4.js";
|
|
98
97
|
import "../chunk-62FI3NJF.js";
|
|
99
|
-
import "../chunk-
|
|
100
|
-
import "../chunk-
|
|
98
|
+
import "../chunk-HW2UCOOC.js";
|
|
99
|
+
import "../chunk-7KQLPVV7.js";
|
|
101
100
|
import "../chunk-FUJ36YDV.js";
|
|
102
101
|
import "../chunk-BQJIFRAZ.js";
|
|
103
|
-
import "../chunk-
|
|
104
|
-
import "../chunk-
|
|
102
|
+
import "../chunk-D4FFS3IS.js";
|
|
103
|
+
import "../chunk-LDKV4UHI.js";
|
|
105
104
|
import {
|
|
106
105
|
NON_CHANNEL_BITCOIN_RAILS,
|
|
107
106
|
depleteLots,
|
|
@@ -111,17 +110,20 @@ import {
|
|
|
111
110
|
isNonChannelBitcoinRail,
|
|
112
111
|
lotOwedSats,
|
|
113
112
|
netOwedSats
|
|
114
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-2VGMZ7VF.js";
|
|
114
|
+
import "../chunk-YG7G4DPZ.js";
|
|
115
115
|
import "../chunk-COYKJRMM.js";
|
|
116
|
-
import "../chunk-
|
|
116
|
+
import "../chunk-5H7P3ORL.js";
|
|
117
|
+
import "../chunk-EP7OVWI5.js";
|
|
117
118
|
import "../chunk-BPYMEMQX.js";
|
|
119
|
+
import "../chunk-H3GGFEE5.js";
|
|
118
120
|
import {
|
|
119
121
|
_testing,
|
|
120
122
|
wrapMppx
|
|
121
|
-
} from "../chunk-
|
|
122
|
-
import "../chunk-
|
|
123
|
+
} from "../chunk-JLT2YIBS.js";
|
|
124
|
+
import "../chunk-HNXMWHLU.js";
|
|
123
125
|
import "../chunk-66HGCPBU.js";
|
|
124
|
-
import "../chunk-
|
|
126
|
+
import "../chunk-Z4FOPROB.js";
|
|
125
127
|
export {
|
|
126
128
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
127
129
|
JobCancelledError,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProofLike } from '@cashu/cashu-ts';
|
|
2
|
-
import { a5 as Message, aj as FundingMethod, $ as FundingReceipt, bR as CreditSnapshot, a0 as JobReceipt, ay as StepRecord, a1 as MessageType } from './step-cache
|
|
2
|
+
import { a5 as Message, aj as FundingMethod, $ as FundingReceipt, bR as CreditSnapshot, a0 as JobReceipt, ay as StepRecord, a1 as MessageType } from './step-cache-DQqpwXa8.js';
|
|
3
3
|
|
|
4
4
|
type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
|
|
5
5
|
interface JobRecord {
|
|
@@ -210,6 +210,8 @@ interface JobRecord {
|
|
|
210
210
|
* the caller's own words to `ctx.signal.reason` and the `onCancel` hook.
|
|
211
211
|
*/
|
|
212
212
|
interface JobCounters {
|
|
213
|
+
/** The latest durable payment request was satisfied by a balance authorization. */
|
|
214
|
+
balancePaymentSatisfied?: boolean;
|
|
213
215
|
status: JobStatus;
|
|
214
216
|
paidMsats: number;
|
|
215
217
|
pendingPaymentMsats?: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemoryCreditLedger
|
|
3
|
+
} from "./chunk-POYUX2NN.js";
|
|
4
|
+
import "./chunk-2VGMZ7VF.js";
|
|
5
|
+
import "./chunk-YG7G4DPZ.js";
|
|
6
|
+
import "./chunk-COYKJRMM.js";
|
|
7
|
+
import "./chunk-5H7P3ORL.js";
|
|
8
|
+
import "./chunk-EP7OVWI5.js";
|
|
9
|
+
import "./chunk-BPYMEMQX.js";
|
|
10
|
+
import "./chunk-H3GGFEE5.js";
|
|
11
|
+
import "./chunk-Z4FOPROB.js";
|
|
12
|
+
export {
|
|
13
|
+
MemoryCreditLedger
|
|
14
|
+
};
|