@dvmkit/sdk 0.21.1 → 0.21.2
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-MWDUGMN2.js → chunk-27QB2D3Z.js} +2 -2
- package/dist/{chunk-CVN2YNMG.js → chunk-2AGADOX3.js} +1 -1
- package/dist/{chunk-5RLNRLLB.js → chunk-2HSWWHXK.js} +1 -1
- package/dist/{chunk-CXRI4N4Y.js → chunk-2RZRYMCR.js} +1 -1
- package/dist/{chunk-C65P6MGZ.js → chunk-3V6CSTWB.js} +1 -1
- package/dist/{chunk-KRX7VNBG.js → chunk-62JG4AF7.js} +1 -1
- package/dist/{chunk-A6AOE63A.js → chunk-6GZF7VDO.js} +5 -1
- package/dist/{chunk-LY2JYSJS.js → chunk-7KNFEDFW.js} +1 -1
- package/dist/{chunk-DJRTYBEE.js → chunk-B27E7JIR.js} +1 -1
- package/dist/{chunk-2PN4DKZW.js → chunk-D2MGOQIS.js} +1 -1
- package/dist/{chunk-34H4ZKBM.js → chunk-FAT57DAP.js} +1 -1
- package/dist/{chunk-7RWE6ELV.js → chunk-IUFVIIPF.js} +1 -1
- package/dist/{chunk-I5MXADJS.js → chunk-JOSNSNS7.js} +2 -2
- package/dist/{chunk-INYFUPXV.js → chunk-LSANCGLP.js} +1 -1
- package/dist/{chunk-RX6FT7XA.js → chunk-LWF4ABYF.js} +1 -1
- package/dist/{chunk-ALTE7I6C.js → chunk-MA55LUNR.js} +1 -0
- package/dist/{chunk-QTKGFG3I.js → chunk-NRE4NOCY.js} +1 -1
- package/dist/{chunk-MUMZPUYD.js → chunk-VIAMJ6GS.js} +26 -24
- package/dist/{chunk-6RJAE332.js → chunk-WWKFG6TM.js} +1 -1
- package/dist/{chunk-72A4PHLD.js → chunk-XWG54M6T.js} +1 -1
- package/dist/{chunk-QCZXKUS2.js → chunk-Y746QPX7.js} +1 -1
- package/dist/{chunk-OTNHKRHA.js → chunk-ZBOCNF56.js} +2 -2
- package/dist/{content-retention-COnj0QKi.d.ts → content-retention-efjireLM.d.ts} +1 -1
- package/dist/{credit-ledger-ZCJXJG6R.js → credit-ledger-M3EBVMOP.js} +3 -3
- package/dist/{credit-menu-DbjmA1vK.d.ts → credit-menu-UOOxuxVL.d.ts} +4 -4
- package/dist/{fx-DfzQ0Lge.d.ts → fx-BtxHVj6w.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/internal/caller.d.ts +6 -6
- 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-p45j28px.d.ts → job-store-DWVkleH3.d.ts} +1 -1
- package/dist/{lightning-backend-DO7G7VqP.d.ts → lightning-backend-CTijN35u.d.ts} +1 -1
- package/dist/{memory-credit-ledger-N4PZKTT5.js → memory-credit-ledger-WL2VKLE3.js} +4 -4
- package/dist/{mpp-setup-BLIYBORK.js → mpp-setup-DBYDXISN.js} +3 -3
- package/dist/{payout-reporter-5QAHCYIO.js → payout-reporter-D5TCIBQA.js} +2 -2
- package/dist/{postgres-consumed-credential-store-4PCJEZBD.js → postgres-consumed-credential-store-IPWPJ6V7.js} +1 -1
- package/dist/{postgres-job-store-QKN5LGAH.js → postgres-job-store-POZJNFJU.js} +2 -2
- package/dist/{postgres-replay-store-GH5AINQR.js → postgres-replay-store-JQYAKG47.js} +2 -2
- package/dist/{pricing-JJYLTTWK.js → pricing-FGPVRNTL.js} +3 -3
- package/dist/{revenue-reporter-6XARUEG6.js → revenue-reporter-QKCBYFWT.js} +2 -2
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +38 -29
- package/dist/{step-cache-CcCjpZm1.d.ts → step-cache-Bx_ZybWF.d.ts} +2 -1
- package/dist/{tempo-charge-store-A3CDF7D5.js → tempo-charge-store-P7ZBR3GG.js} +2 -2
- package/dist/{tempo-session-store-XJE6GIXN.js → tempo-session-store-ZVRBAMLG.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +6 -6
- package/dist/{usd-BnAFcUai.d.ts → usd-eOAMEO12.d.ts} +1 -1
- package/dist/{x402-XLFD43RF.js → x402-44JZJQ5F.js} +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loggers
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7KNFEDFW.js";
|
|
4
4
|
import {
|
|
5
5
|
diagnosticConsole
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MA55LUNR.js";
|
|
7
7
|
|
|
8
8
|
// src/sdk/server/mpp-setup.ts
|
|
9
9
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-SXL44PL5.js";
|
|
8
8
|
import {
|
|
9
9
|
diagnosticConsole
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MA55LUNR.js";
|
|
11
11
|
|
|
12
12
|
// src/sdk/server/zod-error.ts
|
|
13
13
|
function humanizeZodError(err, opts) {
|
|
@@ -106,6 +106,9 @@ var SIGNED_ENVELOPE_TYPES = {
|
|
|
106
106
|
var SIGNED_ENVELOPE_FIELDS = Object.keys(
|
|
107
107
|
SIGNED_ENVELOPE_TYPES
|
|
108
108
|
);
|
|
109
|
+
function carriesSignedEnvelope(input) {
|
|
110
|
+
return input !== null && typeof input === "object" && !Array.isArray(input) && SIGNED_ENVELOPE_FIELDS.some((field) => field in input);
|
|
111
|
+
}
|
|
109
112
|
var SignedRequestError = class extends Error {
|
|
110
113
|
constructor(message, sub_reason, issues) {
|
|
111
114
|
super(message);
|
|
@@ -371,6 +374,7 @@ export {
|
|
|
371
374
|
zodIssuesOf,
|
|
372
375
|
SIGNED_ENVELOPE_TYPES,
|
|
373
376
|
SIGNED_ENVELOPE_FIELDS,
|
|
377
|
+
carriesSignedEnvelope,
|
|
374
378
|
SignedRequestError,
|
|
375
379
|
createSignedRequestVerifier,
|
|
376
380
|
signedRequestInput,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
} from "./chunk-5UC7TOQC.js";
|
|
11
11
|
import {
|
|
12
12
|
applyRetryToPool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LSANCGLP.js";
|
|
14
14
|
import {
|
|
15
15
|
x402NetworkByCaip2
|
|
16
16
|
} from "./chunk-BPYMEMQX.js";
|
|
17
17
|
import {
|
|
18
18
|
diagnosticConsole
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MA55LUNR.js";
|
|
20
20
|
|
|
21
21
|
// src/sdk/server/credit-ledger.ts
|
|
22
22
|
import { randomUUID } from "crypto";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-XRLKGCAW.js";
|
|
6
6
|
import {
|
|
7
7
|
x402EarnedCeiling
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-62JG4AF7.js";
|
|
9
9
|
import {
|
|
10
10
|
createX402FacilitatorAuthHeaders,
|
|
11
11
|
createX402FacilitatorClient,
|
|
@@ -14,18 +14,19 @@ import {
|
|
|
14
14
|
verifyWithFacilitator,
|
|
15
15
|
withPaymentDiagnostics,
|
|
16
16
|
withPaymentStage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3V6CSTWB.js";
|
|
18
18
|
import {
|
|
19
19
|
MemoryCreditLedger
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-B27E7JIR.js";
|
|
21
21
|
import {
|
|
22
22
|
PostgresJobStore
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-Y746QPX7.js";
|
|
24
24
|
import {
|
|
25
25
|
CASHU_MIN_LOCKTIME_SECONDS,
|
|
26
26
|
DEFAULT_CASHU_LOCK_WINDOW_SECONDS,
|
|
27
27
|
SIGNED_ENVELOPE_FIELDS,
|
|
28
28
|
SignedRequestError,
|
|
29
|
+
carriesSignedEnvelope,
|
|
29
30
|
humanizeZodError,
|
|
30
31
|
humanizeZodIssues,
|
|
31
32
|
shortestCashuLockWindowSeconds,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
signedRequestInput,
|
|
34
35
|
unsignedCashuLockWindowSeconds,
|
|
35
36
|
zodIssuesOf
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6GZF7VDO.js";
|
|
37
38
|
import {
|
|
38
39
|
MemoryJobStore,
|
|
39
40
|
UNCAPPABLE_ASK_TOTAL,
|
|
@@ -42,7 +43,7 @@ import {
|
|
|
42
43
|
isJobRetentionStore,
|
|
43
44
|
isReceiptIssuingStore,
|
|
44
45
|
isStreamableJobStore
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-WWKFG6TM.js";
|
|
46
47
|
import {
|
|
47
48
|
ContentHoldError,
|
|
48
49
|
JobCancelledError,
|
|
@@ -83,7 +84,7 @@ import {
|
|
|
83
84
|
receiptPubkeyFromSecret,
|
|
84
85
|
toLockPubkey,
|
|
85
86
|
verifyChallenge
|
|
86
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-IUFVIIPF.js";
|
|
87
88
|
import {
|
|
88
89
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
89
90
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -110,7 +111,7 @@ import {
|
|
|
110
111
|
} from "./chunk-SXL44PL5.js";
|
|
111
112
|
import {
|
|
112
113
|
createConsoleLogger
|
|
113
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-NRE4NOCY.js";
|
|
114
115
|
import {
|
|
115
116
|
StepCache
|
|
116
117
|
} from "./chunk-BQJIFRAZ.js";
|
|
@@ -127,7 +128,7 @@ import {
|
|
|
127
128
|
roundUsd,
|
|
128
129
|
satsToFiat,
|
|
129
130
|
validateCurrency
|
|
130
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-XWG54M6T.js";
|
|
131
132
|
import {
|
|
132
133
|
CreditLedger,
|
|
133
134
|
CreditLedgerError,
|
|
@@ -143,7 +144,7 @@ import {
|
|
|
143
144
|
isNonChannelBitcoinRail,
|
|
144
145
|
netOwedSats,
|
|
145
146
|
x402SettlementPending
|
|
146
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-JOSNSNS7.js";
|
|
147
148
|
import {
|
|
148
149
|
parseStoreValue
|
|
149
150
|
} from "./chunk-YG7G4DPZ.js";
|
|
@@ -162,7 +163,7 @@ import {
|
|
|
162
163
|
import {
|
|
163
164
|
isTransportError,
|
|
164
165
|
withPostgresRecoveryContext
|
|
165
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-LSANCGLP.js";
|
|
166
167
|
import {
|
|
167
168
|
DvmError,
|
|
168
169
|
x402NetworkByCaip2
|
|
@@ -180,17 +181,17 @@ import {
|
|
|
180
181
|
installHostedTempoCloseGuard,
|
|
181
182
|
isTempoInsufficientFundsError,
|
|
182
183
|
resolveTempoNetwork
|
|
183
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-27QB2D3Z.js";
|
|
184
185
|
import {
|
|
185
186
|
loggers,
|
|
186
187
|
pinDimension,
|
|
187
188
|
withSpan,
|
|
188
189
|
withTraceContext
|
|
189
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-7KNFEDFW.js";
|
|
190
191
|
import {
|
|
191
192
|
createDiagnosticCapabilityAuthority,
|
|
192
193
|
diagnosticConsole
|
|
193
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-MA55LUNR.js";
|
|
194
195
|
|
|
195
196
|
// src/sdk/server/lock-pubkey-store.ts
|
|
196
197
|
async function initLockPubkeyTable(db) {
|
|
@@ -5180,7 +5181,7 @@ async function verifyUpfrontPaymentInScope(opts) {
|
|
|
5180
5181
|
x402Requirements
|
|
5181
5182
|
});
|
|
5182
5183
|
}
|
|
5183
|
-
const { verifyX402Payment } = await import("./x402-
|
|
5184
|
+
const { verifyX402Payment } = await import("./x402-44JZJQ5F.js");
|
|
5184
5185
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
5185
5186
|
x402Payment,
|
|
5186
5187
|
x402Config,
|
|
@@ -6236,7 +6237,7 @@ async function verifyIncomingPaymentInScope(body, opts, snapshot) {
|
|
|
6236
6237
|
snapshot
|
|
6237
6238
|
});
|
|
6238
6239
|
}
|
|
6239
|
-
const { verifyX402Payment } = await import("./x402-
|
|
6240
|
+
const { verifyX402Payment } = await import("./x402-44JZJQ5F.js");
|
|
6240
6241
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
6241
6242
|
body.content.x402_payment,
|
|
6242
6243
|
opts.x402Config,
|
|
@@ -6688,7 +6689,7 @@ async function processIncomingPaymentInScope(job, body, opts) {
|
|
|
6688
6689
|
try {
|
|
6689
6690
|
const requiredMsats = job.pendingPaymentMsats ?? 0;
|
|
6690
6691
|
const requiredUsdcMicro = job.pendingX402AmountUsdcMicro !== void 0 ? BigInt(job.pendingX402AmountUsdcMicro) : BigInt(msatsToUsdc(requiredMsats, rate));
|
|
6691
|
-
const { verifyX402Payment } = await import("./x402-
|
|
6692
|
+
const { verifyX402Payment } = await import("./x402-44JZJQ5F.js");
|
|
6692
6693
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
6693
6694
|
body.content.x402_payment,
|
|
6694
6695
|
opts.x402Config,
|
|
@@ -8296,6 +8297,8 @@ function authErrorBody(err, opts = {}) {
|
|
|
8296
8297
|
const subReason = err.sub_reason === "schema_invalid" ? "signature_invalid" : err.sub_reason;
|
|
8297
8298
|
const display = (() => {
|
|
8298
8299
|
switch (subReason) {
|
|
8300
|
+
case "signature_required":
|
|
8301
|
+
return "This capability requires a signed request";
|
|
8299
8302
|
case "signature_invalid":
|
|
8300
8303
|
return "Request signature didn't match the supplied pubkey";
|
|
8301
8304
|
case "timestamp_drift":
|
|
@@ -8310,7 +8313,7 @@ function authErrorBody(err, opts = {}) {
|
|
|
8310
8313
|
error: "auth_error",
|
|
8311
8314
|
sub_reason: subReason,
|
|
8312
8315
|
display,
|
|
8313
|
-
hint: "Regenerate the request with the current timestamp + a fresh nonce; sign with secp256k1+BIP-340 Schnorr over the canonical JSON form of the input."
|
|
8316
|
+
hint: subReason === "signature_required" ? "Run `npx @dvmkit/dvm-cli init`, then use `dvm request` to sign and send the request, or implement secp256k1+BIP-340 Schnorr signing with the domain-bound envelope described at https://dvmkit.com/docs/protocol." : "Regenerate the request with the current timestamp + a fresh nonce; sign with secp256k1+BIP-340 Schnorr over the canonical JSON form of the input."
|
|
8314
8317
|
};
|
|
8315
8318
|
}
|
|
8316
8319
|
function infoSchemaUrl(requestUrl, publicOrigin) {
|
|
@@ -14343,9 +14346,7 @@ function resultHashFor(record) {
|
|
|
14343
14346
|
// src/sdk/server/unsigned-request.ts
|
|
14344
14347
|
function takesUnsignedPath(auth, body) {
|
|
14345
14348
|
if (!auth?.allowUnsignedPaid) return false;
|
|
14346
|
-
|
|
14347
|
-
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return true;
|
|
14348
|
-
return !SIGNED_ENVELOPE_FIELDS.some((field) => field in raw);
|
|
14349
|
+
return !carriesSignedEnvelope(signedRequestInput(body));
|
|
14349
14350
|
}
|
|
14350
14351
|
function carriesCreditFields(raw) {
|
|
14351
14352
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return false;
|
|
@@ -21870,7 +21871,7 @@ async function createDVMServer(descriptor, opts) {
|
|
|
21870
21871
|
}
|
|
21871
21872
|
}
|
|
21872
21873
|
if (!opts.onJobCompleted && platformToken && platformUrl && dvmId && opts.db) {
|
|
21873
|
-
const { RevenueReporter } = await import("./revenue-reporter-
|
|
21874
|
+
const { RevenueReporter } = await import("./revenue-reporter-QKCBYFWT.js");
|
|
21874
21875
|
const reporter = new RevenueReporter(
|
|
21875
21876
|
opts.db,
|
|
21876
21877
|
platformUrl,
|
|
@@ -21880,7 +21881,7 @@ async function createDVMServer(descriptor, opts) {
|
|
|
21880
21881
|
revenueReporter = reporter;
|
|
21881
21882
|
await reporter.init();
|
|
21882
21883
|
reporter.startRetryLoop();
|
|
21883
|
-
const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-
|
|
21884
|
+
const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-D5TCIBQA.js");
|
|
21884
21885
|
payoutReporter = new PayoutReporter({
|
|
21885
21886
|
dvmId,
|
|
21886
21887
|
db: opts.db,
|
|
@@ -23770,7 +23771,7 @@ var DVMServer = class {
|
|
|
23770
23771
|
if (err instanceof SignedRequestError) return err;
|
|
23771
23772
|
throw err;
|
|
23772
23773
|
}
|
|
23773
|
-
return new SignedRequestError("signed request required", "
|
|
23774
|
+
return new SignedRequestError("signed request required", "signature_required");
|
|
23774
23775
|
}
|
|
23775
23776
|
/**
|
|
23776
23777
|
* On authenticated DVMs, envelope-only parse failures defer to auth
|
|
@@ -25784,6 +25785,7 @@ export {
|
|
|
25784
25785
|
toCreditView,
|
|
25785
25786
|
attachCreditMenu,
|
|
25786
25787
|
toCreditTerms,
|
|
25788
|
+
callerInputIssues,
|
|
25787
25789
|
resolvePriceFiat,
|
|
25788
25790
|
priceFiatMicro,
|
|
25789
25791
|
resolveFxSnapshot,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createX402FacilitatorAuthHeaders,
|
|
3
3
|
settleWithFacilitator,
|
|
4
4
|
verifyWithFacilitator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3V6CSTWB.js";
|
|
6
6
|
import {
|
|
7
7
|
buildPaymentRequirements,
|
|
8
8
|
decodePayment,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-66HGCPBU.js";
|
|
16
16
|
import {
|
|
17
17
|
diagnosticConsole
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MA55LUNR.js";
|
|
19
19
|
|
|
20
20
|
// src/lib/x402/verify.ts
|
|
21
21
|
async function verifyX402Payment(paymentHeader, config, requiredUsdcMicro, resource, btcUsdRate, exactVersions = { v1: true, v2: true }) {
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
isDrainMethod,
|
|
11
11
|
isFundingRail,
|
|
12
12
|
x402SettlementPending
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JOSNSNS7.js";
|
|
14
14
|
import "./chunk-YG7G4DPZ.js";
|
|
15
15
|
import "./chunk-COYKJRMM.js";
|
|
16
16
|
import "./chunk-5UC7TOQC.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-LSANCGLP.js";
|
|
18
18
|
import "./chunk-BPYMEMQX.js";
|
|
19
19
|
import "./chunk-H3GGFEE5.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-MA55LUNR.js";
|
|
21
21
|
export {
|
|
22
22
|
CreditLedger,
|
|
23
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 { cr as HostingCleanupFence, dc as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, dd as X402SettlementIntent, de as HostedFundingReservation, bT as CreditLedgerQuerier, df as X402SettlementCursor, c1 as X402SettlementStatus, dg as X402SettlementWriteOff, bY as X402RefundSettlementGate, dh as X402FacilitatorAuth, di as X402BatchSettlementConfig, cO as PostgresX402ChannelStorage, dj as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dk as CreditDepositEnqueue, dl as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cB as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dm as CreditDrawReleaseEnqueue, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cQ as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cv as ClientCompatibilityGate, ct as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-
|
|
1
|
+
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-CTijN35u.js';
|
|
2
|
+
import { cr as HostingCleanupFence, dc as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, dd as X402SettlementIntent, de as HostedFundingReservation, bT as CreditLedgerQuerier, df as X402SettlementCursor, c1 as X402SettlementStatus, dg as X402SettlementWriteOff, bY as X402RefundSettlementGate, dh as X402FacilitatorAuth, di as X402BatchSettlementConfig, cO as PostgresX402ChannelStorage, dj as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dk as CreditDepositEnqueue, dl as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cB as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dm as CreditDrawReleaseEnqueue, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cQ as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cv as ClientCompatibilityGate, ct as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-Bx_ZybWF.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-BtxHVj6w.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-DWVkleH3.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';
|
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 CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ 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-Bx_ZybWF.js';
|
|
2
|
+
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ as validateCurrency } from './step-cache-Bx_ZybWF.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-BtxHVj6w.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-eOAMEO12.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-DWVkleH3.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
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
SignedRequestError,
|
|
12
12
|
createSignedRequestVerifier,
|
|
13
13
|
resolveCashuConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6GZF7VDO.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_CREDIT_MAX,
|
|
17
17
|
DEFAULT_CREDIT_MIN,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-SXL44PL5.js";
|
|
25
25
|
import {
|
|
26
26
|
buildUpfront
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LWF4ABYF.js";
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_FX_CURRENCIES,
|
|
30
30
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -42,9 +42,9 @@ import {
|
|
|
42
42
|
roundUsd,
|
|
43
43
|
satsToFiat,
|
|
44
44
|
validateCurrency
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-XWG54M6T.js";
|
|
46
46
|
import "./chunk-H3GGFEE5.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-MA55LUNR.js";
|
|
48
48
|
|
|
49
49
|
// src/sdk/configure.ts
|
|
50
50
|
function configureDVM(config) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-
|
|
2
|
-
export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-
|
|
3
|
-
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-
|
|
4
|
-
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 { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-Bx_ZybWF.js';
|
|
2
|
+
export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-Bx_ZybWF.js';
|
|
3
|
+
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-CTijN35u.js';
|
|
4
|
+
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-CTijN35u.js';
|
|
5
5
|
import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
|
|
6
6
|
export { g as getWallet } from '../wallet-Dwjs5n_M.js';
|
|
7
7
|
import { SimplePool } from 'nostr-tools/pool';
|
|
@@ -9,8 +9,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-BtxHVj6w.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-eOAMEO12.js';
|
|
14
14
|
import 'hono';
|
|
15
15
|
import 'mppx';
|
|
16
16
|
import '@x402/core/server';
|
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-D2MGOQIS.js";
|
|
36
36
|
import {
|
|
37
37
|
MemoryKVStore
|
|
38
38
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
withWalletLock,
|
|
135
135
|
writeAgentMnemonic,
|
|
136
136
|
writeIdentity
|
|
137
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-IUFVIIPF.js";
|
|
138
138
|
import {
|
|
139
139
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
140
140
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -178,7 +178,7 @@ import {
|
|
|
178
178
|
import {
|
|
179
179
|
createNoopLogger,
|
|
180
180
|
createStdoutLogger
|
|
181
|
-
} from "../chunk-
|
|
181
|
+
} from "../chunk-NRE4NOCY.js";
|
|
182
182
|
import {
|
|
183
183
|
redactUrl,
|
|
184
184
|
redactUrlsInText
|
|
@@ -192,7 +192,7 @@ import {
|
|
|
192
192
|
InvalidUsdPriceError,
|
|
193
193
|
parseUsdPrice,
|
|
194
194
|
warmFxSnapshot
|
|
195
|
-
} from "../chunk-
|
|
195
|
+
} from "../chunk-XWG54M6T.js";
|
|
196
196
|
import {
|
|
197
197
|
computeResultHash,
|
|
198
198
|
isDrainReceipt,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
import {
|
|
212
212
|
applyRetryToPool,
|
|
213
213
|
withInitRetry
|
|
214
|
-
} from "../chunk-
|
|
214
|
+
} from "../chunk-LSANCGLP.js";
|
|
215
215
|
import {
|
|
216
216
|
DvmError,
|
|
217
217
|
X402_NETWORKS,
|
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
randomTraceId,
|
|
239
239
|
setEmitter,
|
|
240
240
|
withTraceContext
|
|
241
|
-
} from "../chunk-
|
|
241
|
+
} from "../chunk-7KNFEDFW.js";
|
|
242
242
|
import "../chunk-66HGCPBU.js";
|
|
243
243
|
import {
|
|
244
244
|
DIAGNOSTIC_CATALOGUE_VERSION,
|
|
@@ -249,7 +249,7 @@ import {
|
|
|
249
249
|
projectDiagnosticFields,
|
|
250
250
|
projectEventName,
|
|
251
251
|
projectSpanRow
|
|
252
|
-
} from "../chunk-
|
|
252
|
+
} from "../chunk-MA55LUNR.js";
|
|
253
253
|
|
|
254
254
|
// src/lib/budget-core.ts
|
|
255
255
|
function checkBudgetForLedger(ledger, opts) {
|