@dvmkit/sdk 0.8.0 → 0.9.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/dist/{chunk-5K5E6ME6.js → chunk-4VV7WACY.js} +1 -1
- package/dist/{chunk-GSPV3UIM.js → chunk-73C4JN2E.js} +632 -262
- package/dist/{chunk-2I3OHMTY.js → chunk-BAQRUYRL.js} +3 -3
- package/dist/{chunk-ATXDKX6F.js → chunk-GAZBBMAA.js} +1 -1
- package/dist/{chunk-QPXI7YPH.js → chunk-GODOH2AF.js} +3 -3
- package/dist/{chunk-5CQKSLAU.js → chunk-HC4I7LAV.js} +1 -1
- package/dist/{chunk-6FEHRZO7.js → chunk-IBX2ORBV.js} +1 -1
- package/dist/{chunk-TFYY5APM.js → chunk-IYQQXEHV.js} +3 -3
- package/dist/{chunk-X3JEME6P.js → chunk-K2MSIKMM.js} +3 -3
- package/dist/{chunk-55NKZQOC.js → chunk-KGL3YMZA.js} +1 -1
- package/dist/{chunk-YPSJU3OH.js → chunk-LCCG5HQM.js} +2 -2
- package/dist/{chunk-GB5XPAA5.js → chunk-LFVIZH2G.js} +361 -44
- package/dist/{chunk-RTFBVXCN.js → chunk-LW7KZQHG.js} +4 -4
- package/dist/{chunk-DZQYQN2X.js → chunk-OIP44KBB.js} +12 -0
- package/dist/{chunk-P5WEZXJ2.js → chunk-Q3VYRU5R.js} +60 -3
- package/dist/{chunk-BL6LRWXD.js → chunk-QSZW2I5Y.js} +1 -1
- package/dist/{chunk-I6PHA54S.js → chunk-TFDR2YP2.js} +3 -3
- package/dist/{chunk-IFWUWHTW.js → chunk-TRY7BJA4.js} +1 -1
- package/dist/{chunk-PRSKC7AD.js → chunk-WB3E7KE7.js} +3 -3
- package/dist/{chunk-XXLUIXPO.js → chunk-WLPLHXNP.js} +1 -1
- package/dist/{chunk-VYP6ADCS.js → chunk-YYRY32NR.js} +24 -8
- package/dist/{chunk-EBCLWOKF.js → chunk-ZBQKXAYK.js} +17 -4
- package/dist/{content-retention-D2K4MKNO.d.ts → content-retention-CVBYehRS.d.ts} +1 -1
- package/dist/{credit-ledger-AOU6S34N.js → credit-ledger-CZQ56DYI.js} +4 -4
- package/dist/{credit-menu-C-8g2cHT.d.ts → credit-menu-QntEhZJS.d.ts} +4 -4
- package/dist/{fx-Ql4nvdbh.d.ts → fx-CMyNFenZ.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 +16 -16
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +26 -26
- package/dist/{job-store-DCvJQUX0.d.ts → job-store-qOD-FrQF.d.ts} +1 -1
- package/dist/{lightning-backend-CY5ML3km.d.ts → lightning-backend-DtdG6UT5.d.ts} +1 -1
- package/dist/{memory-credit-ledger-4HWYINKJ.js → memory-credit-ledger-EMN7G3MO.js} +5 -5
- package/dist/{mpp-setup-2BKTPEK6.js → mpp-setup-VW53KFPO.js} +5 -3
- package/dist/{payout-reporter-HQSIIBFL.js → payout-reporter-TZX2S7KG.js} +2 -2
- package/dist/{postgres-consumed-credential-store-R7DNU6CM.js → postgres-consumed-credential-store-V464OAJB.js} +3 -3
- package/dist/{postgres-job-store-6VGFL6XE.js → postgres-job-store-27VOCSPO.js} +2 -2
- package/dist/{postgres-replay-store-SY26NUCI.js → postgres-replay-store-7GJFAQXY.js} +2 -2
- package/dist/{pricing-H2RA4X2R.js → pricing-NNMBNP7N.js} +3 -3
- package/dist/{revenue-reporter-X52GPZ5U.js → revenue-reporter-4EAVPWXS.js} +2 -2
- package/dist/server/index.d.ts +14 -10
- package/dist/server/index.js +49 -45
- package/dist/{step-cache-BOWAn_BH.d.ts → step-cache-B7svmPz3.d.ts} +157 -8
- package/dist/{tempo-charge-store-NKXJ2AXE.js → tempo-charge-store-2RPOJBM2.js} +2 -2
- package/dist/{tempo-session-store-ZSDQIWSU.js → tempo-session-store-LI3Q3A3U.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +7 -7
- package/dist/{usd-MAtMp3DB.d.ts → usd-D3izFz71.d.ts} +1 -1
- package/dist/{x402-Q4S36NHQ.js → x402-SL36LSOD.js} +4 -4
- package/package.json +1 -1
|
@@ -1138,7 +1138,7 @@ declare class PostgresX402ChannelStorage implements ChannelStorage {
|
|
|
1138
1138
|
type Query = Pick<Pool | PoolClient, "query">;
|
|
1139
1139
|
type Rail = "x402" | "tempo";
|
|
1140
1140
|
type Operation = "claim" | "refund" | "settle" | "close";
|
|
1141
|
-
type State = "reserved" | "observed" | "report_queued" | "delivered" | "no_report";
|
|
1141
|
+
type State = "reserved" | "observed" | "report_queued" | "delivered" | "no_report" | "exhausted" | "unmatched";
|
|
1142
1142
|
interface ObligationRow {
|
|
1143
1143
|
id: string;
|
|
1144
1144
|
source_key: string;
|
|
@@ -1227,13 +1227,61 @@ declare class HostedSettlementReportObligations {
|
|
|
1227
1227
|
};
|
|
1228
1228
|
}): Promise<HostedEffectReservation | null>;
|
|
1229
1229
|
reserveTempo(channelId: string, operation: "settle" | "close", drainId?: string): Promise<HostedEffectReservation>;
|
|
1230
|
+
/**
|
|
1231
|
+
* Retire a close reservation that never recorded a transaction and reserve
|
|
1232
|
+
* the drain's next attempt in one transaction. At the retry cap the final
|
|
1233
|
+
* row becomes terminal `exhausted` and remains claimable by a late landing.
|
|
1234
|
+
* A close from the retired attempt that lands late is the same channel's close: `recordSubmitted` on the retired row
|
|
1235
|
+
* writes it onto the successor, and recovery attaches it there if that
|
|
1236
|
+
* attempt never got to write, so it is reported once.
|
|
1237
|
+
*
|
|
1238
|
+
* The caller has just read the channel open on chain. The age bound only
|
|
1239
|
+
* spares a reservation young enough to be inside its first receipt wait; an
|
|
1240
|
+
* attempt slowed past it by a degraded RPC can still be running.
|
|
1241
|
+
*/
|
|
1242
|
+
releaseStaleTempoClose(id: string, channelId: string, drainId: string, limits: {
|
|
1243
|
+
staleAfterMs: number;
|
|
1244
|
+
maxReleases: number;
|
|
1245
|
+
onExhausted?: (tx: PoolClient) => Promise<void>;
|
|
1246
|
+
}): Promise<{
|
|
1247
|
+
outcome: "reserved";
|
|
1248
|
+
id: string;
|
|
1249
|
+
releases: number;
|
|
1250
|
+
} | {
|
|
1251
|
+
outcome: "in_flight";
|
|
1252
|
+
} | {
|
|
1253
|
+
outcome: "exhausted";
|
|
1254
|
+
releases: number;
|
|
1255
|
+
}>;
|
|
1256
|
+
/**
|
|
1257
|
+
* Resolve an unsubmitted close reservation whose channel the payer exited
|
|
1258
|
+
* on its own: no cooperative close of ours can land on a finalized channel.
|
|
1259
|
+
*/
|
|
1260
|
+
resolveTempoCloseExit(id: string): Promise<boolean>;
|
|
1261
|
+
tempoCloseAmountAtStake(id: string): Promise<string>;
|
|
1262
|
+
/** Stop automatic searches without declaring a possibly missing payout discharged. */
|
|
1263
|
+
markTempoCloseUnmatched(id: string): Promise<boolean>;
|
|
1264
|
+
writeOffTempoClose(id: string, note: string): Promise<{
|
|
1265
|
+
channelId: string;
|
|
1266
|
+
amount: string;
|
|
1267
|
+
} | undefined>;
|
|
1268
|
+
reopenTempoClose(id: string): Promise<boolean>;
|
|
1269
|
+
private reserveTempoIn;
|
|
1230
1270
|
findPendingTempo(channelId: string, operation: "settle" | "close"): Promise<ObligationRow | undefined>;
|
|
1231
1271
|
/** The original close obligation reserved for this drain, while its report is outstanding. */
|
|
1232
1272
|
pendingTempoClose(channelId: string, drainId: string): Promise<{
|
|
1233
1273
|
id: string;
|
|
1274
|
+
state: State;
|
|
1234
1275
|
txHash: string | null;
|
|
1235
1276
|
reservedAtMs: number;
|
|
1277
|
+
searchBefore: bigint | null;
|
|
1236
1278
|
} | undefined>;
|
|
1279
|
+
/**
|
|
1280
|
+
* Where the next search for this close obligation's transaction resumes. It
|
|
1281
|
+
* lives on the obligation, not the drain's close intent, because releasing
|
|
1282
|
+
* the drain deletes the intent while the obligation still needs the search.
|
|
1283
|
+
*/
|
|
1284
|
+
recordTempoCloseSearch(id: string, resumeAt: bigint): Promise<void>;
|
|
1237
1285
|
submittedIds(rail: Rail, operation: Operation, txHash: string, batchId?: string): Promise<string[]>;
|
|
1238
1286
|
refundClaimDelta(txHash: string, channelId: string): Promise<bigint>;
|
|
1239
1287
|
assertReservedTempoClose(id: string, channelId: string): Promise<void>;
|
|
@@ -1242,6 +1290,26 @@ declare class HostedSettlementReportObligations {
|
|
|
1242
1290
|
reserveOpenX402Settlement(): Promise<HostedEffectReservation>;
|
|
1243
1291
|
private ensureOpenX402Batch;
|
|
1244
1292
|
recordSubmitted(id: string, txHash: string): Promise<void>;
|
|
1293
|
+
/**
|
|
1294
|
+
* Close reservations that never recorded a transaction, oldest first. Each
|
|
1295
|
+
* one owes a payout report if its close lands. Exhausted attempts remain
|
|
1296
|
+
* observable for late landings; unmatched searches require an explicit retry.
|
|
1297
|
+
*/
|
|
1298
|
+
unsubmittedTempoCloses(limit?: number): Promise<Array<{
|
|
1299
|
+
id: string;
|
|
1300
|
+
channelId: string;
|
|
1301
|
+
drainId: string;
|
|
1302
|
+
reservedAtMs: number;
|
|
1303
|
+
searchBefore: bigint | null;
|
|
1304
|
+
}>>;
|
|
1305
|
+
/**
|
|
1306
|
+
* A retired close reservation's attempt can still be running when its
|
|
1307
|
+
* successor is reserved, and its close can land. The close is the same
|
|
1308
|
+
* channel's, so it belongs to the drain's outstanding obligation; writing it
|
|
1309
|
+
* onto the retired row would leave that obligation without a transaction and
|
|
1310
|
+
* the payout unreported.
|
|
1311
|
+
*/
|
|
1312
|
+
private successorOfRetiredClose;
|
|
1245
1313
|
recoveryCandidates(): Promise<HostedRecoverableEffect[]>;
|
|
1246
1314
|
recoverOriginalX402Refunds(): Promise<Array<{
|
|
1247
1315
|
id: string;
|
|
@@ -1262,6 +1330,21 @@ declare class HostedSettlementReportObligations {
|
|
|
1262
1330
|
private lockIdentity;
|
|
1263
1331
|
private insert;
|
|
1264
1332
|
}
|
|
1333
|
+
/** Restart a terminal close-report search after the operator repairs incomplete RPC history. */
|
|
1334
|
+
declare function retryHostedTempoCloseReport(args: {
|
|
1335
|
+
db: Pool;
|
|
1336
|
+
dvmId: string;
|
|
1337
|
+
scope: string;
|
|
1338
|
+
obligationId: string;
|
|
1339
|
+
}): Promise<boolean>;
|
|
1340
|
+
/** Forgo an unmatched builder payout report after the operator declares its history irrecoverable. */
|
|
1341
|
+
declare function writeOffHostedTempoCloseReport(args: {
|
|
1342
|
+
db: Pool;
|
|
1343
|
+
dvmId: string;
|
|
1344
|
+
scope: string;
|
|
1345
|
+
obligationId: string;
|
|
1346
|
+
note: string;
|
|
1347
|
+
}): Promise<boolean>;
|
|
1265
1348
|
|
|
1266
1349
|
type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
1267
1350
|
[key: string]: JsonValue;
|
|
@@ -3210,6 +3293,12 @@ declare class CreditLedger {
|
|
|
3210
3293
|
drainId: string;
|
|
3211
3294
|
tx?: CreditLedgerQuerier;
|
|
3212
3295
|
}): Promise<void>;
|
|
3296
|
+
/** Keep the debit and close intent while the caller uses its timed channel exit. */
|
|
3297
|
+
requireTempoDrainExit(args: {
|
|
3298
|
+
creditId: string;
|
|
3299
|
+
drainId: string;
|
|
3300
|
+
tx?: CreditLedgerQuerier;
|
|
3301
|
+
}): Promise<DrainTransitionResult>;
|
|
3213
3302
|
/**
|
|
3214
3303
|
* Cancel an unfulfilled Tempo cooperative drain and restore the exact
|
|
3215
3304
|
* balance plus rail basis it removed (`pending -> released`). This is only
|
|
@@ -3598,6 +3687,11 @@ interface CreditLedgerLike {
|
|
|
3598
3687
|
drainId: string;
|
|
3599
3688
|
tx?: CreditLedgerQuerier;
|
|
3600
3689
|
}): Promise<void>;
|
|
3690
|
+
requireTempoDrainExit?(args: {
|
|
3691
|
+
creditId: string;
|
|
3692
|
+
drainId: string;
|
|
3693
|
+
tx?: CreditLedgerQuerier;
|
|
3694
|
+
}): Promise<DrainTransitionResult>;
|
|
3601
3695
|
releaseDrain(args: {
|
|
3602
3696
|
creditId: string;
|
|
3603
3697
|
drainId: string;
|
|
@@ -3701,8 +3795,10 @@ type DrainMethod = "cashu" | "x402" | "tempo";
|
|
|
3701
3795
|
* `pending → sent` (builder batch job shipped the send-back). MPP either
|
|
3702
3796
|
* reaches `sent` through cooperative close or `released` with its exact basis
|
|
3703
3797
|
* restored when chain reconciliation proves that close cannot complete.
|
|
3798
|
+
* `exit_required` ends cooperative attempts without restoring the debit;
|
|
3799
|
+
* a late confirmed close can still fulfill it as `sent`.
|
|
3704
3800
|
*/
|
|
3705
|
-
type DrainStatus = "pending" | "parked" | "picked_up" | "sent" | "released";
|
|
3801
|
+
type DrainStatus = "pending" | "parked" | "picked_up" | "sent" | "released" | "exit_required";
|
|
3706
3802
|
/**
|
|
3707
3803
|
* The sats a DVM owes back on undrawn non-channel Bitcoin credit —
|
|
3708
3804
|
* the deposit pot inside the hub's balance, which the operator's sweep may
|
|
@@ -4424,12 +4520,31 @@ declare class PostgresTempoSessionStore implements Store.AtomicStore {
|
|
|
4424
4520
|
getClose(channelId: string): Promise<TempoSessionCloseRecord | null>;
|
|
4425
4521
|
/** Persist proof that a cooperative close reached terminal chain state. */
|
|
4426
4522
|
confirmClose(channelId: string, drainId: string, reference: string): Promise<TempoSessionCloseRecord>;
|
|
4523
|
+
/** Set a close's reference only if none is set, reporting whether this call set it. */
|
|
4524
|
+
claimCloseReference(channelId: string, drainId: string, reference: string): Promise<{
|
|
4525
|
+
reference: string | null;
|
|
4526
|
+
claimed: boolean;
|
|
4527
|
+
}>;
|
|
4528
|
+
getCloseRecovery(channelId: string): Promise<{
|
|
4529
|
+
updatedAtMs: number;
|
|
4530
|
+
searchBefore: bigint | null;
|
|
4531
|
+
settledBeforeClose: bigint | null;
|
|
4532
|
+
} | null>;
|
|
4533
|
+
/** Record where a paused close search resumes; the cursor only moves back. */
|
|
4534
|
+
recordCloseSearch(channelId: string, drainId: string, resumeAt: bigint): Promise<void>;
|
|
4427
4535
|
private runCloseIntentTransaction;
|
|
4428
4536
|
private transaction;
|
|
4429
4537
|
private writeCloseIntent;
|
|
4430
4538
|
private updateInTransaction;
|
|
4431
4539
|
}
|
|
4432
4540
|
|
|
4541
|
+
interface TempoDrainFinalization {
|
|
4542
|
+
reference: string;
|
|
4543
|
+
refundedNative: bigint;
|
|
4544
|
+
outcome: "payer_exit" | "cooperative_close";
|
|
4545
|
+
creditUnbacked: boolean;
|
|
4546
|
+
}
|
|
4547
|
+
type TempoDrainFinalizer = (drain: CreditDrainRecord, evidence: TempoDrainFinalization) => Promise<boolean>;
|
|
4433
4548
|
/**
|
|
4434
4549
|
* Options for assembling an Mppx server handle from explicit recipient strings
|
|
4435
4550
|
* and the surrounding environment. The SDK boundary owns env reads so DVM
|
|
@@ -4566,6 +4681,13 @@ interface MppxServer {
|
|
|
4566
4681
|
settled: number;
|
|
4567
4682
|
inFlight: number;
|
|
4568
4683
|
}>;
|
|
4684
|
+
/**
|
|
4685
|
+
* Bring hosted close obligations whose channel has finalized to what the
|
|
4686
|
+
* chain shows, without settling anything. The sweep runs it too; the hosting
|
|
4687
|
+
* closure runs it alone before it decides, since those obligations block
|
|
4688
|
+
* the closure certificate.
|
|
4689
|
+
*/
|
|
4690
|
+
reconcileTempoSessionCloses?: () => Promise<void>;
|
|
4569
4691
|
/**
|
|
4570
4692
|
* Reconcile and, if the channel is at risk, settle exactly one TIP-1034
|
|
4571
4693
|
* channel. The forced-close protection path: a verified on-chain
|
|
@@ -4664,7 +4786,7 @@ interface MppxServer {
|
|
|
4664
4786
|
/** Reconcile one channel to chain state before deciding how its drain proceeds. */
|
|
4665
4787
|
getTempoSessionDrainState?: (channelId: string) => Promise<TempoSessionDrainState>;
|
|
4666
4788
|
/** Bind the credit ledger that must be terminalized when Tempo backing is lost. */
|
|
4667
|
-
useTempoCreditLedger?: (ledger: CreditLedgerLike) => void;
|
|
4789
|
+
useTempoCreditLedger?: (ledger: CreditLedgerLike, finalizeDrain?: TempoDrainFinalizer) => void;
|
|
4668
4790
|
}
|
|
4669
4791
|
/** What a `ChannelClosed` event split the escrow into. Atomic token units. */
|
|
4670
4792
|
interface TempoChannelCloseAmounts {
|
|
@@ -4760,12 +4882,39 @@ interface TempoSessionChainOps {
|
|
|
4760
4882
|
}): Promise<Hex>;
|
|
4761
4883
|
readChannelClose(client: Client, channelId: Hex, txHash: Hex): Promise<TempoChannelCloseAmounts>;
|
|
4762
4884
|
/**
|
|
4763
|
-
*
|
|
4764
|
-
*
|
|
4765
|
-
*
|
|
4885
|
+
* Search back for how this channel finalized: the newest `ChannelClosed`,
|
|
4886
|
+
* `CloseRequested` or `CloseRequestCancelled` log, from `startBlock` (the
|
|
4887
|
+
* chain head when omitted) down to blocks older than `notBeforeMs`. One call searches a bounded number of
|
|
4888
|
+
* windows; `paused` names the block the next call resumes from.
|
|
4766
4889
|
*/
|
|
4767
|
-
findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number): Promise<
|
|
4890
|
+
findChannelClose(client: Client, channelId: Hex, escrowContract: `0x${string}`, notBeforeMs: number, startBlock?: bigint): Promise<TempoChannelCloseSearch>;
|
|
4768
4891
|
}
|
|
4892
|
+
type TempoChannelCloseSearch =
|
|
4893
|
+
/** A `ChannelClosed` log, with the address that sent its transaction. */
|
|
4894
|
+
{
|
|
4895
|
+
outcome: "closed";
|
|
4896
|
+
txHash: Hex;
|
|
4897
|
+
sender: `0x${string}`;
|
|
4898
|
+
}
|
|
4899
|
+
/**
|
|
4900
|
+
* The payer's `requestClose` is newer than any `ChannelClosed` and was not
|
|
4901
|
+
* cancelled: a timed exit.
|
|
4902
|
+
*/
|
|
4903
|
+
| {
|
|
4904
|
+
outcome: "exit_requested";
|
|
4905
|
+
}
|
|
4906
|
+
/**
|
|
4907
|
+
* Nothing read shows what finalized the channel; a later search resumes at
|
|
4908
|
+
* `stoppedAt`, which never leads below the reservation's time bound. Without
|
|
4909
|
+
* it the range may still hold the answer, and a later search starts over.
|
|
4910
|
+
*/
|
|
4911
|
+
| {
|
|
4912
|
+
outcome: "none";
|
|
4913
|
+
stoppedAt?: bigint;
|
|
4914
|
+
} | {
|
|
4915
|
+
outcome: "paused";
|
|
4916
|
+
resumeAt: bigint;
|
|
4917
|
+
};
|
|
4769
4918
|
declare function attachTempoSessionRuntime(mppx: MppxServer, config: MppOpts["tempoSession"], chainOpOverrides?: Partial<TempoSessionChainOps>): MppxServer;
|
|
4770
4919
|
/** Test-only seams for deterministic watcher coverage without a live Tempo RPC. */
|
|
4771
4920
|
declare const _testing: {
|
|
@@ -5838,4 +5987,4 @@ declare class StepCache {
|
|
|
5838
5987
|
static deserialize(records: StepRecord[]): StepCache;
|
|
5839
5988
|
}
|
|
5840
5989
|
|
|
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
|
|
5990
|
+
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 X402SettlementCursor 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, retryHostedTempoCloseReport as cU, secp256k1Auth as cV, signedRequestInput as cW, writeOffHostedTempoCloseReport as cX, type HostedIntent as cY, type X402SettlementIntent as cZ, type HostedFundingReservation as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainTransitionResult as cd, type DrainReleaseResult as ce, type DrainFulfilment 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 X402SettlementWriteOff as d0, type X402FacilitatorAuth as d1, type X402BatchSettlementConfig as d2, type X402PayoutObserver as d3, type CreditDepositEnqueue as d4, type X402SettlementReconciliationReason as d5, type CreditDrawReleaseEnqueue as d6, 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-IYQQXEHV.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
|
-
import "./chunk-DZQYQN2X.js";
|
|
6
5
|
import "./chunk-COYKJRMM.js";
|
|
6
|
+
import "./chunk-OIP44KBB.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-Q3VYRU5R.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
|
-
import "./chunk-6FEHRZO7.js";
|
|
7
|
-
import "./chunk-DZQYQN2X.js";
|
|
8
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
+
import "./chunk-IBX2ORBV.js";
|
|
8
|
+
import "./chunk-OIP44KBB.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 { 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-CVBYehRS.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-B7svmPz3.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-qOD-FrQF.js';
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'mppx';
|
|
6
6
|
import '@x402/core/server';
|
package/dist/testing/index.js
CHANGED
|
@@ -4,22 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MemoryJobStore,
|
|
6
6
|
createInstrumentedFetch
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TFDR2YP2.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-BL6LRWXD.js";
|
|
13
|
+
} from "../chunk-TRY7BJA4.js";
|
|
15
14
|
import "../chunk-FUJ36YDV.js";
|
|
16
|
-
import "../chunk-66HGCPBU.js";
|
|
17
15
|
import "../chunk-BQJIFRAZ.js";
|
|
18
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-WLPLHXNP.js";
|
|
19
17
|
import {
|
|
20
18
|
validateCurrency
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-HC4I7LAV.js";
|
|
20
|
+
import "../chunk-QSZW2I5Y.js";
|
|
21
|
+
import "../chunk-66HGCPBU.js";
|
|
22
|
+
import "../chunk-OIP44KBB.js";
|
|
23
23
|
|
|
24
24
|
// src/sdk/testing/test-context.ts
|
|
25
25
|
function createTestContext(opts) {
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-WMGXJQI3.js";
|
|
7
7
|
import {
|
|
8
8
|
verifyX402Payment
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-LCCG5HQM.js";
|
|
10
|
+
import "./chunk-GAZBBMAA.js";
|
|
11
11
|
import {
|
|
12
12
|
X402_DEFAULT_FACILITATOR,
|
|
13
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
x402NetworkToCaip2
|
|
29
29
|
} from "./chunk-62FI3NJF.js";
|
|
30
30
|
import "./chunk-FUJ36YDV.js";
|
|
31
|
-
import "./chunk-66HGCPBU.js";
|
|
32
31
|
import {
|
|
33
32
|
X402_NETWORKS,
|
|
34
33
|
assertSupportedX402Network,
|
|
@@ -37,7 +36,8 @@ import {
|
|
|
37
36
|
x402NetworkListForCopy,
|
|
38
37
|
x402SupportedNetworksHint
|
|
39
38
|
} from "./chunk-BPYMEMQX.js";
|
|
40
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-66HGCPBU.js";
|
|
40
|
+
import "./chunk-OIP44KBB.js";
|
|
41
41
|
export {
|
|
42
42
|
X402_DEFAULT_FACILITATOR,
|
|
43
43
|
X402_DEFAULT_NETWORK,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvmkit/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
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
5
|
"author": "DVM Technologies Ltd",
|
|
6
6
|
"keywords": [
|