@dvmkit/sdk 0.7.0-rc.9 → 0.8.0
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/NOTICE +1 -1
- package/README.md +57 -261
- package/dist/{chunk-RJFBBEWQ.js → chunk-2I3OHMTY.js} +1 -1
- package/dist/{chunk-7RZEJJTN.js → chunk-55NKZQOC.js} +2 -2
- package/dist/{chunk-5CSR33B5.js → chunk-5CQKSLAU.js} +1 -1
- package/dist/{chunk-YS6PWVCZ.js → chunk-5K5E6ME6.js} +1 -1
- package/dist/chunk-66HGCPBU.js +25 -0
- package/dist/{chunk-QM2OS3NJ.js → chunk-6FEHRZO7.js} +1 -1
- package/dist/{chunk-FYETJDBB.js → chunk-ATXDKX6F.js} +2 -2
- package/dist/{chunk-RGSWVNQG.js → chunk-BL6LRWXD.js} +2 -43
- package/dist/{chunk-5PLQOC4B.js → chunk-DZQYQN2X.js} +2 -1
- package/dist/{chunk-YE53E4BT.js → chunk-EBCLWOKF.js} +1 -1
- package/dist/{chunk-KXWROQGK.js → chunk-FUJ36YDV.js} +1 -24
- package/dist/{chunk-QN3CQOE2.js → chunk-GB5XPAA5.js} +191 -5
- package/dist/{chunk-G7IXOVKV.js → chunk-GSPV3UIM.js} +98 -51
- package/dist/{chunk-2HAFZ5GC.js → chunk-I6PHA54S.js} +2 -2
- package/dist/chunk-IFWUWHTW.js +47 -0
- package/dist/{chunk-HU6ZMQDN.js → chunk-P5WEZXJ2.js} +1 -1
- package/dist/{chunk-2DE32RAW.js → chunk-PRSKC7AD.js} +1 -1
- package/dist/{chunk-6JZDFYQL.js → chunk-QPXI7YPH.js} +1 -1
- package/dist/{chunk-5TIFEMHJ.js → chunk-RTFBVXCN.js} +2 -2
- package/dist/{chunk-ZLWPEIE2.js → chunk-TFYY5APM.js} +1 -1
- package/dist/{chunk-IOKEKMIU.js → chunk-VYP6ADCS.js} +2 -2
- package/dist/{chunk-OFSOLHRX.js → chunk-WMGXJQI3.js} +1 -1
- package/dist/{chunk-YNHXOONR.js → chunk-X3JEME6P.js} +1 -1
- package/dist/{chunk-2GTLF74N.js → chunk-XXLUIXPO.js} +1 -1
- package/dist/{chunk-WGK5KZ6S.js → chunk-YPSJU3OH.js} +3 -3
- package/dist/{content-retention-U7dJM7Ph.d.ts → content-retention-D2K4MKNO.d.ts} +1 -1
- package/dist/{credit-ledger-F2LWQU6N.js → credit-ledger-AOU6S34N.js} +3 -3
- package/dist/{credit-menu-CUJdCfpt.d.ts → credit-menu-C-8g2cHT.d.ts} +5 -5
- package/dist/{fx-BvG2Wnjk.d.ts → fx-Ql4nvdbh.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/internal/caller.d.ts +10 -8
- package/dist/internal/caller.js +12 -9
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +22 -20
- package/dist/{job-store-DjgN2AOk.d.ts → job-store-DCvJQUX0.d.ts} +1 -1
- package/dist/{lightning-backend-DeasHNOP.d.ts → lightning-backend-CY5ML3km.d.ts} +1 -1
- package/dist/{memory-credit-ledger-XOOWJTBZ.js → memory-credit-ledger-4HWYINKJ.js} +4 -4
- package/dist/{mpp-setup-KGX6PLAF.js → mpp-setup-2BKTPEK6.js} +4 -2
- package/dist/{payout-reporter-W3CCLYCN.js → payout-reporter-HQSIIBFL.js} +2 -2
- package/dist/{postgres-consumed-credential-store-LUJ5CUJS.js → postgres-consumed-credential-store-R7DNU6CM.js} +1 -1
- package/dist/{postgres-job-store-IX7IUXF4.js → postgres-job-store-6VGFL6XE.js} +2 -2
- package/dist/{postgres-replay-store-Q6MEQDWZ.js → postgres-replay-store-SY26NUCI.js} +2 -2
- package/dist/{pricing-ZUEFO3CM.js → pricing-H2RA4X2R.js} +3 -3
- package/dist/{revenue-reporter-NRS2FANA.js → revenue-reporter-X52GPZ5U.js} +2 -2
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +30 -28
- package/dist/{step-cache-C9JRSFhM.d.ts → step-cache-BOWAn_BH.d.ts} +32 -4
- package/dist/{tempo-charge-store-NZJTJCUO.js → tempo-charge-store-NKXJ2AXE.js} +2 -2
- package/dist/{tempo-session-store-ENFDLDKC.js → tempo-session-store-ZSDQIWSU.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +8 -6
- package/dist/{usd-DXDkHn_8.d.ts → usd-MAtMp3DB.d.ts} +1 -1
- package/dist/{x402-T7WVKDD4.js → x402-Q4S36NHQ.js} +6 -5
- package/package.json +18 -3
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-2I3OHMTY.js";
|
|
4
4
|
import {
|
|
5
5
|
PostgresKVStore
|
|
6
6
|
} from "../chunk-V5ZRATJH.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseNwcUri,
|
|
19
19
|
validateX402Env,
|
|
20
20
|
withNwcPool
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-55NKZQOC.js";
|
|
22
22
|
import {
|
|
23
23
|
MemoryKVStore
|
|
24
24
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -80,32 +80,32 @@ import {
|
|
|
80
80
|
stripProtocolEnvelope,
|
|
81
81
|
toCreditView,
|
|
82
82
|
unknownRouteNotFound
|
|
83
|
-
} from "../chunk-
|
|
83
|
+
} from "../chunk-GSPV3UIM.js";
|
|
84
84
|
import {
|
|
85
85
|
TEMPO_MODERATO_CHAIN_ID,
|
|
86
86
|
TEMPO_MODERATO_RPC,
|
|
87
87
|
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
88
88
|
TempoSettlementReadiness,
|
|
89
89
|
resolveTempoNetwork
|
|
90
|
-
} from "../chunk-
|
|
91
|
-
import "../chunk-
|
|
92
|
-
import "../chunk-
|
|
90
|
+
} from "../chunk-GB5XPAA5.js";
|
|
91
|
+
import "../chunk-X3JEME6P.js";
|
|
92
|
+
import "../chunk-ATXDKX6F.js";
|
|
93
93
|
import {
|
|
94
94
|
MemoryCreditLedger
|
|
95
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-EBCLWOKF.js";
|
|
96
96
|
import {
|
|
97
97
|
PostgresJobStore
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-QPXI7YPH.js";
|
|
99
99
|
import "../chunk-YG7G4DPZ.js";
|
|
100
100
|
import {
|
|
101
101
|
SignedRequestError,
|
|
102
102
|
createDefaultReplayStore,
|
|
103
103
|
createSignedRequestVerifier,
|
|
104
104
|
signedRequestInput
|
|
105
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-5K5E6ME6.js";
|
|
106
106
|
import {
|
|
107
107
|
isStreamableJobStore
|
|
108
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-I6PHA54S.js";
|
|
109
109
|
import {
|
|
110
110
|
ContentHoldError,
|
|
111
111
|
baselineContentExpiry,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
IMPLICIT_CREDIT_TTL_MS,
|
|
117
117
|
generateEphemeralReceiptKey,
|
|
118
118
|
receiptPubkeyFromSecret
|
|
119
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-RTFBVXCN.js";
|
|
120
120
|
import {
|
|
121
121
|
X402_DEFAULT_FACILITATOR,
|
|
122
122
|
X402_DEFAULT_NETWORK,
|
|
@@ -128,13 +128,15 @@ import {
|
|
|
128
128
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
129
129
|
signedRequestStatementHeader
|
|
130
130
|
} from "../chunk-UKD3R2KU.js";
|
|
131
|
+
import "../chunk-IFWUWHTW.js";
|
|
131
132
|
import {
|
|
132
133
|
initLoggers
|
|
133
|
-
} from "../chunk-
|
|
134
|
-
import "../chunk-
|
|
134
|
+
} from "../chunk-BL6LRWXD.js";
|
|
135
|
+
import "../chunk-FUJ36YDV.js";
|
|
136
|
+
import "../chunk-66HGCPBU.js";
|
|
135
137
|
import "../chunk-BQJIFRAZ.js";
|
|
136
|
-
import "../chunk-
|
|
137
|
-
import "../chunk-
|
|
138
|
+
import "../chunk-XXLUIXPO.js";
|
|
139
|
+
import "../chunk-5CQKSLAU.js";
|
|
138
140
|
import {
|
|
139
141
|
CreditLedger,
|
|
140
142
|
CreditLedgerError,
|
|
@@ -142,16 +144,16 @@ import {
|
|
|
142
144
|
PostgresX402ChannelStorage,
|
|
143
145
|
X402RelaySubmissionLockError,
|
|
144
146
|
allocateDrawValue
|
|
145
|
-
} from "../chunk-
|
|
147
|
+
} from "../chunk-VYP6ADCS.js";
|
|
146
148
|
import {
|
|
147
149
|
applyRetryToPool
|
|
148
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-6FEHRZO7.js";
|
|
149
151
|
import {
|
|
150
152
|
assertSupportedX402Network
|
|
151
153
|
} from "../chunk-BPYMEMQX.js";
|
|
152
154
|
import {
|
|
153
155
|
diagnosticConsole
|
|
154
|
-
} from "../chunk-
|
|
156
|
+
} from "../chunk-DZQYQN2X.js";
|
|
155
157
|
import {
|
|
156
158
|
MemoryProcessedPaymentStore,
|
|
157
159
|
PostgresProcessedPaymentStore,
|
|
@@ -1147,7 +1149,7 @@ function createDVMHost(opts = {}) {
|
|
|
1147
1149
|
});
|
|
1148
1150
|
applyRetryToPool(pool, "dvm-host");
|
|
1149
1151
|
pgPool = pool;
|
|
1150
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1152
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-6VGFL6XE.js");
|
|
1151
1153
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1152
1154
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1153
1155
|
jobStore = pgJobStore;
|
|
@@ -1240,11 +1242,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1240
1242
|
let tempoChargeBackend = "user-supplied";
|
|
1241
1243
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1242
1244
|
if (!mpp && mppTempoRecipient) {
|
|
1243
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1245
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-2BKTPEK6.js");
|
|
1244
1246
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1245
1247
|
let tempoCharge;
|
|
1246
1248
|
if (pgPool) {
|
|
1247
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1249
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-NKXJ2AXE.js");
|
|
1248
1250
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1249
1251
|
tempoChargeStore = chargeStore;
|
|
1250
1252
|
pendingInits.push(chargeStore.init());
|
|
@@ -1264,7 +1266,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1264
1266
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1265
1267
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1266
1268
|
] = await Promise.all([
|
|
1267
|
-
import("../tempo-session-store-
|
|
1269
|
+
import("../tempo-session-store-ZSDQIWSU.js"),
|
|
1268
1270
|
import("viem/accounts"),
|
|
1269
1271
|
import("viem"),
|
|
1270
1272
|
import("viem/chains")
|
|
@@ -1417,7 +1419,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1417
1419
|
}
|
|
1418
1420
|
}
|
|
1419
1421
|
const fxSource = envMaybe.DVMKIT_FX_SOURCE;
|
|
1420
|
-
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-
|
|
1422
|
+
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-H2RA4X2R.js");
|
|
1421
1423
|
const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
|
|
1422
1424
|
const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
|
|
1423
1425
|
if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
|
|
@@ -1427,7 +1429,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1427
1429
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1428
1430
|
let sharedPgReplayStore;
|
|
1429
1431
|
if (pgPool) {
|
|
1430
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1432
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-SY26NUCI.js");
|
|
1431
1433
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1432
1434
|
pendingInits.push(store2.init());
|
|
1433
1435
|
sharedPgReplayStore = store2;
|
|
@@ -1455,13 +1457,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1455
1457
|
}
|
|
1456
1458
|
let sharedPgConsumedStore;
|
|
1457
1459
|
if (pgPool) {
|
|
1458
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1460
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-R7DNU6CM.js");
|
|
1459
1461
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1460
1462
|
pendingInits.push(consumedStore.init());
|
|
1461
1463
|
sharedPgConsumedStore = consumedStore;
|
|
1462
1464
|
}
|
|
1463
1465
|
if (pgPool) {
|
|
1464
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1466
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-AOU6S34N.js");
|
|
1465
1467
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1466
1468
|
pendingInits.push(pgLedger.init());
|
|
1467
1469
|
creditLedger = pgLedger;
|
|
@@ -1470,7 +1472,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1470
1472
|
pendingInits.push(pgProcessed.init());
|
|
1471
1473
|
processedPayments = pgProcessed;
|
|
1472
1474
|
} else {
|
|
1473
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1475
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-4HWYINKJ.js");
|
|
1474
1476
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1475
1477
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1476
1478
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -1971,7 +1973,7 @@ function logBootSummary(s) {
|
|
|
1971
1973
|
diagnosticConsole.log(` Database: ${s.databaseConnected ? "connected" : "(not configured)"}`);
|
|
1972
1974
|
diagnosticConsole.log(` Mints: ${s.mints && s.mints.length > 0 ? s.mints.join(", ") : "(none)"}`);
|
|
1973
1975
|
diagnosticConsole.log(` Cashu mode: ${s.cashuOpts.cashuMode ?? "(disabled)"}`);
|
|
1974
|
-
diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm}` : "(unconfigured)"}`);
|
|
1976
|
+
diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm ?? "(unset)"}` : "(unconfigured)"}`);
|
|
1975
1977
|
if (s.mpp) {
|
|
1976
1978
|
const rotState = !s.mppSecretState ? "single-key (no DB-backed rotation)" : s.mppSecretState.previous ? `dual-key (previous expires ${new Date(s.mppSecretState.previous.expiresAtMs).toISOString()})` : "active-only";
|
|
1977
1979
|
diagnosticConsole.log(` Tempo secret: ${rotState}`);
|
|
@@ -1228,6 +1228,12 @@ declare class HostedSettlementReportObligations {
|
|
|
1228
1228
|
}): Promise<HostedEffectReservation | null>;
|
|
1229
1229
|
reserveTempo(channelId: string, operation: "settle" | "close", drainId?: string): Promise<HostedEffectReservation>;
|
|
1230
1230
|
findPendingTempo(channelId: string, operation: "settle" | "close"): Promise<ObligationRow | undefined>;
|
|
1231
|
+
/** The original close obligation reserved for this drain, while its report is outstanding. */
|
|
1232
|
+
pendingTempoClose(channelId: string, drainId: string): Promise<{
|
|
1233
|
+
id: string;
|
|
1234
|
+
txHash: string | null;
|
|
1235
|
+
reservedAtMs: number;
|
|
1236
|
+
} | undefined>;
|
|
1231
1237
|
submittedIds(rail: Rail, operation: Operation, txHash: string, batchId?: string): Promise<string[]>;
|
|
1232
1238
|
refundClaimDelta(txHash: string, channelId: string): Promise<bigint>;
|
|
1233
1239
|
assertReservedTempoClose(id: string, channelId: string): Promise<void>;
|
|
@@ -4519,7 +4525,8 @@ interface MppOpts {
|
|
|
4519
4525
|
* of ours can reach the un-dual-keyed door — see `createDualKeyMppxFromOpts`.
|
|
4520
4526
|
*/
|
|
4521
4527
|
interface MppxServer {
|
|
4522
|
-
realm
|
|
4528
|
+
/** Undefined when neither `Mppx.create` nor mppx's environment lookup names a realm. */
|
|
4529
|
+
realm?: string;
|
|
4523
4530
|
methods: readonly Method.AnyServer[];
|
|
4524
4531
|
/** Public, non-secret Tempo bindings resolved from the exact live method configuration. */
|
|
4525
4532
|
tempoConfiguration?: {
|
|
@@ -4531,9 +4538,9 @@ interface MppxServer {
|
|
|
4531
4538
|
};
|
|
4532
4539
|
challenge: any;
|
|
4533
4540
|
/**
|
|
4534
|
-
* Re-validate and broadcast a credential, returning a receipt.
|
|
4535
|
-
*
|
|
4536
|
-
*
|
|
4541
|
+
* Re-validate and broadcast a credential, returning a receipt. Accepting
|
|
4542
|
+
* payment is always this mutating path; `validateCredential` below is only
|
|
4543
|
+
* the hosted close's preflight.
|
|
4537
4544
|
*/
|
|
4538
4545
|
broadcastCredential(credential: Credential.Credential | string, options?: any): Promise<Receipt.Receipt>;
|
|
4539
4546
|
/** Non-mutating mppx HMAC, route, expiry and method preflight. */
|
|
@@ -4605,6 +4612,21 @@ interface MppxServer {
|
|
|
4605
4612
|
getTempoSessionCloseIntent?: (channelId: string) => Promise<TempoSessionCloseRecord | null>;
|
|
4606
4613
|
/** Read terminally consumed value for an exact cooperative-close challenge. */
|
|
4607
4614
|
getTempoSessionSpent?: (channelId: string) => Promise<bigint>;
|
|
4615
|
+
/**
|
|
4616
|
+
* Refuse a cooperative close voucher that mppx's close would refuse before
|
|
4617
|
+
* submitting, using only the stored channel: no chain read and no write.
|
|
4618
|
+
* A hosted close runs it before reserving its settlement-report obligation,
|
|
4619
|
+
* so a voucher that could never broadcast does not leave a reservation behind.
|
|
4620
|
+
*/
|
|
4621
|
+
assertTempoSessionCloseVoucher?: (voucher: {
|
|
4622
|
+
channelId: string;
|
|
4623
|
+
cumulativeAmount: bigint;
|
|
4624
|
+
signature: string;
|
|
4625
|
+
/** The credential's TIP-1034 channel descriptor, unchecked. */
|
|
4626
|
+
descriptor: unknown;
|
|
4627
|
+
/** The HMAC-verified challenge request the credential answers. */
|
|
4628
|
+
request: Record<string, unknown>;
|
|
4629
|
+
}) => Promise<void>;
|
|
4608
4630
|
/**
|
|
4609
4631
|
* Read the immutable chain binding of a stored channel, or `null`
|
|
4610
4632
|
* when this DVM holds no such channel. What a close event must match before
|
|
@@ -4737,6 +4759,12 @@ interface TempoSessionChainOps {
|
|
|
4737
4759
|
onSessionSettlement?: NonNullable<MppOpts["tempoSession"]>["onSessionSettlement"];
|
|
4738
4760
|
}): Promise<Hex>;
|
|
4739
4761
|
readChannelClose(client: Client, channelId: Hex, txHash: Hex): Promise<TempoChannelCloseAmounts>;
|
|
4762
|
+
/**
|
|
4763
|
+
* The transaction that emitted this channel's `ChannelClosed`, searched back
|
|
4764
|
+
* from the chain head no further than blocks older than `notBeforeMs`. Null
|
|
4765
|
+
* only when that whole range was searched and holds no close.
|
|
4766
|
+
*/
|
|
4767
|
+
findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number): Promise<Hex | null>;
|
|
4740
4768
|
}
|
|
4741
4769
|
declare function attachTempoSessionRuntime(mppx: MppxServer, config: MppOpts["tempoSession"], chainOpOverrides?: Partial<TempoSessionChainOps>): MppxServer;
|
|
4742
4770
|
/** Test-only seams for deterministic watcher coverage without a live Tempo RPC. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoChargeStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TFYY5APM.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-DZQYQN2X.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
7
|
export {
|
|
8
8
|
PostgresTempoChargeStore
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore,
|
|
3
3
|
assertMonotonicTransition
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P5WEZXJ2.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-6FEHRZO7.js";
|
|
7
|
+
import "./chunk-DZQYQN2X.js";
|
|
8
8
|
import "./chunk-COYKJRMM.js";
|
|
9
9
|
export {
|
|
10
10
|
PostgresTempoSessionStore,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
2
|
-
import { a0 as JobReceipt, a5 as Message, a1 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-
|
|
3
|
-
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-
|
|
1
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-D2K4MKNO.js';
|
|
2
|
+
import { a0 as JobReceipt, a5 as Message, a1 as MessageType, K as KVStore, L as Logger, v as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-BOWAn_BH.js';
|
|
3
|
+
import { c as StreamableJobStore, R as ReceiptIssuingStore, J as JobRecord, d as RequestIdClaim, e as RequestIdClaimResult, f as JobRetentionCursor, O as OutgoingMessage, A as AppendOutgoingOptions, P as PaymentCreditDelta, V as VerifyAndCreditResult, g as JobCounters } from '../job-store-DCvJQUX0.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'mppx';
|
|
6
6
|
import '@x402/core/server';
|
package/dist/testing/index.js
CHANGED
|
@@ -4,20 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MemoryJobStore,
|
|
6
6
|
createInstrumentedFetch
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-I6PHA54S.js";
|
|
8
8
|
import {
|
|
9
9
|
JobCancelledError
|
|
10
10
|
} from "../chunk-AFV77S4C.js";
|
|
11
11
|
import {
|
|
12
12
|
createNoopLogger
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-IFWUWHTW.js";
|
|
14
|
+
import "../chunk-BL6LRWXD.js";
|
|
15
|
+
import "../chunk-FUJ36YDV.js";
|
|
16
|
+
import "../chunk-66HGCPBU.js";
|
|
15
17
|
import "../chunk-BQJIFRAZ.js";
|
|
16
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-XXLUIXPO.js";
|
|
17
19
|
import {
|
|
18
20
|
validateCurrency
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-5CQKSLAU.js";
|
|
22
|
+
import "../chunk-DZQYQN2X.js";
|
|
21
23
|
|
|
22
24
|
// src/sdk/testing/test-context.ts
|
|
23
25
|
function createTestContext(opts) {
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
generateX402PrivateKey,
|
|
4
4
|
getX402Balance,
|
|
5
5
|
resolveX402Asset
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WMGXJQI3.js";
|
|
7
7
|
import {
|
|
8
8
|
verifyX402Payment
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-YPSJU3OH.js";
|
|
10
|
+
import "./chunk-ATXDKX6F.js";
|
|
11
11
|
import {
|
|
12
12
|
X402_DEFAULT_FACILITATOR,
|
|
13
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
usdcContractByCaip2,
|
|
28
28
|
x402NetworkToCaip2
|
|
29
29
|
} from "./chunk-62FI3NJF.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-FUJ36YDV.js";
|
|
31
|
+
import "./chunk-66HGCPBU.js";
|
|
31
32
|
import {
|
|
32
33
|
X402_NETWORKS,
|
|
33
34
|
assertSupportedX402Network,
|
|
@@ -36,7 +37,7 @@ import {
|
|
|
36
37
|
x402NetworkListForCopy,
|
|
37
38
|
x402SupportedNetworksHint
|
|
38
39
|
} from "./chunk-BPYMEMQX.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-DZQYQN2X.js";
|
|
40
41
|
export {
|
|
41
42
|
X402_DEFAULT_FACILITATOR,
|
|
42
43
|
X402_DEFAULT_NETWORK,
|
package/package.json
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "SDK for building
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "SDK for building Digital Vending Machines: pay-per-use HTTPS services AI agents can find, pay, and call with no account or API key",
|
|
5
|
+
"author": "DVM Technologies Ltd",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"dvm",
|
|
8
|
+
"digital-vending-machine",
|
|
9
|
+
"ai-agents",
|
|
10
|
+
"agent-payments",
|
|
11
|
+
"pay-per-use",
|
|
12
|
+
"x402",
|
|
13
|
+
"cashu",
|
|
14
|
+
"lightning",
|
|
15
|
+
"mpp",
|
|
16
|
+
"hono"
|
|
17
|
+
],
|
|
5
18
|
"license": "Apache-2.0",
|
|
6
19
|
"repository": {
|
|
7
20
|
"type": "git",
|
|
@@ -44,6 +57,7 @@
|
|
|
44
57
|
},
|
|
45
58
|
"scripts": {
|
|
46
59
|
"build": "NODE_OPTIONS=--max-old-space-size=6144 tsup --config tsup.config.ts && node scripts/write-internal-entry.mjs && node scripts/prune-sdk-dist.mjs",
|
|
60
|
+
"check:readme-quickstart": "node scripts/check-readme-quickstart.mjs",
|
|
47
61
|
"check:api": "node scripts/check-api-surface.mjs && node scripts/generate-api-reference.mjs --check",
|
|
48
62
|
"check:consumer": "node scripts/consumer-smoke.mjs",
|
|
49
63
|
"install-published-release": "node scripts/install-published-release.mjs",
|
|
@@ -57,7 +71,8 @@
|
|
|
57
71
|
"docs:api": "node scripts/generate-api-reference.mjs --write",
|
|
58
72
|
"release:tag": "node scripts/release-tag.mjs",
|
|
59
73
|
"test": "vitest run --config vitest.config.ts",
|
|
60
|
-
"test:examples": "node --test examples/quickstart/handler.test.
|
|
74
|
+
"test:examples": "node --test examples/quickstart/handler.test.ts examples/authenticated-route/handler.test.ts examples/payments-and-lifecycle/handler.test.ts",
|
|
75
|
+
"test:server": "vitest run --config vitest.server.config.ts",
|
|
61
76
|
"test:db": "vitest run --config vitest.db.config.ts",
|
|
62
77
|
"typecheck": "tsc --noEmit",
|
|
63
78
|
"typecheck:scripts": "tsc --noEmit --project tsconfig.scripts.json",
|