@dvmkit/sdk 0.6.0-rc.1 → 0.7.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -2
- package/dist/{chunk-PLG4XER6.js → chunk-2NUFE2PG.js} +47 -5
- package/dist/{chunk-7ZUKL4IV.js → chunk-3E4C6W7W.js} +16 -5
- package/dist/{chunk-HHBDBMEO.js → chunk-53SNRGQQ.js} +375 -158
- package/dist/{chunk-IWQHUSMO.js → chunk-62FI3NJF.js} +78 -2
- package/dist/chunk-6HJEVCVI.js +17 -0
- package/dist/chunk-A262WVYX.js +6 -0
- package/dist/{chunk-RLTSCKRI.js → chunk-BPYMEMQX.js} +50 -3
- package/dist/{chunk-IV6Q7NRW.js → chunk-C5RIQWG4.js} +1 -1
- package/dist/{chunk-GAOAYHZA.js → chunk-FBQVOOYF.js} +37 -6
- package/dist/{chunk-Z4ZT5LNT.js → chunk-GEI4MAXE.js} +3 -3
- package/dist/{chunk-FYRR2UEZ.js → chunk-GLIAR7RN.js} +1 -1
- package/dist/{chunk-X7EZ5CLI.js → chunk-HCATFJDD.js} +3 -3
- package/dist/{chunk-BYCEKO65.js → chunk-HPCXF3DV.js} +220 -32
- package/dist/{chunk-JH3SX3LY.js → chunk-IRXIH775.js} +6 -6
- package/dist/{chunk-QR2EF2NI.js → chunk-KCQDXIJU.js} +1 -42
- package/dist/chunk-MDW7ZR7V.js +47 -0
- package/dist/{chunk-KA6VN5FK.js → chunk-MQYM4T66.js} +3 -3
- package/dist/{chunk-P6QON7ER.js → chunk-NV7Z7377.js} +1 -1
- package/dist/{chunk-OQA7IHI4.js → chunk-OBBVDKLE.js} +484 -234
- package/dist/{chunk-EQLA4FFY.js → chunk-OHUXCAOM.js} +17 -6
- package/dist/{chunk-FI4CST2D.js → chunk-PZ5IAWFD.js} +5 -7
- package/dist/{chunk-IXR5RFK7.js → chunk-R3TQSXWT.js} +191 -5
- package/dist/{chunk-VHNPVGSA.js → chunk-T5DIXOLR.js} +3 -3
- package/dist/{chunk-RCM3P2HE.js → chunk-UKD3R2KU.js} +55 -4
- package/dist/chunk-WMGXJQI3.js +120 -0
- package/dist/{chunk-N5RZ5HVB.js → chunk-X6S2CHFM.js} +2 -2
- package/dist/{chunk-ETXDTUJO.js → chunk-ZCNPIILZ.js} +112 -1
- package/dist/{content-retention-BTGSQRfP.d.ts → content-retention-D2K4MKNO.d.ts} +1 -1
- package/dist/{credit-ledger-MI2H7NEC.js → credit-ledger-MFIIOSZH.js} +4 -5
- package/dist/{credit-menu-BAsrRu3z.d.ts → credit-menu-D2t1-Tf6.d.ts} +13 -6
- package/dist/{fx-BgDmyTdd.d.ts → fx-Ql4nvdbh.d.ts} +10 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +248 -16
- package/dist/internal/caller.d.ts +4586 -7318
- package/dist/internal/caller.js +4431 -8127
- package/dist/internal/index.js +1 -1
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +30 -33
- package/dist/{job-store-BVeF5_Jq.d.ts → job-store-DCvJQUX0.d.ts} +1 -1
- package/dist/{lightning-backend-40fIzz1W.d.ts → lightning-backend-CY5ML3km.d.ts} +4 -2
- package/dist/memory-credit-ledger-44NE4PZC.js +11 -0
- package/dist/{mpp-setup-RF5FXGGV.js → mpp-setup-HRWUBULX.js} +4 -2
- package/dist/{payout-reporter-3Y2U55ZX.js → payout-reporter-7P66T77I.js} +6 -4
- package/dist/{postgres-consumed-credential-store-BUVCAPLS.js → postgres-consumed-credential-store-IDGPFKIL.js} +3 -3
- package/dist/{postgres-job-store-VHLQBJZC.js → postgres-job-store-UKNJ2F6Z.js} +2 -2
- package/dist/{postgres-replay-store-ARZSQ45X.js → postgres-replay-store-PMA4ADXN.js} +2 -2
- package/dist/{pricing-XT2IAPNE.js → pricing-52XJHJ6K.js} +12 -12
- package/dist/{revenue-reporter-MAERPYGK.js → revenue-reporter-HV7RMS54.js} +2 -2
- package/dist/server/index.d.ts +12 -11
- package/dist/server/index.js +49 -53
- package/dist/{step-cache-CPdH1hei.d.ts → step-cache-BOWAn_BH.d.ts} +84 -7
- package/dist/{tempo-charge-store-Q3D7KYMH.js → tempo-charge-store-P2Z4RMU7.js} +2 -2
- package/dist/{tempo-session-store-ZRNCOX7P.js → tempo-session-store-VSP7KLBS.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +7 -6
- package/dist/{usd-AWlrwlM5.d.ts → usd-MAtMp3DB.d.ts} +1 -1
- package/dist/{x402-R6HPBY5D.js → x402-3IQ3HXSG.js} +9 -29
- package/package.json +3 -2
- package/dist/chunk-AT6V3SY7.js +0 -102
- package/dist/chunk-B2IROPQF.js +0 -1844
- package/dist/chunk-CZULM42S.js +0 -143
- package/dist/chunk-GFY5FRX3.js +0 -218
- package/dist/chunk-HCLVYZUZ.js +0 -244
- package/dist/chunk-LE74UEV7.js +0 -1071
- package/dist/chunk-LIRAHP7B.js +0 -53
- package/dist/chunk-MZRJR2CW.js +0 -776
- package/dist/chunk-OFVV37XC.js +0 -57
- package/dist/chunk-PAIM66YA.js +0 -347
- package/dist/chunk-UOCZXO2Z.js +0 -1663
- package/dist/memory-credit-ledger-W2BAUYJP.js +0 -12
- package/dist/tempo-lifecycle-ZBBLFBMH.js +0 -15
- package/dist/tempo-wallet-B5XXV3YH.js +0 -40
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-T5DIXOLR.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-PZ5IAWFD.js";
|
|
22
22
|
import {
|
|
23
23
|
MemoryKVStore
|
|
24
24
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
initLockPubkeyTable,
|
|
64
64
|
initWalletAccumulatorTable,
|
|
65
65
|
installAdminContentRoutes,
|
|
66
|
+
isTestMintUrl,
|
|
66
67
|
parseClientCapabilities,
|
|
67
68
|
parseClientCompatibility,
|
|
68
69
|
parseDvmClient,
|
|
@@ -79,29 +80,32 @@ import {
|
|
|
79
80
|
stripProtocolEnvelope,
|
|
80
81
|
toCreditView,
|
|
81
82
|
unknownRouteNotFound
|
|
82
|
-
} from "../chunk-
|
|
83
|
+
} from "../chunk-53SNRGQQ.js";
|
|
83
84
|
import {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
TEMPO_MODERATO_CHAIN_ID,
|
|
86
|
+
TEMPO_MODERATO_RPC,
|
|
87
|
+
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
88
|
+
TempoSettlementReadiness,
|
|
89
|
+
resolveTempoNetwork
|
|
90
|
+
} from "../chunk-R3TQSXWT.js";
|
|
91
|
+
import "../chunk-FBQVOOYF.js";
|
|
92
|
+
import "../chunk-2NUFE2PG.js";
|
|
89
93
|
import {
|
|
90
94
|
MemoryCreditLedger
|
|
91
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-GLIAR7RN.js";
|
|
92
96
|
import {
|
|
93
97
|
PostgresJobStore
|
|
94
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-OHUXCAOM.js";
|
|
95
99
|
import "../chunk-YG7G4DPZ.js";
|
|
96
100
|
import {
|
|
97
101
|
SignedRequestError,
|
|
98
102
|
createDefaultReplayStore,
|
|
99
103
|
createSignedRequestVerifier,
|
|
100
104
|
signedRequestInput
|
|
101
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-X6S2CHFM.js";
|
|
102
106
|
import {
|
|
103
107
|
isStreamableJobStore
|
|
104
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-C5RIQWG4.js";
|
|
105
109
|
import {
|
|
106
110
|
ContentHoldError,
|
|
107
111
|
baselineContentExpiry,
|
|
@@ -109,35 +113,30 @@ import {
|
|
|
109
113
|
isContentHoldStore
|
|
110
114
|
} from "../chunk-AFV77S4C.js";
|
|
111
115
|
import {
|
|
116
|
+
IMPLICIT_CREDIT_TTL_MS,
|
|
112
117
|
generateEphemeralReceiptKey,
|
|
113
|
-
isTestMintUrl,
|
|
114
118
|
receiptPubkeyFromSecret
|
|
115
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-OBBVDKLE.js";
|
|
116
120
|
import {
|
|
117
121
|
X402_DEFAULT_FACILITATOR,
|
|
118
122
|
X402_DEFAULT_NETWORK,
|
|
123
|
+
resolveRpcOverride,
|
|
119
124
|
x402NetworkToCaip2
|
|
120
|
-
} from "../chunk-
|
|
121
|
-
import {
|
|
122
|
-
IMPLICIT_CREDIT_TTL_MS
|
|
123
|
-
} from "../chunk-PAIM66YA.js";
|
|
124
|
-
import {
|
|
125
|
-
resolveRpcOverride
|
|
126
|
-
} from "../chunk-CZULM42S.js";
|
|
125
|
+
} from "../chunk-62FI3NJF.js";
|
|
127
126
|
import {
|
|
128
127
|
SIGNED_REQUEST_AUTH_ID,
|
|
129
128
|
SIGNED_REQUEST_STATEMENT_VERSION,
|
|
130
129
|
signedRequestStatementHeader
|
|
131
|
-
} from "../chunk-
|
|
132
|
-
import "../chunk-
|
|
130
|
+
} from "../chunk-UKD3R2KU.js";
|
|
131
|
+
import "../chunk-MDW7ZR7V.js";
|
|
133
132
|
import {
|
|
134
133
|
initLoggers
|
|
135
|
-
} from "../chunk-
|
|
136
|
-
import "../chunk-66HGCPBU.js";
|
|
134
|
+
} from "../chunk-KCQDXIJU.js";
|
|
137
135
|
import "../chunk-FUJ36YDV.js";
|
|
136
|
+
import "../chunk-66HGCPBU.js";
|
|
138
137
|
import "../chunk-BQJIFRAZ.js";
|
|
139
|
-
import "../chunk-
|
|
140
|
-
import "../chunk-
|
|
138
|
+
import "../chunk-6HJEVCVI.js";
|
|
139
|
+
import "../chunk-HPCXF3DV.js";
|
|
141
140
|
import {
|
|
142
141
|
CreditLedger,
|
|
143
142
|
CreditLedgerError,
|
|
@@ -145,28 +144,25 @@ import {
|
|
|
145
144
|
PostgresX402ChannelStorage,
|
|
146
145
|
X402RelaySubmissionLockError,
|
|
147
146
|
allocateDrawValue
|
|
148
|
-
} from "../chunk-
|
|
149
|
-
import {
|
|
150
|
-
SDK_INIT_ADVISORY_LOCK,
|
|
151
|
-
withSdkInitLock
|
|
152
|
-
} from "../chunk-COYKJRMM.js";
|
|
147
|
+
} from "../chunk-IRXIH775.js";
|
|
153
148
|
import {
|
|
154
149
|
applyRetryToPool
|
|
155
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-NV7Z7377.js";
|
|
156
151
|
import {
|
|
157
152
|
assertSupportedX402Network
|
|
158
|
-
} from "../chunk-
|
|
159
|
-
import "../chunk-LIRAHP7B.js";
|
|
160
|
-
import {
|
|
161
|
-
TEMPO_MODERATO_CHAIN_ID,
|
|
162
|
-
TEMPO_MODERATO_RPC,
|
|
163
|
-
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
164
|
-
TempoSettlementReadiness,
|
|
165
|
-
resolveTempoNetwork
|
|
166
|
-
} from "../chunk-IXR5RFK7.js";
|
|
153
|
+
} from "../chunk-BPYMEMQX.js";
|
|
167
154
|
import {
|
|
168
155
|
diagnosticConsole
|
|
169
|
-
} from "../chunk-
|
|
156
|
+
} from "../chunk-ZCNPIILZ.js";
|
|
157
|
+
import {
|
|
158
|
+
MemoryProcessedPaymentStore,
|
|
159
|
+
PostgresProcessedPaymentStore,
|
|
160
|
+
ProcessedPaymentReplayError
|
|
161
|
+
} from "../chunk-XRLKGCAW.js";
|
|
162
|
+
import {
|
|
163
|
+
SDK_INIT_ADVISORY_LOCK,
|
|
164
|
+
withSdkInitLock
|
|
165
|
+
} from "../chunk-COYKJRMM.js";
|
|
170
166
|
|
|
171
167
|
// src/sdk/server/cashu-env.ts
|
|
172
168
|
async function resolveCashuOptsFromEnv(env, pool, cashuModeHint) {
|
|
@@ -1153,7 +1149,7 @@ function createDVMHost(opts = {}) {
|
|
|
1153
1149
|
});
|
|
1154
1150
|
applyRetryToPool(pool, "dvm-host");
|
|
1155
1151
|
pgPool = pool;
|
|
1156
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1152
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-UKNJ2F6Z.js");
|
|
1157
1153
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1158
1154
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1159
1155
|
jobStore = pgJobStore;
|
|
@@ -1246,11 +1242,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1246
1242
|
let tempoChargeBackend = "user-supplied";
|
|
1247
1243
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1248
1244
|
if (!mpp && mppTempoRecipient) {
|
|
1249
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1245
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-HRWUBULX.js");
|
|
1250
1246
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1251
1247
|
let tempoCharge;
|
|
1252
1248
|
if (pgPool) {
|
|
1253
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1249
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-P2Z4RMU7.js");
|
|
1254
1250
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1255
1251
|
tempoChargeStore = chargeStore;
|
|
1256
1252
|
pendingInits.push(chargeStore.init());
|
|
@@ -1270,7 +1266,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1270
1266
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1271
1267
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1272
1268
|
] = await Promise.all([
|
|
1273
|
-
import("../tempo-session-store-
|
|
1269
|
+
import("../tempo-session-store-VSP7KLBS.js"),
|
|
1274
1270
|
import("viem/accounts"),
|
|
1275
1271
|
import("viem"),
|
|
1276
1272
|
import("viem/chains")
|
|
@@ -1423,7 +1419,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1423
1419
|
}
|
|
1424
1420
|
}
|
|
1425
1421
|
const fxSource = envMaybe.DVMKIT_FX_SOURCE;
|
|
1426
|
-
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-
|
|
1422
|
+
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-52XJHJ6K.js");
|
|
1427
1423
|
const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
|
|
1428
1424
|
const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
|
|
1429
1425
|
if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
|
|
@@ -1433,7 +1429,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1433
1429
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1434
1430
|
let sharedPgReplayStore;
|
|
1435
1431
|
if (pgPool) {
|
|
1436
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1432
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-PMA4ADXN.js");
|
|
1437
1433
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1438
1434
|
pendingInits.push(store2.init());
|
|
1439
1435
|
sharedPgReplayStore = store2;
|
|
@@ -1461,13 +1457,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1461
1457
|
}
|
|
1462
1458
|
let sharedPgConsumedStore;
|
|
1463
1459
|
if (pgPool) {
|
|
1464
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1460
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-IDGPFKIL.js");
|
|
1465
1461
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1466
1462
|
pendingInits.push(consumedStore.init());
|
|
1467
1463
|
sharedPgConsumedStore = consumedStore;
|
|
1468
1464
|
}
|
|
1469
1465
|
if (pgPool) {
|
|
1470
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1466
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-MFIIOSZH.js");
|
|
1471
1467
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1472
1468
|
pendingInits.push(pgLedger.init());
|
|
1473
1469
|
creditLedger = pgLedger;
|
|
@@ -1476,7 +1472,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1476
1472
|
pendingInits.push(pgProcessed.init());
|
|
1477
1473
|
processedPayments = pgProcessed;
|
|
1478
1474
|
} else {
|
|
1479
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1475
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-44NE4PZC.js");
|
|
1480
1476
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1481
1477
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1482
1478
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -1977,7 +1973,7 @@ function logBootSummary(s) {
|
|
|
1977
1973
|
diagnosticConsole.log(` Database: ${s.databaseConnected ? "connected" : "(not configured)"}`);
|
|
1978
1974
|
diagnosticConsole.log(` Mints: ${s.mints && s.mints.length > 0 ? s.mints.join(", ") : "(none)"}`);
|
|
1979
1975
|
diagnosticConsole.log(` Cashu mode: ${s.cashuOpts.cashuMode ?? "(disabled)"}`);
|
|
1980
|
-
diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm}` : "(unconfigured)"}`);
|
|
1976
|
+
diagnosticConsole.log(` Tempo: ${s.mpp ? `realm=${s.mpp.realm ?? "(unset)"}` : "(unconfigured)"}`);
|
|
1981
1977
|
if (s.mpp) {
|
|
1982
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";
|
|
1983
1979
|
diagnosticConsole.log(` Tempo secret: ${rotState}`);
|
|
@@ -81,7 +81,11 @@ type X402SettlementReconciliationReason = "settlement_not_on_chain" | "chain_unr
|
|
|
81
81
|
interface X402BatchSettlementConfig {
|
|
82
82
|
/** Receiver-authorizer signer used when the facilitator advertises none. */
|
|
83
83
|
receiverAuthorizerSigner?: AuthorizerSigner;
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Immutable payer withdrawal grace in integer seconds; defaults to 86400 (24 hours).
|
|
86
|
+
* Base Sepolia (`eip155:84532`) permits an explicit value >=900 (15 minutes).
|
|
87
|
+
* All other networks retain the 86400 minimum, including in dev/test mode.
|
|
88
|
+
*/
|
|
85
89
|
withdrawDelay?: number;
|
|
86
90
|
/** Freshness window for local voucher verification. */
|
|
87
91
|
onchainStateTtlMs?: number;
|
|
@@ -1224,6 +1228,12 @@ declare class HostedSettlementReportObligations {
|
|
|
1224
1228
|
}): Promise<HostedEffectReservation | null>;
|
|
1225
1229
|
reserveTempo(channelId: string, operation: "settle" | "close", drainId?: string): Promise<HostedEffectReservation>;
|
|
1226
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>;
|
|
1227
1237
|
submittedIds(rail: Rail, operation: Operation, txHash: string, batchId?: string): Promise<string[]>;
|
|
1228
1238
|
refundClaimDelta(txHash: string, channelId: string): Promise<bigint>;
|
|
1229
1239
|
assertReservedTempoClose(id: string, channelId: string): Promise<void>;
|
|
@@ -1779,6 +1789,8 @@ interface X402WedgedRefund {
|
|
|
1779
1789
|
createdAt: number;
|
|
1780
1790
|
native?: number;
|
|
1781
1791
|
}
|
|
1792
|
+
/** Rail-native value the channel's credit has earned; `undefined` when no credit is bound. */
|
|
1793
|
+
type X402EarnedNative = (channelId: string) => Promise<number | undefined>;
|
|
1782
1794
|
interface X402PayoutContext {
|
|
1783
1795
|
/** `${network}|${payTo}|${token}` — the scope the settle-pending marker is keyed on. */
|
|
1784
1796
|
scope: string;
|
|
@@ -1787,6 +1799,12 @@ interface X402PayoutContext {
|
|
|
1787
1799
|
storage: {
|
|
1788
1800
|
list(): Promise<X402TrackedChannel[]>;
|
|
1789
1801
|
};
|
|
1802
|
+
/**
|
|
1803
|
+
* The claim ceiling's earned figure for a channel. Pending counts only what a
|
|
1804
|
+
* claim could present, so a channel's unspent deposit is never reported as
|
|
1805
|
+
* the builder's.
|
|
1806
|
+
*/
|
|
1807
|
+
earnedNative: X402EarnedNative;
|
|
1790
1808
|
/** The scheduler's settle cadence — what a wedge's `nextRetry` is derived from. */
|
|
1791
1809
|
settleIntervalMs: number;
|
|
1792
1810
|
listWedgedRefunds?: () => Promise<X402WedgedRefund[]>;
|
|
@@ -1961,7 +1979,8 @@ declare class PayoutReporter implements PayoutTransport {
|
|
|
1961
1979
|
snapshotCashu(): Promise<void>;
|
|
1962
1980
|
/**
|
|
1963
1981
|
* x402: the open batch (claimed, not yet transferred) plus every channel's
|
|
1964
|
-
*
|
|
1982
|
+
* earned value not yet claimed — a channel whose earned figure cannot be
|
|
1983
|
+
* read contributes nothing; wedged when the settle keeps failing, and the
|
|
1965
1984
|
* refund settlements stuck between chain and ledger beside it.
|
|
1966
1985
|
*/
|
|
1967
1986
|
snapshotX402(): Promise<void>;
|
|
@@ -2163,6 +2182,13 @@ interface CreditDepositPayload {
|
|
|
2163
2182
|
fundedAt: number;
|
|
2164
2183
|
/** Current credit expiry after this funding committed (epoch ms). */
|
|
2165
2184
|
expiryMs: number;
|
|
2185
|
+
/**
|
|
2186
|
+
* The stablecoin instrument behind the funded credit, read from the
|
|
2187
|
+
* credit's stored binding rather than inferred from `fundingId`'s shape.
|
|
2188
|
+
* Present on every x402 and Tempo deposit; absent on Cashu and Lightning,
|
|
2189
|
+
* which have only one instrument each.
|
|
2190
|
+
*/
|
|
2191
|
+
instrument?: "x402_exact" | "x402_channel" | "tempo_charge" | "tempo_session";
|
|
2166
2192
|
/**
|
|
2167
2193
|
* Tempo session funding only: the TIP-1034 channel this deposit
|
|
2168
2194
|
* arrived on, registered so the platform's close observer can route a
|
|
@@ -4499,7 +4525,8 @@ interface MppOpts {
|
|
|
4499
4525
|
* of ours can reach the un-dual-keyed door — see `createDualKeyMppxFromOpts`.
|
|
4500
4526
|
*/
|
|
4501
4527
|
interface MppxServer {
|
|
4502
|
-
realm
|
|
4528
|
+
/** Undefined when neither `Mppx.create` nor mppx's environment lookup names a realm. */
|
|
4529
|
+
realm?: string;
|
|
4503
4530
|
methods: readonly Method.AnyServer[];
|
|
4504
4531
|
/** Public, non-secret Tempo bindings resolved from the exact live method configuration. */
|
|
4505
4532
|
tempoConfiguration?: {
|
|
@@ -4511,9 +4538,9 @@ interface MppxServer {
|
|
|
4511
4538
|
};
|
|
4512
4539
|
challenge: any;
|
|
4513
4540
|
/**
|
|
4514
|
-
* Re-validate and broadcast a credential, returning a receipt.
|
|
4515
|
-
*
|
|
4516
|
-
*
|
|
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.
|
|
4517
4544
|
*/
|
|
4518
4545
|
broadcastCredential(credential: Credential.Credential | string, options?: any): Promise<Receipt.Receipt>;
|
|
4519
4546
|
/** Non-mutating mppx HMAC, route, expiry and method preflight. */
|
|
@@ -4585,6 +4612,21 @@ interface MppxServer {
|
|
|
4585
4612
|
getTempoSessionCloseIntent?: (channelId: string) => Promise<TempoSessionCloseRecord | null>;
|
|
4586
4613
|
/** Read terminally consumed value for an exact cooperative-close challenge. */
|
|
4587
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>;
|
|
4588
4630
|
/**
|
|
4589
4631
|
* Read the immutable chain binding of a stored channel, or `null`
|
|
4590
4632
|
* when this DVM holds no such channel. What a close event must match before
|
|
@@ -4717,6 +4759,12 @@ interface TempoSessionChainOps {
|
|
|
4717
4759
|
onSessionSettlement?: NonNullable<MppOpts["tempoSession"]>["onSessionSettlement"];
|
|
4718
4760
|
}): Promise<Hex>;
|
|
4719
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>;
|
|
4720
4768
|
}
|
|
4721
4769
|
declare function attachTempoSessionRuntime(mppx: MppxServer, config: MppOpts["tempoSession"], chainOpOverrides?: Partial<TempoSessionChainOps>): MppxServer;
|
|
4722
4770
|
/** Test-only seams for deterministic watcher coverage without a live Tempo RPC. */
|
|
@@ -5321,6 +5369,21 @@ interface IncomingMessage {
|
|
|
5321
5369
|
*/
|
|
5322
5370
|
type PriceValue = string;
|
|
5323
5371
|
type PaymentMethod = "cashu" | "x402" | "tempo";
|
|
5372
|
+
/**
|
|
5373
|
+
* One line of a capability's published rate card, declared on `CapabilityConfig.rates`.
|
|
5374
|
+
* Example: `{ label: "balanced", amount: "0.00015", currency: "USD", per: "character" }`.
|
|
5375
|
+
*
|
|
5376
|
+
* `amount` is decimal dollars written as a string (`/^\d+(\.\d+)?$/`, above
|
|
5377
|
+
* zero, at most 12 characters). `per` names the unit and `label` optionally
|
|
5378
|
+
* names a tier; each is 1 to 24 characters with no leading or trailing
|
|
5379
|
+
* whitespace. `/v1/info` publishes the entries exactly as written, in order.
|
|
5380
|
+
*/
|
|
5381
|
+
interface CapabilityRate {
|
|
5382
|
+
label?: string;
|
|
5383
|
+
amount: string;
|
|
5384
|
+
currency: "USD";
|
|
5385
|
+
per: string;
|
|
5386
|
+
}
|
|
5324
5387
|
/**
|
|
5325
5388
|
* Rails that may fund a prepaid **credit**.
|
|
5326
5389
|
*
|
|
@@ -5457,6 +5520,16 @@ interface CapabilityConfig<State = Record<string, unknown>, InputSchema extends
|
|
|
5457
5520
|
/** Static price — a USD literal ("$0.05"). Free capabilities omit this and `onQuote`. */
|
|
5458
5521
|
price?: PriceValue;
|
|
5459
5522
|
onQuote?: QuoteConfig;
|
|
5523
|
+
/**
|
|
5524
|
+
* Rate card published on `/v1/info` as `pricing.rates`: 1 to 5
|
|
5525
|
+
* {@link CapabilityRate} entries, exactly as declared. Allowed only on a
|
|
5526
|
+
* priced capability (`price` or `onQuote`); a free capability that declares
|
|
5527
|
+
* rates is refused when the server starts, as is any entry outside the
|
|
5528
|
+
* limits on {@link CapabilityRate} or carrying another key. For a quoted
|
|
5529
|
+
* capability the rates describe how the quote is computed; they never
|
|
5530
|
+
* change the quote itself.
|
|
5531
|
+
*/
|
|
5532
|
+
rates?: CapabilityRate[];
|
|
5460
5533
|
/** Handle a newly submitted job for this capability (required). */
|
|
5461
5534
|
onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
|
|
5462
5535
|
/** Handle a client response to a prompt within a job of this capability. */
|
|
@@ -5488,6 +5561,8 @@ interface CapabilityDescriptor<State = unknown, InputSchema extends ZodLike | un
|
|
|
5488
5561
|
/** Static price — a USD literal ("$0.05"). Undefined for dynamic-priced or free. */
|
|
5489
5562
|
readonly price?: PriceValue;
|
|
5490
5563
|
readonly onQuote?: QuoteConfig;
|
|
5564
|
+
/** Rate card published on `/v1/info`. See `CapabilityConfig.rates`. */
|
|
5565
|
+
readonly rates?: CapabilityRate[];
|
|
5491
5566
|
readonly onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
|
|
5492
5567
|
/** Handle a client response to a prompt. */
|
|
5493
5568
|
readonly onResponse?: (ctx: SDKJobContext<State, InputType<InputSchema>>, content: ResponseContent) => void | Promise<void>;
|
|
@@ -5627,6 +5702,8 @@ interface DVMConfig<State = Record<string, unknown>, InputSchema extends ZodLike
|
|
|
5627
5702
|
onMessage?(ctx: SDKJobContext<State, InputType<InputSchema>>, msg: IncomingMessage): void | Promise<void>;
|
|
5628
5703
|
/** Quote handler for dynamic pricing. Flat shape only. */
|
|
5629
5704
|
onQuote?: QuoteConfig;
|
|
5705
|
+
/** Rate card published on `/v1/info`. Flat shape only — see `CapabilityConfig.rates`. */
|
|
5706
|
+
rates?: CapabilityRate[];
|
|
5630
5707
|
/** Payment methods this DVM accepts. Default: derived from configured rails — adds "cashu" when `mints` is set, "x402" when `x402` is set, "tempo" when `tempo` is set. */
|
|
5631
5708
|
paymentMethods?: PaymentMethod[];
|
|
5632
5709
|
/** x402 stablecoin payment configuration (provider-side). */
|
|
@@ -5761,4 +5838,4 @@ declare class StepCache {
|
|
|
5761
5838
|
static deserialize(records: StepRecord[]): StepCache;
|
|
5762
5839
|
}
|
|
5763
5840
|
|
|
5764
|
-
export { type
|
|
5841
|
+
export { type FundingReceipt as $, type ApprovalContent as A, type SignedRequestDomain as B, type Currency as C, type DVMConfig as D, SignedRequestError as E, type SignedRequestFailure as F, type SignedRequestReplayStore as G, type SignedRequestSignOpts as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestStatementHeader as M, type SignedRequestVerifier as N, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type InvoiceWriteOff as b$, isDrainReceipt as b0, isFundingReceipt as b1, isPaymentRequestMessage as b2, isPromptMessage as b3, isSignedJobReceipt as b4, isTextMessage as b5, isWorkingMessage as b6, paymentRequiredV2FromV1 as b7, signDrainReceipt as b8, signFundingReceipt as b9, type X402TrackedChannel as bA, _testing as bB, createDefaultReplayStore as bC, depleteLots as bD, fifoOrder as bE, inKindDrawMsats as bF, isInKindDepletion as bG, isNonChannelBitcoinRail as bH, lotOwedSats as bI, netOwedSats as bJ, wrapMppx as bK, type CreditDrainEnqueue as bL, HostedSettlementReportObligations as bM, type DVMAuthScheme as bN, type CreditLedgerLike as bO, type X402RefundSettlementGate as bP, type CreditSnapshot as bQ, type DrawResult as bR, type X402SettlementStatus as bS, type X402UnresolvedRefund as bT, type GrownDrawResult as bU, type DrawResolution as bV, type FundingRecord as bW, type CreditInvoiceRecord as bX, type InvoiceSettlement as bY, type BlockedInvoiceCursor as bZ, type InvoiceReconciliation as b_, signReceipt as ba, usdcContractByCaip2 as bb, usdcContractFor as bc, usdcDomainNameFor as bd, usdcDomainVersionFor as be, verifyDrainReceipt as bf, verifyFundingReceipt as bg, verifyReceipt as bh, x402NetworkToCaip2 as bi, type X402ExactVersionSupport as bj, type X402Receipt as bk, type TransactionalPayoutHook as bl, type CashuMeltCompleted as bm, type CreditDepositPayload as bn, type CreditDrainPayload as bo, type FundingLot as bp, type LotDebit as bq, type LotDepletion as br, type MppxServer as bs, NON_CHANNEL_BITCOIN_RAILS as bt, type NonChannelBitcoinRail as bu, PayoutReporter as bv, PostgresTempoSessionStore as bw, RevenueReporter as bx, SIGNED_ENVELOPE_FIELDS as by, SIGNED_ENVELOPE_TYPES as bz, type CancelContent as c, type X402FacilitatorAuth as c$, type DrawRecord as c0, type StalePendingDrawCursor as c1, type TempoCreditLossEvidence as c2, type CreditLedgerQuerier as c3, type TempoCreditLoss as c4, type X402CreditLossEvidence as c5, type X402CreditLoss as c6, type DrainMethod as c7, type DrainRequestResult as c8, type BitcoinDepositLiability as c9, type JobCostReportPayload as cA, type JobTerminalReportPayload as cB, PostgresX402ChannelStorage as cC, type ReplayStoreBackend as cD, type RevenueSkippedNoRailPayload as cE, type RevenueSkippedNoRailReason as cF, type Secp256k1AuthOpts as cG, type X402ChannelStorageOpts as cH, type X402RelayLockHolder as cI, type X402RelaySubmissionLock as cJ, X402RelaySubmissionLockError as cK, allocateDrawValue as cL, clientCompatibilityAttributes as cM, clientCompatibilityMiddleware as cN, clientUpgradeRequired as cO, parseClientCapabilities as cP, parseClientCompatibility as cQ, parseDvmClient as cR, parseProtocolVersion as cS, requireClientCompatibility as cT, secp256k1Auth as cU, signedRequestInput as cV, type HostedIntent as cW, type X402SettlementIntent as cX, type HostedFundingReservation as cY, type X402SettlementCursor as cZ, type X402SettlementWriteOff as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainReleaseResult as cd, type DrainFulfilment as ce, type DrainTransitionResult as cf, HostingCleanupFence as cg, CLIENT_COMPATIBILITY_HEADERS as ch, type ClientCompatibility as ci, type ClientCompatibilityEnv as cj, type ClientCompatibilityGate as ck, type ClientCompatibilityRequirement as cl, type ClientSemVer as cm, type CreditFundingBasis as cn, type CreditInvoiceStatus as co, CreditLedger as cp, CreditLedgerError as cq, type CreditLedgerErrorCode as cr, type CreditLedgerErrorDetails as cs, type CreditLedgerPool as ct, type CreditStatus as cu, DRAIN_DELIVERY_RESERVE_SATS as cv, DVM_PROTOCOL_VERSION as cw, type DrainConflictReason as cx, type DrawRailValue as cy, type DrawStatus as cz, type CanonicalEnvelope as d, type X402BatchSettlementConfig as d0, type X402PayoutObserver as d1, type CreditDepositEnqueue as d2, type X402SettlementReconciliationReason as d3, type CreditDrawReleaseEnqueue as d4, type CapabilityRate as e, type CreateSignedRequestVerifierOpts as f, type CreditConfig as g, type CreditView as h, DEFAULT_CREDIT_MAX as i, DEFAULT_CREDIT_MIN as j, DEFAULT_CREDIT_TTL_SECONDS as k, DEFAULT_JOB_RETENTION_DAYS as l, type DVMRouteContext as m, type InputType as n, InvalidCurrencyError as o, type PaymentMethod as p, type PriceValue as q, type ProgressContent as r, type PromptOpts as s, type QuoteContext as t, type QuoteResult as u, type ResponseContent as v, type SDKPaymentRequestOpts as w, SIGNED_REQUEST_AUTH_ID as x, SIGNED_REQUEST_STATEMENT_VERSION as y, type SignedRequestAudience as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoChargeStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MQYM4T66.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
|
+
import "./chunk-ZCNPIILZ.js";
|
|
5
6
|
import "./chunk-COYKJRMM.js";
|
|
6
|
-
import "./chunk-ETXDTUJO.js";
|
|
7
7
|
export {
|
|
8
8
|
PostgresTempoChargeStore
|
|
9
9
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore,
|
|
3
3
|
assertMonotonicTransition
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HCATFJDD.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
|
+
import "./chunk-NV7Z7377.js";
|
|
7
|
+
import "./chunk-ZCNPIILZ.js";
|
|
6
8
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-P6QON7ER.js";
|
|
8
|
-
import "./chunk-ETXDTUJO.js";
|
|
9
9
|
export {
|
|
10
10
|
PostgresTempoSessionStore,
|
|
11
11
|
assertMonotonicTransition
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
2
|
-
import {
|
|
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,21 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MemoryJobStore,
|
|
6
6
|
createInstrumentedFetch
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-C5RIQWG4.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-MDW7ZR7V.js";
|
|
14
|
+
import "../chunk-KCQDXIJU.js";
|
|
15
15
|
import "../chunk-FUJ36YDV.js";
|
|
16
|
+
import "../chunk-66HGCPBU.js";
|
|
16
17
|
import "../chunk-BQJIFRAZ.js";
|
|
18
|
+
import "../chunk-6HJEVCVI.js";
|
|
17
19
|
import {
|
|
18
20
|
validateCurrency
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-ETXDTUJO.js";
|
|
21
|
+
} from "../chunk-HPCXF3DV.js";
|
|
22
|
+
import "../chunk-ZCNPIILZ.js";
|
|
22
23
|
|
|
23
24
|
// src/sdk/testing/test-context.ts
|
|
24
25
|
function createTestContext(opts) {
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
connectedX402Payer,
|
|
3
2
|
ensureAddress,
|
|
4
3
|
generateX402PrivateKey,
|
|
5
4
|
getX402Balance,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
repinX402WalletNetwork,
|
|
9
|
-
resolveX402Asset,
|
|
10
|
-
saveX402Wallet,
|
|
11
|
-
tryX402Payment,
|
|
12
|
-
x402WrongAssetHint
|
|
13
|
-
} from "./chunk-LE74UEV7.js";
|
|
14
|
-
import "./chunk-B2IROPQF.js";
|
|
15
|
-
import "./chunk-MZRJR2CW.js";
|
|
5
|
+
resolveX402Asset
|
|
6
|
+
} from "./chunk-WMGXJQI3.js";
|
|
16
7
|
import {
|
|
17
8
|
verifyX402Payment
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-3E4C6W7W.js";
|
|
10
|
+
import "./chunk-2NUFE2PG.js";
|
|
20
11
|
import {
|
|
21
12
|
X402_DEFAULT_FACILITATOR,
|
|
22
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -35,13 +26,9 @@ import {
|
|
|
35
26
|
paymentRequiredV2FromV1,
|
|
36
27
|
usdcContractByCaip2,
|
|
37
28
|
x402NetworkToCaip2
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-PAIM66YA.js";
|
|
40
|
-
import "./chunk-CZULM42S.js";
|
|
41
|
-
import "./chunk-OFVV37XC.js";
|
|
42
|
-
import "./chunk-66HGCPBU.js";
|
|
29
|
+
} from "./chunk-62FI3NJF.js";
|
|
43
30
|
import "./chunk-FUJ36YDV.js";
|
|
44
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-66HGCPBU.js";
|
|
45
32
|
import {
|
|
46
33
|
X402_NETWORKS,
|
|
47
34
|
assertSupportedX402Network,
|
|
@@ -49,8 +36,8 @@ import {
|
|
|
49
36
|
x402NetworkLabel,
|
|
50
37
|
x402NetworkListForCopy,
|
|
51
38
|
x402SupportedNetworksHint
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
39
|
+
} from "./chunk-BPYMEMQX.js";
|
|
40
|
+
import "./chunk-ZCNPIILZ.js";
|
|
54
41
|
export {
|
|
55
42
|
X402_DEFAULT_FACILITATOR,
|
|
56
43
|
X402_DEFAULT_NETWORK,
|
|
@@ -62,7 +49,6 @@ export {
|
|
|
62
49
|
buildPaymentRequirements,
|
|
63
50
|
caip2ToX402Network,
|
|
64
51
|
chainIdFromCaip2,
|
|
65
|
-
connectedX402Payer,
|
|
66
52
|
decodePayment,
|
|
67
53
|
decodePaymentRequiredHeader,
|
|
68
54
|
encodePayment,
|
|
@@ -72,19 +58,13 @@ export {
|
|
|
72
58
|
exactEvmAuthorization,
|
|
73
59
|
generateX402PrivateKey,
|
|
74
60
|
getX402Balance,
|
|
75
|
-
loadX402Wallet,
|
|
76
61
|
paymentRequiredV2FromV1,
|
|
77
|
-
removeX402Wallet,
|
|
78
|
-
repinX402WalletNetwork,
|
|
79
62
|
resolveX402Asset,
|
|
80
|
-
saveX402Wallet,
|
|
81
|
-
tryX402Payment,
|
|
82
63
|
usdcContractByCaip2,
|
|
83
64
|
verifyX402Payment,
|
|
84
65
|
x402NetworkByCaip2,
|
|
85
66
|
x402NetworkLabel,
|
|
86
67
|
x402NetworkListForCopy,
|
|
87
68
|
x402NetworkToCaip2,
|
|
88
|
-
x402SupportedNetworksHint
|
|
89
|
-
x402WrongAssetHint
|
|
69
|
+
x402SupportedNetworksHint
|
|
90
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-rc.10",
|
|
4
4
|
"description": "SDK for building accountless, pay-per-use Digital Vending Machines",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"test:db": "vitest run --config vitest.db.config.ts",
|
|
62
62
|
"typecheck": "tsc --noEmit",
|
|
63
63
|
"typecheck:scripts": "tsc --noEmit --project tsconfig.scripts.json",
|
|
64
|
-
"verify": "node scripts/verify.mjs"
|
|
64
|
+
"verify": "node scripts/verify.mjs",
|
|
65
|
+
"check:ownership": "node scripts/check-caller-ownership.mjs"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@cashu/cashu-ts": "4.10.2",
|