@dvmkit/sdk 0.2.0-rc.9 → 0.2.1-rc.9
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/README.md +2 -0
- package/dist/{chunk-V7EVFLAK.js → chunk-2D75MNNG.js} +154 -523
- package/dist/{chunk-BIFLRKMO.js → chunk-2KGG5ORW.js} +1 -1
- package/dist/{chunk-5URG56JJ.js → chunk-A4CM2BD3.js} +18 -2
- package/dist/{chunk-FT6HTUM4.js → chunk-AJNFXR7J.js} +1 -1
- package/dist/{chunk-S3XAHZQY.js → chunk-COYKJRMM.js} +24 -3
- package/dist/{chunk-UP2F5RRT.js → chunk-D7YQYLLM.js} +1 -4
- package/dist/{chunk-OMIQMMME.js → chunk-FPOLJRBF.js} +3 -3
- package/dist/{chunk-QP53RWAD.js → chunk-JAHRF5X3.js} +1 -1
- package/dist/{chunk-PCUQZDZA.js → chunk-JNKQZVZX.js} +95 -321
- package/dist/{chunk-JDT5LCJC.js → chunk-MD3H3BF7.js} +1 -1
- package/dist/{chunk-KSQEFVFJ.js → chunk-MMCE7XSR.js} +1 -1
- package/dist/{chunk-MRAGS5VP.js → chunk-N5B66UOS.js} +4 -16
- package/dist/{chunk-2ATUAUAO.js → chunk-O6D72KYA.js} +2 -2
- package/dist/{chunk-KXCKFIJI.js → chunk-QX52F6IB.js} +1 -1
- package/dist/{chunk-PHHAYRQV.js → chunk-U5VNEALI.js} +23 -10
- package/dist/{chunk-JLXYOV4Y.js → chunk-V5ZRATJH.js} +1 -1
- package/dist/{chunk-6GRIKOFB.js → chunk-VA7GT6C6.js} +5 -16
- package/dist/{chunk-O2X2CCKH.js → chunk-VIVXB4CD.js} +1 -1
- package/dist/{chunk-L67WTZX2.js → chunk-XMDQOXHO.js} +10 -33
- package/dist/{chunk-QT4ONTST.js → chunk-XRLKGCAW.js} +1 -1
- package/dist/{chunk-KMZXTBLA.js → chunk-XZ7LW4S5.js} +0 -1
- package/dist/{chunk-XQXJKJ3P.js → chunk-YO56VCTQ.js} +0 -4
- package/dist/{credit-ledger-5ZEJRI46.js → credit-ledger-MHA652TV.js} +2 -2
- package/dist/{credit-menu-D4Gcdgc4.d.ts → credit-menu-kDA9RVzD.d.ts} +135 -532
- package/dist/{fx-B0SLBe5x.d.ts → fx-DhyT1Cjh.d.ts} +1 -1
- package/dist/index.d.ts +5 -17
- package/dist/internal/caller.d.ts +109 -698
- package/dist/internal/caller.js +10 -12
- package/dist/internal/server.d.ts +17 -42
- package/dist/internal/server.js +15 -15
- package/dist/{job-store-B2uZvga4.d.ts → job-store-D3CcZp_g.d.ts} +6 -10
- package/dist/{lightning-backend-CQBnQgsT.d.ts → lightning-backend-BhsyrBLa.d.ts} +1 -15
- package/dist/{memory-credit-ledger-ZOH6C3N4.js → memory-credit-ledger-BYBATRN3.js} +3 -3
- package/dist/{mpp-secret-state-WNAQQ6K4.js → mpp-secret-state-B5GCILVH.js} +1 -1
- package/dist/{mpp-setup-IOJBF7DB.js → mpp-setup-MPP3ST5X.js} +1 -1
- package/dist/{payout-reporter-5PIRYFVQ.js → payout-reporter-KEMUXEUO.js} +2 -2
- package/dist/{postgres-consumed-credential-store-ISRHBMOU.js → postgres-consumed-credential-store-6N2V5MJN.js} +1 -1
- package/dist/postgres-job-store-MZZZMS2B.js +7 -0
- package/dist/postgres-kv-store-DXGTKXLU.js +7 -0
- package/dist/{postgres-replay-store-IZFLTTAC.js → postgres-replay-store-ZF4JNZOW.js} +2 -2
- package/dist/{processed-payment-store-FIDI3RNH.js → processed-payment-store-GKMAWOM3.js} +2 -2
- package/dist/revenue-reporter-O75BGYFK.js +7 -0
- package/dist/server/index.d.ts +34 -140
- package/dist/server/index.js +52 -124
- package/dist/{step-cache-CXg7ziML.d.ts → step-cache-v2yhyhSZ.d.ts} +359 -1112
- package/dist/{tempo-charge-store-76TDAF34.js → tempo-charge-store-SDTUNTKA.js} +2 -2
- package/dist/{tempo-lifecycle-DXM7QXJQ.js → tempo-lifecycle-G5SB4HFC.js} +4 -4
- package/dist/{tempo-session-store-2JNOKJGX.js → tempo-session-store-WF3VZXNF.js} +2 -2
- package/dist/{tempo-wallet-O67H5M4N.js → tempo-wallet-ZFNUDFVO.js} +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +2 -2
- package/dist/{usd-BNDg1715.d.ts → usd-Cu9G6xv2.d.ts} +1 -1
- package/dist/{x402-7S2EFINY.js → x402-CI6PSHNO.js} +4 -4
- package/package.json +2 -2
- package/dist/postgres-job-store-OGQ6IT4U.js +0 -7
- package/dist/postgres-kv-store-D5E2EZ24.js +0 -7
- package/dist/revenue-reporter-NNCNRY4C.js +0 -7
package/dist/server/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AJNFXR7J.js";
|
|
4
4
|
import {
|
|
5
5
|
PostgresJobStore
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JAHRF5X3.js";
|
|
7
7
|
import {
|
|
8
8
|
PostgresKVStore
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-V5ZRATJH.js";
|
|
10
10
|
import {
|
|
11
11
|
SSRFError,
|
|
12
12
|
assertSafeUrl,
|
|
@@ -78,16 +78,16 @@ import {
|
|
|
78
78
|
stripProtocolEnvelope,
|
|
79
79
|
toCreditView,
|
|
80
80
|
unknownRouteNotFound
|
|
81
|
-
} from "../chunk-
|
|
81
|
+
} from "../chunk-JNKQZVZX.js";
|
|
82
82
|
import {
|
|
83
83
|
MemoryProcessedPaymentStore,
|
|
84
84
|
PostgresProcessedPaymentStore,
|
|
85
85
|
ProcessedPaymentReplayError
|
|
86
|
-
} from "../chunk-
|
|
86
|
+
} from "../chunk-XRLKGCAW.js";
|
|
87
87
|
import "../chunk-BQ2NMWKE.js";
|
|
88
88
|
import {
|
|
89
89
|
MemoryCreditLedger
|
|
90
|
-
} from "../chunk-
|
|
90
|
+
} from "../chunk-U5VNEALI.js";
|
|
91
91
|
import {
|
|
92
92
|
SignedRequestError,
|
|
93
93
|
createDefaultReplayStore,
|
|
@@ -96,12 +96,12 @@ import {
|
|
|
96
96
|
} from "../chunk-H2MEFVH6.js";
|
|
97
97
|
import {
|
|
98
98
|
isStreamableJobStore
|
|
99
|
-
} from "../chunk-
|
|
99
|
+
} from "../chunk-MD3H3BF7.js";
|
|
100
100
|
import {
|
|
101
101
|
generateEphemeralReceiptKey,
|
|
102
102
|
isTestMintUrl,
|
|
103
103
|
receiptPubkeyFromSecret
|
|
104
|
-
} from "../chunk-
|
|
104
|
+
} from "../chunk-QX52F6IB.js";
|
|
105
105
|
import {
|
|
106
106
|
X402_DEFAULT_FACILITATOR,
|
|
107
107
|
X402_DEFAULT_NETWORK,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
} from "../chunk-Z4BNLUZF.js";
|
|
111
111
|
import {
|
|
112
112
|
IMPLICIT_CREDIT_TTL_MS
|
|
113
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-A4CM2BD3.js";
|
|
114
114
|
import {
|
|
115
115
|
resolveRpcOverride
|
|
116
116
|
} from "../chunk-MKI6OVW4.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
} from "../chunk-KXZUCCEY.js";
|
|
122
122
|
import {
|
|
123
123
|
initLoggers
|
|
124
|
-
} from "../chunk-
|
|
124
|
+
} from "../chunk-YO56VCTQ.js";
|
|
125
125
|
import "../chunk-66HGCPBU.js";
|
|
126
126
|
import "../chunk-FUJ36YDV.js";
|
|
127
127
|
import "../chunk-4A2RAKCW.js";
|
|
@@ -133,11 +133,11 @@ import {
|
|
|
133
133
|
PostgresX402ChannelStorage,
|
|
134
134
|
X402RelaySubmissionLockError,
|
|
135
135
|
allocateDrawValue
|
|
136
|
-
} from "../chunk-
|
|
136
|
+
} from "../chunk-2D75MNNG.js";
|
|
137
137
|
import {
|
|
138
138
|
SDK_INIT_ADVISORY_LOCK,
|
|
139
139
|
withSdkInitLock
|
|
140
|
-
} from "../chunk-
|
|
140
|
+
} from "../chunk-COYKJRMM.js";
|
|
141
141
|
import {
|
|
142
142
|
applyRetryToPool
|
|
143
143
|
} from "../chunk-C3MTFLC6.js";
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
148
148
|
TempoSettlementReadiness,
|
|
149
149
|
resolveTempoNetwork
|
|
150
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-XZ7LW4S5.js";
|
|
151
151
|
|
|
152
152
|
// src/sdk/server/cashu-env.ts
|
|
153
153
|
async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
@@ -221,6 +221,7 @@ async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
|
221
221
|
error: err instanceof Error ? err.message : String(err)
|
|
222
222
|
})
|
|
223
223
|
);
|
|
224
|
+
if (cashuMode === "p2pk-accumulator") throw err;
|
|
224
225
|
db = void 0;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
@@ -320,7 +321,6 @@ var PlatformLightningRailHealth = class {
|
|
|
320
321
|
lastAttemptAtMs;
|
|
321
322
|
inFlight;
|
|
322
323
|
ceilingLoggedForMs;
|
|
323
|
-
/** Prime the signal during boot without making a menu request wait for it. */
|
|
324
324
|
async refresh() {
|
|
325
325
|
if (this.inFlight) return this.inFlight;
|
|
326
326
|
this.lastAttemptAtMs = this.now();
|
|
@@ -332,7 +332,6 @@ var PlatformLightningRailHealth = class {
|
|
|
332
332
|
this.inFlight = void 0;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
/** Answer from cache and begin a non-blocking refresh once it is due. */
|
|
336
335
|
available() {
|
|
337
336
|
const nowMs = this.now();
|
|
338
337
|
if (this.lastAttemptAtMs === void 0 || nowMs - this.lastAttemptAtMs >= this.refreshTtlMs) {
|
|
@@ -463,16 +462,10 @@ var LightningReceive = class _LightningReceive {
|
|
|
463
462
|
permissionRefusal;
|
|
464
463
|
railHealth;
|
|
465
464
|
/**
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
* unreachable.** A wallet outage at boot must not stop a DVM whose other
|
|
471
|
-
* rails are fine — the menu simply omits `lightning` until a later probe
|
|
472
|
-
* succeeds. A connection that can spend, or one that can't state what it can
|
|
473
|
-
* do, is a different thing entirely: it is a standing money risk that no
|
|
474
|
-
* amount of retrying fixes, so it fails the boot loudly with the fix in the
|
|
475
|
-
* message.
|
|
465
|
+
* Return undefined when unconfigured. Permission/URI failures refuse construction with a
|
|
466
|
+
* corrective message; wallet transport failure constructs an unavailable receive leg so
|
|
467
|
+
* other rails can still boot. Recovery must validate method scope before advertising
|
|
468
|
+
* Lightning.
|
|
476
469
|
*/
|
|
477
470
|
static async create(config) {
|
|
478
471
|
const invoiceTtlSeconds = resolveInvoiceTtl(config.invoiceTtlSeconds);
|
|
@@ -528,26 +521,17 @@ var LightningReceive = class _LightningReceive {
|
|
|
528
521
|
);
|
|
529
522
|
}
|
|
530
523
|
/**
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
* Reads the cached observation and never blocks; a stale one kicks off a
|
|
534
|
-
* background refresh and answers with what we last knew. Advertising a rail
|
|
535
|
-
* whose wallet is down would hand the caller an option that 402s on use —
|
|
536
|
-
* the §4 posture is to drop it and let the sale survive on the others.
|
|
524
|
+
* Answer from cached wallet and optional rail-health observations without blocking. A stale
|
|
525
|
+
* wallet observation starts a background refresh.
|
|
537
526
|
*/
|
|
538
527
|
available() {
|
|
539
528
|
if (Date.now() - this.checkedAtMs > HEALTH_TTL_MS) void this.refresh();
|
|
540
529
|
return this.health === "healthy" && (this.railHealth?.available() ?? true);
|
|
541
530
|
}
|
|
542
531
|
/**
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
* signed body — that binding is the condition-3 commitment on this
|
|
547
|
-
* rail, and it is why no artifact hash rides the request: there is no
|
|
548
|
-
* caller-supplied artifact to hash. A re-poll returns the stored row rather
|
|
549
|
-
* than minting again; a second bolt11 for one `fund_id` would leave two
|
|
550
|
-
* payable invoices against a funding that can only be credited once.
|
|
532
|
+
* Return the stored invoice on retry: two payable bolt11s for one fund ID could charge
|
|
533
|
+
* twice while only one credits. Caller and amount are bound to the recorded credit/funding
|
|
534
|
+
* pair, without a caller-supplied artifact hash.
|
|
551
535
|
*/
|
|
552
536
|
async issue(ledger, args) {
|
|
553
537
|
const existing = await ledger.getInvoice({ creditId: args.creditId, fundId: args.fundId });
|
|
@@ -582,9 +566,8 @@ var LightningReceive = class _LightningReceive {
|
|
|
582
566
|
fundId: args.fundId,
|
|
583
567
|
callerPubkey: args.callerPubkey,
|
|
584
568
|
currency: args.currency,
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
// caller was quoted (the shape).
|
|
569
|
+
// Pin fiat and millisatoshi amounts at issue time; settlement does not reprice them
|
|
570
|
+
// after FX changes.
|
|
588
571
|
amountMicro: args.amountMicro,
|
|
589
572
|
amountMsats: created.amountMsats || args.amountMsats,
|
|
590
573
|
paymentHash: created.paymentHash,
|
|
@@ -593,24 +576,9 @@ var LightningReceive = class _LightningReceive {
|
|
|
593
576
|
});
|
|
594
577
|
}
|
|
595
578
|
/**
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* `blocked` row implies payment — {@link applyOne} returns above the block
|
|
600
|
-
* classification when the lookup says unpaid — but that is *this fleet's
|
|
601
|
-
* belief, recorded possibly weeks ago*, and the verb it gates mints balance
|
|
602
|
-
* against it. One round trip turns the belief into a fact and recovers the
|
|
603
|
-
* true settlement instant for `settled_at`, which a blocked row never got to
|
|
604
|
-
* write.
|
|
605
|
-
*
|
|
606
|
-
* Unlike {@link settlePending} this **throws**: there is no request whose
|
|
607
|
-
* latency it protects, and crediting on an unverifiable wallet is exactly
|
|
608
|
-
* what it exists to prevent. `NOT_FOUND` is the one exception, and it is not
|
|
609
|
-
* an outage — it is the wallet saying it has never seen this hash, the same
|
|
610
|
-
* reading {@link applyOne} and the caller-side reconcile in `src/lib/nwc.ts`
|
|
611
|
-
* take. It comes back as `known: false` because the operator's repair for it
|
|
612
|
-
* ("you are pointed at a different wallet than the one that minted this")
|
|
613
|
-
* is not the repair for an unpaid invoice, and certainly not for a retry.
|
|
579
|
+
* Re-observe the wallet payment before an operator credits a blocked invoice and recover
|
|
580
|
+
* its settlement instant. Unlike settlePending, lookup failures throw. NOT_FOUND returns
|
|
581
|
+
* known:false, distinguishing the wrong wallet/unknown hash from an unpaid known invoice.
|
|
614
582
|
*/
|
|
615
583
|
async lookupSettlement(paymentHash) {
|
|
616
584
|
try {
|
|
@@ -627,23 +595,12 @@ var LightningReceive = class _LightningReceive {
|
|
|
627
595
|
}
|
|
628
596
|
}
|
|
629
597
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
* The pending rows are read locally first, so the common case (nothing
|
|
634
|
-
* outstanding) costs one indexed SELECT and no network at all. Bounded to
|
|
635
|
-
* {@link MAX_SETTLE_CHECKS} invoices on a short deadline, and **never throws
|
|
636
|
-
* into the request**: a wallet failure here means the caller's balance is
|
|
637
|
-
* merely not updated yet, which the ordinary `insufficient_credit` path
|
|
638
|
-
* already states honestly.
|
|
598
|
+
* Read pending invoices locally, then check at most MAX_SETTLE_CHECKS on bounded wallet
|
|
599
|
+
* deadlines. Log failures without throwing into the request.
|
|
639
600
|
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
*
|
|
643
|
-
* the rest of the pass down with it: the next invoice in the window may be
|
|
644
|
-
* the paid one, and it would never be looked up. Only a transport failure
|
|
645
|
-
* ends the pass early, because there the wallet itself is gone and the
|
|
646
|
-
* remaining lookups would just spend the caller's latency confirming it.
|
|
601
|
+
* An invoice-specific failure must not suppress payable siblings; wallet transport failure
|
|
602
|
+
* ends the pass. Deterministic refusals retire that row as blocked for operator repair,
|
|
603
|
+
* while transient failures remain pending.
|
|
647
604
|
*/
|
|
648
605
|
async settlePending(ledger, args) {
|
|
649
606
|
let pending;
|
|
@@ -683,13 +640,6 @@ var LightningReceive = class _LightningReceive {
|
|
|
683
640
|
}
|
|
684
641
|
return settled;
|
|
685
642
|
}
|
|
686
|
-
/**
|
|
687
|
-
* One invoice's settlement check. Returns the applied settlement, or
|
|
688
|
-
* `undefined` when nothing changed (still unpaid, or retired unpaid).
|
|
689
|
-
*
|
|
690
|
-
* Throws whatever the wallet or the ledger threw — classifying that is
|
|
691
|
-
* {@link retireOrLog}'s job, so this stays one invoice's happy path.
|
|
692
|
-
*/
|
|
693
643
|
async applyOne(ledger, backend, invoice, opts) {
|
|
694
644
|
let status;
|
|
695
645
|
try {
|
|
@@ -740,18 +690,9 @@ var LightningReceive = class _LightningReceive {
|
|
|
740
690
|
});
|
|
741
691
|
}
|
|
742
692
|
/**
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
*
|
|
746
|
-
* The split that matters is permanent-versus-transient, because it decides
|
|
747
|
-
* whether the row keeps a slot in the sweep window. A transient failure — the
|
|
748
|
-
* database blinked, the wallet answered oddly — leaves it `pending` and the
|
|
749
|
-
* caller's next request retries it. A **permanent** one means the ledger will
|
|
750
|
-
* refuse this invoice identically forever, so leaving it pending costs a
|
|
751
|
-
* `lookup_invoice` on every subsequent request and, at
|
|
752
|
-
* {@link MAX_SETTLE_CHECKS} of them, fills the window so a genuinely payable
|
|
753
|
-
* invoice behind them is never even looked up. Those get `blocked`, which
|
|
754
|
-
* drops them out of the sweep and hands the operator the payment hash.
|
|
693
|
+
* Retire a deterministic uncreditable payment as blocked so it no longer occupies the
|
|
694
|
+
* bounded sweep window. Transient failures stay pending for a later request; report the
|
|
695
|
+
* payment hash for operator repair.
|
|
755
696
|
*/
|
|
756
697
|
async retireOrLog(ledger, invoice, err) {
|
|
757
698
|
const reason = await this.blockingReason(ledger, invoice, err);
|
|
@@ -784,21 +725,10 @@ var LightningReceive = class _LightningReceive {
|
|
|
784
725
|
);
|
|
785
726
|
}
|
|
786
727
|
/**
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
* has already committed (a `credit_fundings` entry at this
|
|
792
|
-
* `(credit_id, fund_id)`, or a `credits` row whose owner, denomination or
|
|
793
|
-
* rail disagrees with the invoice), or the basis this module rebuilds
|
|
794
|
-
* identically from the invoice row on every pass. None of them is a race.
|
|
795
|
-
*
|
|
796
|
-
* `funding_replayed` is the one that needs a second read to classify.
|
|
797
|
-
* Usually it *is* benign — a concurrent check won the race and the money is
|
|
798
|
-
* credited either way — but the key is `(credit_id, fund_id)` and `fund_id`
|
|
799
|
-
* is **caller-chosen**: reuse it on cashu or x402 after this bolt11 was
|
|
800
|
-
* minted and the row that collided is a different payment entirely, so the
|
|
801
|
-
* sats this invoice received have nowhere to land.
|
|
728
|
+
* Classify funding_replayed by reading the existing funding’s rail. A Lightning row can
|
|
729
|
+
* represent a concurrent applied check; another rail at this caller-chosen key is a
|
|
730
|
+
* different payment, leaving the invoice’s sats uncredited. A failed diagnostic read
|
|
731
|
+
* remains transient, never a guessed permanent refusal.
|
|
802
732
|
*/
|
|
803
733
|
async blockingReason(ledger, invoice, err) {
|
|
804
734
|
if (!(err instanceof CreditLedgerError)) return void 0;
|
|
@@ -834,7 +764,6 @@ var LightningReceive = class _LightningReceive {
|
|
|
834
764
|
throw err;
|
|
835
765
|
}
|
|
836
766
|
}
|
|
837
|
-
/** Record activity without letting it promote an unvalidated connection. */
|
|
838
767
|
noteOperationOk() {
|
|
839
768
|
if (this.health !== "healthy") return;
|
|
840
769
|
this.checkedAtMs = Date.now();
|
|
@@ -1027,7 +956,6 @@ var PostgresTempoSettlementReadinessStore = class {
|
|
|
1027
956
|
address;
|
|
1028
957
|
token;
|
|
1029
958
|
now;
|
|
1030
|
-
/** Create the shared latch table under the SDK-wide boot migration lock. */
|
|
1031
959
|
async init() {
|
|
1032
960
|
await withSdkInitLock(this.pool, async () => {
|
|
1033
961
|
await this.pool.query(`
|
|
@@ -1199,13 +1127,13 @@ function createDVMHost(opts = {}) {
|
|
|
1199
1127
|
});
|
|
1200
1128
|
applyRetryToPool(pool, "dvm-host");
|
|
1201
1129
|
pgPool = pool;
|
|
1202
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1130
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-MZZZMS2B.js");
|
|
1203
1131
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1204
1132
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1205
1133
|
jobStore = pgJobStore;
|
|
1206
1134
|
pgStreamStore = pgJobStore;
|
|
1207
1135
|
if (!opts.store) {
|
|
1208
|
-
const { PostgresKVStore: PostgresKVStore2 } = await import("../postgres-kv-store-
|
|
1136
|
+
const { PostgresKVStore: PostgresKVStore2 } = await import("../postgres-kv-store-DXGTKXLU.js");
|
|
1209
1137
|
const pgKvStore = new PostgresKVStore2(pool);
|
|
1210
1138
|
pendingInits.push(pgKvStore.init());
|
|
1211
1139
|
store = pgKvStore;
|
|
@@ -1290,11 +1218,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1290
1218
|
let tempoChargeBackend = "user-supplied";
|
|
1291
1219
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1292
1220
|
if (!mpp && mppTempoRecipient) {
|
|
1293
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1221
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-MPP3ST5X.js");
|
|
1294
1222
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1295
1223
|
let tempoCharge;
|
|
1296
1224
|
if (pgPool) {
|
|
1297
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1225
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-SDTUNTKA.js");
|
|
1298
1226
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1299
1227
|
pendingInits.push(chargeStore.init());
|
|
1300
1228
|
tempoCharge = { store: chargeStore };
|
|
@@ -1313,7 +1241,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1313
1241
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1314
1242
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1315
1243
|
] = await Promise.all([
|
|
1316
|
-
import("../tempo-session-store-
|
|
1244
|
+
import("../tempo-session-store-WF3VZXNF.js"),
|
|
1317
1245
|
import("viem/accounts"),
|
|
1318
1246
|
import("viem"),
|
|
1319
1247
|
import("viem/chains")
|
|
@@ -1414,7 +1342,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1414
1342
|
applyMppSecretRotation,
|
|
1415
1343
|
loadMppSecretState,
|
|
1416
1344
|
DEFAULT_ROTATION_WINDOW_MS
|
|
1417
|
-
} = await import("../mpp-secret-state-
|
|
1345
|
+
} = await import("../mpp-secret-state-B5GCILVH.js");
|
|
1418
1346
|
await initMppSecretStateTable(pgPool);
|
|
1419
1347
|
const rotation = await applyMppSecretRotation(
|
|
1420
1348
|
pgPool,
|
|
@@ -1454,7 +1382,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1454
1382
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1455
1383
|
let sharedPgReplayStore;
|
|
1456
1384
|
if (pgPool) {
|
|
1457
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1385
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-ZF4JNZOW.js");
|
|
1458
1386
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1459
1387
|
pendingInits.push(store2.init());
|
|
1460
1388
|
sharedPgReplayStore = store2;
|
|
@@ -1482,24 +1410,24 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1482
1410
|
}
|
|
1483
1411
|
let sharedPgConsumedStore;
|
|
1484
1412
|
if (pgPool) {
|
|
1485
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1413
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-6N2V5MJN.js");
|
|
1486
1414
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1487
1415
|
pendingInits.push(consumedStore.init());
|
|
1488
1416
|
sharedPgConsumedStore = consumedStore;
|
|
1489
1417
|
}
|
|
1490
1418
|
if (pgPool) {
|
|
1491
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1419
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-MHA652TV.js");
|
|
1492
1420
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1493
1421
|
pendingInits.push(pgLedger.init());
|
|
1494
1422
|
creditLedger = pgLedger;
|
|
1495
|
-
const { PostgresProcessedPaymentStore: PostgresProcessedPaymentStore2 } = await import("../processed-payment-store-
|
|
1423
|
+
const { PostgresProcessedPaymentStore: PostgresProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1496
1424
|
const pgProcessed = new PostgresProcessedPaymentStore2(pgPool);
|
|
1497
1425
|
pendingInits.push(pgProcessed.init());
|
|
1498
1426
|
processedPayments = pgProcessed;
|
|
1499
1427
|
} else {
|
|
1500
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1428
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-BYBATRN3.js");
|
|
1501
1429
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1502
|
-
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-
|
|
1430
|
+
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1503
1431
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
1504
1432
|
}
|
|
1505
1433
|
await Promise.all(pendingInits);
|