@dvmkit/sdk 0.10.1 → 0.12.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-STJBBVNL.js → chunk-2VGMZ7VF.js} +487 -71
- package/dist/{chunk-3Q6FTZDB.js → chunk-3YFFZLW7.js} +2 -2
- package/dist/{chunk-VMHYGKWT.js → chunk-566CFXGU.js} +9 -1
- package/dist/chunk-5H7P3ORL.js +92 -0
- package/dist/{chunk-3R7NQA3Z.js → chunk-7KQLPVV7.js} +1 -1
- package/dist/{chunk-JNECYURT.js → chunk-D4FFS3IS.js} +1 -1
- package/dist/{chunk-VTHYQCDB.js → chunk-E7ZBCT5U.js} +1 -1
- package/dist/{chunk-MMGSYMIC.js → chunk-EP7OVWI5.js} +1 -1
- package/dist/{chunk-LDIPVPKI.js → chunk-FFRTAQUW.js} +1 -1
- package/dist/chunk-H3GGFEE5.js +57 -0
- package/dist/{chunk-M3T5JYDJ.js → chunk-HNXMWHLU.js} +1 -1
- package/dist/{chunk-UKD3R2KU.js → chunk-HW2UCOOC.js} +4 -55
- package/dist/{chunk-FFXXGCVG.js → chunk-ITRSITFP.js} +1 -1
- package/dist/{chunk-MU3IE434.js → chunk-JLT2YIBS.js} +267 -52
- package/dist/{chunk-KFCEXCZM.js → chunk-KJZVTWMX.js} +1 -1
- package/dist/{chunk-W3VGCNG6.js → chunk-LDKV4UHI.js} +1 -1
- package/dist/{chunk-AJ6UHXUA.js → chunk-M4NFYEEY.js} +1 -1
- package/dist/{chunk-MB6R4XPZ.js → chunk-NS2OMIU7.js} +15 -3
- package/dist/{chunk-YOSZIWC3.js → chunk-POYUX2NN.js} +149 -11
- package/dist/{chunk-VUGEEMLT.js → chunk-RPUFWIT4.js} +11 -89
- package/dist/{chunk-SYBFMHXQ.js → chunk-S7PIFHE4.js} +590 -67
- package/dist/{chunk-2OGBZPPJ.js → chunk-TWKQFIOW.js} +21 -3
- package/dist/{chunk-EWZFANHJ.js → chunk-VWIMQ5H5.js} +1 -1
- package/dist/{chunk-2XQLL6N6.js → chunk-WFCVS6QB.js} +2 -2
- package/dist/{chunk-QGNXYVBO.js → chunk-Z4FOPROB.js} +17 -0
- package/dist/{content-retention-CrILCNxk.d.ts → content-retention-a1yRdmhI.d.ts} +1 -1
- package/dist/{credit-ledger-4PZNAMDT.js → credit-ledger-MF23UKRJ.js} +6 -3
- package/dist/{credit-menu-BWsVqMh-.d.ts → credit-menu-B2T-O9oY.d.ts} +11 -4
- package/dist/{fx-BM5h4o5S.d.ts → fx-DLhscRUh.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -5
- package/dist/internal/caller.d.ts +8 -6
- package/dist/internal/caller.js +27 -22
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +24 -22
- package/dist/{job-store-92v8e1LQ.d.ts → job-store-B8Ijr5V6.d.ts} +3 -1
- package/dist/{lightning-backend-9oky_wJi.d.ts → lightning-backend-DmwMSgaM.d.ts} +1 -1
- package/dist/memory-credit-ledger-ERD764PS.js +14 -0
- package/dist/{mpp-setup-FURD45LI.js → mpp-setup-JU3MT7QX.js} +3 -3
- package/dist/{payout-reporter-HVJ6WUF3.js → payout-reporter-NXWQVKXW.js} +2 -2
- package/dist/{postgres-consumed-credential-store-WO6OCFXZ.js → postgres-consumed-credential-store-WXJLM6J7.js} +1 -1
- package/dist/{postgres-job-store-H45PRBLA.js → postgres-job-store-ZVMAN6L2.js} +2 -2
- package/dist/{postgres-replay-store-XXJSA457.js → postgres-replay-store-QJ4FG6AR.js} +2 -2
- package/dist/{pricing-X4XU5HXY.js → pricing-KCLENT2C.js} +3 -3
- package/dist/{revenue-reporter-EV3K5L6B.js → revenue-reporter-HD4GMXGD.js} +2 -2
- package/dist/server/index.d.ts +30 -12
- package/dist/server/index.js +32 -30
- package/dist/{step-cache--7yA5Ihr.d.ts → step-cache-DQqpwXa8.d.ts} +206 -47
- package/dist/{tempo-charge-store-5JOIYUIH.js → tempo-charge-store-7LTUAQHQ.js} +2 -2
- package/dist/{tempo-session-store-S6QMLQUA.js → tempo-session-store-LYAIDR2B.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +6 -6
- package/dist/{usd-C7lvLvLk.d.ts → usd-D5kk2nIT.d.ts} +1 -1
- package/dist/{x402-EN5LSOVM.js → x402-RUJ4LUKF.js} +3 -3
- package/package.json +1 -1
- package/recipes/postgres/financial-export-v1.sql +19 -5
- package/dist/memory-credit-ledger-RP7DT5IY.js +0 -11
|
@@ -7,6 +7,38 @@ import { PaymentPayload as PaymentPayload$1, PaymentRequirements as PaymentRequi
|
|
|
7
7
|
import { Account, Client, Hex } from 'viem';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
|
+
/** Auth identifier advertised by DVMs using audience-bound caller proofs. */
|
|
11
|
+
declare const SIGNED_REQUEST_AUTH_ID: "secp256k1-schnorr-v2";
|
|
12
|
+
/** Version of the canonical audience-bound caller statement. */
|
|
13
|
+
declare const SIGNED_REQUEST_STATEMENT_VERSION: 2;
|
|
14
|
+
/** Attested service identity a signed caller statement is intended for. */
|
|
15
|
+
interface SignedRequestAudience {
|
|
16
|
+
dvm_id: string;
|
|
17
|
+
builder_pubkey: string;
|
|
18
|
+
}
|
|
19
|
+
/** Operation fields kept outside the signed input to prevent schema substitution. */
|
|
20
|
+
interface SignedRequestDomain {
|
|
21
|
+
audience: SignedRequestAudience;
|
|
22
|
+
method: string;
|
|
23
|
+
path: string;
|
|
24
|
+
capability: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** Domain fields carried with every v2 signed-request envelope. */
|
|
27
|
+
interface SignedRequestStatementHeader {
|
|
28
|
+
v: typeof SIGNED_REQUEST_STATEMENT_VERSION;
|
|
29
|
+
protocol: "dvmkit";
|
|
30
|
+
protocol_version: 1;
|
|
31
|
+
auth: typeof SIGNED_REQUEST_AUTH_ID;
|
|
32
|
+
audience: SignedRequestAudience;
|
|
33
|
+
method: string;
|
|
34
|
+
path: string;
|
|
35
|
+
capability: string | null;
|
|
36
|
+
}
|
|
37
|
+
/** Build the versioned header persisted beside a caller's flat input envelope. */
|
|
38
|
+
declare function signedRequestStatementHeader(domain: SignedRequestDomain): SignedRequestStatementHeader;
|
|
39
|
+
/** Canonicalize a concrete request path: leading slash, no query or fragment. */
|
|
40
|
+
declare function canonicalRequestPath(pathOrUrl: string): string;
|
|
41
|
+
|
|
10
42
|
/**
|
|
11
43
|
* Currency-code identifier used throughout the SDK's pricing surface. Validated
|
|
12
44
|
* to ISO 4217-style three-letter lowercase ("usd", "eur", "jpy", …) at SDK
|
|
@@ -435,6 +467,11 @@ interface ArtifactContent {
|
|
|
435
467
|
}
|
|
436
468
|
/** Provider requests payment to continue. */
|
|
437
469
|
interface PaymentRequestContent {
|
|
470
|
+
/** Exact outstanding balance charge, in integer micro-units. Use this message’s seq as request_seq. */
|
|
471
|
+
credit?: {
|
|
472
|
+
amount_micro: number;
|
|
473
|
+
currency: string;
|
|
474
|
+
};
|
|
438
475
|
amount_msats: number;
|
|
439
476
|
reason: string;
|
|
440
477
|
/**
|
|
@@ -486,8 +523,22 @@ interface PaymentRequestContent {
|
|
|
486
523
|
challenges: MppxChallenge[];
|
|
487
524
|
};
|
|
488
525
|
}
|
|
489
|
-
/** Requester sends
|
|
526
|
+
/** Requester sends a rail proof or signed balance authorization; provider sends change/refund. */
|
|
490
527
|
interface PaymentContent {
|
|
528
|
+
/** Signed authorization to spend existing credit on one outstanding ask. Cannot accompany rail credentials. */
|
|
529
|
+
credit?: {
|
|
530
|
+
credit_id: string;
|
|
531
|
+
draw_id: string;
|
|
532
|
+
payment_id: string;
|
|
533
|
+
request_seq: number;
|
|
534
|
+
amount_micro: number;
|
|
535
|
+
currency: string;
|
|
536
|
+
pubkey: string;
|
|
537
|
+
signature: string;
|
|
538
|
+
timestamp: number;
|
|
539
|
+
nonce: string;
|
|
540
|
+
auth_statement: SignedRequestStatementHeader;
|
|
541
|
+
};
|
|
491
542
|
cashu_token?: string;
|
|
492
543
|
mint?: string;
|
|
493
544
|
amount_msats?: number;
|
|
@@ -614,38 +665,6 @@ declare function isWorkingMessage(msg: Message): msg is MessageBase & {
|
|
|
614
665
|
content: WorkingContent;
|
|
615
666
|
};
|
|
616
667
|
|
|
617
|
-
/** Auth identifier advertised by DVMs using audience-bound caller proofs. */
|
|
618
|
-
declare const SIGNED_REQUEST_AUTH_ID: "secp256k1-schnorr-v2";
|
|
619
|
-
/** Version of the canonical audience-bound caller statement. */
|
|
620
|
-
declare const SIGNED_REQUEST_STATEMENT_VERSION: 2;
|
|
621
|
-
/** Attested service identity a signed caller statement is intended for. */
|
|
622
|
-
interface SignedRequestAudience {
|
|
623
|
-
dvm_id: string;
|
|
624
|
-
builder_pubkey: string;
|
|
625
|
-
}
|
|
626
|
-
/** Operation fields kept outside the signed input to prevent schema substitution. */
|
|
627
|
-
interface SignedRequestDomain {
|
|
628
|
-
audience: SignedRequestAudience;
|
|
629
|
-
method: string;
|
|
630
|
-
path: string;
|
|
631
|
-
capability: string | null;
|
|
632
|
-
}
|
|
633
|
-
/** Domain fields carried with every v2 signed-request envelope. */
|
|
634
|
-
interface SignedRequestStatementHeader {
|
|
635
|
-
v: typeof SIGNED_REQUEST_STATEMENT_VERSION;
|
|
636
|
-
protocol: "dvmkit";
|
|
637
|
-
protocol_version: 1;
|
|
638
|
-
auth: typeof SIGNED_REQUEST_AUTH_ID;
|
|
639
|
-
audience: SignedRequestAudience;
|
|
640
|
-
method: string;
|
|
641
|
-
path: string;
|
|
642
|
-
capability: string | null;
|
|
643
|
-
}
|
|
644
|
-
/** Build the versioned header persisted beside a caller's flat input envelope. */
|
|
645
|
-
declare function signedRequestStatementHeader(domain: SignedRequestDomain): SignedRequestStatementHeader;
|
|
646
|
-
/** Canonicalize a concrete request path: leading slash, no query or fragment. */
|
|
647
|
-
declare function canonicalRequestPath(pathOrUrl: string): string;
|
|
648
|
-
|
|
649
668
|
/** Protocol version spoken by this SDK generation. */
|
|
650
669
|
declare const DVM_PROTOCOL_VERSION = "1";
|
|
651
670
|
/** HTTP headers used by the additive client-compatibility contract. */
|
|
@@ -1268,6 +1287,7 @@ declare class HostedSettlementReportObligations {
|
|
|
1268
1287
|
obligationId: string;
|
|
1269
1288
|
};
|
|
1270
1289
|
all?: boolean;
|
|
1290
|
+
channelId?: string;
|
|
1271
1291
|
}): Promise<{
|
|
1272
1292
|
id: string;
|
|
1273
1293
|
channelId: string;
|
|
@@ -1687,6 +1707,8 @@ interface FundingLot {
|
|
|
1687
1707
|
rail: NonChannelBitcoinRail;
|
|
1688
1708
|
/** Sats this funding delivered. `0` on a credit funded before a rail basis was recorded. */
|
|
1689
1709
|
satsFunded: number;
|
|
1710
|
+
/** Explicit original-asset evidence, including a refund whose integer share is zero sats. */
|
|
1711
|
+
satsBasisKnown?: boolean;
|
|
1690
1712
|
/** Credit micro this funding bought — the lot's denominator, never depleted. */
|
|
1691
1713
|
creditedMicro: number;
|
|
1692
1714
|
remainingMicro: number;
|
|
@@ -2356,6 +2378,20 @@ interface CreditDepositPayload {
|
|
|
2356
2378
|
*/
|
|
2357
2379
|
repaired?: boolean;
|
|
2358
2380
|
}
|
|
2381
|
+
/** Completed-draw reversal posted to /_internal/credit-draw-refund. */
|
|
2382
|
+
interface CreditDrawRefundPayload {
|
|
2383
|
+
dvmId: string;
|
|
2384
|
+
creditId: string;
|
|
2385
|
+
drawId: string;
|
|
2386
|
+
jobId: string;
|
|
2387
|
+
refundId: string;
|
|
2388
|
+
amountMicro: number;
|
|
2389
|
+
creditCurrency: string;
|
|
2390
|
+
ledgerSeq: number;
|
|
2391
|
+
refundedAt: number;
|
|
2392
|
+
reason?: string;
|
|
2393
|
+
}
|
|
2394
|
+
type CreditDrawRefundEnqueue = (tx: RevenueReporterQuerier, payload: CreditDrawRefundPayload) => Promise<void>;
|
|
2359
2395
|
/**
|
|
2360
2396
|
* JSON wire shape POSTed to the platform's `/_internal/credit-draw-release`
|
|
2361
2397
|
* endpoint. A released hold leaves the credit balance intact, but
|
|
@@ -2651,6 +2687,8 @@ declare class RevenueReporter {
|
|
|
2651
2687
|
* rail transaction commits, including after a process restart.
|
|
2652
2688
|
*/
|
|
2653
2689
|
enqueueDeposit(tx: RevenueReporterQuerier, payload: CreditDepositPayload): Promise<void>;
|
|
2690
|
+
/** Persist without network delivery before the refund accounting transaction commits. */
|
|
2691
|
+
enqueueCreditDrawRefund(tx: RevenueReporterQuerier, payload: CreditDrawRefundPayload): Promise<void>;
|
|
2654
2692
|
/** Join a released draw to the transaction that made the hold terminal. */
|
|
2655
2693
|
enqueueCreditDrawRelease(tx: RevenueReporterQuerier, payload: CreditDrawReleasePayload): Promise<void>;
|
|
2656
2694
|
/**
|
|
@@ -2738,6 +2776,40 @@ declare class RevenueReporter {
|
|
|
2738
2776
|
private markStale;
|
|
2739
2777
|
}
|
|
2740
2778
|
|
|
2779
|
+
type CreditDrawRefundArgs = {
|
|
2780
|
+
refundId: string;
|
|
2781
|
+
amountMicro?: number;
|
|
2782
|
+
reason?: string;
|
|
2783
|
+
outbox: {
|
|
2784
|
+
dvmId: string;
|
|
2785
|
+
enqueue: CreditDrawRefundEnqueue;
|
|
2786
|
+
};
|
|
2787
|
+
/** DVM receipt key from trusted server configuration, never from job content or the request. */
|
|
2788
|
+
trustedReceiptPubkey?: string;
|
|
2789
|
+
nowMs?: number;
|
|
2790
|
+
} & ({
|
|
2791
|
+
jobId: string;
|
|
2792
|
+
creditId?: never;
|
|
2793
|
+
drawId?: never;
|
|
2794
|
+
} | {
|
|
2795
|
+
creditId: string;
|
|
2796
|
+
drawId: string;
|
|
2797
|
+
jobId?: never;
|
|
2798
|
+
});
|
|
2799
|
+
interface CreditDrawRefundResult {
|
|
2800
|
+
refundId: string;
|
|
2801
|
+
creditId: string;
|
|
2802
|
+
drawId: string;
|
|
2803
|
+
jobId: string;
|
|
2804
|
+
amountMicro: number;
|
|
2805
|
+
currency: string;
|
|
2806
|
+
ledgerSeq: number;
|
|
2807
|
+
refundedAt: number;
|
|
2808
|
+
/** Persisted balance immediately after this refund, not a current balance read. */
|
|
2809
|
+
balanceAfterMicro: number;
|
|
2810
|
+
replayed: boolean;
|
|
2811
|
+
}
|
|
2812
|
+
|
|
2741
2813
|
interface TempoSessionSettlementStore {
|
|
2742
2814
|
withDrawPlacement<value>(channelId: string, operation: (tx: CreditLedgerQuerier, lifecycle: TempoSessionLifecycle$1) => Promise<value>, tx?: CreditLedgerQuerier): Promise<value>;
|
|
2743
2815
|
withTerminalConsumption<value>(channelId: string, operation: (tx: CreditLedgerQuerier, lifecycle: TempoSessionLifecycle$1) => Promise<{
|
|
@@ -2759,6 +2831,9 @@ interface TempoCreditLossEvidence {
|
|
|
2759
2831
|
settledOnChainNative: bigint;
|
|
2760
2832
|
highestVoucherNative: bigint;
|
|
2761
2833
|
consumedNative: bigint;
|
|
2834
|
+
/** Exact same-close cooperative refund. Omission preserves the caller's loss assertion without proving zero. */
|
|
2835
|
+
refundedToPayerNative?: bigint;
|
|
2836
|
+
closeKind?: "cooperative_close" | "payer_exit";
|
|
2762
2837
|
observedAt?: number;
|
|
2763
2838
|
}
|
|
2764
2839
|
interface TempoCreditLoss {
|
|
@@ -2771,6 +2846,9 @@ interface TempoCreditLoss {
|
|
|
2771
2846
|
highestVoucherNative: bigint;
|
|
2772
2847
|
consumedServiceMicro: number;
|
|
2773
2848
|
consumedNative: bigint;
|
|
2849
|
+
refundedToPayerNative?: bigint | null;
|
|
2850
|
+
lossNative?: bigint | null;
|
|
2851
|
+
lossBasis?: "cooperative_close" | "payer_exit" | "caller_asserted" | null;
|
|
2774
2852
|
observedAt: number;
|
|
2775
2853
|
}
|
|
2776
2854
|
/** Chain-proven evidence that an x402 channel no longer backs its bound credit. */
|
|
@@ -2798,7 +2876,7 @@ interface X402CreditLoss {
|
|
|
2798
2876
|
*
|
|
2799
2877
|
* The ledger is host-wide: credit_id and caller_pubkey identify rows, without a per-mount
|
|
2800
2878
|
* dvm_id. Draws hold funds until settlement or release, and share a gap-free per-credit
|
|
2801
|
-
* ledger_seq with drains.
|
|
2879
|
+
* ledger_seq with drains and completed-draw refunds.
|
|
2802
2880
|
*/
|
|
2803
2881
|
declare class CreditLedger {
|
|
2804
2882
|
private readonly pool;
|
|
@@ -2808,6 +2886,7 @@ declare class CreditLedger {
|
|
|
2808
2886
|
* fleet, so this DVM may advertise credit.
|
|
2809
2887
|
*/
|
|
2810
2888
|
readonly durable = true;
|
|
2889
|
+
readonly tempoCreditLossEvidenceVersion = 1;
|
|
2811
2890
|
private x402Settlements?;
|
|
2812
2891
|
private expiryReleaseOutbox?;
|
|
2813
2892
|
private hostingCleanupFence?;
|
|
@@ -2926,7 +3005,8 @@ declare class CreditLedger {
|
|
|
2926
3005
|
/**
|
|
2927
3006
|
* Grow an accepted job’s pending hold while preserving its original ledger_seq. The balance
|
|
2928
3007
|
* tuple is updated at that sequence, so interleaved draws need not form a monotonic balance
|
|
2929
|
-
* trajectory.
|
|
3008
|
+
* trajectory. Existing rail top-ups retain accepted-job semantics; spending existing balance
|
|
3009
|
+
* opts into fresh-spend expiry and channel gates.
|
|
2930
3010
|
*
|
|
2931
3011
|
* Available balance excludes every pending hold, including this one. An earmark allocates
|
|
2932
3012
|
* the incoming funding’s rail value; absent one, growth uses the pool.
|
|
@@ -2937,6 +3017,9 @@ declare class CreditLedger {
|
|
|
2937
3017
|
* than throwing and rolling back accepted proofs.
|
|
2938
3018
|
*/
|
|
2939
3019
|
growDraw(args: {
|
|
3020
|
+
/** Apply fresh-spend expiry and channel gates when consuming existing balance. */
|
|
3021
|
+
spendExistingBalance?: boolean;
|
|
3022
|
+
hostingPaymentSeq?: number;
|
|
2940
3023
|
creditId: string;
|
|
2941
3024
|
drawId: string;
|
|
2942
3025
|
addAmountMicro: number;
|
|
@@ -2964,6 +3047,8 @@ declare class CreditLedger {
|
|
|
2964
3047
|
tx?: CreditLedgerQuerier;
|
|
2965
3048
|
nowMs?: number;
|
|
2966
3049
|
}): Promise<GrownDrawResult>;
|
|
3050
|
+
/** Restore a completed draw and its report under one durable transaction. */
|
|
3051
|
+
refundDraw(args: CreditDrawRefundArgs): Promise<CreditDrawRefundResult>;
|
|
2967
3052
|
/**
|
|
2968
3053
|
* Finalize a pending draw: the hold becomes a real debit
|
|
2969
3054
|
* (`balance_micro −= amount`). Available balance is unchanged — the amount
|
|
@@ -3217,7 +3302,8 @@ declare class CreditLedger {
|
|
|
3217
3302
|
private terminalizeTempoCreditsLocked;
|
|
3218
3303
|
listTempoCreditLosses(args?: {
|
|
3219
3304
|
limit?: number;
|
|
3220
|
-
|
|
3305
|
+
channelId?: string;
|
|
3306
|
+
}, tx?: CreditLedgerQuerier): Promise<TempoCreditLoss[]>;
|
|
3221
3307
|
/**
|
|
3222
3308
|
* Reconcile the credit bound to a chain-proven empty x402 channel.
|
|
3223
3309
|
*
|
|
@@ -3284,8 +3370,8 @@ declare class CreditLedger {
|
|
|
3284
3370
|
*/
|
|
3285
3371
|
listPendingDrains(): Promise<CreditDrainRecord[]>;
|
|
3286
3372
|
/**
|
|
3287
|
-
* Page
|
|
3288
|
-
* age-bounded
|
|
3373
|
+
* Page held Tempo-channel drains by (created_at, credit_id, drain_id), optionally
|
|
3374
|
+
* age-bounded. Audit reads also include terminal operator decisions. Accept the legacy mpp stored method as well as
|
|
3289
3375
|
* tempo so pre-migration drains remain repairable. Use the compound key for both ordering
|
|
3290
3376
|
* and continuation.
|
|
3291
3377
|
*/
|
|
@@ -3295,6 +3381,7 @@ declare class CreditLedger {
|
|
|
3295
3381
|
createdBeforeMs: number;
|
|
3296
3382
|
rail: "tempo";
|
|
3297
3383
|
includeResolved?: boolean;
|
|
3384
|
+
includeWrittenOff?: boolean;
|
|
3298
3385
|
}): Promise<CreditDrainRecord[]>;
|
|
3299
3386
|
/**
|
|
3300
3387
|
* Record that an operator reviewed a floor-refused channel drain and is not
|
|
@@ -3334,18 +3421,39 @@ declare class CreditLedger {
|
|
|
3334
3421
|
drainId: string;
|
|
3335
3422
|
tx?: CreditLedgerQuerier;
|
|
3336
3423
|
}): Promise<DrainTransitionResult>;
|
|
3424
|
+
/** Retain an exact receipt-derived refund; a later missing/zero read cannot erase payment. */
|
|
3425
|
+
recordTempoDrainRefund(args: {
|
|
3426
|
+
creditId: string;
|
|
3427
|
+
drainId: string;
|
|
3428
|
+
refundedNative: string | bigint;
|
|
3429
|
+
}): Promise<void>;
|
|
3430
|
+
/** Retain trusted proof that some refund was paid, without claiming an exact amount. */
|
|
3431
|
+
recordTempoDrainPayment(args: {
|
|
3432
|
+
creditId: string;
|
|
3433
|
+
drainId: string;
|
|
3434
|
+
}): Promise<void>;
|
|
3435
|
+
private recordTempoDrainRefundEvidence;
|
|
3436
|
+
/** Record the latest established proof refusal without changing the held debit. */
|
|
3437
|
+
recordTempoDrainHold(args: {
|
|
3438
|
+
creditId: string;
|
|
3439
|
+
drainId: string;
|
|
3440
|
+
reason: TempoDrainHoldReason;
|
|
3441
|
+
}): Promise<void>;
|
|
3337
3442
|
/**
|
|
3338
|
-
*
|
|
3339
|
-
*
|
|
3340
|
-
*
|
|
3341
|
-
*
|
|
3443
|
+
* An operator attests a full off-path refund or restores the exact unpaid debit. The
|
|
3444
|
+
* channel lock precedes the credit and drain locks; automatic booking shares the drain
|
|
3445
|
+
* CAS, so only one terminal outcome can commit. No channel lifecycle state is reopened.
|
|
3446
|
+
* Direct callers own reporting: hosted booking must join the caller's drain outbox transaction.
|
|
3342
3447
|
*/
|
|
3448
|
+
decideTempoDrain(args: TempoDrainDecisionArgs): Promise<TempoDrainDecisionResult>;
|
|
3449
|
+
/** Restore an unpaid pending drain; operator decisions also admit exit_required. */
|
|
3343
3450
|
releaseDrain(args: {
|
|
3344
3451
|
creditId: string;
|
|
3345
3452
|
drainId: string;
|
|
3346
3453
|
tx?: CreditLedgerQuerier;
|
|
3347
3454
|
nowMs?: number;
|
|
3348
3455
|
}): Promise<DrainReleaseResult>;
|
|
3456
|
+
private releaseDrainLocked;
|
|
3349
3457
|
/**
|
|
3350
3458
|
* Attach the parked Cashu token to a pending drain (`pending → parked`).
|
|
3351
3459
|
* A single-statement CAS on `status = 'pending'` — no credit lock needed;
|
|
@@ -3475,6 +3583,8 @@ interface CreditLedgerLike {
|
|
|
3475
3583
|
* would get `credit_not_found`, so advertising credit there misadvertises.
|
|
3476
3584
|
*/
|
|
3477
3585
|
readonly durable: boolean;
|
|
3586
|
+
/** Close-aware loss arithmetic, truthful refund evidence, atomic mutation, and transaction-aware loss reads. */
|
|
3587
|
+
readonly tempoCreditLossEvidenceVersion?: 1;
|
|
3478
3588
|
/**
|
|
3479
3589
|
* Bind the durable x402 settlement state spending is gated on.
|
|
3480
3590
|
*
|
|
@@ -3538,6 +3648,8 @@ interface CreditLedgerLike {
|
|
|
3538
3648
|
nowMs?: number;
|
|
3539
3649
|
}): Promise<DrawResult>;
|
|
3540
3650
|
growDraw(args: {
|
|
3651
|
+
spendExistingBalance?: boolean;
|
|
3652
|
+
hostingPaymentSeq?: number;
|
|
3541
3653
|
creditId: string;
|
|
3542
3654
|
drawId: string;
|
|
3543
3655
|
addAmountMicro: number;
|
|
@@ -3550,6 +3662,7 @@ interface CreditLedgerLike {
|
|
|
3550
3662
|
tx?: CreditLedgerQuerier;
|
|
3551
3663
|
nowMs?: number;
|
|
3552
3664
|
}): Promise<GrownDrawResult>;
|
|
3665
|
+
refundDraw(args: CreditDrawRefundArgs): Promise<CreditDrawRefundResult>;
|
|
3553
3666
|
settle(args: {
|
|
3554
3667
|
creditId: string;
|
|
3555
3668
|
drawId: string;
|
|
@@ -3681,7 +3794,8 @@ interface CreditLedgerLike {
|
|
|
3681
3794
|
terminalizeTempoCredits(evidence: TempoCreditLossEvidence, tx?: CreditLedgerQuerier): Promise<TempoCreditLoss[]>;
|
|
3682
3795
|
listTempoCreditLosses(args?: {
|
|
3683
3796
|
limit?: number;
|
|
3684
|
-
|
|
3797
|
+
channelId?: string;
|
|
3798
|
+
}, tx?: CreditLedgerQuerier): Promise<TempoCreditLoss[]>;
|
|
3685
3799
|
terminalizeX402Credit(evidence: X402CreditLossEvidence, tx?: CreditLedgerQuerier): Promise<X402CreditLoss[]>;
|
|
3686
3800
|
listX402CreditLosses(args?: {
|
|
3687
3801
|
limit?: number;
|
|
@@ -3710,6 +3824,7 @@ interface CreditLedgerLike {
|
|
|
3710
3824
|
createdBeforeMs: number;
|
|
3711
3825
|
rail: "tempo";
|
|
3712
3826
|
includeResolved?: boolean;
|
|
3827
|
+
includeWrittenOff?: boolean;
|
|
3713
3828
|
}): Promise<CreditDrainRecord[]>;
|
|
3714
3829
|
writeOffDrain(args: {
|
|
3715
3830
|
creditId: string;
|
|
@@ -3722,6 +3837,21 @@ interface CreditLedgerLike {
|
|
|
3722
3837
|
drainId: string;
|
|
3723
3838
|
tx?: CreditLedgerQuerier;
|
|
3724
3839
|
}): Promise<void>;
|
|
3840
|
+
decideTempoDrain?(args: TempoDrainDecisionArgs): Promise<TempoDrainDecisionResult>;
|
|
3841
|
+
recordTempoDrainPayment?(args: {
|
|
3842
|
+
creditId: string;
|
|
3843
|
+
drainId: string;
|
|
3844
|
+
}): Promise<void>;
|
|
3845
|
+
recordTempoDrainRefund?(args: {
|
|
3846
|
+
creditId: string;
|
|
3847
|
+
drainId: string;
|
|
3848
|
+
refundedNative: string | bigint;
|
|
3849
|
+
}): Promise<void>;
|
|
3850
|
+
recordTempoDrainHold?(args: {
|
|
3851
|
+
creditId: string;
|
|
3852
|
+
drainId: string;
|
|
3853
|
+
reason: TempoDrainHoldReason;
|
|
3854
|
+
}): Promise<void>;
|
|
3725
3855
|
requireTempoDrainExit?(args: {
|
|
3726
3856
|
creditId: string;
|
|
3727
3857
|
drainId: string;
|
|
@@ -3900,6 +4030,29 @@ interface DrainFulfilment {
|
|
|
3900
4030
|
/** Lightning routing the sending wallet reported, where it reported any. */
|
|
3901
4031
|
routingFeeMsats: number | null;
|
|
3902
4032
|
}
|
|
4033
|
+
/** Latest established refund-proof refusal; transient read failures do not replace it. */
|
|
4034
|
+
type TempoDrainHoldReason = "close_history_unmatched" | "collateral_missing" | "close_evidence_missing" | "refund_short";
|
|
4035
|
+
/** Immutable full-refund attestation or unpaid-release decision, independent of chain proof. */
|
|
4036
|
+
interface TempoDrainDecision {
|
|
4037
|
+
source: "operator";
|
|
4038
|
+
decision: "book_refunded" | "release";
|
|
4039
|
+
reason: string;
|
|
4040
|
+
evidence?: string;
|
|
4041
|
+
decidedAt: number;
|
|
4042
|
+
}
|
|
4043
|
+
interface TempoDrainDecisionArgs {
|
|
4044
|
+
creditId: string;
|
|
4045
|
+
drainId: string;
|
|
4046
|
+
decision: TempoDrainDecision["decision"];
|
|
4047
|
+
reason: string;
|
|
4048
|
+
evidence?: string;
|
|
4049
|
+
nowMs?: number;
|
|
4050
|
+
tx?: CreditLedgerQuerier;
|
|
4051
|
+
}
|
|
4052
|
+
interface TempoDrainDecisionResult extends DrainReleaseResult {
|
|
4053
|
+
/** Effective new-draw availability, including channel lifecycle and expiry restrictions. */
|
|
4054
|
+
spendableMicro: number;
|
|
4055
|
+
}
|
|
3903
4056
|
/**
|
|
3904
4057
|
* One drain liability, camel-cased, joined with its credit's `currency` and
|
|
3905
4058
|
* `callerPubkey` so consumers (route, admin surface, batch job) never need a
|
|
@@ -3983,6 +4136,12 @@ interface CreditDrainRecord {
|
|
|
3983
4136
|
*/
|
|
3984
4137
|
writeOffNote: string | null;
|
|
3985
4138
|
writtenOffAt: number | null;
|
|
4139
|
+
operatorDecision?: TempoDrainDecision | null;
|
|
4140
|
+
holdReason?: TempoDrainHoldReason | null;
|
|
4141
|
+
/** Exact retained refund evidence; null/absent means unknown, not zero. */
|
|
4142
|
+
provenRefundNative?: string | null;
|
|
4143
|
+
/** Sticky proof that some refund was paid; false/absent does not prove zero. */
|
|
4144
|
+
refundPaymentProven?: boolean;
|
|
3986
4145
|
}
|
|
3987
4146
|
/**
|
|
3988
4147
|
* Keyset cursor for {@link CreditLedger.listChannelDrains} — the last row of
|
|
@@ -4056,7 +4215,7 @@ interface CreditSnapshot {
|
|
|
4056
4215
|
expired: boolean;
|
|
4057
4216
|
status: CreditStatus;
|
|
4058
4217
|
/**
|
|
4059
|
-
* High-water sequence shared by draw placements and
|
|
4218
|
+
* High-water sequence shared by draw placements, drains, and completed-draw refunds.
|
|
4060
4219
|
*/
|
|
4061
4220
|
lastLedgerSeq: number;
|
|
4062
4221
|
createdAt: number;
|
|
@@ -4081,7 +4240,7 @@ interface DrawResult {
|
|
|
4081
4240
|
*/
|
|
4082
4241
|
balanceAfterMicro: number;
|
|
4083
4242
|
/**
|
|
4084
|
-
* Per-credit gap-free sequence shared with drains; growth keeps the original value.
|
|
4243
|
+
* Per-credit gap-free sequence shared with drains and refunds; growth keeps the original value.
|
|
4085
4244
|
*/
|
|
4086
4245
|
ledgerSeq: number;
|
|
4087
4246
|
status: DrawStatus;
|
|
@@ -4355,7 +4514,7 @@ interface BlockedInvoiceCursor {
|
|
|
4355
4514
|
creditId: string;
|
|
4356
4515
|
fundId: string;
|
|
4357
4516
|
}
|
|
4358
|
-
type CreditLedgerErrorCode = "credit_not_found" | "credit_expired" | "credit_unbacked" | "tempo_channel_closing" | "tempo_settlement_pending" | "settlement_pending" | "insufficient_credit" | "draw_conflict" | "draw_not_found" | "invalid_draw_state" | "funding_replayed" | "currency_mismatch" | "caller_mismatch" | "rail_mismatch" | "invalid_amount" | "invalid_expiry" | "invalid_basis" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "invalid_drain_state" | "invoice_not_found" | "invoice_conflict" | "invoice_not_blocked" | "below_rail_minimum";
|
|
4517
|
+
type CreditLedgerErrorCode = "credit_not_found" | "credit_expired" | "credit_unbacked" | "tempo_channel_closing" | "tempo_settlement_pending" | "settlement_pending" | "insufficient_credit" | "draw_conflict" | "invalid_refund" | "draw_not_completed" | "refund_conflict" | "refund_exceeds_draw" | "credit_not_open" | "credit_refund_channel_unsupported" | "credit_refund_basis_unavailable" | "credit_refund_state_unavailable" | "draw_not_found" | "invalid_draw_state" | "funding_replayed" | "currency_mismatch" | "caller_mismatch" | "rail_mismatch" | "invalid_amount" | "invalid_expiry" | "invalid_basis" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "invalid_drain_state" | "tempo_drain_close_pending" | "tempo_drain_refund_paid" | "tempo_drain_refund_unknown" | "invalid_drain_decision" | "drain_not_repairable" | "drain_decision_conflict" | "invoice_not_found" | "invoice_conflict" | "invoice_not_blocked" | "below_rail_minimum";
|
|
4359
4518
|
/**
|
|
4360
4519
|
* Structured drain_conflict reasons select caller instructions without matching prose. A
|
|
4361
4520
|
* refund_floor shortfall needs operator resolution, unlike duplicate payout; foreign_credit
|
|
@@ -6029,4 +6188,4 @@ declare class StepCache {
|
|
|
6029
6188
|
static deserialize(records: StepRecord[]): StepCache;
|
|
6030
6189
|
}
|
|
6031
6190
|
|
|
6032
|
-
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
|
|
6191
|
+
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 InvoiceSettlement 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 CreditLedgerQuerier as bL, type CreditDrainEnqueue as bM, HostedSettlementReportObligations as bN, type DVMAuthScheme as bO, type CreditLedgerLike as bP, type X402RefundSettlementGate as bQ, type CreditSnapshot as bR, type CreditDrawRefundArgs as bS, type CreditDrawRefundResult as bT, type DrawResult as bU, type X402SettlementStatus as bV, type X402UnresolvedRefund as bW, type GrownDrawResult as bX, type DrawResolution as bY, type FundingRecord as bZ, type CreditInvoiceRecord 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, retryHostedTempoCloseReport as c$, type BlockedInvoiceCursor as c0, type InvoiceReconciliation as c1, type InvoiceWriteOff as c2, type DrawRecord as c3, type StalePendingDrawCursor as c4, type TempoCreditLossEvidence as c5, type TempoCreditLoss as c6, type X402CreditLossEvidence as c7, type X402CreditLoss as c8, type DrainMethod as c9, type DrawRailValue as cA, type DrawStatus as cB, type HostedTempoCloseReportWriteOff as cC, type JobCostReportPayload as cD, type JobTerminalReportPayload as cE, PostgresX402ChannelStorage as cF, type ReplayStoreBackend as cG, type RevenueSkippedNoRailPayload as cH, type RevenueSkippedNoRailReason as cI, type Secp256k1AuthOpts as cJ, type TempoDrainDecision as cK, type TempoDrainDecisionArgs as cL, type TempoDrainDecisionResult as cM, type TempoDrainHoldReason as cN, type X402ChannelStorageOpts as cO, type X402RelayLockHolder as cP, type X402RelaySubmissionLock as cQ, X402RelaySubmissionLockError as cR, allocateDrawValue as cS, clientCompatibilityAttributes as cT, clientCompatibilityMiddleware as cU, clientUpgradeRequired as cV, parseClientCapabilities as cW, parseClientCompatibility as cX, parseDvmClient as cY, parseProtocolVersion as cZ, requireClientCompatibility as c_, type DrainRequestResult as ca, type BitcoinDepositLiability as cb, type CreditDrainRecord as cc, type ChannelDrainCursor as cd, type DrainWriteOff as ce, type DrainTransitionResult as cf, type DrainReleaseResult as cg, type DrainFulfilment as ch, HostingCleanupFence as ci, CLIENT_COMPATIBILITY_HEADERS as cj, type ClientCompatibility as ck, type ClientCompatibilityEnv as cl, type ClientCompatibilityGate as cm, type ClientCompatibilityRequirement as cn, type ClientSemVer as co, type CreditFundingBasis as cp, type CreditInvoiceStatus as cq, CreditLedger as cr, CreditLedgerError as cs, type CreditLedgerErrorCode as ct, type CreditLedgerErrorDetails as cu, type CreditLedgerPool as cv, type CreditStatus as cw, DRAIN_DELIVERY_RESERVE_SATS as cx, DVM_PROTOCOL_VERSION as cy, type DrainConflictReason as cz, type CanonicalEnvelope as d, secp256k1Auth as d0, signedRequestInput as d1, writeOffHostedTempoCloseReport as d2, type HostedIntent as d3, type X402SettlementIntent as d4, type HostedFundingReservation as d5, type X402SettlementCursor as d6, type X402SettlementWriteOff as d7, type X402FacilitatorAuth as d8, type X402BatchSettlementConfig as d9, type X402PayoutObserver as da, type CreditDepositEnqueue as db, type X402SettlementReconciliationReason as dc, type CreditDrawReleaseEnqueue as dd, 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-FFRTAQUW.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
5
|
import "./chunk-COYKJRMM.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-Z4FOPROB.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-NS2OMIU7.js";
|
|
5
5
|
import "./chunk-YG7G4DPZ.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-EP7OVWI5.js";
|
|
8
|
+
import "./chunk-Z4FOPROB.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-a1yRdmhI.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-DQqpwXa8.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-B8Ijr5V6.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-KJZVTWMX.js";
|
|
8
8
|
import {
|
|
9
9
|
JobCancelledError
|
|
10
10
|
} from "../chunk-AFV77S4C.js";
|
|
11
11
|
import {
|
|
12
12
|
createNoopLogger
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-7KQLPVV7.js";
|
|
14
14
|
import "../chunk-FUJ36YDV.js";
|
|
15
15
|
import "../chunk-BQJIFRAZ.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-D4FFS3IS.js";
|
|
17
17
|
import {
|
|
18
18
|
validateCurrency
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-LDKV4UHI.js";
|
|
20
|
+
import "../chunk-HNXMWHLU.js";
|
|
21
21
|
import "../chunk-66HGCPBU.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-Z4FOPROB.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-3YFFZLW7.js";
|
|
10
|
+
import "./chunk-E7ZBCT5U.js";
|
|
11
11
|
import {
|
|
12
12
|
X402_DEFAULT_FACILITATOR,
|
|
13
13
|
X402_DEFAULT_NETWORK,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
x402SupportedNetworksHint
|
|
38
38
|
} from "./chunk-BPYMEMQX.js";
|
|
39
39
|
import "./chunk-66HGCPBU.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-Z4FOPROB.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.12.0-rc.1",
|
|
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": [
|