@dvmkit/sdk 0.21.1 → 0.22.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.
Files changed (55) hide show
  1. package/dist/card-charge-journal-SKMBEPRM.js +44 -0
  2. package/dist/{chunk-ALTE7I6C.js → chunk-2WWVI32F.js} +56 -1
  3. package/dist/{chunk-C65P6MGZ.js → chunk-3DGIRHP2.js} +2 -2
  4. package/dist/{chunk-6RJAE332.js → chunk-5NMHZIIU.js} +1 -1
  5. package/dist/{chunk-34H4ZKBM.js → chunk-5YJWAJ4N.js} +1 -1
  6. package/dist/{chunk-2PN4DKZW.js → chunk-CUWSJQGT.js} +1 -1
  7. package/dist/{chunk-A6AOE63A.js → chunk-DLRPKEAM.js} +5 -1
  8. package/dist/{chunk-KRX7VNBG.js → chunk-DY5QIHJA.js} +1 -1
  9. package/dist/{chunk-RX6FT7XA.js → chunk-EHBUAJ5M.js} +1 -1
  10. package/dist/{chunk-7RWE6ELV.js → chunk-EQIP6TFD.js} +1 -1
  11. package/dist/{chunk-OTNHKRHA.js → chunk-GDZXGB43.js} +3 -3
  12. package/dist/{chunk-5RLNRLLB.js → chunk-HEH7YUGE.js} +1 -1
  13. package/dist/{chunk-DJRTYBEE.js → chunk-HVZIITWW.js} +27 -4
  14. package/dist/{chunk-MUMZPUYD.js → chunk-JINZMDNK.js} +1231 -85
  15. package/dist/{chunk-QTKGFG3I.js → chunk-JMTLK2SZ.js} +1 -1
  16. package/dist/{chunk-INYFUPXV.js → chunk-L35WYOH2.js} +1 -1
  17. package/dist/{chunk-MWDUGMN2.js → chunk-LCNRFKP7.js} +2 -2
  18. package/dist/{chunk-CVN2YNMG.js → chunk-QMKGYIBM.js} +1 -1
  19. package/dist/{chunk-I5MXADJS.js → chunk-SEIMPHIP.js} +225 -11
  20. package/dist/{chunk-QCZXKUS2.js → chunk-SQOVLAJ2.js} +1 -1
  21. package/dist/{chunk-72A4PHLD.js → chunk-UVRBD5GR.js} +1 -1
  22. package/dist/{chunk-5RGZN6WQ.js → chunk-XB644VN3.js} +1 -1
  23. package/dist/{chunk-CXRI4N4Y.js → chunk-YNHFJE6U.js} +1 -1
  24. package/dist/{chunk-LY2JYSJS.js → chunk-ZH5CLGO6.js} +1 -1
  25. package/dist/{content-retention-COnj0QKi.d.ts → content-retention-DEvY5vjM.d.ts} +1 -1
  26. package/dist/{credit-ledger-ZCJXJG6R.js → credit-ledger-S76KU53A.js} +11 -3
  27. package/dist/{credit-menu-DbjmA1vK.d.ts → credit-menu-BA2my6hE.d.ts} +229 -8
  28. package/dist/{fx-DfzQ0Lge.d.ts → fx-J5oXbv9A.d.ts} +1 -1
  29. package/dist/index.d.ts +5 -5
  30. package/dist/index.js +4 -4
  31. package/dist/internal/caller.d.ts +10 -9
  32. package/dist/internal/caller.js +11 -11
  33. package/dist/internal/server.d.ts +7 -7
  34. package/dist/internal/server.js +21 -21
  35. package/dist/{job-store-p45j28px.d.ts → job-store-CjPnf0dd.d.ts} +1 -1
  36. package/dist/{lightning-backend-DO7G7VqP.d.ts → lightning-backend-D9Q2KDS-.d.ts} +1 -1
  37. package/dist/{memory-credit-ledger-N4PZKTT5.js → memory-credit-ledger-5KXHOWB2.js} +4 -4
  38. package/dist/{mpp-setup-BLIYBORK.js → mpp-setup-3YZMURZL.js} +3 -3
  39. package/dist/{payout-reporter-5QAHCYIO.js → payout-reporter-KTLBNJJ7.js} +2 -2
  40. package/dist/{postgres-consumed-credential-store-4PCJEZBD.js → postgres-consumed-credential-store-Y336KNIB.js} +1 -1
  41. package/dist/{postgres-job-store-QKN5LGAH.js → postgres-job-store-ESEAN7JL.js} +2 -2
  42. package/dist/{postgres-replay-store-GH5AINQR.js → postgres-replay-store-6SVCZ475.js} +2 -2
  43. package/dist/{pricing-JJYLTTWK.js → pricing-RP5CGW6I.js} +3 -3
  44. package/dist/{revenue-reporter-6XARUEG6.js → revenue-reporter-FD3GDQZS.js} +2 -2
  45. package/dist/server/index.d.ts +20 -11
  46. package/dist/server/index.js +303 -30
  47. package/dist/{step-cache-CcCjpZm1.d.ts → step-cache-DXFftnAc.d.ts} +156 -13
  48. package/dist/{tempo-charge-store-A3CDF7D5.js → tempo-charge-store-SOIRMEFJ.js} +2 -2
  49. package/dist/{tempo-session-store-XJE6GIXN.js → tempo-session-store-UBDFFHDG.js} +3 -3
  50. package/dist/testing/index.d.ts +3 -3
  51. package/dist/testing/index.js +6 -6
  52. package/dist/{usd-BnAFcUai.d.ts → usd-Bc_rva_K.d.ts} +1 -1
  53. package/dist/{x402-XLFD43RF.js → x402-MFBRORHG.js} +5 -5
  54. package/package.json +1 -1
  55. package/dist/{chunk-NUDHO4HV.js → chunk-LABJSMSJ.js} +48 -48
@@ -1,11 +1,11 @@
1
- import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DO7G7VqP.js';
2
- import { cr as HostingCleanupFence, dc as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, dd as X402SettlementIntent, de as HostedFundingReservation, bT as CreditLedgerQuerier, df as X402SettlementCursor, c1 as X402SettlementStatus, dg as X402SettlementWriteOff, bY as X402RefundSettlementGate, dh as X402FacilitatorAuth, di as X402BatchSettlementConfig, cO as PostgresX402ChannelStorage, dj as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dk as CreditDepositEnqueue, dl as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cB as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dm as CreditDrawReleaseEnqueue, cM as JobCostReportPayload, cN as JobTerminalReportPayload, cQ as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cv as ClientCompatibilityGate, ct as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-CcCjpZm1.js';
1
+ import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-D9Q2KDS-.js';
2
+ import { cs as HostingCleanupFence, dd as HostedIntent, an as FundingMethod, q as PaymentMethod, bX as CreditLedgerLike, a9 as Message, V as UpfrontPayment, a3 as FundingReceipt, bZ as CreditSnapshot, a4 as JobReceipt, S as SDKJobContext, aB as StepCache, x as ResponseContent, P as PaymentContent, a5 as MessageType, bs as X402Receipt, aK as X402Config, br as X402ExactVersionSupport, ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, de as X402SettlementIntent, df as HostedFundingReservation, bT as CreditLedgerQuerier, dg as X402SettlementCursor, c1 as X402SettlementStatus, dh as X402SettlementWriteOff, bY as X402RefundSettlementGate, di as X402FacilitatorAuth, dj as X402BatchSettlementConfig, cP as PostgresX402ChannelStorage, dk as X402PayoutObserver, bV as HostedSettlementReportObligations, bv as CreditDepositPayload, bA as MppxServer, ai as CashuMode, dl as CreditDepositEnqueue, dm as X402SettlementReconciliationReason, au as PaymentRequirements, c5 as FundingRecord, a7 as MppxCredential, c0 as DrawResult, cC as CreditLedgerError, ab as ReceiptCredit, ak as DrainReceiptEvent, ac as DrainReceipt, a2 as DrawFundingReceipt, K as KVStore, E as SignedRequestAudience, dn as CreditDrawReleaseEnqueue, cN as JobCostReportPayload, cO as JobTerminalReportPayload, cR as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c7 as CreditInvoiceRecord, c8 as InvoiceSettlement, cw as ClientCompatibilityGate, cu as ClientCompatibility, bE as PostgresTempoSessionStore, bD as PayoutReporter, w as ResolvedCreditConfig, i as CreditView } from './step-cache-DXFftnAc.js';
3
3
  import { ProofLike, SerializedDLEQ, Proof } from '@cashu/cashu-ts';
4
4
  import { Hono, Context } from 'hono';
5
5
  import { Pool } from 'pg';
6
- import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-DfzQ0Lge.js';
6
+ import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-J5oXbv9A.js';
7
7
  import { Store, Challenge } from 'mppx';
8
- import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-p45j28px.js';
8
+ import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-CjPnf0dd.js';
9
9
  import { SettleResponse, SupportedResponse } from '@x402/core/types';
10
10
  import { Channel, AutoSettlementConfig } from '@x402/evm/batch-settlement/server';
11
11
  import { FacilitatorClient } from '@x402/core/server';
@@ -1005,7 +1005,7 @@ declare function fundingCommitment(artifact: string): string;
1005
1005
  * Deterministic credit id for an implicit N=1 funding — namespaced so a
1006
1006
  * caller-chosen explicit `credit_id` can never collide with it.
1007
1007
  */
1008
- declare function implicitCreditId(rail: "cashu" | "x402" | "tempo", paymentId: string): string;
1008
+ declare function implicitCreditId(rail: "cashu" | "x402" | "tempo" | "stripe", paymentId: string): string;
1009
1009
  /**
1010
1010
  * Whether a credit id sits in a namespace the server derives — which a caller
1011
1011
  * may **reference** but must never **create**.
@@ -1089,7 +1089,7 @@ interface ProcessedPaymentStore {
1089
1089
  withTx<T>(fn: (tx?: ProcessedPaymentQuerier) => Promise<T>): Promise<T>;
1090
1090
  }
1091
1091
  /** Rails that commit through the marker (Cashu commits via the accumulator). */
1092
- type ProcessedPaymentRail = "x402" | "tempo";
1092
+ type ProcessedPaymentRail = "x402" | "tempo" | "stripe";
1093
1093
  /** One recorded funding marker. */
1094
1094
  interface ProcessedPaymentRecord {
1095
1095
  dvmId: string;
@@ -1156,6 +1156,199 @@ declare class MemoryProcessedPaymentStore implements ProcessedPaymentStore {
1156
1156
  }): Promise<ProcessedPaymentRecord | undefined>;
1157
1157
  }
1158
1158
 
1159
+ /**
1160
+ * A durable note of every card charge this DVM attempts, written before Stripe is called.
1161
+ *
1162
+ * A charge that succeeds at Stripe but is never booked (the process dies before the ledger
1163
+ * commits, and the caller does not resend within the challenge's five minutes) leaves the
1164
+ * card charged with no credit behind it. Stripe tags the PaymentIntent with the challenge id
1165
+ * (`metadata.mpp_challenge_id`), but nothing in that metadata says which DVM charged it, and
1166
+ * several DVMs can share one Stripe account. This journal is what scopes recovery to this
1167
+ * DVM: the card-refund sweep looks up only the challenges recorded here.
1168
+ */
1169
+ interface CardChargeJournal {
1170
+ record(challengeId: string): Promise<void>;
1171
+ /** Unresolved attempts recorded at or before `olderThanMs`, oldest first. */
1172
+ listUnresolved(args: {
1173
+ olderThanMs: number;
1174
+ limit: number;
1175
+ }): Promise<CardChargeAttempt[]>;
1176
+ resolve(challengeId: string, outcome: string): Promise<void>;
1177
+ }
1178
+ interface CardChargeAttempt {
1179
+ challengeId: string;
1180
+ createdAt: number;
1181
+ }
1182
+
1183
+ /** What a refund needs to know about the charge behind one funding PaymentIntent. */
1184
+ interface StripeChargeFacts {
1185
+ paymentIntentId: string;
1186
+ status: string;
1187
+ /** What the PaymentIntent charged, in the charge currency's minor unit (cents). */
1188
+ amount: number;
1189
+ currency: string;
1190
+ /** Already refunded against the charge, in the charge currency's minor unit. */
1191
+ amountRefunded: number;
1192
+ disputed: boolean;
1193
+ /**
1194
+ * Stripe's processing fee as a share of the charge: `fee` over `amount` from the charge's
1195
+ * balance transaction, both in the settlement currency. Null while Stripe has not
1196
+ * written the balance transaction yet.
1197
+ */
1198
+ fee: {
1199
+ fee: number;
1200
+ settledAmount: number;
1201
+ } | null;
1202
+ }
1203
+ interface StripeRefund {
1204
+ id: string;
1205
+ status: string;
1206
+ amount: number;
1207
+ paymentIntentId: string | null;
1208
+ metadata: Record<string, string>;
1209
+ }
1210
+ interface StripeDispute {
1211
+ id: string;
1212
+ paymentIntentId: string | null;
1213
+ status: string;
1214
+ created: number;
1215
+ }
1216
+ interface StripePaymentIntentSummary {
1217
+ id: string;
1218
+ status: string;
1219
+ amount: number;
1220
+ currency: string;
1221
+ created: number;
1222
+ }
1223
+ interface StripeRefundApi {
1224
+ retrieveCharge(paymentIntentId: string): Promise<StripeChargeFacts>;
1225
+ listRefunds(paymentIntentId: string): Promise<StripeRefund[]>;
1226
+ createRefund(args: {
1227
+ paymentIntentId: string;
1228
+ amount: number;
1229
+ idempotencyKey: string;
1230
+ metadata: Record<string, string>;
1231
+ }): Promise<StripeRefund>;
1232
+ retrieveRefund(refundId: string): Promise<StripeRefund>;
1233
+ /** One page of disputes created at or after `createdGte` (unix seconds), newest first. */
1234
+ listDisputes(args: {
1235
+ createdGte: number;
1236
+ startingAfter?: string;
1237
+ }): Promise<{
1238
+ disputes: StripeDispute[];
1239
+ hasMore: boolean;
1240
+ }>;
1241
+ /** Every dispute on one PaymentIntent, however old (first page of 100; a charge has one). */
1242
+ listDisputesForPaymentIntent(paymentIntentId: string): Promise<{
1243
+ disputes: StripeDispute[];
1244
+ hasMore: boolean;
1245
+ }>;
1246
+ /** PaymentIntents whose `metadata[key]` equals `value`, via Stripe's search API. */
1247
+ searchPaymentIntentsByMetadata(key: string, value: string): Promise<StripePaymentIntentSummary[]>;
1248
+ }
1249
+
1250
+ /** The env vars that opt a DVM into card-funded credit. */
1251
+ interface StripeCreditConfig {
1252
+ /** Seller's Stripe secret key; the charge lands in this account. */
1253
+ secretKey: string;
1254
+ /** Seller's Stripe network profile id, echoed to the caller for its spend request. */
1255
+ networkId: string;
1256
+ /** MPP challenge-binding HMAC secret, shared with Tempo. */
1257
+ hmacSecret: string;
1258
+ }
1259
+ /** Stripe's own error classification: enums, never Stripe's free-text message. */
1260
+ interface StripeErrorCodes {
1261
+ type?: string;
1262
+ code?: string;
1263
+ declineCode?: string;
1264
+ }
1265
+ /** What one charge attempt established. */
1266
+ type StripeChargeOutcome = {
1267
+ ok: true;
1268
+ /** The PaymentIntent id: the funding's settlement reference and replay key. */
1269
+ paymentIntentId: string;
1270
+ /** Stripe answered from its idempotency cache: this credential was charged before. */
1271
+ replayed: boolean;
1272
+ } | {
1273
+ ok: false;
1274
+ /**
1275
+ * `invalid_credential`: refused before any Stripe call (binding, expiry, amount).
1276
+ * `declined`: Stripe refused the card; nothing was charged.
1277
+ * `requires_action`: the card needs an authentication step the agent cannot do.
1278
+ * `token_unusable`: Stripe rejected the token itself (already used, over its approved
1279
+ * limit, unknown); nothing was charged.
1280
+ * `mismatch`: Stripe reported a PaymentIntent whose amount or currency is not this
1281
+ * top-up's. It is not booked.
1282
+ * `indeterminate`: the charge may or may not exist.
1283
+ * `unavailable`: refused before any Stripe call because the charge attempt could not
1284
+ * be journaled; nothing was charged and the same credential can be resent.
1285
+ */
1286
+ reason: "unavailable" | "invalid_credential" | "declined" | "requires_action" | "token_unusable" | "mismatch" | "indeterminate";
1287
+ /**
1288
+ * A fixed description of the category. Never upstream text: Stripe's and mppx's
1289
+ * messages can quote the shared payment token, which is a bearer credential.
1290
+ */
1291
+ message: string;
1292
+ stripeError?: StripeErrorCodes;
1293
+ /**
1294
+ * A PaymentIntent Stripe reported on a failed or unconfirmed attempt. It is what a
1295
+ * later reconciliation of unbooked charges looks up.
1296
+ */
1297
+ paymentIntentId?: string;
1298
+ };
1299
+ /**
1300
+ * The card-credit rail. Separate from the Tempo MPP handle on purpose: no job
1301
+ * surface ever holds it, so `/v1/job` cannot issue or accept a stripe challenge.
1302
+ */
1303
+ interface StripeCreditRail {
1304
+ networkId: string;
1305
+ /** Issue a `method="stripe"` charge challenge for a top-up of `amountMicro` USD micro. */
1306
+ issueChallenge(args: {
1307
+ amountMicro: number;
1308
+ resourcePath: string;
1309
+ /** ISO timestamp; the upfront challenge window, shared with Tempo. */
1310
+ expires: string;
1311
+ }): Promise<Challenge.Challenge>;
1312
+ /** Verify the credential against this top-up and charge the token once. */
1313
+ charge(credential: string, args: {
1314
+ amountMicro: number;
1315
+ resourcePath: string;
1316
+ }): Promise<StripeChargeOutcome>;
1317
+ /** The same Stripe account's refund, dispute and lookup calls, for returning card credit. */
1318
+ refunds: StripeRefundApi;
1319
+ /** The charge-attempt journal the sweep reads to find charges that were never booked. */
1320
+ chargeJournal?: CardChargeJournal;
1321
+ }
1322
+ interface CreateStripeCreditRailOpts extends StripeCreditConfig {
1323
+ /**
1324
+ * The HMAC secret that was active before the last `DVMKIT_TEMPO_SECRET_KEY` rotation,
1325
+ * while its window is open. A credential bound under it is still verified, so a resend
1326
+ * across a redeploy can book the charge it made.
1327
+ */
1328
+ previousHmacSecret?: () => Promise<string | undefined>;
1329
+ /**
1330
+ * Where each charge attempt's challenge id is noted before Stripe is called, so a charge
1331
+ * that is never booked can be found and refunded. See {@link CardChargeJournal}.
1332
+ */
1333
+ chargeJournal?: CardChargeJournal;
1334
+ /** Stripe API origin. Tests point it at a local fake. */
1335
+ apiBase?: string;
1336
+ fetch?: typeof fetch;
1337
+ }
1338
+ /**
1339
+ * Build the card-credit rail on mppx's Stripe charge method.
1340
+ *
1341
+ * mppx owns the challenge, its HMAC binding, expiry, the amount check and the
1342
+ * PaymentIntent parameters (including the idempotency key
1343
+ * `mppx_<challengeId>_<spt>`). This module owns the HTTP call, for one reason:
1344
+ * mppx refuses a Stripe idempotent replay as "already processed", which would
1345
+ * leave a charge that succeeded before a crash permanently unbooked. Reporting
1346
+ * the replayed PaymentIntent as an ordinary success lets a retry of the same
1347
+ * credential book it; the ledger's processed-payment marker on the
1348
+ * PaymentIntent id is what stops a replay from booking twice.
1349
+ */
1350
+ declare function createStripeCreditRail(opts: CreateStripeCreditRailOpts): StripeCreditRail;
1351
+
1159
1352
  /**
1160
1353
  * Machine codes an accumulator-path receive can reject with. Named and exported
1161
1354
  * so the payment-error builder in `payment.ts` folds them into `PaymentErrorCode`
@@ -2410,7 +2603,7 @@ declare function verifyTempoSessionManagementCredential(args: {
2410
2603
  * here: the former is already complete, the latter is a challenge envelope, not
2411
2604
  * an error report.
2412
2605
  */
2413
- type PaymentErrorCode = "payment_invalid" | "x402_not_offered" | "payment_method_requires_signature" | "payment_authorization_too_short" | "x402_settlement_ambiguous" | "cashu_unavailable" | "cashu_not_p2pk_locked" | "mint_health_pending" | "cashu_mint_sick" | "payment_insufficient" | "payment_unapplied" | "insufficient_credit" | "credit_expired" | "credit_unbacked" | "credit_not_found" | "tempo_channel_closing" | "settlement_pending" | "draw_conflict" | "funding_commitment_mismatch" | "credit_not_supported" | "one_shot_credit_not_supported" | "credit_below_min" | "below_rail_minimum" | "credit_over_max" | "credit_id_unavailable" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "drain_method_unsupported" | "tempo_channel_exit_required" | "x402_settlement_submission_failed" | X402SettlementReconciliationReason | "lightning_settlement_pending" | "lightning_invoice_expired" | "lightning_unavailable" | AccumulatorRejectionCode;
2606
+ type PaymentErrorCode = "payment_invalid" | "x402_not_offered" | "payment_method_requires_signature" | "payment_authorization_too_short" | "x402_settlement_ambiguous" | "cashu_unavailable" | "cashu_not_p2pk_locked" | "mint_health_pending" | "cashu_mint_sick" | "payment_insufficient" | "payment_unapplied" | "insufficient_credit" | "credit_expired" | "credit_unbacked" | "credit_closed" | "credit_not_found" | "tempo_channel_closing" | "settlement_pending" | "draw_conflict" | "funding_commitment_mismatch" | "credit_not_supported" | "one_shot_credit_not_supported" | "credit_below_min" | "below_rail_minimum" | "credit_over_max" | "credit_id_unavailable" | "nothing_to_drain" | "drain_below_dust" | "drain_not_found" | "drain_conflict" | "drain_method_unsupported" | "tempo_channel_exit_required" | "x402_settlement_submission_failed" | X402SettlementReconciliationReason | "lightning_settlement_pending" | "lightning_invoice_expired" | "lightning_unavailable" | AccumulatorRejectionCode;
2414
2607
  /**
2415
2608
  * Per-code display, hint and retryability may be overridden for a particular
2416
2609
  * refusal. Keep the hint and retry decision consistent. Extra fields merge
@@ -4236,6 +4429,11 @@ interface DVMHostOpts {
4236
4429
  cashuMode?: CashuMode;
4237
4430
  /** MPP handle override. Defaults to env-resolved via `createMppFromOpts`. */
4238
4431
  mpp?: MppxServer;
4432
+ /**
4433
+ * Card-credit rail override. Defaults to env-resolved from `DVMKIT_STRIPE_SECRET_KEY` and
4434
+ * `DVMKIT_STRIPE_NETWORK_ID`, with `DVMKIT_TEMPO_SECRET_KEY` binding its challenges.
4435
+ */
4436
+ stripeCredit?: StripeCreditRail;
4239
4437
  /** x402 stablecoin payment configuration. Defaults to env-resolved. */
4240
4438
  x402?: X402Config;
4241
4439
  /** Payment methods override. Defaults to derived from configured rails. */
@@ -4518,6 +4716,11 @@ interface SDKServerOpts {
4518
4716
  x402FacilitatorHealth?: X402FacilitatorHealthLike;
4519
4717
  /** MPP multi-rail payment handle (built via `createMppFromOpts`). */
4520
4718
  mpp?: MppxServer;
4719
+ /**
4720
+ * Card-funded prepaid credit (built via `createStripeCreditRail`). Only `POST /v1/credit`
4721
+ * holds it, so no job surface can issue or accept a stripe challenge.
4722
+ */
4723
+ stripeCredit?: StripeCreditRail;
4521
4724
  /**
4522
4725
  * Tracks already-consumed upfront-flow MPP credentials so the same
4523
4726
  * credential can't satisfy `POST /v1/job` twice within its `expires`
@@ -4747,6 +4950,12 @@ interface AppEnv {
4747
4950
  */
4748
4951
  declare function unknownRouteNotFound(c: Context): Response;
4749
4952
 
4953
+ /**
4954
+ * Smallest card top-up, in USD micro-units. Stripe refuses a USD charge below
4955
+ * $0.50, so the funding menu never advertises a lower card floor whatever the
4956
+ * builder's `credit.min` says.
4957
+ */
4958
+ declare const STRIPE_CREDIT_MIN_MICRO = 500000;
4750
4959
  /**
4751
4960
  * Public, cacheable prepaid terms exclude caller IDs and balances. toCreditTerms explicitly
4752
4961
  * whitelists this shape so later caller-specific menu fields cannot leak into /v1/info.
@@ -4800,6 +5009,16 @@ interface CreditTerms {
4800
5009
  * make the advertised amount insufficient.
4801
5010
  */
4802
5011
  lightning_min_micro?: number;
5012
+ /**
5013
+ * Present with offered card funding. `network_id` is the seller's Stripe profile id, which
5014
+ * the caller's spend request names; the card is charged once, immediately, in `currency`.
5015
+ * `min_micro` is the card floor, never below Stripe's $0.50.
5016
+ */
5017
+ stripe?: {
5018
+ network_id: string;
5019
+ min_micro: number;
5020
+ currency: "usd";
5021
+ };
4803
5022
  }
4804
5023
  /**
4805
5024
  * Funding options and sizing in the wire denomination. max_micro limits residual balance,
@@ -4855,6 +5074,8 @@ interface BuildCreditMenuArgs {
4855
5074
  * current request-time rates.
4856
5075
  */
4857
5076
  lightningFundingMinSats?: number;
5077
+ /** Seller's Stripe network profile id when card credit is configured. */
5078
+ stripeNetworkId?: string;
4858
5079
  /**
4859
5080
  * Read the configured accepted mint list, not its health-filtered advertisement. Non-channel
4860
5081
  * Bitcoin refunds need a mint, but configuration alone does not establish refund solvency.
@@ -4901,4 +5122,4 @@ declare function attachCreditMenu(body: Record<string, unknown>, menu: CreditMen
4901
5122
  */
4902
5123
  declare function toCreditTerms(menu: CreditMenu): CreditTerms;
4903
5124
 
4904
- export { hashLockKey as $, type AccumulatorPool as A, activePubkeySet as B, type ConsumedCredentialStore as C, DEFAULT_LOCK_PUBKEY_GRACE_SECONDS as D, applyPaymentInfoToJob as E, type FiatDenomination as F, assertRevenueReporterReady as G, buildPaymentErrorResponse as H, type IncomingPaymentOpts as I, JobCancelledError as J, clearAccumulatorForDvm as K, type LockPubkeyStateLoader as L, MintHealthTracker as M, createDVMServer as N, creditDepositPayload as O, PAYMENT_PROOF_KEYS as P, derivedFundCreditId as Q, type ReporterBannerOpts as R, type SDKServerOpts as S, type TempoChannelReport as T, type UpfrontPaymentOpts as U, type VerifiedIncomingPayment as V, devModeSkipsPaymentVerification as W, type X402BatchChannelObservation as X, fromJobRecord as Y, fundedMicroFor as Z, hasPaymentProof as _, type AppEnv as a, type PlatformReporterOpts as a$, implicitCreditId as a0, initLockPubkeyTable as a1, initWalletAccumulatorTable as a2, insertAccumulatorRows as a3, isDerivedCreditId as a4, isTerminal as a5, isYieldMessage as a6, issueUpfrontChallenges as a7, loadLockPubkeyState as a8, msatsToFiatMicro as a9, type BuildCreditMenuArgs as aA, type BuilderIdentity as aB, CREDIT_ENVELOPE_KEYS as aC, type CreateX402BatchSettlementServerOpts as aD, type CreditEnvelope as aE, CreditEnvelopeError as aF, type CreditFundCommitment as aG, type CreditTerms as aH, DEFAULT_INVOICE_TTL_SECONDS as aI, type DVMHost as aJ, type HostingClosureCommand as aK, type HostingClosureEvidence as aL, type HostingControlCommand as aM, type HostingControlConfig as aN, type HostingControlStatus as aO, JobManager as aP, type JobManagerOpts as aQ, type LightningReceiveConfig as aR, MIN_INVOICE_TTL_SECONDS as aS, MemoryConsumedCredentialStore as aT, type MemoryConsumedCredentialStoreOpts as aU, MemoryProcessedPaymentStore as aV, MemoryX402ExactSettlementStore as aW, type MountOpts as aX, type OwnerDisplay as aY, type PaidJobCompletion as aZ, type PaymentMode as a_, paymentErrorBody as aa, pinAskFiat as ab, priceFiatMicro as ac, processIncomingPayment as ad, providerMessage as ae, pruneRetired as af, repairX402ExactSettlementEffect as ag, resolveFxSnapshot as ah, resolvePriceFiat as ai, revenueReporterBannerState as aj, rotateLockPubkey as ak, seedLockPubkeyState as al, toCreditTerms as am, toJobRecord as an, unknownRouteNotFound as ao, verifyIncomingPayment as ap, verifyTempoSessionManagementCredential as aq, verifyUpfrontPayment as ar, x402RequiredUsdcMicro as as, x402SettledShare as at, type CreditMenu as au, ReceiptIssuer as av, LightningReceive as aw, TempoSettlementReadiness as ax, type DVMHostOpts as ay, type DVMServeResult as az, type CreditFundingReport as b, PostgresProcessedPaymentStore as b0, PostgresX402ExactSettlementStore as b1, type PriceFiat as b2, type ProcessedPaymentQuerier as b3, type ProcessedPaymentRail as b4, type ProcessedPaymentRecord as b5, ProcessedPaymentReplayError as b6, type ProcessedPaymentStore as b7, type X402BatchAcceptance as b8, type X402BatchFunding as b9, drawSettlementRef as bA, extractCreditEnvelope as bB, fundingCommitment as bC, selectPrimaryCredit as bD, signHostingClosure as bE, signHostingControl as bF, stripCreditEnvelope as bG, toCreditView as bH, type X402BatchRefusal as ba, type X402BatchSettlementServer as bb, type X402ExactAcceptance as bc, X402ExactIntentConflictError as bd, type X402ExactSettlementAttempt as be, type X402ExactSettlementChainEvidence as bf, type X402ExactSettlementEffect as bg, X402ExactSettlementEvidenceMissingError as bh, type X402ExactSettlementEvidenceReader as bi, type X402ExactSettlementIntent as bj, X402ExactSettlementNotReadyError as bk, X402ExactSettlementServer as bl, type X402ExactSettlementServerOpts as bm, type X402ExactSettlementStatus as bn, type X402ExactSettlementStore as bo, type X402SettlementChainEvidence as bp, type X402SettlementEvidenceReader as bq, X402SettlementSubmissionError as br, X402_BATCH_AUTO_SETTLEMENT as bs, X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS as bt, X402_BATCH_SETTLEMENT_NETWORK as bu, attachCreditMenu as bv, buildCreditMenu as bw, createDVMHost as bx, createX402BatchSettlementServer as by, creditEnvelopeIgnoreFields as bz, type FiatDenominationFailure as c, type FundOnlyRequest as d, type LockPubkeyPool as e, type LockPubkeyState as f, type PaymentErrorCode as g, type PaymentErrorDetail as h, type PaymentInfo as i, PostgresTempoChargeStore as j, type ResolvedFx as k, type RevenueBootCheckOpts as l, type ServerJob as m, type ShortPayForfeit as n, type TempoObserverHealth as o, TempoSessionChannelMismatchError as p, type VerifyIncomingSnapshot as q, X402FacilitatorHealth as r, type X402SettlementEvidenceOutcome as s, type X402SettlementRepair as t, type X402SettlementRepairRefusal as u, type X402SettlementRepaired as v, type X402WedgedSettlement as w, type X402WedgedSettlementPage as x, X402_BATCH_SETTLEMENT_MAINNET_NETWORK as y, abortJob as z };
5125
+ export { hashLockKey as $, type AccumulatorPool as A, activePubkeySet as B, type ConsumedCredentialStore as C, DEFAULT_LOCK_PUBKEY_GRACE_SECONDS as D, applyPaymentInfoToJob as E, type FiatDenomination as F, assertRevenueReporterReady as G, buildPaymentErrorResponse as H, type IncomingPaymentOpts as I, JobCancelledError as J, clearAccumulatorForDvm as K, type LockPubkeyStateLoader as L, MintHealthTracker as M, createDVMServer as N, creditDepositPayload as O, PAYMENT_PROOF_KEYS as P, derivedFundCreditId as Q, type ReporterBannerOpts as R, type SDKServerOpts as S, type TempoChannelReport as T, type UpfrontPaymentOpts as U, type VerifiedIncomingPayment as V, devModeSkipsPaymentVerification as W, type X402BatchChannelObservation as X, fromJobRecord as Y, fundedMicroFor as Z, hasPaymentProof as _, type AppEnv as a, type MountOpts as a$, implicitCreditId as a0, initLockPubkeyTable as a1, initWalletAccumulatorTable as a2, insertAccumulatorRows as a3, isDerivedCreditId as a4, isTerminal as a5, isYieldMessage as a6, issueUpfrontChallenges as a7, loadLockPubkeyState as a8, msatsToFiatMicro as a9, type DVMServeResult as aA, type BuildCreditMenuArgs as aB, type BuilderIdentity as aC, CREDIT_ENVELOPE_KEYS as aD, type CardChargeAttempt as aE, type CardChargeJournal as aF, type CreateStripeCreditRailOpts as aG, type CreateX402BatchSettlementServerOpts as aH, type CreditEnvelope as aI, CreditEnvelopeError as aJ, type CreditFundCommitment as aK, type CreditTerms as aL, DEFAULT_INVOICE_TTL_SECONDS as aM, type DVMHost as aN, type HostingClosureCommand as aO, type HostingClosureEvidence as aP, type HostingControlCommand as aQ, type HostingControlConfig as aR, type HostingControlStatus as aS, JobManager as aT, type JobManagerOpts as aU, type LightningReceiveConfig as aV, MIN_INVOICE_TTL_SECONDS as aW, MemoryConsumedCredentialStore as aX, type MemoryConsumedCredentialStoreOpts as aY, MemoryProcessedPaymentStore as aZ, MemoryX402ExactSettlementStore as a_, paymentErrorBody as aa, pinAskFiat as ab, priceFiatMicro as ac, processIncomingPayment as ad, providerMessage as ae, pruneRetired as af, repairX402ExactSettlementEffect as ag, resolveFxSnapshot as ah, resolvePriceFiat as ai, revenueReporterBannerState as aj, rotateLockPubkey as ak, seedLockPubkeyState as al, toCreditTerms as am, toJobRecord as an, unknownRouteNotFound as ao, verifyIncomingPayment as ap, verifyTempoSessionManagementCredential as aq, verifyUpfrontPayment as ar, x402RequiredUsdcMicro as as, x402SettledShare as at, type CreditMenu as au, ReceiptIssuer as av, LightningReceive as aw, TempoSettlementReadiness as ax, type StripeCreditRail as ay, type DVMHostOpts as az, type CreditFundingReport as b, type OwnerDisplay as b0, type PaidJobCompletion as b1, type PaymentMode as b2, type PlatformReporterOpts as b3, PostgresProcessedPaymentStore as b4, PostgresX402ExactSettlementStore as b5, type PriceFiat as b6, type ProcessedPaymentQuerier as b7, type ProcessedPaymentRail as b8, type ProcessedPaymentRecord as b9, type X402ExactSettlementStatus as bA, type X402ExactSettlementStore as bB, type X402SettlementChainEvidence as bC, type X402SettlementEvidenceReader as bD, X402SettlementSubmissionError as bE, X402_BATCH_AUTO_SETTLEMENT as bF, X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS as bG, X402_BATCH_SETTLEMENT_NETWORK as bH, attachCreditMenu as bI, buildCreditMenu as bJ, createDVMHost as bK, createStripeCreditRail as bL, createX402BatchSettlementServer as bM, creditEnvelopeIgnoreFields as bN, drawSettlementRef as bO, extractCreditEnvelope as bP, fundingCommitment as bQ, selectPrimaryCredit as bR, signHostingClosure as bS, signHostingControl as bT, stripCreditEnvelope as bU, toCreditView as bV, ProcessedPaymentReplayError as ba, type ProcessedPaymentStore as bb, STRIPE_CREDIT_MIN_MICRO as bc, type StripeChargeFacts as bd, type StripeChargeOutcome as be, type StripeCreditConfig as bf, type StripeDispute as bg, type StripeErrorCodes as bh, type StripePaymentIntentSummary as bi, type StripeRefund as bj, type StripeRefundApi as bk, type X402BatchAcceptance as bl, type X402BatchFunding as bm, type X402BatchRefusal as bn, type X402BatchSettlementServer as bo, type X402ExactAcceptance as bp, X402ExactIntentConflictError as bq, type X402ExactSettlementAttempt as br, type X402ExactSettlementChainEvidence as bs, type X402ExactSettlementEffect as bt, X402ExactSettlementEvidenceMissingError as bu, type X402ExactSettlementEvidenceReader as bv, type X402ExactSettlementIntent as bw, X402ExactSettlementNotReadyError as bx, X402ExactSettlementServer as by, type X402ExactSettlementServerOpts as bz, type FiatDenominationFailure as c, type FundOnlyRequest as d, type LockPubkeyPool as e, type LockPubkeyState as f, type PaymentErrorCode as g, type PaymentErrorDetail as h, type PaymentInfo as i, PostgresTempoChargeStore as j, type ResolvedFx as k, type RevenueBootCheckOpts as l, type ServerJob as m, type ShortPayForfeit as n, type TempoObserverHealth as o, TempoSessionChannelMismatchError as p, type VerifyIncomingSnapshot as q, X402FacilitatorHealth as r, type X402SettlementEvidenceOutcome as s, type X402SettlementRepair as t, type X402SettlementRepairRefusal as u, type X402SettlementRepaired as v, type X402WedgedSettlement as w, type X402WedgedSettlementPage as x, X402_BATCH_SETTLEMENT_MAINNET_NETWORK as y, abortJob as z };
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-CcCjpZm1.js';
1
+ import { C as Currency } from './step-cache-DXFftnAc.js';
2
2
 
3
3
  /**
4
4
  * Quote-time FX snapshot. `rates` maps configured lowercase currency codes to
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-CcCjpZm1.js';
2
- export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ as validateCurrency } from './step-cache-CcCjpZm1.js';
3
- export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-DfzQ0Lge.js';
4
- export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-BnAFcUai.js';
5
- export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-p45j28px.js';
1
+ import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-DXFftnAc.js';
2
+ export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CashuConfig, g as CreateSignedRequestVerifierOpts, h as CreditConfig, i as CreditView, j as DEFAULT_CREDIT_MAX, k as DEFAULT_CREDIT_MIN, l as DEFAULT_CREDIT_TTL_SECONDS, m as DEFAULT_JOB_RETENTION_DAYS, n as DVMRouteContext, I as IncomingMessage, o as InputType, p as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, q as PaymentMethod, r as PriceValue, s as ProgressContent, t as PromptOpts, Q as QuoteConfig, u as QuoteContext, v as QuoteResult, R as ResolvedCashuConfig, w as ResolvedCreditConfig, x as ResponseContent, S as SDKJobContext, y as SDKPaymentRequestOpts, z as SIGNED_REQUEST_AUTH_ID, B as SIGNED_REQUEST_STATEMENT_VERSION, E as SignedRequestAudience, F as SignedRequestDomain, G as SignedRequestError, H as SignedRequestFailure, M as SignedRequestReplayStore, N as SignedRequestSignOpts, O as SignedRequestStatementHeader, T as SignedRequestVerifier, U as UnsupportedCurrencyError, V as UpfrontPayment, W as createSignedRequestVerifier, X as isZodSchema, Y as signedRequestStatementHeader, _ as validateCurrency } from './step-cache-DXFftnAc.js';
3
+ export { C as CreateFxFetcherOpts, D as DEFAULT_FX_CURRENCIES, a as DEFAULT_FX_RATE_SOURCE, F as FxFetcher, b as FxRateSnapshot, c as FxRateUnavailableError, d as FxSourceFailure, e as FxSourceFailureCategory, P as PlatformFxSource, f as createFxFetcher, g as fxRateFor, r as resolveFxSourceFromEnv } from './fx-J5oXbv9A.js';
4
+ export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-Bc_rva_K.js';
5
+ export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-CjPnf0dd.js';
6
6
  export { P as PinnedFetch, S as SSRFError, a as SSRFGuardOpts, b as SSRFReason, c as SSRFResolver, d as assertSafeUrl, e as createPinnedFetch } from './ssrf-dMooihtY.js';
7
7
  export { z } from 'zod';
8
8
  import 'hono';
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  SignedRequestError,
12
12
  createSignedRequestVerifier,
13
13
  resolveCashuConfig
14
- } from "./chunk-A6AOE63A.js";
14
+ } from "./chunk-DLRPKEAM.js";
15
15
  import {
16
16
  DEFAULT_CREDIT_MAX,
17
17
  DEFAULT_CREDIT_MIN,
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-SXL44PL5.js";
25
25
  import {
26
26
  buildUpfront
27
- } from "./chunk-RX6FT7XA.js";
27
+ } from "./chunk-EHBUAJ5M.js";
28
28
  import {
29
29
  DEFAULT_FX_CURRENCIES,
30
30
  DEFAULT_FX_RATE_SOURCE,
@@ -42,9 +42,9 @@ import {
42
42
  roundUsd,
43
43
  satsToFiat,
44
44
  validateCurrency
45
- } from "./chunk-72A4PHLD.js";
45
+ } from "./chunk-UVRBD5GR.js";
46
46
  import "./chunk-H3GGFEE5.js";
47
- import "./chunk-ALTE7I6C.js";
47
+ import "./chunk-2WWVI32F.js";
48
48
 
49
49
  // src/sdk/configure.ts
50
50
  function configureDVM(config) {
@@ -1,7 +1,7 @@
1
- import { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-CcCjpZm1.js';
2
- export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-CcCjpZm1.js';
3
- import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-DO7G7VqP.js';
4
- export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-DO7G7VqP.js';
1
+ import { $ as JsonValue, F as SignedRequestDomain, O as SignedRequestStatementHeader, a0 as X402_BATCH_SETTLEMENT_SCHEME, a1 as X402_EXACT_SCHEME, a2 as DrawFundingReceipt, a3 as FundingReceipt, a4 as JobReceipt$1, V as UpfrontPayment, a5 as MessageType, a6 as X402Version, a7 as MppxCredential, E as SignedRequestAudience, a8 as PaymentRequired, a9 as Message, aa as MppxChallenge, ab as ReceiptCredit, ac as DrainReceipt, C as Currency, ad as X402Wallet, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-DXFftnAc.js';
2
+ export { ag as BuildPaymentRequirementsOpts, ah as CapabilityDescriptor, ai as CashuMode, aj as CompleteContent, ak as DrainReceiptEvent, al as ExactEvmPayload, am as ExactEvmPayloadAuthorization, an as FundingMethod, ao as MessageFrom, ap as PaymentPayload, aq as PaymentPayloadV1, ar as PaymentPayloadV2, as as PaymentRequestContent, at as PaymentRequiredV2, au as PaymentRequirements, av as PromptContent, aw as RAIL_REFUNDABLE, ax as ReceiptOutcome, ay as ReceiptPayment, az as ResourceInfo, aA as SettleResponse, aB as StepCache, aC as StepRecord, aD as TextContent, aE as UnsignedDrainReceipt, aF as UnsignedDrawFundingReceipt, aG as UnsignedFundingReceipt, aH as UnsignedJobReceipt, aI as VerifyResponse, aJ as WorkingContent, aK as X402Config, aL as X402ResponseBody, aM as X402SelfRelayRpcFailureReason, aN as X402_DEFAULT_NETWORK, aO as X402_V1_VERSION, aP as X402_VERSION, aQ as buildPaymentRequiredV2, aR as buildPaymentRequirements, aS as caip2ToX402Network, aT as canonicalRequestPath, aU as canonicaliseForSigning, aV as canonicalize, aW as chainIdFromCaip2, aX as computeResultHash, aY as decodePayment, aZ as decodePaymentRequiredHeader, a_ as encodePayment, a$ as encodePaymentRequiredHeader, b0 as encodeSettleResponseHeader, b1 as exactEvmAuthorization, b2 as isArtifactMessage, b3 as isCancelMessage, b4 as isCompleteMessage, b5 as isDrainReceipt, b6 as isDrawFundingReceipt, b7 as isFundingReceipt, b8 as isPaymentRequestMessage, b9 as isPromptMessage, ba as isSignedJobReceipt, bb as isTextMessage, bc as isWorkingMessage, bd as paymentRequiredV2FromV1, be as signDrainReceipt, bf as signDrawFundingReceipt, bg as signFundingReceipt, bh as signReceipt, bi as usdcContractByCaip2, bj as usdcContractFor, bk as usdcDomainNameFor, bl as usdcDomainVersionFor, bm as verifyDrainReceipt, bn as verifyDrawFundingReceipt, bo as verifyFundingReceipt, bp as verifyReceipt, bq as x402NetworkToCaip2 } from '../step-cache-DXFftnAc.js';
3
+ import { L as LightningTransactionListOptions, a as LightningTransactionSnapshot, b as LightningBackend, c as LightningPayment, d as LightningWalletInfo, C as CreatedInvoice, I as InvoiceStatus } from '../lightning-backend-D9Q2KDS-.js';
4
+ export { A as AttestationPayload, B as BuilderIdentityKeypair, e as CheckMintHealthOptions, f as LockPubkey, M as MintAmountBounds, g as MintHealthCheckResult, h as amountBoundsVerdict, i as assertNutSupport, j as buildAttestation, k as canSwap, l as checkMintHealth, m as generateIdentity, n as hashCapabilities, o as loadIdentitySecret, p as meltAmountBounds, s as signAttestation, t as toLockPubkey, v as verifyAttestation, w as writeIdentity } from '../lightning-backend-D9Q2KDS-.js';
5
5
  import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
6
6
  export { g as getWallet } from '../wallet-Dwjs5n_M.js';
7
7
  import { SimplePool } from 'nostr-tools/pool';
@@ -9,8 +9,8 @@ import { Session } from 'mppx/tempo';
9
9
  import { Pool } from 'pg';
10
10
  import { PaymentRequired as PaymentRequired$1 } from '@x402/core/types';
11
11
  import { ClientChannelStorage, BatchSettlementClientContext, BatchSettlementEvmScheme } from '@x402/evm/batch-settlement/client';
12
- export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-DfzQ0Lge.js';
13
- export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-BnAFcUai.js';
12
+ export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-J5oXbv9A.js';
13
+ export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-Bc_rva_K.js';
14
14
  import 'hono';
15
15
  import 'mppx';
16
16
  import '@x402/core/server';
@@ -647,13 +647,14 @@ type X402CreditFlavour = typeof X402_BATCH_SETTLEMENT_SCHEME | typeof X402_EXACT
647
647
  * Rails accepted by caller funding selection and pin validation. Each rail's orchestration still
648
648
  * owns its availability and payment protocol.
649
649
  */
650
- declare const CREDIT_FUND_RAILS: readonly ["cashu", "lightning", "x402", "tempo"];
650
+ declare const CREDIT_FUND_RAILS: readonly ["cashu", "lightning", "x402", "tempo", "stripe"];
651
651
  type CreditFundRail = (typeof CREDIT_FUND_RAILS)[number];
652
652
  /**
653
653
  * Lightning invoices fund credit but do not provide a reclaim credential; reclaim uses the other
654
- * supported payout rails.
654
+ * supported payout rails. `stripe` refunds card-funded credit to the card, and is the only
655
+ * rail that credit drains on.
655
656
  */
656
- declare const CREDIT_DRAIN_RAILS: readonly ["cashu", "x402", "tempo"];
657
+ declare const CREDIT_DRAIN_RAILS: readonly ["cashu", "x402", "tempo", "stripe"];
657
658
  type CreditDrainRail = (typeof CREDIT_DRAIN_RAILS)[number];
658
659
  declare function isCreditFundRail(value: unknown): value is CreditFundRail;
659
660
  /**
@@ -4,7 +4,7 @@ import {
4
4
  getX402Balance,
5
5
  isValidEvmPrivateKey,
6
6
  resolveX402Asset
7
- } from "../chunk-5RGZN6WQ.js";
7
+ } from "../chunk-XB644VN3.js";
8
8
  import {
9
9
  CAPABILITY_NAME_RE
10
10
  } from "../chunk-A262WVYX.js";
@@ -32,7 +32,7 @@ import {
32
32
  sha256hex,
33
33
  validateX402Env,
34
34
  withNwcPool
35
- } from "../chunk-2PN4DKZW.js";
35
+ } from "../chunk-CUWSJQGT.js";
36
36
  import {
37
37
  MemoryKVStore
38
38
  } from "../chunk-SDK6KDJN.js";
@@ -134,7 +134,7 @@ import {
134
134
  withWalletLock,
135
135
  writeAgentMnemonic,
136
136
  writeIdentity
137
- } from "../chunk-7RWE6ELV.js";
137
+ } from "../chunk-EQIP6TFD.js";
138
138
  import {
139
139
  X402_BATCH_SETTLEMENT_SCHEME,
140
140
  X402_DEFAULT_FACILITATOR,
@@ -167,7 +167,7 @@ import {
167
167
  usdcDomainVersionFor,
168
168
  usdcToMsats,
169
169
  x402NetworkToCaip2
170
- } from "../chunk-NUDHO4HV.js";
170
+ } from "../chunk-LABJSMSJ.js";
171
171
  import {
172
172
  RAIL_REFUNDABLE,
173
173
  SIGNED_REQUEST_AUTH_ID,
@@ -178,7 +178,7 @@ import {
178
178
  import {
179
179
  createNoopLogger,
180
180
  createStdoutLogger
181
- } from "../chunk-QTKGFG3I.js";
181
+ } from "../chunk-JMTLK2SZ.js";
182
182
  import {
183
183
  redactUrl,
184
184
  redactUrlsInText
@@ -192,7 +192,7 @@ import {
192
192
  InvalidUsdPriceError,
193
193
  parseUsdPrice,
194
194
  warmFxSnapshot
195
- } from "../chunk-72A4PHLD.js";
195
+ } from "../chunk-UVRBD5GR.js";
196
196
  import {
197
197
  computeResultHash,
198
198
  isDrainReceipt,
@@ -211,7 +211,7 @@ import {
211
211
  import {
212
212
  applyRetryToPool,
213
213
  withInitRetry
214
- } from "../chunk-INYFUPXV.js";
214
+ } from "../chunk-L35WYOH2.js";
215
215
  import {
216
216
  DvmError,
217
217
  X402_NETWORKS,
@@ -238,7 +238,7 @@ import {
238
238
  randomTraceId,
239
239
  setEmitter,
240
240
  withTraceContext
241
- } from "../chunk-LY2JYSJS.js";
241
+ } from "../chunk-ZH5CLGO6.js";
242
242
  import "../chunk-66HGCPBU.js";
243
243
  import {
244
244
  DIAGNOSTIC_CATALOGUE_VERSION,
@@ -249,7 +249,7 @@ import {
249
249
  projectDiagnosticFields,
250
250
  projectEventName,
251
251
  projectSpanRow
252
- } from "../chunk-ALTE7I6C.js";
252
+ } from "../chunk-2WWVI32F.js";
253
253
 
254
254
  // src/lib/budget-core.ts
255
255
  function checkBudgetForLedger(ledger, opts) {
@@ -712,8 +712,8 @@ function randomNonce() {
712
712
  }
713
713
 
714
714
  // src/lib/credit-funding-contracts.ts
715
- var CREDIT_FUND_RAILS = ["cashu", "lightning", "x402", "tempo"];
716
- var CREDIT_DRAIN_RAILS = ["cashu", "x402", "tempo"];
715
+ var CREDIT_FUND_RAILS = ["cashu", "lightning", "x402", "tempo", "stripe"];
716
+ var CREDIT_DRAIN_RAILS = ["cashu", "x402", "tempo", "stripe"];
717
717
  function isCreditFundRail(value) {
718
718
  return typeof value === "string" && CREDIT_FUND_RAILS.includes(value);
719
719
  }
@@ -1,22 +1,22 @@
1
1
  import { FacilitatorConfig } from '@x402/core/server';
2
- import { ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, aK as X402Config, aA as SettleResponse, aI as VerifyResponse, br as X402ExactVersionSupport, bs as X402Receipt, bt as TransactionalPayoutHook, bu as CashuMeltCompleted } from '../step-cache-CcCjpZm1.js';
3
- export { bv as CreditDepositPayload, bw as CreditDrainPayload, bx as FundingLot, by as LotDebit, bz as LotDepletion, bA as MppxServer, bB as NON_CHANNEL_BITCOIN_RAILS, bC as NonChannelBitcoinRail, bD as PayoutReporter, bE as PostgresTempoSessionStore, bF as RevenueReporter, bG as SIGNED_ENVELOPE_FIELDS, bH as SIGNED_ENVELOPE_TYPES, bI as X402TrackedChannel, bJ as _testing, bK as createDefaultReplayStore, bL as depleteLots, bM as fifoOrder, bN as inKindDrawMsats, bO as isInKindDepletion, bP as isNonChannelBitcoinRail, bQ as lotOwedSats, bR as netOwedSats, bS as wrapMppx } from '../step-cache-CcCjpZm1.js';
2
+ import { ap as PaymentPayload, ae as PaymentRequirementsV1, af as PaymentRequirementsV2, aK as X402Config, aA as SettleResponse, aI as VerifyResponse, br as X402ExactVersionSupport, bs as X402Receipt, bt as TransactionalPayoutHook, bu as CashuMeltCompleted } from '../step-cache-DXFftnAc.js';
3
+ export { bv as CreditDepositPayload, bw as CreditDrainPayload, bx as FundingLot, by as LotDebit, bz as LotDepletion, bA as MppxServer, bB as NON_CHANNEL_BITCOIN_RAILS, bC as NonChannelBitcoinRail, bD as PayoutReporter, bE as PostgresTempoSessionStore, bF as RevenueReporter, bG as SIGNED_ENVELOPE_FIELDS, bH as SIGNED_ENVELOPE_TYPES, bI as X402TrackedChannel, bJ as _testing, bK as createDefaultReplayStore, bL as depleteLots, bM as fifoOrder, bN as inKindDrawMsats, bO as isInKindDepletion, bP as isNonChannelBitcoinRail, bQ as lotOwedSats, bR as netOwedSats, bS as wrapMppx } from '../step-cache-DXFftnAc.js';
4
4
  import { Hono } from 'hono';
5
5
  import { Env, BlankSchema } from 'hono/types';
6
6
  import { Pool } from 'pg';
7
7
  export { Pool } from 'pg';
8
8
  import { g as getWallet } from '../wallet-Dwjs5n_M.js';
9
- import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-DbjmA1vK.js';
10
- export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-DbjmA1vK.js';
11
- export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-p45j28px.js';
9
+ import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-BA2my6hE.js';
10
+ export { A as AccumulatorPool, a as AppEnv, b as CreditFundingReport, D as DEFAULT_LOCK_PUBKEY_GRACE_SECONDS, F as FiatDenomination, c as FiatDenominationFailure, d as FundOnlyRequest, I as IncomingPaymentOpts, J as JobCancelledError, e as LockPubkeyPool, f as LockPubkeyState, M as MintHealthTracker, P as PAYMENT_PROOF_KEYS, g as PaymentErrorCode, h as PaymentErrorDetail, i as PaymentInfo, j as PostgresTempoChargeStore, R as ReporterBannerOpts, k as ResolvedFx, l as RevenueBootCheckOpts, S as SDKServerOpts, m as ServerJob, n as ShortPayForfeit, T as TempoChannelReport, o as TempoObserverHealth, p as TempoSessionChannelMismatchError, U as UpfrontPaymentOpts, V as VerifiedIncomingPayment, q as VerifyIncomingSnapshot, X as X402BatchChannelObservation, r as X402FacilitatorHealth, s as X402SettlementEvidenceOutcome, t as X402SettlementRepair, u as X402SettlementRepairRefusal, v as X402SettlementRepaired, w as X402WedgedSettlement, x as X402WedgedSettlementPage, y as X402_BATCH_SETTLEMENT_MAINNET_NETWORK, z as abortJob, B as activePubkeySet, E as applyPaymentInfoToJob, G as assertRevenueReporterReady, H as buildPaymentErrorResponse, K as clearAccumulatorForDvm, N as createDVMServer, O as creditDepositPayload, Q as derivedFundCreditId, W as devModeSkipsPaymentVerification, Y as fromJobRecord, Z as fundedMicroFor, _ as hasPaymentProof, $ as hashLockKey, a0 as implicitCreditId, a1 as initLockPubkeyTable, a2 as initWalletAccumulatorTable, a3 as insertAccumulatorRows, a4 as isDerivedCreditId, a5 as isTerminal, a6 as isYieldMessage, a7 as issueUpfrontChallenges, a8 as loadLockPubkeyState, a9 as msatsToFiatMicro, aa as paymentErrorBody, ab as pinAskFiat, ac as priceFiatMicro, ad as processIncomingPayment, ae as providerMessage, af as pruneRetired, ag as repairX402ExactSettlementEffect, ah as resolveFxSnapshot, ai as resolvePriceFiat, aj as revenueReporterBannerState, ak as rotateLockPubkey, al as seedLockPubkeyState, am as toCreditTerms, an as toJobRecord, ao as unknownRouteNotFound, ap as verifyIncomingPayment, aq as verifyTempoSessionManagementCredential, ar as verifyUpfrontPayment, as as x402RequiredUsdcMicro, at as x402SettledShare } from '../credit-menu-BA2my6hE.js';
11
+ export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-CjPnf0dd.js';
12
12
  import { z } from 'zod';
13
- export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-DO7G7VqP.js';
13
+ export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-D9Q2KDS-.js';
14
14
  import 'mppx';
15
15
  import '@x402/evm/batch-settlement/server';
16
16
  import '@x402/core/types';
17
17
  import 'viem';
18
18
  import '@cashu/cashu-ts';
19
- import '../fx-DfzQ0Lge.js';
19
+ import '../fx-J5oXbv9A.js';
20
20
 
21
21
  declare function verifyWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<VerifyResponse>;
22
22
  declare function settleWithFacilitator(payload: PaymentPayload, requirements: PaymentRequirementsV1 | PaymentRequirementsV2, config?: Pick<X402Config, "facilitator" | "facilitatorAuth">, createAuthHeaders?: FacilitatorConfig["createAuthHeaders"] | undefined): Promise<SettleResponse>;