@dvmkit/sdk 0.7.0-rc.4 → 0.7.0-rc.5
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-5WOKIGLM.js → chunk-3NVM4WPI.js} +21 -18
- package/dist/{chunk-CYTV76CG.js → chunk-6RYCZLCK.js} +1 -1
- package/dist/{chunk-3CNYUUD7.js → chunk-BDHJVTWA.js} +1 -1
- package/dist/{chunk-UEYUFBSV.js → chunk-BIZR5ORK.js} +2 -2
- package/dist/{chunk-O3JEEW5V.js → chunk-BQP3LU2O.js} +1 -1
- package/dist/{chunk-AE2ITUMA.js → chunk-FOJKZ4E7.js} +1 -1
- package/dist/{chunk-WIQLTSJY.js → chunk-FXDQMJQ2.js} +18 -0
- package/dist/{chunk-76W5MYFF.js → chunk-GDCIHJAR.js} +1 -1
- package/dist/{chunk-ARGYJ7SB.js → chunk-GKIOZCL7.js} +1 -1
- package/dist/{chunk-LZHBNR5C.js → chunk-HG2CZPRJ.js} +1 -1
- package/dist/{chunk-RBCHIOVB.js → chunk-JUEEUV5X.js} +1 -1
- package/dist/{chunk-C6YFACIM.js → chunk-KYCLHWKO.js} +1 -1
- package/dist/{chunk-XYLF33BJ.js → chunk-LQQ6H4UB.js} +1 -1
- package/dist/{chunk-H2XKINRX.js → chunk-MYJOV4R4.js} +1 -1
- package/dist/{chunk-MU3UX5M4.js → chunk-NUPEAWRM.js} +1 -1
- package/dist/{chunk-DY2MIZ6E.js → chunk-QTH7CIA3.js} +1 -1
- package/dist/{chunk-KIPJRLGP.js → chunk-SX4WCPW7.js} +1 -1
- package/dist/{chunk-EN7VI7T5.js → chunk-WP7UX6RF.js} +2 -2
- package/dist/{chunk-QFRU6W34.js → chunk-X5RY2G3C.js} +1 -1
- package/dist/{chunk-WNX22IND.js → chunk-XEOTTFLH.js} +1 -1
- package/dist/{chunk-MCIIDEXH.js → chunk-YK54BJ2L.js} +1 -1
- package/dist/{content-retention-ChFSSVO0.d.ts → content-retention-z1fRPIkt.d.ts} +1 -1
- package/dist/{credit-ledger-4ZIL7IX2.js → credit-ledger-SW4BGMNH.js} +3 -3
- package/dist/{credit-menu-D7lF-100.d.ts → credit-menu-CJl2Ysc-.d.ts} +7 -4
- package/dist/{fx-4TFUkedZ.d.ts → fx-Cin14QvX.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 +6 -6
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +19 -19
- package/dist/{job-store-DkfNE9sv.d.ts → job-store-BtdD_xt1.d.ts} +1 -1
- package/dist/{lightning-backend-C3Gf1XpP.d.ts → lightning-backend-BYTODXJ2.d.ts} +1 -1
- package/dist/{memory-credit-ledger-HCECP6R7.js → memory-credit-ledger-E4C3VQE4.js} +4 -4
- package/dist/{mpp-setup-OL22TIDP.js → mpp-setup-BYKGEYFA.js} +2 -2
- package/dist/{payout-reporter-WSLDLMKK.js → payout-reporter-KOGHXJH4.js} +2 -2
- package/dist/{postgres-consumed-credential-store-7ONNOW37.js → postgres-consumed-credential-store-EZ4KETWH.js} +1 -1
- package/dist/{postgres-job-store-36GJGQMB.js → postgres-job-store-E6AUHNKB.js} +2 -2
- package/dist/{postgres-replay-store-JJ6XPVIU.js → postgres-replay-store-GIYZS4LJ.js} +2 -2
- package/dist/{pricing-FM6WVLCR.js → pricing-DG5IJ5QF.js} +3 -3
- package/dist/{revenue-reporter-CAWZMYQK.js → revenue-reporter-E56J3NZK.js} +2 -2
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +25 -25
- package/dist/{step-cache-DDTwd4SK.d.ts → step-cache-C6lMgDH8.d.ts} +7 -0
- package/dist/{tempo-charge-store-MVZH6CEB.js → tempo-charge-store-WTBIX2JX.js} +2 -2
- package/dist/{tempo-session-store-CCCG4HL7.js → tempo-session-store-AWIFUAA6.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +5 -5
- package/dist/{usd-DkRy9nfU.d.ts → usd-5v1FQ7Mn.d.ts} +1 -1
- package/dist/{x402-RHVRGUUI.js → x402-BN26TQZ6.js} +3 -3
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
installHostedTempoCloseGuard,
|
|
8
8
|
isTempoInsufficientFundsError,
|
|
9
9
|
resolveTempoNetwork
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KYCLHWKO.js";
|
|
11
11
|
import {
|
|
12
12
|
createX402FacilitatorAuthHeaders,
|
|
13
13
|
createX402FacilitatorClient,
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
verifyWithFacilitator,
|
|
17
17
|
withPaymentDiagnostics,
|
|
18
18
|
withPaymentStage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XEOTTFLH.js";
|
|
20
20
|
import {
|
|
21
21
|
MemoryCreditLedger
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FOJKZ4E7.js";
|
|
23
23
|
import {
|
|
24
24
|
PostgresJobStore
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-JUEEUV5X.js";
|
|
26
26
|
import {
|
|
27
27
|
parseStoreValue
|
|
28
28
|
} from "./chunk-YG7G4DPZ.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
humanizeZodIssues,
|
|
34
34
|
signedRequestInput,
|
|
35
35
|
zodIssuesOf
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-X5RY2G3C.js";
|
|
37
37
|
import {
|
|
38
38
|
MemoryJobStore,
|
|
39
39
|
UNCAPPABLE_ASK_TOTAL,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
isJobRetentionStore,
|
|
43
43
|
isReceiptIssuingStore,
|
|
44
44
|
isStreamableJobStore
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-MYJOV4R4.js";
|
|
46
46
|
import {
|
|
47
47
|
ContentHoldError,
|
|
48
48
|
JobCancelledError,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
signReceipt,
|
|
81
81
|
toLockPubkey,
|
|
82
82
|
verifyChallenge
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-QTH7CIA3.js";
|
|
84
84
|
import {
|
|
85
85
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
86
86
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
pinDimension,
|
|
113
113
|
withSpan,
|
|
114
114
|
withTraceContext
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-SX4WCPW7.js";
|
|
116
116
|
import {
|
|
117
117
|
StepCache
|
|
118
118
|
} from "./chunk-BQJIFRAZ.js";
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
roundUsd,
|
|
130
130
|
satsToFiat,
|
|
131
131
|
validateCurrency
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-LQQ6H4UB.js";
|
|
133
133
|
import {
|
|
134
134
|
CreditLedger,
|
|
135
135
|
CreditLedgerError,
|
|
@@ -145,10 +145,10 @@ import {
|
|
|
145
145
|
isNonChannelBitcoinRail,
|
|
146
146
|
netOwedSats,
|
|
147
147
|
x402SettlementPending
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-WP7UX6RF.js";
|
|
149
149
|
import {
|
|
150
150
|
withPostgresRecoveryContext
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-6RYCZLCK.js";
|
|
152
152
|
import {
|
|
153
153
|
DvmError,
|
|
154
154
|
x402NetworkByCaip2
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
import {
|
|
157
157
|
createDiagnosticCapabilityAuthority,
|
|
158
158
|
diagnosticConsole
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-FXDQMJQ2.js";
|
|
160
160
|
import {
|
|
161
161
|
MemoryProcessedPaymentStore,
|
|
162
162
|
PostgresProcessedPaymentStore,
|
|
@@ -3874,7 +3874,7 @@ async function verifyUpfrontPaymentInScope(opts) {
|
|
|
3874
3874
|
x402Requirements
|
|
3875
3875
|
});
|
|
3876
3876
|
}
|
|
3877
|
-
const { verifyX402Payment } = await import("./x402-
|
|
3877
|
+
const { verifyX402Payment } = await import("./x402-BN26TQZ6.js");
|
|
3878
3878
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
3879
3879
|
x402Payment,
|
|
3880
3880
|
x402Config,
|
|
@@ -4862,7 +4862,7 @@ async function verifyIncomingPaymentInScope(body, opts, snapshot) {
|
|
|
4862
4862
|
snapshot
|
|
4863
4863
|
});
|
|
4864
4864
|
}
|
|
4865
|
-
const { verifyX402Payment } = await import("./x402-
|
|
4865
|
+
const { verifyX402Payment } = await import("./x402-BN26TQZ6.js");
|
|
4866
4866
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
4867
4867
|
body.content.x402_payment,
|
|
4868
4868
|
opts.x402Config,
|
|
@@ -5293,7 +5293,7 @@ async function processIncomingPaymentInScope(job, body, opts) {
|
|
|
5293
5293
|
try {
|
|
5294
5294
|
const requiredMsats = job.pendingPaymentMsats ?? 0;
|
|
5295
5295
|
const requiredUsdcMicro = job.pendingX402AmountUsdcMicro !== void 0 ? BigInt(job.pendingX402AmountUsdcMicro) : BigInt(msatsToUsdc(requiredMsats, rate));
|
|
5296
|
-
const { verifyX402Payment } = await import("./x402-
|
|
5296
|
+
const { verifyX402Payment } = await import("./x402-BN26TQZ6.js");
|
|
5297
5297
|
const receipt = await withPaymentStage("verifier_broadcast", () => verifyX402Payment(
|
|
5298
5298
|
body.content.x402_payment,
|
|
5299
5299
|
opts.x402Config,
|
|
@@ -5940,9 +5940,11 @@ async function fundAndDrawInScope(ctx, funding, tx) {
|
|
|
5940
5940
|
throw new Error("deposit outbox enqueue requires the rail's open transaction and a DVM id");
|
|
5941
5941
|
}
|
|
5942
5942
|
const commitDeposit = async (result, credit) => {
|
|
5943
|
+
const instrument = credit.rail ? storedCreditBinding(credit).instrument : void 0;
|
|
5943
5944
|
const report = {
|
|
5944
5945
|
...deposit,
|
|
5945
|
-
callerPubkey: credit.callerPubkey
|
|
5946
|
+
callerPubkey: credit.callerPubkey,
|
|
5947
|
+
...instrument && { instrument }
|
|
5946
5948
|
};
|
|
5947
5949
|
if (createsDepositLiability && enqueue && tx) {
|
|
5948
5950
|
await enqueue(tx, creditDepositPayload(ctx.dvmId, report));
|
|
@@ -6124,6 +6126,7 @@ function creditDepositPayload(dvmId, funding) {
|
|
|
6124
6126
|
creditCurrency: funding.currency,
|
|
6125
6127
|
fundedAt: funding.fundedAt,
|
|
6126
6128
|
expiryMs: funding.expiryMs,
|
|
6129
|
+
...funding.instrument && { instrument: funding.instrument },
|
|
6127
6130
|
// label a session-funded deposit as one, whether or not the chain
|
|
6128
6131
|
// binding below could be read. `rail: "tempo"` alone does not say — a
|
|
6129
6132
|
// `tempo/charge` one-shot funds a credit with no channel at all — so this is
|
|
@@ -19530,7 +19533,7 @@ async function createDVMServer(descriptor, opts) {
|
|
|
19530
19533
|
}
|
|
19531
19534
|
}
|
|
19532
19535
|
if (!opts.onJobCompleted && platformToken && platformUrl && dvmId && opts.db) {
|
|
19533
|
-
const { RevenueReporter } = await import("./revenue-reporter-
|
|
19536
|
+
const { RevenueReporter } = await import("./revenue-reporter-E56J3NZK.js");
|
|
19534
19537
|
const reporter = new RevenueReporter(
|
|
19535
19538
|
opts.db,
|
|
19536
19539
|
platformUrl,
|
|
@@ -19540,7 +19543,7 @@ async function createDVMServer(descriptor, opts) {
|
|
|
19540
19543
|
revenueReporter = reporter;
|
|
19541
19544
|
await reporter.init();
|
|
19542
19545
|
reporter.startRetryLoop();
|
|
19543
|
-
const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-
|
|
19546
|
+
const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-KOGHXJH4.js");
|
|
19544
19547
|
payoutReporter = new PayoutReporter({
|
|
19545
19548
|
dvmId,
|
|
19546
19549
|
db: opts.db,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createX402FacilitatorAuthHeaders,
|
|
3
3
|
settleWithFacilitator,
|
|
4
4
|
verifyWithFacilitator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XEOTTFLH.js";
|
|
6
6
|
import {
|
|
7
7
|
buildPaymentRequirements,
|
|
8
8
|
decodePayment,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-KXWROQGK.js";
|
|
16
16
|
import {
|
|
17
17
|
diagnosticConsole
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FXDQMJQ2.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 }) {
|
|
@@ -337,6 +337,9 @@ var diagnostic_catalogue_v1_default = {
|
|
|
337
337
|
"revenue_skipped_unsettled_draw",
|
|
338
338
|
"rollback",
|
|
339
339
|
"router.proxy",
|
|
340
|
+
"sanctions_ip_data_incomplete",
|
|
341
|
+
"sanctions_ip_data_load_failed",
|
|
342
|
+
"sanctions_ip_data_stale",
|
|
340
343
|
"scrape_cache_touch_failed",
|
|
341
344
|
"scrape_cache_write_failed",
|
|
342
345
|
"scrape_card_segmentation_failed",
|
|
@@ -825,6 +828,7 @@ var diagnostic_catalogue_v1_default = {
|
|
|
825
828
|
"quota_exceeded",
|
|
826
829
|
"rate_limited",
|
|
827
830
|
"rate_limited_by_target",
|
|
831
|
+
"region_unavailable",
|
|
828
832
|
"replay_detected",
|
|
829
833
|
"request_integrity_failed",
|
|
830
834
|
"retry_hardened",
|
|
@@ -1052,6 +1056,17 @@ var diagnostic_catalogue_v1_default = {
|
|
|
1052
1056
|
paymentPhases: [
|
|
1053
1057
|
"upfront",
|
|
1054
1058
|
"mid-job"
|
|
1059
|
+
],
|
|
1060
|
+
sanctionsRegions: [
|
|
1061
|
+
"BY",
|
|
1062
|
+
"CU",
|
|
1063
|
+
"IR",
|
|
1064
|
+
"KP",
|
|
1065
|
+
"RU",
|
|
1066
|
+
"UA-09",
|
|
1067
|
+
"UA-14",
|
|
1068
|
+
"UA-40",
|
|
1069
|
+
"UA-43"
|
|
1055
1070
|
]
|
|
1056
1071
|
};
|
|
1057
1072
|
|
|
@@ -1089,6 +1104,7 @@ var CLIENT_PROTOCOL_VERSIONS = new Set(
|
|
|
1089
1104
|
diagnostic_catalogue_v1_default.clientProtocolVersions
|
|
1090
1105
|
);
|
|
1091
1106
|
var CLIENT_VERSION_FIELDS = new Set(diagnostic_catalogue_v1_default.clientVersionFields);
|
|
1107
|
+
var SANCTIONS_REGIONS = new Set(diagnostic_catalogue_v1_default.sanctionsRegions);
|
|
1092
1108
|
var SPAN_ID_RE = /^(?!0{16}$)[0-9a-f]{16}$/;
|
|
1093
1109
|
var TRACE_ID_RE = /^(?!0{32}$)[0-9a-f]{32}$/;
|
|
1094
1110
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -1317,6 +1333,8 @@ function projectField(key, value, dataset, authority, identityAuthority) {
|
|
|
1317
1333
|
return typeof value === "string" && STRIPE_EVENT_RE.test(value) ? value : void 0;
|
|
1318
1334
|
if (key === "reject_reason")
|
|
1319
1335
|
return value === "scanner_probe" ? value : void 0;
|
|
1336
|
+
if (key === "sanctions_region")
|
|
1337
|
+
return typeof value === "string" && SANCTIONS_REGIONS.has(value) ? value : void 0;
|
|
1320
1338
|
return void 0;
|
|
1321
1339
|
}
|
|
1322
1340
|
function projectService(value) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyRetryToPool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6RYCZLCK.js";
|
|
4
4
|
import {
|
|
5
5
|
x402NetworkByCaip2
|
|
6
6
|
} from "./chunk-BPYMEMQX.js";
|
|
7
7
|
import {
|
|
8
8
|
diagnosticConsole
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FXDQMJQ2.js";
|
|
10
10
|
import {
|
|
11
11
|
withSdkInitLock
|
|
12
12
|
} from "./chunk-COYKJRMM.js";
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
isDrainMethod,
|
|
11
11
|
isFundingRail,
|
|
12
12
|
x402SettlementPending
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-WP7UX6RF.js";
|
|
14
|
+
import "./chunk-6RYCZLCK.js";
|
|
15
15
|
import "./chunk-BPYMEMQX.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FXDQMJQ2.js";
|
|
17
17
|
import "./chunk-COYKJRMM.js";
|
|
18
18
|
export {
|
|
19
19
|
CreditLedger,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-
|
|
2
|
-
import { cf as HostingCleanupFence, cV as HostedIntent, ai as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a4 as Message, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a0 as MessageType, bj as X402Receipt, aE as X402Config, bi as X402ExactVersionSupport, cW as X402SettlementIntent, aa as PaymentRequirementsV2, cX as HostedFundingReservation, c2 as CreditLedgerQuerier, cY as X402SettlementCursor, bR as X402SettlementStatus, cZ as X402SettlementWriteOff, bO as X402RefundSettlementGate, c_ as X402FacilitatorAuth, c$ as X402BatchSettlementConfig, cB as PostgresX402ChannelStorage, d0 as X402PayoutObserver, bL as HostedSettlementReportObligations, br as MppxServer, ad as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, ap as PaymentRequirements, a2 as MppxCredential,
|
|
1
|
+
import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-BYTODXJ2.js';
|
|
2
|
+
import { cf as HostingCleanupFence, cV as HostedIntent, ai as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a4 as Message, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a0 as MessageType, bj as X402Receipt, aE as X402Config, bi as X402ExactVersionSupport, cW as X402SettlementIntent, aa as PaymentRequirementsV2, cX as HostedFundingReservation, c2 as CreditLedgerQuerier, cY as X402SettlementCursor, bR as X402SettlementStatus, cZ as X402SettlementWriteOff, bO as X402RefundSettlementGate, c_ as X402FacilitatorAuth, c$ as X402BatchSettlementConfig, cB as PostgresX402ChannelStorage, d0 as X402PayoutObserver, bL as HostedSettlementReportObligations, bm as CreditDepositPayload, br as MppxServer, ad as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, ap as PaymentRequirements, a2 as MppxCredential, bQ as DrawResult, cp as CreditLedgerError, a6 as ReceiptCredit, af as DrainReceiptEvent, a7 as DrainReceipt, K as KVStore, y as SignedRequestAudience, d3 as CreditDrawReleaseEnqueue, cz as JobCostReportPayload, cA as JobTerminalReportPayload, cD as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, bW as CreditInvoiceRecord, bX as InvoiceSettlement, cj as ClientCompatibilityGate, ch as ClientCompatibility, bv as PostgresTempoSessionStore, bu as PayoutReporter, R as ResolvedCreditConfig, g as CreditView } from './step-cache-C6lMgDH8.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-Cin14QvX.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-BtdD_xt1.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';
|
|
@@ -1859,6 +1859,8 @@ interface CreditFundingReport {
|
|
|
1859
1859
|
fundedAt: number;
|
|
1860
1860
|
/** Current credit expiry after this funding committed (epoch ms). */
|
|
1861
1861
|
expiryMs: number;
|
|
1862
|
+
/** The funded credit's stored instrument; absent for Cashu. */
|
|
1863
|
+
instrument?: CreditInstrument;
|
|
1862
1864
|
/** TIP-1034 voucher identity, present only for session-funded credit. */
|
|
1863
1865
|
tempoSession?: {
|
|
1864
1866
|
channelId: string;
|
|
@@ -2504,6 +2506,7 @@ declare function repairX402ExactSettlementEffect(args: {
|
|
|
2504
2506
|
enqueueCreditDeposit?: CreditDepositEnqueue;
|
|
2505
2507
|
tx?: CreditLedgerQuerier;
|
|
2506
2508
|
}): Promise<CommittedFunding | undefined>;
|
|
2509
|
+
type CreditInstrument = NonNullable<CreditDepositPayload["instrument"]>;
|
|
2507
2510
|
|
|
2508
2511
|
interface ReceiptIssuerOpts {
|
|
2509
2512
|
/** 32-byte hex receipt secret — `DVMKIT_RECEIPT_KEY`, or an ephemeral dev key. */
|
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 CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DEFAULT_JOB_RETENTION_DAYS, l as DVMRouteContext, I as IncomingMessage, m as InputType, n as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, o as PaymentMethod, p as PriceValue, q as ProgressContent, r as PromptOpts, Q as QuoteConfig, s as QuoteContext, t as QuoteResult, R as ResolvedCreditConfig, u as ResponseContent, S as SDKJobContext, v as SDKPaymentRequestOpts, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, y as SignedRequestAudience, z as SignedRequestDomain, B as SignedRequestError, E as SignedRequestFailure, F as SignedRequestReplayStore, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, U as UnsupportedCurrencyError, N as createSignedRequestVerifier, O as isZodSchema, T as signedRequestStatementHeader, V 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-C6lMgDH8.js';
|
|
2
|
+
export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DEFAULT_JOB_RETENTION_DAYS, l as DVMRouteContext, I as IncomingMessage, m as InputType, n as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, o as PaymentMethod, p as PriceValue, q as ProgressContent, r as PromptOpts, Q as QuoteConfig, s as QuoteContext, t as QuoteResult, R as ResolvedCreditConfig, u as ResponseContent, S as SDKJobContext, v as SDKPaymentRequestOpts, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, y as SignedRequestAudience, z as SignedRequestDomain, B as SignedRequestError, E as SignedRequestFailure, F as SignedRequestReplayStore, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, U as UnsupportedCurrencyError, N as createSignedRequestVerifier, O as isZodSchema, T as signedRequestStatementHeader, V as validateCurrency } from './step-cache-C6lMgDH8.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-Cin14QvX.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-5v1FQ7Mn.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-BtdD_xt1.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-X5RY2G3C.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_CREDIT_MAX,
|
|
16
16
|
DEFAULT_CREDIT_MIN,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-UKD3R2KU.js";
|
|
24
24
|
import {
|
|
25
25
|
buildUpfront
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NUPEAWRM.js";
|
|
27
27
|
import {
|
|
28
28
|
DEFAULT_FX_CURRENCIES,
|
|
29
29
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -41,8 +41,8 @@ import {
|
|
|
41
41
|
roundUsd,
|
|
42
42
|
satsToFiat,
|
|
43
43
|
validateCurrency
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
} from "./chunk-LQQ6H4UB.js";
|
|
45
|
+
import "./chunk-FXDQMJQ2.js";
|
|
46
46
|
|
|
47
47
|
// src/sdk/configure.ts
|
|
48
48
|
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-BYTODXJ2.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-BYTODXJ2.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 { W as JsonValue, z as SignedRequestDomain, H as SignedRequestStatementHeader, X as X402_BATCH_SETTLEMENT_SCHEME, Y as X402_EXACT_SCHEME, _ as FundingReceipt, $ as JobReceipt$1, a0 as MessageType, a1 as X402Version, a2 as MppxCredential, y as SignedRequestAudience, a3 as PaymentRequired, a4 as Message, a5 as MppxChallenge, a6 as ReceiptCredit, a7 as DrainReceipt, C as Currency, a8 as X402Wallet, a9 as PaymentRequirementsV1, aa as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-
|
|
6
|
-
export { ab as BuildPaymentRequirementsOpts, ac as CapabilityDescriptor, ad as CashuMode, ae as CompleteContent, af as DrainReceiptEvent, ag as ExactEvmPayload, ah as ExactEvmPayloadAuthorization, ai as FundingMethod, aj as MessageFrom, ak as PaymentPayload, al as PaymentPayloadV1, am as PaymentPayloadV2, an as PaymentRequestContent, ao as PaymentRequiredV2, ap as PaymentRequirements, aq as PromptContent, ar as RAIL_REFUNDABLE, as as ReceiptOutcome, at as ReceiptPayment, au as ResourceInfo, av as SettleResponse, aw as StepCache, ax as StepRecord, ay as TextContent, az as UnsignedDrainReceipt, aA as UnsignedFundingReceipt, aB as UnsignedJobReceipt, aC as VerifyResponse, aD as WorkingContent, aE as X402Config, aF as X402ResponseBody, aG as X402SelfRelayRpcFailureReason, aH as X402_DEFAULT_NETWORK, aI as X402_V1_VERSION, aJ as X402_VERSION, aK as buildPaymentRequiredV2, aL as buildPaymentRequirements, aM as caip2ToX402Network, aN as canonicalRequestPath, aO as canonicaliseForSigning, aP as canonicalize, aQ as chainIdFromCaip2, aR as computeResultHash, aS as decodePayment, aT as decodePaymentRequiredHeader, aU as encodePayment, aV as encodePaymentRequiredHeader, aW as encodeSettleResponseHeader, aX as exactEvmAuthorization, aY as isArtifactMessage, aZ as isCancelMessage, a_ as isCompleteMessage, a$ as isDrainReceipt, b0 as isFundingReceipt, b1 as isPaymentRequestMessage, b2 as isPromptMessage, b3 as isSignedJobReceipt, b4 as isTextMessage, b5 as isWorkingMessage, b6 as paymentRequiredV2FromV1, b7 as signDrainReceipt, b8 as signFundingReceipt, b9 as signReceipt, ba as usdcContractByCaip2, bb as usdcContractFor, bc as usdcDomainNameFor, bd as usdcDomainVersionFor, be as verifyDrainReceipt, bf as verifyFundingReceipt, bg as verifyReceipt, bh as x402NetworkToCaip2 } from '../step-cache-
|
|
5
|
+
import { W as JsonValue, z as SignedRequestDomain, H as SignedRequestStatementHeader, X as X402_BATCH_SETTLEMENT_SCHEME, Y as X402_EXACT_SCHEME, _ as FundingReceipt, $ as JobReceipt$1, a0 as MessageType, a1 as X402Version, a2 as MppxCredential, y as SignedRequestAudience, a3 as PaymentRequired, a4 as Message, a5 as MppxChallenge, a6 as ReceiptCredit, a7 as DrainReceipt, C as Currency, a8 as X402Wallet, a9 as PaymentRequirementsV1, aa as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-C6lMgDH8.js';
|
|
6
|
+
export { ab as BuildPaymentRequirementsOpts, ac as CapabilityDescriptor, ad as CashuMode, ae as CompleteContent, af as DrainReceiptEvent, ag as ExactEvmPayload, ah as ExactEvmPayloadAuthorization, ai as FundingMethod, aj as MessageFrom, ak as PaymentPayload, al as PaymentPayloadV1, am as PaymentPayloadV2, an as PaymentRequestContent, ao as PaymentRequiredV2, ap as PaymentRequirements, aq as PromptContent, ar as RAIL_REFUNDABLE, as as ReceiptOutcome, at as ReceiptPayment, au as ResourceInfo, av as SettleResponse, aw as StepCache, ax as StepRecord, ay as TextContent, az as UnsignedDrainReceipt, aA as UnsignedFundingReceipt, aB as UnsignedJobReceipt, aC as VerifyResponse, aD as WorkingContent, aE as X402Config, aF as X402ResponseBody, aG as X402SelfRelayRpcFailureReason, aH as X402_DEFAULT_NETWORK, aI as X402_V1_VERSION, aJ as X402_VERSION, aK as buildPaymentRequiredV2, aL as buildPaymentRequirements, aM as caip2ToX402Network, aN as canonicalRequestPath, aO as canonicaliseForSigning, aP as canonicalize, aQ as chainIdFromCaip2, aR as computeResultHash, aS as decodePayment, aT as decodePaymentRequiredHeader, aU as encodePayment, aV as encodePaymentRequiredHeader, aW as encodeSettleResponseHeader, aX as exactEvmAuthorization, aY as isArtifactMessage, aZ as isCancelMessage, a_ as isCompleteMessage, a$ as isDrainReceipt, b0 as isFundingReceipt, b1 as isPaymentRequestMessage, b2 as isPromptMessage, b3 as isSignedJobReceipt, b4 as isTextMessage, b5 as isWorkingMessage, b6 as paymentRequiredV2FromV1, b7 as signDrainReceipt, b8 as signFundingReceipt, b9 as signReceipt, ba as usdcContractByCaip2, bb as usdcContractFor, bc as usdcDomainNameFor, bd as usdcDomainVersionFor, be as verifyDrainReceipt, bf as verifyFundingReceipt, bg as verifyReceipt, bh as x402NetworkToCaip2 } from '../step-cache-C6lMgDH8.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-Cin14QvX.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-5v1FQ7Mn.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-BDHJVTWA.js";
|
|
36
36
|
import {
|
|
37
37
|
MemoryKVStore
|
|
38
38
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
withWalletLock,
|
|
140
140
|
writeAgentMnemonic,
|
|
141
141
|
writeIdentity
|
|
142
|
-
} from "../chunk-
|
|
142
|
+
} from "../chunk-QTH7CIA3.js";
|
|
143
143
|
import {
|
|
144
144
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
145
145
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -193,7 +193,7 @@ import {
|
|
|
193
193
|
randomTraceId,
|
|
194
194
|
setEmitter,
|
|
195
195
|
withTraceContext
|
|
196
|
-
} from "../chunk-
|
|
196
|
+
} from "../chunk-SX4WCPW7.js";
|
|
197
197
|
import {
|
|
198
198
|
redactUrl,
|
|
199
199
|
redactUrlsInText
|
|
@@ -207,11 +207,11 @@ import {
|
|
|
207
207
|
InvalidUsdPriceError,
|
|
208
208
|
parseUsdPrice,
|
|
209
209
|
warmFxSnapshot
|
|
210
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-LQQ6H4UB.js";
|
|
211
211
|
import {
|
|
212
212
|
applyRetryToPool,
|
|
213
213
|
withInitRetry
|
|
214
|
-
} from "../chunk-
|
|
214
|
+
} from "../chunk-6RYCZLCK.js";
|
|
215
215
|
import {
|
|
216
216
|
DvmError,
|
|
217
217
|
X402_NETWORKS,
|
|
@@ -234,7 +234,7 @@ import {
|
|
|
234
234
|
projectDiagnosticFields,
|
|
235
235
|
projectEventName,
|
|
236
236
|
projectSpanRow
|
|
237
|
-
} from "../chunk-
|
|
237
|
+
} from "../chunk-FXDQMJQ2.js";
|
|
238
238
|
|
|
239
239
|
// src/lib/budget-core.ts
|
|
240
240
|
function checkBudgetForLedger(ledger, opts) {
|