@dvmkit/sdk 0.6.0-rc.1 → 0.7.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JH3SX3LY.js → chunk-6XF3RVVX.js} +1 -1
- package/dist/{chunk-RLTSCKRI.js → chunk-BPYMEMQX.js} +50 -3
- package/dist/{chunk-IWQHUSMO.js → chunk-CXCQLOOK.js} +143 -2
- package/dist/{chunk-LE74UEV7.js → chunk-EZXAJ6EI.js} +64 -53
- package/dist/{chunk-FI4CST2D.js → chunk-FWGWLPXF.js} +4 -6
- package/dist/{chunk-HHBDBMEO.js → chunk-GY66THYI.js} +21 -23
- package/dist/{chunk-UOCZXO2Z.js → chunk-JEVLNAO3.js} +10 -5
- package/dist/{chunk-OQA7IHI4.js → chunk-KMED3H3A.js} +10 -6
- package/dist/{chunk-PAIM66YA.js → chunk-NFMOPYBA.js} +47 -37
- package/dist/{chunk-B2IROPQF.js → chunk-O2OTZ5GP.js} +40 -15
- package/dist/{chunk-FYRR2UEZ.js → chunk-OML32F6I.js} +1 -1
- package/dist/{chunk-7ZUKL4IV.js → chunk-RA2WIX7G.js} +5 -5
- package/dist/{chunk-PLG4XER6.js → chunk-S3OY533W.js} +1 -1
- package/dist/{chunk-GFY5FRX3.js → chunk-SZVXOQ75.js} +5 -12
- package/dist/{chunk-MZRJR2CW.js → chunk-WBOKPC37.js} +22 -3
- package/dist/{content-retention-BTGSQRfP.d.ts → content-retention-DHyLdA6b.d.ts} +1 -1
- package/dist/{credit-ledger-MI2H7NEC.js → credit-ledger-MCUXYKSJ.js} +2 -3
- package/dist/{credit-menu-BAsrRu3z.d.ts → credit-menu-DjnkeEUU.d.ts} +4 -4
- package/dist/{fx-BgDmyTdd.d.ts → fx-zMWFzfrU.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/internal/caller.d.ts +1359 -851
- package/dist/internal/caller.js +1000 -914
- package/dist/internal/index.js +1 -1
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +9 -11
- package/dist/{job-store-BVeF5_Jq.d.ts → job-store-DdLXBpol.d.ts} +1 -1
- package/dist/{lightning-backend-40fIzz1W.d.ts → lightning-backend-Bw-qtAbt.d.ts} +4 -2
- package/dist/{memory-credit-ledger-W2BAUYJP.js → memory-credit-ledger-SBSMGMDX.js} +3 -4
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +14 -17
- package/dist/{step-cache-CPdH1hei.d.ts → step-cache-2MkvenJn.d.ts} +1 -1
- package/dist/tempo-lifecycle-GJ77YKVY.js +15 -0
- package/dist/{tempo-wallet-B5XXV3YH.js → tempo-wallet-X2GGAZ6X.js} +4 -4
- package/dist/testing/index.d.ts +3 -3
- package/dist/{usd-AWlrwlM5.d.ts → usd-DI3d3gTK.d.ts} +1 -1
- package/dist/{x402-R6HPBY5D.js → x402-FT4S4JS4.js} +8 -10
- package/package.json +3 -2
- package/dist/chunk-CZULM42S.js +0 -143
- package/dist/chunk-LIRAHP7B.js +0 -53
- package/dist/tempo-lifecycle-ZBBLFBMH.js +0 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BTC_RATE_FILE,
|
|
3
3
|
ensureConfigSubdir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CXCQLOOK.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicaliseForSigning
|
|
7
7
|
} from "./chunk-OFVV37XC.js";
|
|
@@ -12,6 +12,47 @@ import {
|
|
|
12
12
|
// src/lib/credit-implicit.ts
|
|
13
13
|
var IMPLICIT_CREDIT_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
14
14
|
|
|
15
|
+
// src/lib/payment-amounts.ts
|
|
16
|
+
function msatsToUsd(msats, rate) {
|
|
17
|
+
return msats / 1e11 * rate;
|
|
18
|
+
}
|
|
19
|
+
function usdToMsats(usd, rate) {
|
|
20
|
+
return Math.round(usd / rate * 1e11);
|
|
21
|
+
}
|
|
22
|
+
function msatsToUsdCents(msats, btcPriceUsd) {
|
|
23
|
+
const usd = msatsToUsd(msats, btcPriceUsd);
|
|
24
|
+
return Math.round(usd * 100);
|
|
25
|
+
}
|
|
26
|
+
function msatsToUsdc(msats, btcUsdRate) {
|
|
27
|
+
if (!Number.isSafeInteger(msats) || msats < 0) {
|
|
28
|
+
throw new RangeError("msats must be a non-negative safe integer");
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isFinite(btcUsdRate) || btcUsdRate <= 0) {
|
|
31
|
+
throw new RangeError("BTC/USD rate must be finite and positive");
|
|
32
|
+
}
|
|
33
|
+
const [mantissa, exponent = "0"] = btcUsdRate.toString().split("e");
|
|
34
|
+
const decimalPlaces = mantissa.split(".")[1]?.length ?? 0;
|
|
35
|
+
const shift = Number(exponent) - decimalPlaces;
|
|
36
|
+
let numerator = BigInt(msats) * BigInt(mantissa.replace(".", ""));
|
|
37
|
+
let denominator = 100000n;
|
|
38
|
+
if (shift > 0) numerator *= 10n ** BigInt(shift);
|
|
39
|
+
else if (shift < 0) denominator *= 10n ** BigInt(-shift);
|
|
40
|
+
const micro = (numerator + denominator - 1n) / denominator;
|
|
41
|
+
if (micro > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
42
|
+
throw new RangeError("USDC micro-unit amount exceeds the safe integer range");
|
|
43
|
+
}
|
|
44
|
+
return Number(micro);
|
|
45
|
+
}
|
|
46
|
+
function usdcToMsats(usdc, btcUsdRate) {
|
|
47
|
+
return usdToMsats(usdc, btcUsdRate);
|
|
48
|
+
}
|
|
49
|
+
function msatsToMicro(msats, btcRate) {
|
|
50
|
+
return Math.round(msatsToUsd(msats, btcRate) * 1e6);
|
|
51
|
+
}
|
|
52
|
+
function microToSats(micro, btcRate) {
|
|
53
|
+
return Math.ceil(usdToMsats(micro / 1e6, btcRate) / 1e3);
|
|
54
|
+
}
|
|
55
|
+
|
|
15
56
|
// src/lib/fx-coingecko.ts
|
|
16
57
|
var COINGECKO_SIMPLE_PRICE_URL = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,usd-coin&vs_currencies=usd";
|
|
17
58
|
var COINGECKO_BTC_USD_URL = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd";
|
|
@@ -58,39 +99,6 @@ function isPositiveNumber(v) {
|
|
|
58
99
|
// src/lib/currency.ts
|
|
59
100
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
60
101
|
import { dirname } from "path";
|
|
61
|
-
function msatsToUsd(msats, rate) {
|
|
62
|
-
return msats / 1e11 * rate;
|
|
63
|
-
}
|
|
64
|
-
function usdToMsats(usd, rate) {
|
|
65
|
-
return Math.round(usd / rate * 1e11);
|
|
66
|
-
}
|
|
67
|
-
function msatsToUsdCents(msats, btcPriceUsd) {
|
|
68
|
-
const usd = msatsToUsd(msats, btcPriceUsd);
|
|
69
|
-
return Math.round(usd * 100);
|
|
70
|
-
}
|
|
71
|
-
function msatsToUsdc(msats, btcUsdRate) {
|
|
72
|
-
if (!Number.isSafeInteger(msats) || msats < 0) {
|
|
73
|
-
throw new RangeError("msats must be a non-negative safe integer");
|
|
74
|
-
}
|
|
75
|
-
if (!Number.isFinite(btcUsdRate) || btcUsdRate <= 0) {
|
|
76
|
-
throw new RangeError("BTC/USD rate must be finite and positive");
|
|
77
|
-
}
|
|
78
|
-
const [mantissa, exponent = "0"] = btcUsdRate.toString().split("e");
|
|
79
|
-
const decimalPlaces = mantissa.split(".")[1]?.length ?? 0;
|
|
80
|
-
const shift = Number(exponent) - decimalPlaces;
|
|
81
|
-
let numerator = BigInt(msats) * BigInt(mantissa.replace(".", ""));
|
|
82
|
-
let denominator = 100000n;
|
|
83
|
-
if (shift > 0) numerator *= 10n ** BigInt(shift);
|
|
84
|
-
else if (shift < 0) denominator *= 10n ** BigInt(-shift);
|
|
85
|
-
const micro = (numerator + denominator - 1n) / denominator;
|
|
86
|
-
if (micro > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
87
|
-
throw new RangeError("USDC micro-unit amount exceeds the safe integer range");
|
|
88
|
-
}
|
|
89
|
-
return Number(micro);
|
|
90
|
-
}
|
|
91
|
-
function usdcToMsats(usdc, btcUsdRate) {
|
|
92
|
-
return usdToMsats(usdc, btcUsdRate);
|
|
93
|
-
}
|
|
94
102
|
function formatSats(msats) {
|
|
95
103
|
if (msats === 0) return "0 sats";
|
|
96
104
|
if (msats < 1e3) return `${msats.toLocaleString("en-US")} msats`;
|
|
@@ -313,14 +321,16 @@ function verifyDrainReceipt(receipt) {
|
|
|
313
321
|
|
|
314
322
|
export {
|
|
315
323
|
IMPLICIT_CREDIT_TTL_MS,
|
|
316
|
-
COINGECKO_SIMPLE_PRICE_URL,
|
|
317
|
-
fetchCoinGeckoSpot,
|
|
318
|
-
fetchCoinGeckoBtcUsd,
|
|
319
324
|
msatsToUsd,
|
|
320
325
|
usdToMsats,
|
|
321
326
|
msatsToUsdCents,
|
|
322
327
|
msatsToUsdc,
|
|
323
328
|
usdcToMsats,
|
|
329
|
+
msatsToMicro,
|
|
330
|
+
microToSats,
|
|
331
|
+
COINGECKO_SIMPLE_PRICE_URL,
|
|
332
|
+
fetchCoinGeckoSpot,
|
|
333
|
+
fetchCoinGeckoBtcUsd,
|
|
324
334
|
formatSats,
|
|
325
335
|
formatAmount,
|
|
326
336
|
formatPaymentAmount,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IMPLICIT_CREDIT_TTL_MS,
|
|
3
3
|
isDrainReceipt
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NFMOPYBA.js";
|
|
5
5
|
import {
|
|
6
6
|
CREDITS_FILE,
|
|
7
7
|
ensureConfigDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CXCQLOOK.js";
|
|
9
9
|
import {
|
|
10
10
|
DvmError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BPYMEMQX.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/payment-rails/types.ts
|
|
14
14
|
var RAIL_FLAGS = ["cashu", "tempo", "x402"];
|
|
@@ -1449,33 +1449,58 @@ function isObjectRecord(value) {
|
|
|
1449
1449
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1450
1450
|
}
|
|
1451
1451
|
function mergeDuplicateCredits(credits) {
|
|
1452
|
-
const
|
|
1452
|
+
const groups = [];
|
|
1453
1453
|
const byCredit = /* @__PURE__ */ new Map();
|
|
1454
1454
|
let changed = false;
|
|
1455
1455
|
for (const record of credits) {
|
|
1456
1456
|
if (typeof record.creditId !== "string" || typeof record.callerPubkey !== "string") {
|
|
1457
|
-
|
|
1457
|
+
groups.push([record]);
|
|
1458
1458
|
continue;
|
|
1459
1459
|
}
|
|
1460
1460
|
const key = `${record.callerPubkey}\0${record.creditId}`;
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1461
|
+
let group = byCredit.get(key);
|
|
1462
|
+
if (group === void 0) {
|
|
1463
|
+
group = [];
|
|
1464
|
+
byCredit.set(key, group);
|
|
1465
|
+
groups.push(group);
|
|
1466
1466
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1467
|
+
let combined = record;
|
|
1468
|
+
let index = group.findIndex((candidate) => compatibleCreditLocations(candidate, combined));
|
|
1469
|
+
while (index !== -1) {
|
|
1470
|
+
combined = mergeCreditRecords(group[index], combined);
|
|
1471
|
+
group.splice(index, 1);
|
|
1472
|
+
changed = true;
|
|
1473
|
+
index = group.findIndex((candidate) => compatibleCreditLocations(candidate, combined));
|
|
1474
|
+
}
|
|
1475
|
+
group.push(combined);
|
|
1469
1476
|
}
|
|
1470
|
-
return { credits:
|
|
1477
|
+
return { credits: groups.flat(), changed };
|
|
1478
|
+
}
|
|
1479
|
+
function compatibleCreditLocations(left, right) {
|
|
1480
|
+
const leftIdentity = dvmLocationIdentity(left);
|
|
1481
|
+
const rightIdentity = dvmLocationIdentity(right);
|
|
1482
|
+
if (leftIdentity && rightIdentity) {
|
|
1483
|
+
return matchesDvmIdentity(left, rightIdentity);
|
|
1484
|
+
}
|
|
1485
|
+
if (leftIdentity) {
|
|
1486
|
+
return dvmLocationOrigins(left).some((origin) => matchesDvmOrigin(right, origin, leftIdentity));
|
|
1487
|
+
}
|
|
1488
|
+
if (rightIdentity) {
|
|
1489
|
+
return dvmLocationOrigins(right).some((origin) => matchesDvmOrigin(left, origin, rightIdentity));
|
|
1490
|
+
}
|
|
1491
|
+
return dvmLocationOrigins(left).some((origin) => matchesDvmOrigin(right, origin, void 0));
|
|
1471
1492
|
}
|
|
1472
1493
|
function mergeCreditRecords(left, right) {
|
|
1473
1494
|
const leftUpdated = Number.isFinite(left.updatedAt) ? left.updatedAt : 0;
|
|
1474
1495
|
const rightUpdated = Number.isFinite(right.updatedAt) ? right.updatedAt : 0;
|
|
1475
1496
|
const [newer, older] = rightUpdated >= leftUpdated ? [right, left] : [left, right];
|
|
1476
1497
|
const record = { ...newer };
|
|
1477
|
-
|
|
1478
|
-
if (
|
|
1498
|
+
const identity = dvmLocationIdentity(newer) ?? dvmLocationIdentity(older);
|
|
1499
|
+
if (identity) {
|
|
1500
|
+
record.dvmId = identity.dvmId;
|
|
1501
|
+
record.attestedBuilderPubkey = identity.builderPubkey;
|
|
1502
|
+
} else if (record.dvmId === void 0 && record.attestedBuilderPubkey === void 0) {
|
|
1503
|
+
record.dvmId = older.dvmId;
|
|
1479
1504
|
record.attestedBuilderPubkey = older.attestedBuilderPubkey;
|
|
1480
1505
|
}
|
|
1481
1506
|
if (record.rail === void 0 && older.rail !== void 0) record.rail = older.rail;
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
createX402FacilitatorAuthHeaders,
|
|
3
3
|
settleWithFacilitator,
|
|
4
4
|
verifyWithFacilitator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-S3OY533W.js";
|
|
6
|
+
import {
|
|
7
|
+
usdcToMsats
|
|
8
|
+
} from "./chunk-NFMOPYBA.js";
|
|
6
9
|
import {
|
|
7
10
|
buildPaymentRequirements,
|
|
8
11
|
decodePayment,
|
|
9
12
|
encodeSettleResponseHeader,
|
|
10
13
|
exactEvmAuthorization
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
usdcToMsats
|
|
14
|
-
} from "./chunk-PAIM66YA.js";
|
|
14
|
+
} from "./chunk-CXCQLOOK.js";
|
|
15
15
|
import {
|
|
16
16
|
callerLoggers
|
|
17
17
|
} from "./chunk-66HGCPBU.js";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isValidEvmPrivateKey,
|
|
3
3
|
loadConfig,
|
|
4
|
+
tempoAccountFromConfig,
|
|
4
5
|
updateConfig
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WBOKPC37.js";
|
|
6
7
|
import {
|
|
7
8
|
resolveRpcHttpTransportOptions,
|
|
8
9
|
resolveRpcOverride
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CXCQLOOK.js";
|
|
10
11
|
import {
|
|
11
12
|
redactUrl,
|
|
12
13
|
redactUrlsInText
|
|
13
14
|
} from "./chunk-FUJ36YDV.js";
|
|
14
15
|
import {
|
|
15
16
|
DvmError
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BPYMEMQX.js";
|
|
17
18
|
|
|
18
19
|
// src/lib/payment-rails/tempo-wallet.ts
|
|
19
20
|
var TEMPO_USDC_MAINNET = "0x20C000000000000000000000b9537d11c60E8b50";
|
|
@@ -103,7 +104,7 @@ async function generateTempoKey(opts = {}) {
|
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
if (existing && opts.force) {
|
|
106
|
-
const { assertTempoWalletIdle } = await import("./tempo-lifecycle-
|
|
107
|
+
const { assertTempoWalletIdle } = await import("./tempo-lifecycle-GJ77YKVY.js");
|
|
107
108
|
await assertTempoWalletIdle("replace");
|
|
108
109
|
}
|
|
109
110
|
const { privateKeyToAccount, generatePrivateKey } = await import("viem/accounts");
|
|
@@ -182,14 +183,6 @@ async function deriveTempoAddress(privateKey) {
|
|
|
182
183
|
function shortAddress(addr) {
|
|
183
184
|
return `${addr.slice(0, 6)}\u2026${addr.slice(-4)}`;
|
|
184
185
|
}
|
|
185
|
-
async function tempoAccountFromConfig(config) {
|
|
186
|
-
if (config?.tempo?.method !== "tempo") return null;
|
|
187
|
-
const apiKey = config.tempo.apiKey;
|
|
188
|
-
if (!apiKey || !isValidEvmPrivateKey(apiKey)) return null;
|
|
189
|
-
const privateKey = apiKey;
|
|
190
|
-
const address = await deriveTempoAddress(privateKey);
|
|
191
|
-
return { privateKey, address, network: config.tempo.network ?? "mainnet" };
|
|
192
|
-
}
|
|
193
186
|
function invalidTempoPrivateKey() {
|
|
194
187
|
return new DvmError(
|
|
195
188
|
"invalid_api_key",
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
CONFIG_BACKUP_FILE,
|
|
4
4
|
CONFIG_FILE,
|
|
5
5
|
CONFIG_PINNED_FILE,
|
|
6
|
+
X402_DEFAULT_NETWORK,
|
|
6
7
|
ensureConfigDir
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CXCQLOOK.js";
|
|
8
9
|
import {
|
|
9
10
|
DvmError
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BPYMEMQX.js";
|
|
11
12
|
|
|
12
13
|
// src/lib/evm-private-key.ts
|
|
13
14
|
import { secp256k1 } from "@noble/curves/secp256k1.js";
|
|
@@ -756,6 +757,22 @@ function retireSlot(reason, slot) {
|
|
|
756
757
|
return true;
|
|
757
758
|
}
|
|
758
759
|
|
|
760
|
+
// src/lib/wallet-credentials.ts
|
|
761
|
+
function x402WalletFromConfig(config) {
|
|
762
|
+
const x402 = config?.x402;
|
|
763
|
+
const privateKey = x402?.privateKey;
|
|
764
|
+
if (!privateKey || !isValidEvmPrivateKey(privateKey)) return null;
|
|
765
|
+
return { privateKey, address: "", network: x402.network ?? X402_DEFAULT_NETWORK };
|
|
766
|
+
}
|
|
767
|
+
async function tempoAccountFromConfig(config) {
|
|
768
|
+
if (config?.tempo?.method !== "tempo") return null;
|
|
769
|
+
const privateKey = config.tempo.apiKey;
|
|
770
|
+
if (!privateKey || !isValidEvmPrivateKey(privateKey)) return null;
|
|
771
|
+
const { privateKeyToAccount } = await import("viem/accounts");
|
|
772
|
+
const address = privateKeyToAccount(privateKey).address.toLowerCase();
|
|
773
|
+
return { privateKey, address, network: config.tempo.network ?? "mainnet" };
|
|
774
|
+
}
|
|
775
|
+
|
|
759
776
|
export {
|
|
760
777
|
isValidEvmPrivateKey,
|
|
761
778
|
authorizeProtectedRemoval,
|
|
@@ -772,5 +789,7 @@ export {
|
|
|
772
789
|
ensureConfig,
|
|
773
790
|
previewConfigRollback,
|
|
774
791
|
rollbackConfig,
|
|
775
|
-
retireConfigBackup
|
|
792
|
+
retireConfigBackup,
|
|
793
|
+
x402WalletFromConfig,
|
|
794
|
+
tempoAccountFromConfig
|
|
776
795
|
};
|
|
@@ -10,11 +10,10 @@ import {
|
|
|
10
10
|
isDrainMethod,
|
|
11
11
|
isFundingRail,
|
|
12
12
|
x402SettlementPending
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6XF3RVVX.js";
|
|
14
14
|
import "./chunk-COYKJRMM.js";
|
|
15
15
|
import "./chunk-P6QON7ER.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-LIRAHP7B.js";
|
|
16
|
+
import "./chunk-BPYMEMQX.js";
|
|
18
17
|
import "./chunk-ETXDTUJO.js";
|
|
19
18
|
export {
|
|
20
19
|
CreditLedger,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { g as LockPubkey, f as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-
|
|
2
|
-
import { cf as HostingCleanupFence, cV as HostedIntent,
|
|
1
|
+
import { g as LockPubkey, f as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-Bw-qtAbt.js';
|
|
2
|
+
import { cf as HostingCleanupFence, cV as HostedIntent, aj as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a3 as Message, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a4 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, ae as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, aq as PaymentRequirements, a2 as MppxCredential, bm as CreditDepositPayload, bQ as DrawResult, cp as CreditLedgerError, a7 as ReceiptCredit, ag as DrainReceiptEvent, a6 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-2MkvenJn.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 { b as FxRateSnapshot, F as FxFetcher } from './fx-
|
|
6
|
+
import { b as FxRateSnapshot, F as FxFetcher } from './fx-zMWFzfrU.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-DdLXBpol.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 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, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-
|
|
4
|
-
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-
|
|
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-2MkvenJn.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-2MkvenJn.js';
|
|
3
|
+
export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, P as PlatformFxSource, d as createFxFetcher, f as fxRateFor, r as resolveFxSourceFromEnv } from './fx-zMWFzfrU.js';
|
|
4
|
+
export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-DI3d3gTK.js';
|
|
5
|
+
export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-DdLXBpol.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';
|