@dvmkit/sdk 0.7.0-rc.5 → 0.7.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -173,6 +173,35 @@ Three things worth knowing:
173
173
 
174
174
  The cost is yours, never the caller's: it is recorded separately from what the caller paid and is never netted against it. Both report shapes use the same durable outbox. Cost-only reports are keyed on the job id and revisioned, so retries and cross-machine updates converge on the latest cumulative value. With the Postgres job store, boot-time and periodic reconciliation enqueue any terminal cost revision that a process exited before reporting.
175
175
 
176
+ ## Rate cards
177
+
178
+ A priced capability can tell callers what it charges per unit, so an agent can explain the price before it asks for a quote. Declare `rates` next to `price` or `onQuote`, in the flat shape or on an entry in `capabilities`:
179
+
180
+ ```ts
181
+ capabilities: {
182
+ synthesise: {
183
+ onQuote: { schema, handler: quoteBySize },
184
+ rates: [
185
+ { label: "balanced", amount: "0.00015", currency: "USD", per: "character" },
186
+ { label: "expressive", amount: "0.00030", currency: "USD", per: "character" },
187
+ ],
188
+ onJob,
189
+ },
190
+ },
191
+ ```
192
+
193
+ `/v1/info` publishes the list as `capabilities.<name>.pricing.rates`, exactly as you wrote it: same order, same strings. A capability without `rates` publishes nothing extra. For a quoted capability the rates describe how your quote is computed; the SDK does not compute or check quotes against them, so keep the two in step yourself.
194
+
195
+ The server refuses to start, naming the capability and the entry, when a rate card breaks one of these limits:
196
+
197
+ - 1 to 5 entries, on a capability with `price` or `onQuote`. A free capability cannot declare rates.
198
+ - `amount` is decimal dollars as a string, above zero and at most 12 characters: `"0.00015"`, not `0.00015` or `"$0.00015"`.
199
+ - `currency` is `"USD"`.
200
+ - `per` names the unit (`"character"`, `"episode"`, `"GB per day stored"`) and `label`, which is optional, names a tier. Each is 1 to 24 characters with no leading or trailing spaces.
201
+ - No other keys.
202
+
203
+ The [portable fixture](./protocol-fixtures/capability-rates.json) carries the same limits and the accepted and refused examples, for clients that parse the field.
204
+
176
205
  ## Contributing
177
206
 
178
207
  **This repository does not accept unsolicited pull requests.** One opened without an invitation is closed automatically, with a pointer to where the report belongs.
@@ -7,6 +7,18 @@ import {
7
7
 
8
8
  // src/sdk/server/payout-reporter.ts
9
9
  import { createHash, randomUUID } from "crypto";
10
+ async function x402EarnedCeiling(channel, earnedNative) {
11
+ let earned;
12
+ try {
13
+ earned = await earnedNative(channel.channelId.toLowerCase());
14
+ } catch (error) {
15
+ return { kind: "unresolved", error };
16
+ }
17
+ if (earned === void 0) return { kind: "unbound" };
18
+ const charged = BigInt(channel.chargedCumulativeAmount);
19
+ const wanted = BigInt(earned);
20
+ return { kind: "ceiling", ceiling: wanted < charged ? wanted : charged };
21
+ }
10
22
  var MemoryX402BatchStore = class {
11
23
  batches = /* @__PURE__ */ new Map();
12
24
  get(scope) {
@@ -719,7 +731,8 @@ var PayoutReporter = class {
719
731
  }
720
732
  /**
721
733
  * x402: the open batch (claimed, not yet transferred) plus every channel's
722
- * unclaimed voucher value; wedged when the settle keeps failing, and the
734
+ * earned value not yet claimed — a channel whose earned figure cannot be
735
+ * read contributes nothing; wedged when the settle keeps failing, and the
723
736
  * refund settlements stuck between chain and ledger beside it.
724
737
  */
725
738
  async snapshotX402() {
@@ -751,12 +764,29 @@ var PayoutReporter = class {
751
764
  }
752
765
  const unclaimed = [];
753
766
  for (const channel of await ctx.storage.list()) {
754
- const owed = BigInt(channel.chargedCumulativeAmount) - BigInt(channel.totalClaimed);
767
+ const claimed = BigInt(channel.totalClaimed);
768
+ if (BigInt(channel.chargedCumulativeAmount) <= claimed) continue;
769
+ let resolved;
770
+ try {
771
+ resolved = await x402EarnedCeiling(channel, ctx.earnedNative);
772
+ } catch (err) {
773
+ resolved = { kind: "unresolved", error: err };
774
+ }
775
+ if (resolved.kind === "unresolved") {
776
+ warn("payout_pending_snapshot_failed", {
777
+ rail: "x402",
778
+ "channel.id": channel.channelId,
779
+ error: message(resolved.error)
780
+ });
781
+ continue;
782
+ }
783
+ if (resolved.kind === "unbound") continue;
784
+ const owed = resolved.ceiling - claimed;
755
785
  if (owed > 0n) {
756
786
  unclaimed.push({
757
787
  id: channel.channelId,
758
788
  native: Number(owed),
759
- label: "unclaimed vouchers"
789
+ label: "earned, awaiting claim"
760
790
  });
761
791
  }
762
792
  }
@@ -902,6 +932,7 @@ function warn(level, fields) {
902
932
  }
903
933
 
904
934
  export {
935
+ x402EarnedCeiling,
905
936
  MemoryX402BatchStore,
906
937
  PostgresX402BatchStore,
907
938
  PAYOUT_SNAPSHOT_INTERVAL_MS,
@@ -8,6 +8,9 @@ import {
8
8
  isTempoInsufficientFundsError,
9
9
  resolveTempoNetwork
10
10
  } from "./chunk-KYCLHWKO.js";
11
+ import {
12
+ x402EarnedCeiling
13
+ } from "./chunk-3VFEX2Y3.js";
11
14
  import {
12
15
  createX402FacilitatorAuthHeaders,
13
16
  createX402FacilitatorClient,
@@ -2078,6 +2081,7 @@ async function createX402BatchSettlementServer(opts) {
2078
2081
  payTo: opts.payTo,
2079
2082
  network: opts.network,
2080
2083
  storage,
2084
+ earnedNative: opts.earnedNative,
2081
2085
  settleIntervalMs: (settlementConfig.settleIntervalSecs ?? X402_BATCH_AUTO_SETTLEMENT.settleIntervalSecs ?? 300) * 1e3,
2082
2086
  ...postgres ? { listWedgedRefunds: () => listWedgedRefunds(postgres) } : {}
2083
2087
  });
@@ -2832,22 +2836,19 @@ function claimCeilingSelector(earnedNative) {
2832
2836
  const charged = BigInt(channel.chargedCumulativeAmount);
2833
2837
  const claimed = BigInt(channel.totalClaimed);
2834
2838
  if (charged <= claimed) continue;
2835
- let earned;
2836
- try {
2837
- earned = await earnedNative(channel.channelId.toLowerCase());
2838
- } catch (error) {
2839
+ const resolved = await x402EarnedCeiling(channel, earnedNative);
2840
+ if (resolved.kind === "unresolved") {
2839
2841
  loggers.x402.warn("x402_claim_ceiling_unresolved", {
2840
2842
  "channel.id": channel.channelId,
2841
- error: error instanceof Error ? error.message : String(error)
2843
+ error: resolved.error instanceof Error ? resolved.error.message : String(resolved.error)
2842
2844
  });
2843
2845
  continue;
2844
2846
  }
2845
- if (earned === void 0) {
2847
+ if (resolved.kind === "unbound") {
2846
2848
  loggers.x402.warn("x402_claim_ceiling_unbound", { "channel.id": channel.channelId });
2847
2849
  continue;
2848
2850
  }
2849
- const wanted = BigInt(earned);
2850
- const ceiling = wanted < charged ? wanted : charged;
2851
+ const { ceiling } = resolved;
2851
2852
  if (ceiling <= claimed) continue;
2852
2853
  selected.push({ ...channel, chargedCumulativeAmount: ceiling.toString() });
2853
2854
  }
@@ -19543,7 +19544,7 @@ async function createDVMServer(descriptor, opts) {
19543
19544
  revenueReporter = reporter;
19544
19545
  await reporter.init();
19545
19546
  reporter.startRetryLoop();
19546
- const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-KOGHXJH4.js");
19547
+ const { MemoryX402BatchStore, PayoutReporter } = await import("./payout-reporter-3UVWPGMO.js");
19547
19548
  payoutReporter = new PayoutReporter({
19548
19549
  dvmId,
19549
19550
  db: opts.db,
@@ -19828,6 +19829,7 @@ var DVMServer = class {
19828
19829
  `createDVMServer: this DVM prices in ${JSON.stringify(this.pricingCurrency)} (DVMConfig.currency) but its fx fetcher only quotes [${fxCurrencies.join(", ")}]. Wire a fetcher that carries it \u2014 createFxFetcher({ currencies: [..., ${JSON.stringify(this.pricingCurrency)}] }) \u2014 or price in one of the above.`
19829
19830
  );
19830
19831
  }
19832
+ assertCapabilityRates(descriptor.capabilities);
19831
19833
  if (opts.mintHealthTracker) {
19832
19834
  this.mintHealthTracker = opts.mintHealthTracker;
19833
19835
  this.ownsMintHealthTracker = false;
@@ -20940,17 +20942,20 @@ var DVMServer = class {
20940
20942
  entry.input_schema = toJSONSchema(cap.input, { io: "input" });
20941
20943
  }
20942
20944
  if (cap.example !== void 0) entry.example = cap.example;
20945
+ let pricing;
20943
20946
  if (cap.onQuote?.schema) {
20944
20947
  const qs = cap.onQuote.schema;
20945
- entry.pricing = {
20948
+ pricing = {
20946
20949
  quote: {
20947
20950
  schema: isZodSchema(qs) ? toJSONSchema(qs, { io: "input" }) : qs
20948
20951
  }
20949
20952
  };
20950
20953
  } else {
20951
20954
  const max = this.jobManager.currentPricingMax(name);
20952
- if (max) entry.pricing = { max };
20955
+ if (max) pricing = { max };
20953
20956
  }
20957
+ if (cap.rates) pricing = { ...pricing, rates: cap.rates };
20958
+ if (pricing) entry.pricing = pricing;
20954
20959
  out[name] = entry;
20955
20960
  }
20956
20961
  return out;
@@ -22747,6 +22752,55 @@ function validateMessageContent(type, content, devMode) {
22747
22752
  }
22748
22753
  return null;
22749
22754
  }
22755
+ var MAX_RATES = 5;
22756
+ var MAX_RATE_AMOUNT_LENGTH = 12;
22757
+ var MAX_RATE_TEXT_LENGTH = 24;
22758
+ var RATE_AMOUNT_RE = /^\d+(\.\d+)?$/;
22759
+ var RATE_KEYS = /* @__PURE__ */ new Set(["label", "amount", "currency", "per"]);
22760
+ function assertCapabilityRates(capabilities) {
22761
+ for (const [name, cap] of Object.entries(capabilities)) {
22762
+ if (cap.rates === void 0) continue;
22763
+ const refuse = (detail) => {
22764
+ throw new Error(`createDVMServer: capability ${JSON.stringify(name)}: ${detail}`);
22765
+ };
22766
+ const rates = cap.rates;
22767
+ if (!Array.isArray(rates) || rates.length === 0 || rates.length > MAX_RATES) {
22768
+ refuse(`rates must be an array of 1 to ${MAX_RATES} entries`);
22769
+ }
22770
+ if (cap.price === void 0 && cap.onQuote === void 0) {
22771
+ refuse("rates is declared on a free capability; set `price` or `onQuote`, or remove `rates`");
22772
+ }
22773
+ rates.forEach((rate, i) => {
22774
+ const at = `rates[${i}]`;
22775
+ if (typeof rate !== "object" || rate === null || Array.isArray(rate)) {
22776
+ refuse(`${at} must be an object with amount, currency and per`);
22777
+ }
22778
+ const entry = rate;
22779
+ for (const key of Object.keys(entry)) {
22780
+ if (!RATE_KEYS.has(key)) refuse(`${at}.${key} is not a rate field (label, amount, currency, per)`);
22781
+ }
22782
+ const amount = entry.amount;
22783
+ if (typeof amount !== "string" || amount.length > MAX_RATE_AMOUNT_LENGTH || !RATE_AMOUNT_RE.test(amount) || // Above zero without parsing to a float: some digit is non-zero.
22784
+ !/[1-9]/.test(amount)) {
22785
+ refuse(
22786
+ `${at}.amount must be a decimal dollar string above zero of at most ${MAX_RATE_AMOUNT_LENGTH} characters, like "0.00015" (got ${JSON.stringify(amount)})`
22787
+ );
22788
+ }
22789
+ if (entry.currency !== "USD") {
22790
+ refuse(`${at}.currency must be "USD" (got ${JSON.stringify(entry.currency)})`);
22791
+ }
22792
+ assertRateText(entry.per, `${at}.per`, refuse);
22793
+ if (entry.label !== void 0) assertRateText(entry.label, `${at}.label`, refuse);
22794
+ });
22795
+ }
22796
+ }
22797
+ function assertRateText(value, field, refuse) {
22798
+ if (typeof value !== "string" || value.length === 0 || value.length > MAX_RATE_TEXT_LENGTH || value.trim() !== value) {
22799
+ refuse(
22800
+ `${field} must be a string of 1 to ${MAX_RATE_TEXT_LENGTH} characters with no leading or trailing whitespace (got ${JSON.stringify(value)})`
22801
+ );
22802
+ }
22803
+ }
22750
22804
 
22751
22805
  // src/sdk/server/tempo-observer-health.ts
22752
22806
  var TEMPO_OBSERVER_HEALTH_REFRESH_TTL_MS = 60 * 1e3;
@@ -1,4 +1,4 @@
1
- import { b as JobStore, J as JobRecord } from './job-store-BtdD_xt1.js';
1
+ import { b as JobStore, J as JobRecord } from './job-store-DjgN2AOk.js';
2
2
 
3
3
  /** Authenticated caller metadata; omitted fields on older services mean unknown. */
4
4
  interface JobContentMetadata {
@@ -1,11 +1,11 @@
1
- import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-BYTODXJ2.js';
2
- import { cf as HostingCleanupFence, cV as HostedIntent, ai as FundingMethod, o as PaymentMethod, bN as CreditLedgerLike, a4 as Message, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, S as SDKJobContext, aw as StepCache, u as ResponseContent, P as PaymentContent, a0 as MessageType, bj as X402Receipt, aE as X402Config, bi as X402ExactVersionSupport, cW as X402SettlementIntent, aa as PaymentRequirementsV2, cX as HostedFundingReservation, c2 as CreditLedgerQuerier, cY as X402SettlementCursor, bR as X402SettlementStatus, cZ as X402SettlementWriteOff, bO as X402RefundSettlementGate, c_ as X402FacilitatorAuth, c$ as X402BatchSettlementConfig, cB as PostgresX402ChannelStorage, d0 as X402PayoutObserver, bL as HostedSettlementReportObligations, bm as CreditDepositPayload, br as MppxServer, ad as CashuMode, d1 as CreditDepositEnqueue, d2 as X402SettlementReconciliationReason, ap as PaymentRequirements, a2 as MppxCredential, bQ as DrawResult, cp as CreditLedgerError, a6 as ReceiptCredit, af as DrainReceiptEvent, a7 as DrainReceipt, K as KVStore, y as SignedRequestAudience, d3 as CreditDrawReleaseEnqueue, cz as JobCostReportPayload, cA as JobTerminalReportPayload, cD as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, bW as CreditInvoiceRecord, bX as InvoiceSettlement, cj as ClientCompatibilityGate, ch as ClientCompatibility, bv as PostgresTempoSessionStore, bu as PayoutReporter, R as ResolvedCreditConfig, g as CreditView } from './step-cache-C6lMgDH8.js';
1
+ import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DeasHNOP.js';
2
+ import { cg as HostingCleanupFence, cW as HostedIntent, aj as FundingMethod, p as PaymentMethod, bO as CreditLedgerLike, a5 as Message, $ as FundingReceipt, bQ as CreditSnapshot, a0 as JobReceipt, S as SDKJobContext, ax as StepCache, v as ResponseContent, P as PaymentContent, a1 as MessageType, bk as X402Receipt, aF as X402Config, bj as X402ExactVersionSupport, cX as X402SettlementIntent, ab as PaymentRequirementsV2, cY as HostedFundingReservation, c3 as CreditLedgerQuerier, cZ as X402SettlementCursor, bS as X402SettlementStatus, c_ as X402SettlementWriteOff, bP as X402RefundSettlementGate, c$ as X402FacilitatorAuth, d0 as X402BatchSettlementConfig, cC as PostgresX402ChannelStorage, d1 as X402PayoutObserver, bM as HostedSettlementReportObligations, bn as CreditDepositPayload, bs as MppxServer, ae as CashuMode, d2 as CreditDepositEnqueue, d3 as X402SettlementReconciliationReason, aq as PaymentRequirements, a3 as MppxCredential, bR as DrawResult, cq as CreditLedgerError, a7 as ReceiptCredit, ag as DrainReceiptEvent, a8 as DrainReceipt, K as KVStore, z as SignedRequestAudience, d4 as CreditDrawReleaseEnqueue, cA as JobCostReportPayload, cB as JobTerminalReportPayload, cE as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, bX as CreditInvoiceRecord, bY as InvoiceSettlement, ck as ClientCompatibilityGate, ci as ClientCompatibility, bw as PostgresTempoSessionStore, bv as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-C9JRSFhM.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-Cin14QvX.js';
6
+ import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-BvG2Wnjk.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-BtdD_xt1.js';
8
+ import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-DjgN2AOk.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';
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-C6lMgDH8.js';
1
+ import { C as Currency } from './step-cache-C9JRSFhM.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-C6lMgDH8.js';
2
- export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CreateSignedRequestVerifierOpts, f as CreditConfig, g as CreditView, h as DEFAULT_CREDIT_MAX, i as DEFAULT_CREDIT_MIN, j as DEFAULT_CREDIT_TTL_SECONDS, k as DEFAULT_JOB_RETENTION_DAYS, l as DVMRouteContext, I as IncomingMessage, m as InputType, n as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, o as PaymentMethod, p as PriceValue, q as ProgressContent, r as PromptOpts, Q as QuoteConfig, s as QuoteContext, t as QuoteResult, R as ResolvedCreditConfig, u as ResponseContent, S as SDKJobContext, v as SDKPaymentRequestOpts, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, y as SignedRequestAudience, z as SignedRequestDomain, B as SignedRequestError, E as SignedRequestFailure, F as SignedRequestReplayStore, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, U as UnsupportedCurrencyError, N as createSignedRequestVerifier, O as isZodSchema, T as signedRequestStatementHeader, V as validateCurrency } from './step-cache-C6lMgDH8.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-Cin14QvX.js';
4
- export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-5v1FQ7Mn.js';
5
- export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-BtdD_xt1.js';
1
+ import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-C9JRSFhM.js';
2
+ export { A as ApprovalContent, b as ArtifactContent, c as CancelContent, d as CanonicalEnvelope, e as CapabilityRate, f as CreateSignedRequestVerifierOpts, g as CreditConfig, h as CreditView, i as DEFAULT_CREDIT_MAX, j as DEFAULT_CREDIT_MIN, k as DEFAULT_CREDIT_TTL_SECONDS, l as DEFAULT_JOB_RETENTION_DAYS, m as DVMRouteContext, I as IncomingMessage, n as InputType, o as InvalidCurrencyError, J as JobCost, K as KVStore, L as Logger, P as PaymentContent, p as PaymentMethod, q as PriceValue, r as ProgressContent, s as PromptOpts, Q as QuoteConfig, t as QuoteContext, u as QuoteResult, R as ResolvedCreditConfig, v as ResponseContent, S as SDKJobContext, w as SDKPaymentRequestOpts, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, z as SignedRequestAudience, B as SignedRequestDomain, E as SignedRequestError, F as SignedRequestFailure, G as SignedRequestReplayStore, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, U as UnsupportedCurrencyError, O as createSignedRequestVerifier, T as isZodSchema, V as signedRequestStatementHeader, W as validateCurrency } from './step-cache-C9JRSFhM.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-BvG2Wnjk.js';
4
+ export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-DXDkHn_8.js';
5
+ export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-DjgN2AOk.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
@@ -173,6 +173,7 @@ function buildCapabilityMap(config, currency) {
173
173
  state: config.state ?? {},
174
174
  price: config.price,
175
175
  onQuote: config.onQuote,
176
+ rates: snapshotRates(config.rates),
176
177
  onJob: config.onJob,
177
178
  onResponse: config.onResponse,
178
179
  onPayment: config.onPayment,
@@ -208,6 +209,7 @@ function buildExplicitCapabilities(capabilities, currency) {
208
209
  state: cap.state !== void 0 ? structuredClone(cap.state) : {},
209
210
  price: cap.price,
210
211
  onQuote: cap.onQuote,
212
+ rates: snapshotRates(cap.rates),
211
213
  onJob: cap.onJob,
212
214
  onResponse: cap.onResponse,
213
215
  onPayment: cap.onPayment,
@@ -220,7 +222,7 @@ function buildExplicitCapabilities(capabilities, currency) {
220
222
  return out;
221
223
  }
222
224
  function flatPerCapFieldsSet(config) {
223
- return config.input !== void 0 || config.example !== void 0 || config.state !== void 0 || config.price !== void 0 || config.onQuote !== void 0 || typeof config.onResponse === "function" || typeof config.onPayment === "function" || typeof config.onApproval === "function" || typeof config.onCancel === "function" || typeof config.onMessage === "function";
225
+ return config.input !== void 0 || config.example !== void 0 || config.state !== void 0 || config.price !== void 0 || config.onQuote !== void 0 || config.rates !== void 0 || typeof config.onResponse === "function" || typeof config.onPayment === "function" || typeof config.onApproval === "function" || typeof config.onCancel === "function" || typeof config.onMessage === "function";
224
226
  }
225
227
  function validateExampleAgainstInput(capName, input, example) {
226
228
  if (example === void 0) return;
@@ -264,6 +266,16 @@ function singleCapabilityEntry(capabilities) {
264
266
  if (keys.length !== 1) return void 0;
265
267
  return capabilities[keys[0]];
266
268
  }
269
+ function snapshotRates(rates) {
270
+ if (rates === void 0) return void 0;
271
+ const copy = structuredClone(rates);
272
+ if (Array.isArray(copy)) {
273
+ for (const entry of copy) {
274
+ if (typeof entry === "object" && entry !== null) Object.freeze(entry);
275
+ }
276
+ }
277
+ return Object.freeze(copy);
278
+ }
267
279
 
268
280
  // src/sdk/heartbeat.ts
269
281
  async function withProgressHeartbeat(opts, fn) {
@@ -1,16 +1,16 @@
1
- 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-BYTODXJ2.js';
2
- 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-BYTODXJ2.js';
1
+ 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-DeasHNOP.js';
2
+ 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-DeasHNOP.js';
3
3
  import { ProofLike, MeltQuoteBolt11Response, Proof, Wallet, MintQuoteBolt11Response, MintPreview, CounterSource, CounterRange, SerializedDLEQ, OutputData, OutputDataLike } from '@cashu/cashu-ts';
4
4
  export { g as getWallet } from '../wallet-Dwjs5n_M.js';
5
- import { W as JsonValue, z as SignedRequestDomain, H as SignedRequestStatementHeader, X as X402_BATCH_SETTLEMENT_SCHEME, Y as X402_EXACT_SCHEME, _ as FundingReceipt, $ as JobReceipt$1, a0 as MessageType, a1 as X402Version, a2 as MppxCredential, y as SignedRequestAudience, a3 as PaymentRequired, a4 as Message, a5 as MppxChallenge, a6 as ReceiptCredit, a7 as DrainReceipt, C as Currency, a8 as X402Wallet, a9 as PaymentRequirementsV1, aa as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-C6lMgDH8.js';
6
- export { ab as BuildPaymentRequirementsOpts, ac as CapabilityDescriptor, ad as CashuMode, ae as CompleteContent, af as DrainReceiptEvent, ag as ExactEvmPayload, ah as ExactEvmPayloadAuthorization, ai as FundingMethod, aj as MessageFrom, ak as PaymentPayload, al as PaymentPayloadV1, am as PaymentPayloadV2, an as PaymentRequestContent, ao as PaymentRequiredV2, ap as PaymentRequirements, aq as PromptContent, ar as RAIL_REFUNDABLE, as as ReceiptOutcome, at as ReceiptPayment, au as ResourceInfo, av as SettleResponse, aw as StepCache, ax as StepRecord, ay as TextContent, az as UnsignedDrainReceipt, aA as UnsignedFundingReceipt, aB as UnsignedJobReceipt, aC as VerifyResponse, aD as WorkingContent, aE as X402Config, aF as X402ResponseBody, aG as X402SelfRelayRpcFailureReason, aH as X402_DEFAULT_NETWORK, aI as X402_V1_VERSION, aJ as X402_VERSION, aK as buildPaymentRequiredV2, aL as buildPaymentRequirements, aM as caip2ToX402Network, aN as canonicalRequestPath, aO as canonicaliseForSigning, aP as canonicalize, aQ as chainIdFromCaip2, aR as computeResultHash, aS as decodePayment, aT as decodePaymentRequiredHeader, aU as encodePayment, aV as encodePaymentRequiredHeader, aW as encodeSettleResponseHeader, aX as exactEvmAuthorization, aY as isArtifactMessage, aZ as isCancelMessage, a_ as isCompleteMessage, a$ as isDrainReceipt, b0 as isFundingReceipt, b1 as isPaymentRequestMessage, b2 as isPromptMessage, b3 as isSignedJobReceipt, b4 as isTextMessage, b5 as isWorkingMessage, b6 as paymentRequiredV2FromV1, b7 as signDrainReceipt, b8 as signFundingReceipt, b9 as signReceipt, ba as usdcContractByCaip2, bb as usdcContractFor, bc as usdcDomainNameFor, bd as usdcDomainVersionFor, be as verifyDrainReceipt, bf as verifyFundingReceipt, bg as verifyReceipt, bh as x402NetworkToCaip2 } from '../step-cache-C6lMgDH8.js';
5
+ import { X as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, Y as X402_BATCH_SETTLEMENT_SCHEME, _ as X402_EXACT_SCHEME, $ as FundingReceipt, a0 as JobReceipt$1, a1 as MessageType, a2 as X402Version, a3 as MppxCredential, z as SignedRequestAudience, a4 as PaymentRequired, a5 as Message, a6 as MppxChallenge, a7 as ReceiptCredit, a8 as DrainReceipt, C as Currency, a9 as X402Wallet, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-C9JRSFhM.js';
6
+ export { ac as BuildPaymentRequirementsOpts, ad as CapabilityDescriptor, ae as CashuMode, af as CompleteContent, ag as DrainReceiptEvent, ah as ExactEvmPayload, ai as ExactEvmPayloadAuthorization, aj as FundingMethod, ak as MessageFrom, al as PaymentPayload, am as PaymentPayloadV1, an as PaymentPayloadV2, ao as PaymentRequestContent, ap as PaymentRequiredV2, aq as PaymentRequirements, ar as PromptContent, as as RAIL_REFUNDABLE, at as ReceiptOutcome, au as ReceiptPayment, av as ResourceInfo, aw as SettleResponse, ax as StepCache, ay as StepRecord, az as TextContent, aA as UnsignedDrainReceipt, aB as UnsignedFundingReceipt, aC as UnsignedJobReceipt, aD as VerifyResponse, aE as WorkingContent, aF as X402Config, aG as X402ResponseBody, aH as X402SelfRelayRpcFailureReason, aI as X402_DEFAULT_NETWORK, aJ as X402_V1_VERSION, aK as X402_VERSION, aL as buildPaymentRequiredV2, aM as buildPaymentRequirements, aN as caip2ToX402Network, aO as canonicalRequestPath, aP as canonicaliseForSigning, aQ as canonicalize, aR as chainIdFromCaip2, aS as computeResultHash, aT as decodePayment, aU as decodePaymentRequiredHeader, aV as encodePayment, aW as encodePaymentRequiredHeader, aX as encodeSettleResponseHeader, aY as exactEvmAuthorization, aZ as isArtifactMessage, a_ as isCancelMessage, a$ as isCompleteMessage, b0 as isDrainReceipt, b1 as isFundingReceipt, b2 as isPaymentRequestMessage, b3 as isPromptMessage, b4 as isSignedJobReceipt, b5 as isTextMessage, b6 as isWorkingMessage, b7 as paymentRequiredV2FromV1, b8 as signDrainReceipt, b9 as signFundingReceipt, ba as signReceipt, bb as usdcContractByCaip2, bc as usdcContractFor, bd as usdcDomainNameFor, be as usdcDomainVersionFor, bf as verifyDrainReceipt, bg as verifyFundingReceipt, bh as verifyReceipt, bi as x402NetworkToCaip2 } from '../step-cache-C9JRSFhM.js';
7
7
  import { SimplePool } from 'nostr-tools/pool';
8
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-Cin14QvX.js';
13
- export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-5v1FQ7Mn.js';
12
+ export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-BvG2Wnjk.js';
13
+ export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-DXDkHn_8.js';
14
14
  import 'hono';
15
15
  import 'mppx';
16
16
  import '@x402/core/server';
@@ -1431,7 +1431,9 @@ interface V1InfoCapability {
1431
1431
  example?: Record<string, unknown>;
1432
1432
  /**
1433
1433
  * Pricing surface — `quote.schema` for dynamic-priced capabilities, `max`
1434
- * for static-priced ones. A free capability omits the block entirely: a
1434
+ * for static-priced ones, plus `rates` on either when the builder declared a
1435
+ * rate card. A free capability omits the block entirely (it cannot declare
1436
+ * rates): a
1435
1437
  * static `price` is a USD literal run through `parseUsdPrice`, which rejects
1436
1438
  * anything below `$0.0001`, so `max: { amount: 0 }` is unreachable.
1437
1439
  */
@@ -1443,6 +1445,17 @@ interface V1InfoCapability {
1443
1445
  quote?: {
1444
1446
  schema: Record<string, unknown>;
1445
1447
  };
1448
+ /**
1449
+ * Builder-declared rate card, published exactly as declared (order and
1450
+ * strings untouched). Present on static-priced and quoted capabilities
1451
+ * alike; for a quoted capability it describes how the quote is computed.
1452
+ */
1453
+ rates?: Array<{
1454
+ label?: string;
1455
+ amount: string;
1456
+ currency: "USD";
1457
+ per: string;
1458
+ }>;
1446
1459
  };
1447
1460
  }
1448
1461
  /**
@@ -1,22 +1,22 @@
1
1
  import { FacilitatorConfig } from '@x402/core/server';
2
- import { ak as PaymentPayload, a9 as PaymentRequirementsV1, aa as PaymentRequirementsV2, aE as X402Config, av as SettleResponse, aC as VerifyResponse, bi as X402ExactVersionSupport, bj as X402Receipt, bk as TransactionalPayoutHook, bl as CashuMeltCompleted } from '../step-cache-C6lMgDH8.js';
3
- export { bm as CreditDepositPayload, bn as CreditDrainPayload, bo as FundingLot, bp as LotDebit, bq as LotDepletion, br as MppxServer, bs as NON_CHANNEL_BITCOIN_RAILS, bt as NonChannelBitcoinRail, bu as PayoutReporter, bv as PostgresTempoSessionStore, bw as RevenueReporter, bx as SIGNED_ENVELOPE_FIELDS, by as SIGNED_ENVELOPE_TYPES, bz as X402TrackedChannel, bA as _testing, bB as createDefaultReplayStore, bC as depleteLots, bD as fifoOrder, bE as inKindDrawMsats, bF as isInKindDepletion, bG as isNonChannelBitcoinRail, bH as lotOwedSats, bI as netOwedSats, bJ as wrapMppx } from '../step-cache-C6lMgDH8.js';
2
+ import { al as PaymentPayload, aa as PaymentRequirementsV1, ab as PaymentRequirementsV2, aF as X402Config, aw as SettleResponse, aD as VerifyResponse, bj as X402ExactVersionSupport, bk as X402Receipt, bl as TransactionalPayoutHook, bm as CashuMeltCompleted } from '../step-cache-C9JRSFhM.js';
3
+ export { bn as CreditDepositPayload, bo as CreditDrainPayload, bp as FundingLot, bq as LotDebit, br as LotDepletion, bs as MppxServer, bt as NON_CHANNEL_BITCOIN_RAILS, bu as NonChannelBitcoinRail, bv as PayoutReporter, bw as PostgresTempoSessionStore, bx as RevenueReporter, by as SIGNED_ENVELOPE_FIELDS, bz as SIGNED_ENVELOPE_TYPES, bA as X402TrackedChannel, bB as _testing, bC as createDefaultReplayStore, bD as depleteLots, bE as fifoOrder, bF as inKindDrawMsats, bG as isInKindDepletion, bH as isNonChannelBitcoinRail, bI as lotOwedSats, bJ as netOwedSats, bK as wrapMppx } from '../step-cache-C9JRSFhM.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-CJl2Ysc-.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-CJl2Ysc-.js';
11
- export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-BtdD_xt1.js';
9
+ import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-Bm8opjYy.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-Bm8opjYy.js';
11
+ export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-DjgN2AOk.js';
12
12
  import { z } from 'zod';
13
- export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-BYTODXJ2.js';
13
+ export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-DeasHNOP.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-Cin14QvX.js';
19
+ import '../fx-BvG2Wnjk.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>;
@@ -7,9 +7,6 @@ import {
7
7
  import {
8
8
  RevenueReporter
9
9
  } from "../chunk-YK54BJ2L.js";
10
- import {
11
- PayoutReporter
12
- } from "../chunk-GKIOZCL7.js";
13
10
  import {
14
11
  PostgresTempoChargeStore
15
12
  } from "../chunk-BQP3LU2O.js";
@@ -64,11 +61,14 @@ import {
64
61
  verifyUpfrontPayment,
65
62
  x402RequiredUsdcMicro,
66
63
  x402SettledShare
67
- } from "../chunk-3NVM4WPI.js";
64
+ } from "../chunk-HGMS3LR7.js";
68
65
  import {
69
66
  _testing,
70
67
  wrapMppx
71
68
  } from "../chunk-KYCLHWKO.js";
69
+ import {
70
+ PayoutReporter
71
+ } from "../chunk-3VFEX2Y3.js";
72
72
  import {
73
73
  settleWithFacilitator,
74
74
  verifyWithFacilitator
@@ -1,5 +1,5 @@
1
1
  import { ProofLike } from '@cashu/cashu-ts';
2
- import { a4 as Message, ai as FundingMethod, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, ax as StepRecord, a0 as MessageType } from './step-cache-C6lMgDH8.js';
2
+ import { a5 as Message, aj as FundingMethod, $ as FundingReceipt, bQ as CreditSnapshot, a0 as JobReceipt, ay as StepRecord, a1 as MessageType } from './step-cache-C9JRSFhM.js';
3
3
 
4
4
  type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
5
5
  interface JobRecord {
@@ -1,4 +1,4 @@
1
- import { W as JsonValue } from './step-cache-C6lMgDH8.js';
1
+ import { X as JsonValue } from './step-cache-C9JRSFhM.js';
2
2
 
3
3
  declare const lockPubkeyBrand: unique symbol;
4
4
  /**
@@ -2,13 +2,15 @@ import {
2
2
  MemoryX402BatchStore,
3
3
  PAYOUT_SNAPSHOT_INTERVAL_MS,
4
4
  PayoutReporter,
5
- PostgresX402BatchStore
6
- } from "./chunk-GKIOZCL7.js";
5
+ PostgresX402BatchStore,
6
+ x402EarnedCeiling
7
+ } from "./chunk-3VFEX2Y3.js";
7
8
  import "./chunk-FXDQMJQ2.js";
8
9
  import "./chunk-COYKJRMM.js";
9
10
  export {
10
11
  MemoryX402BatchStore,
11
12
  PAYOUT_SNAPSHOT_INTERVAL_MS,
12
13
  PayoutReporter,
13
- PostgresX402BatchStore
14
+ PostgresX402BatchStore,
15
+ x402EarnedCeiling
14
16
  };
@@ -1,15 +1,15 @@
1
- import { ad as CashuMode, bK as CreditDrainEnqueue, bL as HostedSettlementReportObligations, R as ResolvedCreditConfig, bM as DVMAuthScheme, z as SignedRequestDomain, bN as CreditLedgerLike, bO as X402RefundSettlementGate, bP as CreditSnapshot, bQ as DrawResult, bR as X402SettlementStatus, bS as X402UnresolvedRefund, bT as GrownDrawResult, bU as DrawResolution, bV as FundingRecord, _ as FundingReceipt, bW as CreditInvoiceRecord, bX as InvoiceSettlement, bY as BlockedInvoiceCursor, bZ as InvoiceReconciliation, b_ as InvoiceWriteOff, b$ as DrawRecord, c0 as StalePendingDrawCursor, c1 as TempoCreditLossEvidence, c2 as CreditLedgerQuerier, c3 as TempoCreditLoss, c4 as X402CreditLossEvidence, c5 as X402CreditLoss, c6 as DrainMethod, c7 as DrainRequestResult, c8 as BitcoinDepositLiability, bo as FundingLot, c9 as CreditDrainRecord, ca as ChannelDrainCursor, cb as DrainWriteOff, cc as DrainReleaseResult, cd as DrainFulfilment, ce as DrainTransitionResult, cf as HostingCleanupFence, $ as JobReceipt, a4 as Message, K as KVStore, F as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-C6lMgDH8.js';
2
- export { cg as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ch as ClientCompatibility, ci as ClientCompatibilityEnv, cj as ClientCompatibilityGate, ck as ClientCompatibilityRequirement, cl as ClientSemVer, e as CreateSignedRequestVerifierOpts, cm as CreditFundingBasis, cn as CreditInvoiceStatus, co as CreditLedger, cp as CreditLedgerError, cq as CreditLedgerErrorCode, cr as CreditLedgerErrorDetails, cs as CreditLedgerPool, ct as CreditStatus, cu as DRAIN_DELIVERY_RESERVE_SATS, cv as DVM_PROTOCOL_VERSION, cw as DrainConflictReason, cx as DrawRailValue, cy as DrawStatus, cz as JobCostReportPayload, cA as JobTerminalReportPayload, cB as PostgresX402ChannelStorage, cC as ReplayStoreBackend, cD as RevenueSkippedNoRailPayload, cE as RevenueSkippedNoRailReason, w as SIGNED_REQUEST_AUTH_ID, x as SIGNED_REQUEST_STATEMENT_VERSION, cF as Secp256k1AuthOpts, y as SignedRequestAudience, B as SignedRequestError, E as SignedRequestFailure, G as SignedRequestSignOpts, H as SignedRequestStatementHeader, M as SignedRequestVerifier, cG as X402ChannelStorageOpts, cH as X402RelayLockHolder, cI as X402RelaySubmissionLock, cJ as X402RelaySubmissionLockError, cK as allocateDrawValue, cL as clientCompatibilityAttributes, cM as clientCompatibilityMiddleware, cN as clientUpgradeRequired, N as createSignedRequestVerifier, cO as parseClientCapabilities, cP as parseClientCompatibility, cQ as parseDvmClient, cR as parseProtocolVersion, cS as requireClientCompatibility, cT as secp256k1Auth, cU as signedRequestInput, T as signedRequestStatementHeader } from '../step-cache-C6lMgDH8.js';
1
+ import { ae as CashuMode, bL as CreditDrainEnqueue, bM as HostedSettlementReportObligations, R as ResolvedCreditConfig, bN as DVMAuthScheme, B as SignedRequestDomain, bO as CreditLedgerLike, bP as X402RefundSettlementGate, bQ as CreditSnapshot, bR as DrawResult, bS as X402SettlementStatus, bT as X402UnresolvedRefund, bU as GrownDrawResult, bV as DrawResolution, bW as FundingRecord, $ as FundingReceipt, bX as CreditInvoiceRecord, bY as InvoiceSettlement, bZ as BlockedInvoiceCursor, b_ as InvoiceReconciliation, b$ as InvoiceWriteOff, c0 as DrawRecord, c1 as StalePendingDrawCursor, c2 as TempoCreditLossEvidence, c3 as CreditLedgerQuerier, c4 as TempoCreditLoss, c5 as X402CreditLossEvidence, c6 as X402CreditLoss, c7 as DrainMethod, c8 as DrainRequestResult, c9 as BitcoinDepositLiability, bp as FundingLot, ca as CreditDrainRecord, cb as ChannelDrainCursor, cc as DrainWriteOff, cd as DrainReleaseResult, ce as DrainFulfilment, cf as DrainTransitionResult, cg as HostingCleanupFence, a0 as JobReceipt, a5 as Message, K as KVStore, G as SignedRequestReplayStore, Z as ZodLike, a as DVMDescriptor } from '../step-cache-C9JRSFhM.js';
2
+ export { ch as CLIENT_COMPATIBILITY_HEADERS, d as CanonicalEnvelope, ci as ClientCompatibility, cj as ClientCompatibilityEnv, ck as ClientCompatibilityGate, cl as ClientCompatibilityRequirement, cm as ClientSemVer, f as CreateSignedRequestVerifierOpts, cn as CreditFundingBasis, co as CreditInvoiceStatus, cp as CreditLedger, cq as CreditLedgerError, cr as CreditLedgerErrorCode, cs as CreditLedgerErrorDetails, ct as CreditLedgerPool, cu as CreditStatus, cv as DRAIN_DELIVERY_RESERVE_SATS, cw as DVM_PROTOCOL_VERSION, cx as DrainConflictReason, cy as DrawRailValue, cz as DrawStatus, cA as JobCostReportPayload, cB as JobTerminalReportPayload, cC as PostgresX402ChannelStorage, cD as ReplayStoreBackend, cE as RevenueSkippedNoRailPayload, cF as RevenueSkippedNoRailReason, x as SIGNED_REQUEST_AUTH_ID, y as SIGNED_REQUEST_STATEMENT_VERSION, cG as Secp256k1AuthOpts, z as SignedRequestAudience, E as SignedRequestError, F as SignedRequestFailure, H as SignedRequestSignOpts, M as SignedRequestStatementHeader, N as SignedRequestVerifier, cH as X402ChannelStorageOpts, cI as X402RelayLockHolder, cJ as X402RelaySubmissionLock, cK as X402RelaySubmissionLockError, cL as allocateDrawValue, cM as clientCompatibilityAttributes, cN as clientCompatibilityMiddleware, cO as clientUpgradeRequired, O as createSignedRequestVerifier, cP as parseClientCapabilities, cQ as parseClientCompatibility, cR as parseDvmClient, cS as parseProtocolVersion, cT as requireClientCompatibility, cU as secp256k1Auth, cV as signedRequestInput, V as signedRequestStatementHeader } from '../step-cache-C9JRSFhM.js';
3
3
  import { Pool } from 'pg';
4
- import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-CJl2Ysc-.js';
5
- export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-CJl2Ysc-.js';
4
+ import { au as CreditMenu, a as AppEnv, U as UpfrontPaymentOpts, i as PaymentInfo, av as ReceiptIssuer, aw as LightningReceive, ax as TempoSettlementReadiness, ay as DVMHostOpts, az as DVMServeResult, L as LockPubkeyStateLoader, C as ConsumedCredentialStore } from '../credit-menu-Bm8opjYy.js';
5
+ export { aA as BuildCreditMenuArgs, aB as BuilderIdentity, aC as CREDIT_ENVELOPE_KEYS, aD as CreateX402BatchSettlementServerOpts, aE as CreditEnvelope, aF as CreditEnvelopeError, aG as CreditFundCommitment, aH as CreditTerms, aI as DEFAULT_INVOICE_TTL_SECONDS, aJ as DVMHost, aK as HostingClosureCommand, aL as HostingClosureEvidence, aM as HostingControlCommand, aN as HostingControlConfig, aO as HostingControlStatus, aP as JobManager, aQ as JobManagerOpts, aR as LightningReceiveConfig, aS as MIN_INVOICE_TTL_SECONDS, aT as MemoryConsumedCredentialStore, aU as MemoryConsumedCredentialStoreOpts, aV as MemoryProcessedPaymentStore, aW as MemoryX402ExactSettlementStore, aX as MountOpts, aY as OwnerDisplay, aZ as PaidJobCompletion, a_ as PaymentMode, a$ as PlatformReporterOpts, b0 as PostgresProcessedPaymentStore, b1 as PostgresX402ExactSettlementStore, b2 as PriceFiat, b3 as ProcessedPaymentQuerier, b4 as ProcessedPaymentRail, b5 as ProcessedPaymentRecord, b6 as ProcessedPaymentReplayError, b7 as ProcessedPaymentStore, b8 as X402BatchAcceptance, b9 as X402BatchFunding, ba as X402BatchRefusal, bb as X402BatchSettlementServer, bc as X402ExactAcceptance, bd as X402ExactIntentConflictError, be as X402ExactSettlementAttempt, bf as X402ExactSettlementChainEvidence, bg as X402ExactSettlementEffect, bh as X402ExactSettlementEvidenceMissingError, bi as X402ExactSettlementEvidenceReader, bj as X402ExactSettlementIntent, bk as X402ExactSettlementNotReadyError, bl as X402ExactSettlementServer, bm as X402ExactSettlementServerOpts, bn as X402ExactSettlementStatus, bo as X402ExactSettlementStore, bp as X402SettlementChainEvidence, bq as X402SettlementEvidenceReader, br as X402SettlementSubmissionError, bs as X402_BATCH_AUTO_SETTLEMENT, bt as X402_BATCH_MIN_WITHDRAW_DELAY_SECONDS, bu as X402_BATCH_SETTLEMENT_NETWORK, bv as attachCreditMenu, bw as buildCreditMenu, bx as createDVMHost, by as createX402BatchSettlementServer, bz as creditEnvelopeIgnoreFields, bA as drawSettlementRef, bB as extractCreditEnvelope, bC as fundingCommitment, bD as selectPrimaryCredit, bE as signHostingClosure, bF as signHostingControl, bG as stripCreditEnvelope, bH as toCreditView } from '../credit-menu-Bm8opjYy.js';
6
6
  import { Context, Hono } from 'hono';
7
7
  import { z } from 'zod';
8
- import { F as FxFetcher } from '../fx-Cin14QvX.js';
9
- 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, b as JobStore } from '../job-store-BtdD_xt1.js';
10
- export { a as JobStatus, h as isStreamableJobStore } from '../job-store-BtdD_xt1.js';
11
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-z1fRPIkt.js';
12
- export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-z1fRPIkt.js';
8
+ import { F as FxFetcher } from '../fx-BvG2Wnjk.js';
9
+ 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, b as JobStore } from '../job-store-DjgN2AOk.js';
10
+ export { a as JobStatus, h as isStreamableJobStore } from '../job-store-DjgN2AOk.js';
11
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-U7dJM7Ph.js';
12
+ export { b as ContentHold, c as ContentHoldError, d as ContentHoldEvent, e as ContentHoldStore, f as ContentHoldsResponse, J as JobContentMetadata, g as baselineContentExpiry, h as contentMetadata, i as isContentHoldStore } from '../content-retention-U7dJM7Ph.js';
13
13
  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';
14
14
  import { Env, BlankSchema } from 'hono/types';
15
15
  import 'mppx';
@@ -17,7 +17,7 @@ import '@x402/core/server';
17
17
  import '@x402/evm/batch-settlement/server';
18
18
  import '@x402/core/types';
19
19
  import 'viem';
20
- import '../lightning-backend-BYTODXJ2.js';
20
+ import '../lightning-backend-DeasHNOP.js';
21
21
  import '@cashu/cashu-ts';
22
22
 
23
23
  /** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
@@ -80,7 +80,7 @@ import {
80
80
  stripProtocolEnvelope,
81
81
  toCreditView,
82
82
  unknownRouteNotFound
83
- } from "../chunk-3NVM4WPI.js";
83
+ } from "../chunk-HGMS3LR7.js";
84
84
  import {
85
85
  TEMPO_MODERATO_CHAIN_ID,
86
86
  TEMPO_MODERATO_RPC,
@@ -88,6 +88,7 @@ import {
88
88
  TempoSettlementReadiness,
89
89
  resolveTempoNetwork
90
90
  } from "../chunk-KYCLHWKO.js";
91
+ import "../chunk-3VFEX2Y3.js";
91
92
  import "../chunk-XEOTTFLH.js";
92
93
  import {
93
94
  MemoryCreditLedger
@@ -1783,6 +1783,8 @@ interface X402WedgedRefund {
1783
1783
  createdAt: number;
1784
1784
  native?: number;
1785
1785
  }
1786
+ /** Rail-native value the channel's credit has earned; `undefined` when no credit is bound. */
1787
+ type X402EarnedNative = (channelId: string) => Promise<number | undefined>;
1786
1788
  interface X402PayoutContext {
1787
1789
  /** `${network}|${payTo}|${token}` — the scope the settle-pending marker is keyed on. */
1788
1790
  scope: string;
@@ -1791,6 +1793,12 @@ interface X402PayoutContext {
1791
1793
  storage: {
1792
1794
  list(): Promise<X402TrackedChannel[]>;
1793
1795
  };
1796
+ /**
1797
+ * The claim ceiling's earned figure for a channel. Pending counts only what a
1798
+ * claim could present, so a channel's unspent deposit is never reported as
1799
+ * the builder's.
1800
+ */
1801
+ earnedNative: X402EarnedNative;
1794
1802
  /** The scheduler's settle cadence — what a wedge's `nextRetry` is derived from. */
1795
1803
  settleIntervalMs: number;
1796
1804
  listWedgedRefunds?: () => Promise<X402WedgedRefund[]>;
@@ -1965,7 +1973,8 @@ declare class PayoutReporter implements PayoutTransport {
1965
1973
  snapshotCashu(): Promise<void>;
1966
1974
  /**
1967
1975
  * x402: the open batch (claimed, not yet transferred) plus every channel's
1968
- * unclaimed voucher value; wedged when the settle keeps failing, and the
1976
+ * earned value not yet claimed — a channel whose earned figure cannot be
1977
+ * read contributes nothing; wedged when the settle keeps failing, and the
1969
1978
  * refund settlements stuck between chain and ledger beside it.
1970
1979
  */
1971
1980
  snapshotX402(): Promise<void>;
@@ -5332,6 +5341,21 @@ interface IncomingMessage {
5332
5341
  */
5333
5342
  type PriceValue = string;
5334
5343
  type PaymentMethod = "cashu" | "x402" | "tempo";
5344
+ /**
5345
+ * One line of a capability's published rate card, declared on `CapabilityConfig.rates`.
5346
+ * Example: `{ label: "balanced", amount: "0.00015", currency: "USD", per: "character" }`.
5347
+ *
5348
+ * `amount` is decimal dollars written as a string (`/^\d+(\.\d+)?$/`, above
5349
+ * zero, at most 12 characters). `per` names the unit and `label` optionally
5350
+ * names a tier; each is 1 to 24 characters with no leading or trailing
5351
+ * whitespace. `/v1/info` publishes the entries exactly as written, in order.
5352
+ */
5353
+ interface CapabilityRate {
5354
+ label?: string;
5355
+ amount: string;
5356
+ currency: "USD";
5357
+ per: string;
5358
+ }
5335
5359
  /**
5336
5360
  * Rails that may fund a prepaid **credit**.
5337
5361
  *
@@ -5468,6 +5492,16 @@ interface CapabilityConfig<State = Record<string, unknown>, InputSchema extends
5468
5492
  /** Static price — a USD literal ("$0.05"). Free capabilities omit this and `onQuote`. */
5469
5493
  price?: PriceValue;
5470
5494
  onQuote?: QuoteConfig;
5495
+ /**
5496
+ * Rate card published on `/v1/info` as `pricing.rates`: 1 to 5
5497
+ * {@link CapabilityRate} entries, exactly as declared. Allowed only on a
5498
+ * priced capability (`price` or `onQuote`); a free capability that declares
5499
+ * rates is refused when the server starts, as is any entry outside the
5500
+ * limits on {@link CapabilityRate} or carrying another key. For a quoted
5501
+ * capability the rates describe how the quote is computed; they never
5502
+ * change the quote itself.
5503
+ */
5504
+ rates?: CapabilityRate[];
5471
5505
  /** Handle a newly submitted job for this capability (required). */
5472
5506
  onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
5473
5507
  /** Handle a client response to a prompt within a job of this capability. */
@@ -5499,6 +5533,8 @@ interface CapabilityDescriptor<State = unknown, InputSchema extends ZodLike | un
5499
5533
  /** Static price — a USD literal ("$0.05"). Undefined for dynamic-priced or free. */
5500
5534
  readonly price?: PriceValue;
5501
5535
  readonly onQuote?: QuoteConfig;
5536
+ /** Rate card published on `/v1/info`. See `CapabilityConfig.rates`. */
5537
+ readonly rates?: CapabilityRate[];
5502
5538
  readonly onJob: (ctx: SDKJobContext<State, InputType<InputSchema>>) => void | Promise<void>;
5503
5539
  /** Handle a client response to a prompt. */
5504
5540
  readonly onResponse?: (ctx: SDKJobContext<State, InputType<InputSchema>>, content: ResponseContent) => void | Promise<void>;
@@ -5638,6 +5674,8 @@ interface DVMConfig<State = Record<string, unknown>, InputSchema extends ZodLike
5638
5674
  onMessage?(ctx: SDKJobContext<State, InputType<InputSchema>>, msg: IncomingMessage): void | Promise<void>;
5639
5675
  /** Quote handler for dynamic pricing. Flat shape only. */
5640
5676
  onQuote?: QuoteConfig;
5677
+ /** Rate card published on `/v1/info`. Flat shape only — see `CapabilityConfig.rates`. */
5678
+ rates?: CapabilityRate[];
5641
5679
  /** Payment methods this DVM accepts. Default: derived from configured rails — adds "cashu" when `mints` is set, "x402" when `x402` is set, "tempo" when `tempo` is set. */
5642
5680
  paymentMethods?: PaymentMethod[];
5643
5681
  /** x402 stablecoin payment configuration (provider-side). */
@@ -5772,4 +5810,4 @@ declare class StepCache {
5772
5810
  static deserialize(records: StepRecord[]): StepCache;
5773
5811
  }
5774
5812
 
5775
- export { type JobReceipt as $, type ApprovalContent as A, SignedRequestError as B, type Currency as C, type DVMConfig as D, type SignedRequestFailure as E, type SignedRequestReplayStore as F, type SignedRequestSignOpts as G, type SignedRequestStatementHeader as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestVerifier as M, createSignedRequestVerifier as N, isZodSchema as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, signedRequestStatementHeader as T, UnsupportedCurrencyError as U, validateCurrency as V, type JsonValue as W, X402_BATCH_SETTLEMENT_SCHEME as X, X402_EXACT_SCHEME as Y, type ZodLike as Z, type FundingReceipt as _, type DVMDescriptor as a, isDrainReceipt as a$, type MessageType as a0, type X402Version as a1, type MppxCredential as a2, type PaymentRequired as a3, type Message as a4, type MppxChallenge as a5, type ReceiptCredit as a6, type DrainReceipt as a7, type X402Wallet as a8, type PaymentRequirementsV1 as a9, type UnsignedFundingReceipt as aA, type UnsignedJobReceipt as aB, type VerifyResponse as aC, type WorkingContent as aD, type X402Config$1 as aE, type X402ResponseBody as aF, type X402SelfRelayRpcFailureReason as aG, X402_DEFAULT_NETWORK as aH, X402_V1_VERSION as aI, X402_VERSION as aJ, buildPaymentRequiredV2 as aK, buildPaymentRequirements as aL, caip2ToX402Network as aM, canonicalRequestPath as aN, canonicaliseForSigning as aO, canonicalize as aP, chainIdFromCaip2 as aQ, computeResultHash as aR, decodePayment as aS, decodePaymentRequiredHeader as aT, encodePayment as aU, encodePaymentRequiredHeader as aV, encodeSettleResponseHeader as aW, exactEvmAuthorization as aX, isArtifactMessage as aY, isCancelMessage as aZ, isCompleteMessage as a_, type PaymentRequirementsV2 as aa, type BuildPaymentRequirementsOpts as ab, type CapabilityDescriptor as ac, type CashuMode as ad, type CompleteContent as ae, type DrainReceiptEvent as af, type ExactEvmPayload as ag, type ExactEvmPayloadAuthorization as ah, type FundingMethod as ai, type MessageFrom as aj, type PaymentPayload as ak, type PaymentPayloadV1 as al, type PaymentPayloadV2 as am, type PaymentRequestContent as an, type PaymentRequiredV2 as ao, type PaymentRequirements as ap, type PromptContent as aq, RAIL_REFUNDABLE as ar, type ReceiptOutcome as as, type ReceiptPayment as at, type ResourceInfo as au, type SettleResponse as av, StepCache as aw, type StepRecord as ax, type TextContent as ay, type UnsignedDrainReceipt as az, type ArtifactContent as b, type DrawRecord as b$, isFundingReceipt as b0, isPaymentRequestMessage as b1, isPromptMessage as b2, isSignedJobReceipt as b3, isTextMessage as b4, isWorkingMessage as b5, paymentRequiredV2FromV1 as b6, signDrainReceipt as b7, signFundingReceipt as b8, signReceipt as b9, _testing as bA, createDefaultReplayStore as bB, depleteLots as bC, fifoOrder as bD, inKindDrawMsats as bE, isInKindDepletion as bF, isNonChannelBitcoinRail as bG, lotOwedSats as bH, netOwedSats as bI, wrapMppx as bJ, type CreditDrainEnqueue as bK, HostedSettlementReportObligations as bL, type DVMAuthScheme as bM, type CreditLedgerLike as bN, type X402RefundSettlementGate as bO, type CreditSnapshot as bP, type DrawResult as bQ, type X402SettlementStatus as bR, type X402UnresolvedRefund as bS, type GrownDrawResult as bT, type DrawResolution as bU, type FundingRecord as bV, type CreditInvoiceRecord as bW, type InvoiceSettlement as bX, type BlockedInvoiceCursor as bY, type InvoiceReconciliation as bZ, type InvoiceWriteOff as b_, usdcContractByCaip2 as ba, usdcContractFor as bb, usdcDomainNameFor as bc, usdcDomainVersionFor as bd, verifyDrainReceipt as be, verifyFundingReceipt as bf, verifyReceipt as bg, x402NetworkToCaip2 as bh, type X402ExactVersionSupport as bi, type X402Receipt as bj, type TransactionalPayoutHook as bk, type CashuMeltCompleted as bl, type CreditDepositPayload as bm, type CreditDrainPayload as bn, type FundingLot as bo, type LotDebit as bp, type LotDepletion as bq, type MppxServer as br, NON_CHANNEL_BITCOIN_RAILS as bs, type NonChannelBitcoinRail as bt, PayoutReporter as bu, PostgresTempoSessionStore as bv, RevenueReporter as bw, SIGNED_ENVELOPE_FIELDS as bx, SIGNED_ENVELOPE_TYPES as by, type X402TrackedChannel as bz, type CancelContent as c, type X402BatchSettlementConfig as c$, type StalePendingDrawCursor as c0, type TempoCreditLossEvidence as c1, type CreditLedgerQuerier as c2, type TempoCreditLoss as c3, type X402CreditLossEvidence as c4, type X402CreditLoss as c5, type DrainMethod as c6, type DrainRequestResult as c7, type BitcoinDepositLiability as c8, type CreditDrainRecord as c9, type JobTerminalReportPayload as cA, PostgresX402ChannelStorage as cB, type ReplayStoreBackend as cC, type RevenueSkippedNoRailPayload as cD, type RevenueSkippedNoRailReason as cE, type Secp256k1AuthOpts as cF, type X402ChannelStorageOpts as cG, type X402RelayLockHolder as cH, type X402RelaySubmissionLock as cI, X402RelaySubmissionLockError as cJ, allocateDrawValue as cK, clientCompatibilityAttributes as cL, clientCompatibilityMiddleware as cM, clientUpgradeRequired as cN, parseClientCapabilities as cO, parseClientCompatibility as cP, parseDvmClient as cQ, parseProtocolVersion as cR, requireClientCompatibility as cS, secp256k1Auth as cT, signedRequestInput as cU, type HostedIntent as cV, type X402SettlementIntent as cW, type HostedFundingReservation as cX, type X402SettlementCursor as cY, type X402SettlementWriteOff as cZ, type X402FacilitatorAuth as c_, type ChannelDrainCursor as ca, type DrainWriteOff as cb, type DrainReleaseResult as cc, type DrainFulfilment as cd, type DrainTransitionResult as ce, HostingCleanupFence as cf, CLIENT_COMPATIBILITY_HEADERS as cg, type ClientCompatibility as ch, type ClientCompatibilityEnv as ci, type ClientCompatibilityGate as cj, type ClientCompatibilityRequirement as ck, type ClientSemVer as cl, type CreditFundingBasis as cm, type CreditInvoiceStatus as cn, CreditLedger as co, CreditLedgerError as cp, type CreditLedgerErrorCode as cq, type CreditLedgerErrorDetails as cr, type CreditLedgerPool as cs, type CreditStatus as ct, DRAIN_DELIVERY_RESERVE_SATS as cu, DVM_PROTOCOL_VERSION as cv, type DrainConflictReason as cw, type DrawRailValue as cx, type DrawStatus as cy, type JobCostReportPayload as cz, type CanonicalEnvelope as d, type X402PayoutObserver as d0, type CreditDepositEnqueue as d1, type X402SettlementReconciliationReason as d2, type CreditDrawReleaseEnqueue as d3, type CreateSignedRequestVerifierOpts as e, type CreditConfig as f, type CreditView as g, DEFAULT_CREDIT_MAX as h, DEFAULT_CREDIT_MIN as i, DEFAULT_CREDIT_TTL_SECONDS as j, DEFAULT_JOB_RETENTION_DAYS as k, type DVMRouteContext as l, type InputType as m, InvalidCurrencyError as n, type PaymentMethod as o, type PriceValue as p, type ProgressContent as q, type PromptOpts as r, type QuoteContext as s, type QuoteResult as t, type ResponseContent as u, type SDKPaymentRequestOpts as v, SIGNED_REQUEST_AUTH_ID as w, SIGNED_REQUEST_STATEMENT_VERSION as x, type SignedRequestAudience as y, type SignedRequestDomain as z };
5813
+ export { type FundingReceipt as $, type ApprovalContent as A, type SignedRequestDomain as B, type Currency as C, type DVMConfig as D, SignedRequestError as E, type SignedRequestFailure as F, type SignedRequestReplayStore as G, type SignedRequestSignOpts as H, type IncomingMessage as I, type JobCost as J, type KVStore as K, type Logger as L, type SignedRequestStatementHeader as M, type SignedRequestVerifier as N, createSignedRequestVerifier as O, type PaymentContent as P, type QuoteConfig as Q, type ResolvedCreditConfig as R, type SDKJobContext as S, isZodSchema as T, UnsupportedCurrencyError as U, signedRequestStatementHeader as V, validateCurrency as W, type JsonValue as X, X402_BATCH_SETTLEMENT_SCHEME as Y, type ZodLike as Z, X402_EXACT_SCHEME as _, type DVMDescriptor as a, isCompleteMessage as a$, type JobReceipt as a0, type MessageType as a1, type X402Version as a2, type MppxCredential as a3, type PaymentRequired as a4, type Message as a5, type MppxChallenge as a6, type ReceiptCredit as a7, type DrainReceipt as a8, type X402Wallet as a9, type UnsignedDrainReceipt as aA, type UnsignedFundingReceipt as aB, type UnsignedJobReceipt as aC, type VerifyResponse as aD, type WorkingContent as aE, type X402Config$1 as aF, type X402ResponseBody as aG, type X402SelfRelayRpcFailureReason as aH, X402_DEFAULT_NETWORK as aI, X402_V1_VERSION as aJ, X402_VERSION as aK, buildPaymentRequiredV2 as aL, buildPaymentRequirements as aM, caip2ToX402Network as aN, canonicalRequestPath as aO, canonicaliseForSigning as aP, canonicalize as aQ, chainIdFromCaip2 as aR, computeResultHash as aS, decodePayment as aT, decodePaymentRequiredHeader as aU, encodePayment as aV, encodePaymentRequiredHeader as aW, encodeSettleResponseHeader as aX, exactEvmAuthorization as aY, isArtifactMessage as aZ, isCancelMessage as a_, type PaymentRequirementsV1 as aa, type PaymentRequirementsV2 as ab, type BuildPaymentRequirementsOpts as ac, type CapabilityDescriptor as ad, type CashuMode as ae, type CompleteContent as af, type DrainReceiptEvent as ag, type ExactEvmPayload as ah, type ExactEvmPayloadAuthorization as ai, type FundingMethod as aj, type MessageFrom as ak, type PaymentPayload as al, type PaymentPayloadV1 as am, type PaymentPayloadV2 as an, type PaymentRequestContent as ao, type PaymentRequiredV2 as ap, type PaymentRequirements as aq, type PromptContent as ar, RAIL_REFUNDABLE as as, type ReceiptOutcome as at, type ReceiptPayment as au, type ResourceInfo as av, type SettleResponse as aw, StepCache as ax, type StepRecord as ay, type TextContent as az, type ArtifactContent as b, type InvoiceWriteOff as b$, isDrainReceipt as b0, isFundingReceipt as b1, isPaymentRequestMessage as b2, isPromptMessage as b3, isSignedJobReceipt as b4, isTextMessage as b5, isWorkingMessage as b6, paymentRequiredV2FromV1 as b7, signDrainReceipt as b8, signFundingReceipt as b9, type X402TrackedChannel as bA, _testing as bB, createDefaultReplayStore as bC, depleteLots as bD, fifoOrder as bE, inKindDrawMsats as bF, isInKindDepletion as bG, isNonChannelBitcoinRail as bH, lotOwedSats as bI, netOwedSats as bJ, wrapMppx as bK, type CreditDrainEnqueue as bL, HostedSettlementReportObligations as bM, type DVMAuthScheme as bN, type CreditLedgerLike as bO, type X402RefundSettlementGate as bP, type CreditSnapshot as bQ, type DrawResult as bR, type X402SettlementStatus as bS, type X402UnresolvedRefund as bT, type GrownDrawResult as bU, type DrawResolution as bV, type FundingRecord as bW, type CreditInvoiceRecord as bX, type InvoiceSettlement as bY, type BlockedInvoiceCursor as bZ, type InvoiceReconciliation as b_, signReceipt as ba, usdcContractByCaip2 as bb, usdcContractFor as bc, usdcDomainNameFor as bd, usdcDomainVersionFor as be, verifyDrainReceipt as bf, verifyFundingReceipt as bg, verifyReceipt as bh, x402NetworkToCaip2 as bi, type X402ExactVersionSupport as bj, type X402Receipt as bk, type TransactionalPayoutHook as bl, type CashuMeltCompleted as bm, type CreditDepositPayload as bn, type CreditDrainPayload as bo, type FundingLot as bp, type LotDebit as bq, type LotDepletion as br, type MppxServer as bs, NON_CHANNEL_BITCOIN_RAILS as bt, type NonChannelBitcoinRail as bu, PayoutReporter as bv, PostgresTempoSessionStore as bw, RevenueReporter as bx, SIGNED_ENVELOPE_FIELDS as by, SIGNED_ENVELOPE_TYPES as bz, type CancelContent as c, type X402FacilitatorAuth as c$, type DrawRecord as c0, type StalePendingDrawCursor as c1, type TempoCreditLossEvidence as c2, type CreditLedgerQuerier as c3, type TempoCreditLoss as c4, type X402CreditLossEvidence as c5, type X402CreditLoss as c6, type DrainMethod as c7, type DrainRequestResult as c8, type BitcoinDepositLiability as c9, type JobCostReportPayload as cA, type JobTerminalReportPayload as cB, PostgresX402ChannelStorage as cC, type ReplayStoreBackend as cD, type RevenueSkippedNoRailPayload as cE, type RevenueSkippedNoRailReason as cF, type Secp256k1AuthOpts as cG, type X402ChannelStorageOpts as cH, type X402RelayLockHolder as cI, type X402RelaySubmissionLock as cJ, X402RelaySubmissionLockError as cK, allocateDrawValue as cL, clientCompatibilityAttributes as cM, clientCompatibilityMiddleware as cN, clientUpgradeRequired as cO, parseClientCapabilities as cP, parseClientCompatibility as cQ, parseDvmClient as cR, parseProtocolVersion as cS, requireClientCompatibility as cT, secp256k1Auth as cU, signedRequestInput as cV, type HostedIntent as cW, type X402SettlementIntent as cX, type HostedFundingReservation as cY, type X402SettlementCursor as cZ, type X402SettlementWriteOff as c_, type CreditDrainRecord as ca, type ChannelDrainCursor as cb, type DrainWriteOff as cc, type DrainReleaseResult as cd, type DrainFulfilment as ce, type DrainTransitionResult as cf, HostingCleanupFence as cg, CLIENT_COMPATIBILITY_HEADERS as ch, type ClientCompatibility as ci, type ClientCompatibilityEnv as cj, type ClientCompatibilityGate as ck, type ClientCompatibilityRequirement as cl, type ClientSemVer as cm, type CreditFundingBasis as cn, type CreditInvoiceStatus as co, CreditLedger as cp, CreditLedgerError as cq, type CreditLedgerErrorCode as cr, type CreditLedgerErrorDetails as cs, type CreditLedgerPool as ct, type CreditStatus as cu, DRAIN_DELIVERY_RESERVE_SATS as cv, DVM_PROTOCOL_VERSION as cw, type DrainConflictReason as cx, type DrawRailValue as cy, type DrawStatus as cz, type CanonicalEnvelope as d, type X402BatchSettlementConfig as d0, type X402PayoutObserver as d1, type CreditDepositEnqueue as d2, type X402SettlementReconciliationReason as d3, type CreditDrawReleaseEnqueue as d4, type CapabilityRate as e, type CreateSignedRequestVerifierOpts as f, type CreditConfig as g, type CreditView as h, DEFAULT_CREDIT_MAX as i, DEFAULT_CREDIT_MIN as j, DEFAULT_CREDIT_TTL_SECONDS as k, DEFAULT_JOB_RETENTION_DAYS as l, type DVMRouteContext as m, type InputType as n, InvalidCurrencyError as o, type PaymentMethod as p, type PriceValue as q, type ProgressContent as r, type PromptOpts as s, type QuoteContext as t, type QuoteResult as u, type ResponseContent as v, type SDKPaymentRequestOpts as w, SIGNED_REQUEST_AUTH_ID as x, SIGNED_REQUEST_STATEMENT_VERSION as y, type SignedRequestAudience as z };
@@ -1,6 +1,6 @@
1
- import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-z1fRPIkt.js';
2
- import { $ as JobReceipt, a4 as Message, a0 as MessageType, K as KVStore, L as Logger, u as ResponseContent, P as PaymentContent, S as SDKJobContext } from '../step-cache-C6lMgDH8.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-BtdD_xt1.js';
1
+ import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-U7dJM7Ph.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-C9JRSFhM.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-DjgN2AOk.js';
4
4
  import 'hono';
5
5
  import 'mppx';
6
6
  import '@x402/core/server';
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-C6lMgDH8.js';
1
+ import { C as Currency } from './step-cache-C9JRSFhM.js';
2
2
 
3
3
  /**
4
4
  * Thrown by `fiatToSatsCeil` / `satsToFiat` when the supplied `ratePerBtc` is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvmkit/sdk",
3
- "version": "0.7.0-rc.5",
3
+ "version": "0.7.0-rc.7",
4
4
  "description": "SDK for building accountless, pay-per-use Digital Vending Machines",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {