@dvmkit/sdk 0.12.0 → 0.14.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 (27) hide show
  1. package/dist/{chunk-RPUFWIT4.js → chunk-5JSPTVIK.js} +52 -2
  2. package/dist/{chunk-5H7P3ORL.js → chunk-5UC7TOQC.js} +22 -0
  3. package/dist/{chunk-2VGMZ7VF.js → chunk-A2YESDQM.js} +47 -11
  4. package/dist/{chunk-WFCVS6QB.js → chunk-HULU2UVM.js} +1 -1
  5. package/dist/{chunk-S7PIFHE4.js → chunk-JFH34P3M.js} +258 -31
  6. package/dist/{chunk-HW2UCOOC.js → chunk-SXL44PL5.js} +1 -1
  7. package/dist/{chunk-POYUX2NN.js → chunk-TKJBUFYY.js} +11 -3
  8. package/dist/{content-retention-a1yRdmhI.d.ts → content-retention-BcHNpP2F.d.ts} +1 -1
  9. package/dist/{credit-ledger-MF23UKRJ.js → credit-ledger-D3UUR2GW.js} +2 -2
  10. package/dist/{credit-menu-B2T-O9oY.d.ts → credit-menu-C-kmf61K.d.ts} +57 -5
  11. package/dist/{fx-DLhscRUh.d.ts → fx-hFlF4Cn8.d.ts} +1 -1
  12. package/dist/index.d.ts +5 -5
  13. package/dist/index.js +2 -2
  14. package/dist/internal/caller.d.ts +160 -9
  15. package/dist/internal/caller.js +141 -10
  16. package/dist/internal/index.js +1 -1
  17. package/dist/internal/server.d.ts +7 -7
  18. package/dist/internal/server.js +7 -7
  19. package/dist/{job-store-B8Ijr5V6.d.ts → job-store-DVCATwhU.d.ts} +1 -1
  20. package/dist/{lightning-backend-DmwMSgaM.d.ts → lightning-backend-DXNVlVs9.d.ts} +1 -1
  21. package/dist/{memory-credit-ledger-ERD764PS.js → memory-credit-ledger-SCXQO4HZ.js} +3 -3
  22. package/dist/server/index.d.ts +17 -13
  23. package/dist/server/index.js +9 -9
  24. package/dist/{step-cache-DQqpwXa8.d.ts → step-cache-CoORQQ_Y.d.ts} +108 -11
  25. package/dist/testing/index.d.ts +3 -3
  26. package/dist/{usd-D5kk2nIT.d.ts → usd-CeXGiyTC.d.ts} +1 -1
  27. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DmwMSgaM.js';
2
- import { ci as HostingCleanupFence, d3 as HostedIntent, aj as FundingMethod, p as PaymentMethod, bP as CreditLedgerLike, a5 as Message, $ as FundingReceipt, bR 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, d4 as X402SettlementIntent, ab as PaymentRequirementsV2, d5 as HostedFundingReservation, bL as CreditLedgerQuerier, d6 as X402SettlementCursor, bV as X402SettlementStatus, d7 as X402SettlementWriteOff, bQ as X402RefundSettlementGate, d8 as X402FacilitatorAuth, d9 as X402BatchSettlementConfig, cF as PostgresX402ChannelStorage, da as X402PayoutObserver, bN as HostedSettlementReportObligations, bn as CreditDepositPayload, bs as MppxServer, ae as CashuMode, db as CreditDepositEnqueue, dc as X402SettlementReconciliationReason, aq as PaymentRequirements, a3 as MppxCredential, bU as DrawResult, cs as CreditLedgerError, a7 as ReceiptCredit, ag as DrainReceiptEvent, a8 as DrainReceipt, K as KVStore, z as SignedRequestAudience, dd as CreditDrawReleaseEnqueue, cD as JobCostReportPayload, cE as JobTerminalReportPayload, cH as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, b_ as CreditInvoiceRecord, b$ as InvoiceSettlement, cm as ClientCompatibilityGate, ck as ClientCompatibility, bw as PostgresTempoSessionStore, bv as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-DQqpwXa8.js';
1
+ import { f as LockPubkey, e as CheckMintHealthOptions, b as LightningBackend, A as AttestationPayload } from './lightning-backend-DXNVlVs9.js';
2
+ import { co as HostingCleanupFence, d9 as HostedIntent, ak as FundingMethod, p as PaymentMethod, bU as CreditLedgerLike, a6 as Message, a0 as FundingReceipt, bW as CreditSnapshot, a1 as JobReceipt, S as SDKJobContext, ay as StepCache, v as ResponseContent, P as PaymentContent, a2 as MessageType, bp as X402Receipt, aH as X402Config, bo as X402ExactVersionSupport, da as X402SettlementIntent, ac as PaymentRequirementsV2, db as HostedFundingReservation, bQ as CreditLedgerQuerier, dc as X402SettlementCursor, b_ as X402SettlementStatus, dd as X402SettlementWriteOff, bV as X402RefundSettlementGate, de as X402FacilitatorAuth, df as X402BatchSettlementConfig, cL as PostgresX402ChannelStorage, dg as X402PayoutObserver, bS as HostedSettlementReportObligations, bs as CreditDepositPayload, bx as MppxServer, af as CashuMode, dh as CreditDepositEnqueue, di as X402SettlementReconciliationReason, ar as PaymentRequirements, c2 as FundingRecord, a4 as MppxCredential, bZ as DrawResult, cy as CreditLedgerError, a8 as ReceiptCredit, ah as DrainReceiptEvent, a9 as DrainReceipt, $ as DrawFundingReceipt, K as KVStore, z as SignedRequestAudience, dj as CreditDrawReleaseEnqueue, cJ as JobCostReportPayload, cK as JobTerminalReportPayload, cN as RevenueSkippedNoRailPayload, Z as ZodLike, a as DVMDescriptor, c4 as CreditInvoiceRecord, c5 as InvoiceSettlement, cs as ClientCompatibilityGate, cq as ClientCompatibility, bB as PostgresTempoSessionStore, bA as PayoutReporter, R as ResolvedCreditConfig, h as CreditView } from './step-cache-CoORQQ_Y.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-DLhscRUh.js';
6
+ import { d as FxSourceFailure, b as FxRateSnapshot, F as FxFetcher } from './fx-hFlF4Cn8.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-B8Ijr5V6.js';
8
+ import { T as TopUpCapUnenforcedReason, A as AppendOutgoingOptions, J as JobRecord, b as JobStore } from './job-store-DVCATwhU.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';
@@ -1832,6 +1832,12 @@ interface PaymentInfo {
1832
1832
  * told or they will re-send. Absent on every ordinary payment.
1833
1833
  */
1834
1834
  unappliedMicro?: number;
1835
+ /**
1836
+ * The ledger's own record of a mid-job funding accepted against the job's
1837
+ * pending draw, fixed inside the rail transaction. Carries the immutable
1838
+ * signing inputs for the caller-facing draw funding receipt.
1839
+ */
1840
+ drawFunding?: FundingRecord;
1835
1841
  }
1836
1842
  /**
1837
1843
  * A funding event as the platform books it — one deposit row (spec
@@ -2021,7 +2027,7 @@ interface UpfrontPaymentOpts {
2021
2027
  /**
2022
2028
  * Credit lifetime to mint, in ms — the DVM's advertised `credit.ttl`.
2023
2029
  * Defaults to {@link IMPLICIT_CREDIT_TTL_MS}. Threading it keeps the
2024
- * funding menu honest: a DVM advertising a 7-day TTL must not mint 30-day
2030
+ * funding menu honest: a DVM advertising a 7-day TTL must not mint 90-day
2025
2031
  * credits.
2026
2032
  */
2027
2033
  creditTtlMs?: number;
@@ -2409,6 +2415,12 @@ interface VerifiedIncomingPayment {
2409
2415
  * `null` delta.
2410
2416
  */
2411
2417
  unappliedMicro?: number;
2418
+ /**
2419
+ * The ledger funding row a mid-job top-up fixed for this payment, when the
2420
+ * job already held a draw. The route issues the signed draw funding receipt
2421
+ * from it; absent when the payment ran ledger-less or opened a fresh credit.
2422
+ */
2423
+ drawFunding?: FundingRecord;
2412
2424
  }
2413
2425
  /**
2414
2426
  * Verify an incoming payment without mutating the job. Returns the credit
@@ -2430,6 +2442,8 @@ declare function verifyIncomingPayment(body: {
2430
2442
  * still a deposit, still reported. See `PaymentErrorDetail`.
2431
2443
  */
2432
2444
  funding?: CreditFundingReport;
2445
+ /** The rail payment id a `replay_rejected` collided on, so the route can return its original evidence. */
2446
+ replayPaymentId?: string;
2433
2447
  };
2434
2448
  }>;
2435
2449
  /**
@@ -2486,6 +2500,8 @@ interface CommittedFunding {
2486
2500
  * find out.
2487
2501
  */
2488
2502
  unappliedMicro?: number;
2503
+ /** The `credit_fundings` row a mid-job top-up fixed beside its fund/grow leg. */
2504
+ drawFunding?: FundingRecord;
2489
2505
  deposit: CreditFundingReport;
2490
2506
  }
2491
2507
  /**
@@ -2563,6 +2579,24 @@ declare class ReceiptIssuer {
2563
2579
  callerPubkey: string;
2564
2580
  issuedAt?: number;
2565
2581
  }): FundingReceipt;
2582
+ /**
2583
+ * Countersign the immutable tuple captured when a mid-job payment funded a
2584
+ * job's credit against its pending draw. `ledgerSeq` is the draw's own
2585
+ * sequence so the artifact lines up with the terminal receipt's credit block.
2586
+ */
2587
+ issueDrawFunding(args: {
2588
+ creditId: string;
2589
+ jobId: string;
2590
+ drawId: string;
2591
+ fundId: string;
2592
+ paymentSeq?: number;
2593
+ currency: string;
2594
+ fundedMicro: number;
2595
+ balanceAfterMicro: number;
2596
+ ledgerSeq: number;
2597
+ callerPubkey: string;
2598
+ issuedAt?: number;
2599
+ }): DrawFundingReceipt;
2566
2600
  }
2567
2601
 
2568
2602
  /** Stable reason why the configured x402 exact rail cannot be advertised. */
@@ -2906,9 +2940,16 @@ type ProcessPaymentOutcome = {
2906
2940
  status: number;
2907
2941
  };
2908
2942
  unappliedCredit?: undefined;
2943
+ drawFundingReceipt?: undefined;
2909
2944
  } | {
2910
2945
  error?: undefined;
2911
2946
  unappliedCredit?: UnappliedCredit;
2947
+ /**
2948
+ * Signed evidence that this payment funded the job's credit against its
2949
+ * pending draw. Absent when the payment ran ledger-less, opened a fresh
2950
+ * credit, or the DVM has no receipt key.
2951
+ */
2952
+ drawFundingReceipt?: DrawFundingReceipt;
2912
2953
  };
2913
2954
  /**
2914
2955
  * Transport-agnostic job lifecycle manager.
@@ -3507,6 +3548,17 @@ declare class JobManager<State, InputSchema extends ZodLike | undefined> {
3507
3548
  lockPubkeys?: LockPubkey[];
3508
3549
  mintHealthTracker?: MintHealthTracker;
3509
3550
  }): Promise<ProcessPaymentOutcome>;
3551
+ /** Issue (or reuse) the signed draw funding receipt for a committed funding row; never throws. */
3552
+ private drawFundingReceiptFor;
3553
+ /**
3554
+ * Every signed draw funding receipt for a job's draw, oldest first, reissuing
3555
+ * any the acknowledgement never carried. Empty when the ledger cannot list
3556
+ * draw fundings or the job holds no draw; a lookup failure is logged and
3557
+ * answered as empty rather than failing the read.
3558
+ */
3559
+ drawFundingReceipts(job: Pick<JobRecord, "id" | "creditId" | "drawId">): Promise<DrawFundingReceipt[]>;
3560
+ /** The stored evidence for a replayed mid-job payment, looked up by the payment id the marker collided on. */
3561
+ private replayedDrawFundingReceipt;
3510
3562
  /**
3511
3563
  * Tx C with a bounded retry.
3512
3564
  *
@@ -1,4 +1,4 @@
1
- import { C as Currency } from './step-cache-DQqpwXa8.js';
1
+ import { C as Currency } from './step-cache-CoORQQ_Y.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-DQqpwXa8.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-DQqpwXa8.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-DLhscRUh.js';
4
- export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-D5kk2nIT.js';
5
- export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-B8Ijr5V6.js';
1
+ import { C as Currency, Z as ZodLike, D as DVMConfig, a as DVMDescriptor } from './step-cache-CoORQQ_Y.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-CoORQQ_Y.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-hFlF4Cn8.js';
4
+ export { I as InvalidFxRateError, f as fiatToSatsCeil, a as formatFiat, b as formatUsd, r as roundUsd, s as satsToFiat } from './usd-CeXGiyTC.js';
5
+ export { J as JobRecord, a as JobStatus, b as JobStore } from './job-store-DVCATwhU.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
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  SignedRequestError,
12
12
  createSignedRequestVerifier
13
- } from "./chunk-WFCVS6QB.js";
13
+ } from "./chunk-HULU2UVM.js";
14
14
  import {
15
15
  DEFAULT_CREDIT_MAX,
16
16
  DEFAULT_CREDIT_MIN,
@@ -20,7 +20,7 @@ import {
20
20
  SIGNED_REQUEST_STATEMENT_VERSION,
21
21
  isZodSchema,
22
22
  signedRequestStatementHeader
23
- } from "./chunk-HW2UCOOC.js";
23
+ } from "./chunk-SXL44PL5.js";
24
24
  import {
25
25
  buildUpfront
26
26
  } from "./chunk-D4FFS3IS.js";
@@ -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-DmwMSgaM.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-DmwMSgaM.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-DXNVlVs9.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-DXNVlVs9.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 { 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-DQqpwXa8.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-DQqpwXa8.js';
5
+ import { X as JsonValue, B as SignedRequestDomain, M as SignedRequestStatementHeader, Y as X402_BATCH_SETTLEMENT_SCHEME, _ as X402_EXACT_SCHEME, $ as DrawFundingReceipt, a0 as FundingReceipt, a1 as JobReceipt$1, a2 as MessageType, a3 as X402Version, a4 as MppxCredential, z as SignedRequestAudience, a5 as PaymentRequired, a6 as Message, a7 as MppxChallenge, a8 as ReceiptCredit, a9 as DrainReceipt, C as Currency, aa as X402Wallet, ab as PaymentRequirementsV1, ac as PaymentRequirementsV2, L as Logger$1, K as KVStore } from '../step-cache-CoORQQ_Y.js';
6
+ export { ad as BuildPaymentRequirementsOpts, ae as CapabilityDescriptor, af as CashuMode, ag as CompleteContent, ah as DrainReceiptEvent, ai as ExactEvmPayload, aj as ExactEvmPayloadAuthorization, ak as FundingMethod, al as MessageFrom, am as PaymentPayload, an as PaymentPayloadV1, ao as PaymentPayloadV2, ap as PaymentRequestContent, aq as PaymentRequiredV2, ar as PaymentRequirements, as as PromptContent, at as RAIL_REFUNDABLE, au as ReceiptOutcome, av as ReceiptPayment, aw as ResourceInfo, ax as SettleResponse, ay as StepCache, az as StepRecord, aA as TextContent, aB as UnsignedDrainReceipt, aC as UnsignedDrawFundingReceipt, aD as UnsignedFundingReceipt, aE as UnsignedJobReceipt, aF as VerifyResponse, aG as WorkingContent, aH as X402Config, aI as X402ResponseBody, aJ as X402SelfRelayRpcFailureReason, aK as X402_DEFAULT_NETWORK, aL as X402_V1_VERSION, aM as X402_VERSION, aN as buildPaymentRequiredV2, aO as buildPaymentRequirements, aP as caip2ToX402Network, aQ as canonicalRequestPath, aR as canonicaliseForSigning, aS as canonicalize, aT as chainIdFromCaip2, aU as computeResultHash, aV as decodePayment, aW as decodePaymentRequiredHeader, aX as encodePayment, aY as encodePaymentRequiredHeader, aZ as encodeSettleResponseHeader, a_ as exactEvmAuthorization, a$ as isArtifactMessage, b0 as isCancelMessage, b1 as isCompleteMessage, b2 as isDrainReceipt, b3 as isDrawFundingReceipt, b4 as isFundingReceipt, b5 as isPaymentRequestMessage, b6 as isPromptMessage, b7 as isSignedJobReceipt, b8 as isTextMessage, b9 as isWorkingMessage, ba as paymentRequiredV2FromV1, bb as signDrainReceipt, bc as signDrawFundingReceipt, bd as signFundingReceipt, be as signReceipt, bf as usdcContractByCaip2, bg as usdcContractFor, bh as usdcDomainNameFor, bi as usdcDomainVersionFor, bj as verifyDrainReceipt, bk as verifyDrawFundingReceipt, bl as verifyFundingReceipt, bm as verifyReceipt, bn as x402NetworkToCaip2 } from '../step-cache-CoORQQ_Y.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-DLhscRUh.js';
13
- export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-D5kk2nIT.js';
12
+ export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-hFlF4Cn8.js';
13
+ export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-CeXGiyTC.js';
14
14
  import 'hono';
15
15
  import 'mppx';
16
16
  import '@x402/core/server';
@@ -792,7 +792,7 @@ interface TrustAnchorRead {
792
792
  * isolate tier, which omits the `/v1/info` `receipts` flag).
793
793
  */
794
794
  type ReceiptVerification = "verified" | "verified_unattested" | "invalid" | "absent";
795
- type ReceiptInvalidReason = "job_id_mismatch" | "drain_id_mismatch" | "credit_id_mismatch" | "fund_id_mismatch" | "funding_amount_mismatch" | "funding_balance_mismatch" | "funding_ledger_seq_mismatch" | "caller_pubkey_mismatch" | "signature_invalid" | "attestation_invalid" | "dvm_identity_mismatch" | "receipt_key_mismatch" | "result_hash_mismatch";
795
+ type ReceiptInvalidReason = "job_id_mismatch" | "drain_id_mismatch" | "draw_id_mismatch" | "credit_id_mismatch" | "fund_id_mismatch" | "funding_amount_mismatch" | "funding_balance_mismatch" | "funding_ledger_seq_mismatch" | "funding_currency_mismatch" | "caller_pubkey_mismatch" | "signature_invalid" | "attestation_invalid" | "dvm_identity_mismatch" | "receipt_key_mismatch" | "result_hash_mismatch";
796
796
 
797
797
  /**
798
798
  * The pair two hostnames must present identically before caller state may be
@@ -901,6 +901,24 @@ interface FundingReceiptVerifyResult {
901
901
  reason?: ReceiptInvalidReason;
902
902
  receipt?: FundingReceipt;
903
903
  }
904
+ interface DrawFundingReceiptChecks {
905
+ credit_id: "ok" | "mismatch" | "unchecked";
906
+ job_id: "ok" | "mismatch" | "unchecked";
907
+ draw_id: "ok" | "mismatch" | "unchecked";
908
+ fund_id: "ok" | "mismatch" | "unchecked";
909
+ currency: "ok" | "mismatch" | "unchecked";
910
+ funded_micro: "ok" | "mismatch" | "unchecked";
911
+ ledger_seq: "ok" | "mismatch" | "unchecked";
912
+ caller_pubkey: "ok" | "mismatch" | "unchecked";
913
+ signature: boolean;
914
+ attestation: ReceiptChecks["attestation"];
915
+ }
916
+ interface DrawFundingReceiptVerifyResult {
917
+ status: ReceiptVerification;
918
+ checks: DrawFundingReceiptChecks;
919
+ reason?: ReceiptInvalidReason;
920
+ receipt?: DrawFundingReceipt;
921
+ }
904
922
  interface VerifyJobReceiptArgs {
905
923
  receipt: JobReceipt$1;
906
924
  /** `/v1/info#builder` for the endpoint that issued it, when known. */
@@ -978,6 +996,26 @@ declare function verifyFundingReceiptChain(args: {
978
996
  expectedLedgerSeq?: number;
979
997
  expectedCallerPubkey?: string;
980
998
  }): FundingReceiptVerifyResult;
999
+ /**
1000
+ * Walk the trust chain for one mid-job **draw funding** receipt, in the same
1001
+ * verdict vocabulary as {@link verifyFundingReceiptChain}. Bindings are checked
1002
+ * before the signature for the reason the drain walk gives: the dangerous
1003
+ * artifact is a validly signed one filed against someone else's credit, job,
1004
+ * draw or payment, which every later link would wave through. A funding fact
1005
+ * that cannot be bound exactly must never raise an expected balance.
1006
+ */
1007
+ declare function verifyDrawFundingReceiptChain(args: {
1008
+ receipt: unknown;
1009
+ builder?: ReceiptTrustAnchor;
1010
+ expectedCreditId?: string;
1011
+ expectedJobId?: string;
1012
+ expectedDrawId?: string;
1013
+ expectedFundId?: string;
1014
+ expectedCurrency?: string;
1015
+ expectedFundedMicro?: number;
1016
+ expectedLedgerSeq?: number;
1017
+ expectedCallerPubkey?: string;
1018
+ }): DrawFundingReceiptVerifyResult;
981
1019
  /**
982
1020
  * Fold a set of verdicts into the one verdict the set collectively earns —
983
1021
  * what a bundle of receipts, taken together, proves.
@@ -1412,6 +1450,25 @@ interface JobStatus {
1412
1450
  fundingReceiptParseError?: ReceiptParseError;
1413
1451
  fundedMicro?: number;
1414
1452
  credit?: CreditWire;
1453
+ /**
1454
+ * Signed mid-job funding evidence for this job's draw (`draw_funding_receipts`),
1455
+ * oldest first. The recovery surface for an acknowledgement that never
1456
+ * arrived: the provider reissues every artifact from its committed rows.
1457
+ */
1458
+ drawFundingReceipts?: DrawFundingReceipt[];
1459
+ /** Present when an offered draw funding receipt failed the structural guard. */
1460
+ drawFundingReceiptParseError?: ReceiptParseError;
1461
+ }
1462
+ /**
1463
+ * What a provider's `201` to a job message carries, when the transport
1464
+ * surfaces it. `seq` names the durable inbound message; `drawFundingReceipt`
1465
+ * is the signed fact a mid-job rail payment funded the job's own draw.
1466
+ */
1467
+ interface SendMessageResult {
1468
+ seq: number;
1469
+ drawFundingReceipt?: DrawFundingReceipt;
1470
+ /** Present when the response offered a `draw_funding_receipt` that failed the structural guard. */
1471
+ drawFundingReceiptParseError?: ReceiptParseError;
1415
1472
  }
1416
1473
  /**
1417
1474
  * Per-capability advertisement on `/v1/info.capabilities`. One entry
@@ -1726,7 +1783,8 @@ interface Transport {
1726
1783
  requestResume?(provider: ProviderRef, requestId: string, signedJob: JobEnvelope, options?: SubmitOptions): Promise<void>;
1727
1784
  status(jobId: string, provider?: ProviderRef, options?: StatusOptions): Promise<JobStatus>;
1728
1785
  getMessages(jobId: string, after: number, provider?: ProviderRef, options?: MessagePollOptions): Promise<Message[]>;
1729
- sendMessage(jobId: string, message: OutboundMessage, provider?: ProviderRef, options?: SendMessageOptions): Promise<void>;
1786
+ /** Resolves with the acknowledgement when the transport parses one; older transports resolve `void`. */
1787
+ sendMessage(jobId: string, message: OutboundMessage, provider?: ProviderRef, options?: SendMessageOptions): Promise<SendMessageResult | void>;
1730
1788
  cancel(jobId: string, reason?: string, provider?: ProviderRef, options?: CancelOptions): Promise<void>;
1731
1789
  /** Open a message stream for a job. Blocks until the provider yields. */
1732
1790
  stream?(jobId: string, afterSeq: number, provider?: ProviderRef, options?: StreamOptions): Promise<StreamResult>;
@@ -1977,12 +2035,66 @@ interface StoredDrainEvidence {
1977
2035
  feeMicro: number | null;
1978
2036
  };
1979
2037
  }
2038
+ /**
2039
+ * One verified mid-job funding fact, held until the draw it grew settles.
2040
+ *
2041
+ * The caller's projection never sees money accepted while a job runs: the
2042
+ * DVM funds the credit and grows the pending draw in one ledger step that
2043
+ * allocates no sequence, so the terminal receipt's `balance_after` includes it
2044
+ * while `remainingMicro − amount` does not. A fact is admitted only after
2045
+ * {@link verifyDrawFundingReceiptChain} binds it to this caller, credit and
2046
+ * provider, and it is spent exactly once, by the terminal receipt whose
2047
+ * `draw_id` and `ledger_seq` it names.
2048
+ */
2049
+ interface StoredDrawFunding {
2050
+ /** Rail payment id the funding committed under; the at-most-once key. */
2051
+ fundId: string;
2052
+ jobId: string;
2053
+ drawId: string;
2054
+ /** Provider-credited micro-units of the credit currency. */
2055
+ fundedMicro: number;
2056
+ /** The draw's ledger sequence — what the terminal receipt's credit block names. */
2057
+ ledgerSeq: number;
2058
+ /** Available balance the DVM signed immediately after the funding committed. */
2059
+ balanceAfterMicro: number;
2060
+ /** Epoch ms the fact was admitted locally. */
2061
+ recordedAt: number;
2062
+ /** The verbatim signed artifact, retained as evidence. */
2063
+ receipt: DrawFundingReceipt;
2064
+ }
2065
+ /** Why {@link recordDrawFunding} refused an artifact. */
2066
+ type DrawFundingRejection =
2067
+ /** Not a structurally valid, correctly signed draw funding receipt (see `verifyReason`). */
2068
+ "invalid"
2069
+ /** No tracked credit for this caller matches the receipt's credit at this provider. */
2070
+ | "unknown_credit"
2071
+ /** The receipt names a different caller pubkey. */
2072
+ | "caller_mismatch"
2073
+ /** The receipt's DVM identity or signing key does not chain to the provider this record is bound to. */
2074
+ | "provider_mismatch"
2075
+ /** The receipt is denominated in a different currency than the tracked credit. */
2076
+ | "currency_mismatch"
2077
+ /** A fact with this fund id is already held. */
2078
+ | "duplicate"
2079
+ /** The projection is already anchored at or beyond the funding's draw sequence. */
2080
+ | "already_reflected";
2081
+ interface RecordDrawFundingResult {
2082
+ /** The record the fact was judged against, when one exists. */
2083
+ credit?: StoredCredit;
2084
+ /** True when the fact is now held and eligible for reconciliation. */
2085
+ recorded: boolean;
2086
+ reason?: DrawFundingRejection;
2087
+ /** The chain verdict's reason when `reason` is `invalid` or `provider_mismatch`. */
2088
+ verifyReason?: ReceiptInvalidReason;
2089
+ }
1980
2090
  /** A detected disagreement between the local projection and a signed receipt. */
1981
2091
  interface CreditDiscrepancy {
1982
2092
  /** Epoch ms the mismatch was detected. */
1983
2093
  atMs: number;
1984
2094
  /** What the local projection said the balance should be after the draw. */
1985
2095
  expectedMicro: number;
2096
+ /** Verified mid-job funding the expectation credited before subtracting the draw. */
2097
+ fundedMicro?: number;
1986
2098
  /** What the DVM's countersigned receipt reported. */
1987
2099
  reportedMicro: number;
1988
2100
  /** The draw whose receipt disagreed. */
@@ -2173,6 +2285,12 @@ interface StoredCredit extends DvmLocated {
2173
2285
  drainEvidence?: StoredDrainEvidence[];
2174
2286
  /** Most recent balance mismatch, kept until the next clean receipt. */
2175
2287
  discrepancy?: CreditDiscrepancy;
2288
+ /**
2289
+ * Verified mid-job funding facts awaiting the terminal receipt of the draw
2290
+ * they grew. Pruned once that draw settles or releases, or once the
2291
+ * projection re-anchors at or beyond their sequence.
2292
+ */
2293
+ drawFundings?: StoredDrawFunding[];
2176
2294
  }
2177
2295
  /**
2178
2296
  * A DVM-level funding-menu snapshot, independent of any balance the caller
@@ -2195,6 +2313,8 @@ interface ApplyReceiptResult {
2195
2313
  credit?: StoredCredit;
2196
2314
  /** Present when the signed `balance_after` contradicted the local projection. */
2197
2315
  mismatch?: CreditDiscrepancy;
2316
+ /** Verified mid-job funding the comparison credited to this draw, when any applied. */
2317
+ fundedMicro?: number;
2198
2318
  }
2199
2319
  /** Result of folding an implicit credit receipt into its separate local namespace. */
2200
2320
  interface ApplyImplicitReceiptResult {
@@ -2401,8 +2521,39 @@ declare function applyReceiptCredit(args: {
2401
2521
  jobId: string;
2402
2522
  outcome: "completed" | "failed" | "cancelled";
2403
2523
  credit: ReceiptCredit;
2524
+ /**
2525
+ * Mid-job funding evidence in hand at reconciliation time, admitted under the
2526
+ * same lock before the comparison so no sibling process can settle the draw
2527
+ * between the two. Each entry is judged exactly as {@link recordDrawFunding}
2528
+ * judges it; a refused entry is simply not credited.
2529
+ */
2530
+ drawFundings?: {
2531
+ receipt: unknown;
2532
+ builder?: ReceiptTrustAnchor;
2533
+ }[];
2404
2534
  now?: number;
2405
2535
  }): ApplyReceiptResult;
2536
+ /**
2537
+ * Admit one signed mid-job funding fact for later reconciliation.
2538
+ *
2539
+ * Verification happens here, not at the call site: an artifact that raises an
2540
+ * expected balance can hide a real shortfall, so nothing reaches
2541
+ * {@link StoredCredit.drawFundings} unless its signature holds, it names this
2542
+ * caller and credit, and it chains to the provider the record is bound to. An
2543
+ * attested record requires a `verified` chain under its own attested builder;
2544
+ * an unattested record accepts `verified_unattested`, the same standard its job
2545
+ * receipts meet. A fact the projection has already passed is refused as
2546
+ * `already_reflected` rather than held for a comparison that can never arm.
2547
+ */
2548
+ declare function recordDrawFunding(args: {
2549
+ endpoint: string;
2550
+ identity?: AttestedDvmIdentity;
2551
+ callerPubkey: string;
2552
+ receipt: unknown;
2553
+ /** `/v1/info#builder` of the issuing endpoint, when the caller has it. */
2554
+ builder?: ReceiptTrustAnchor;
2555
+ now?: number;
2556
+ }): RecordDrawFundingResult;
2406
2557
  /**
2407
2558
  * Fold one countersigned `imp:` balance into the released-value namespace.
2408
2559
  *
@@ -6343,4 +6494,4 @@ declare class MemoryKVStore implements KVStore {
6343
6494
  list(prefix?: string): Promise<string[]>;
6344
6495
  }
6345
6496
 
6346
- export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentRecentSpend, type AgentWallet, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetCheckResult, type BudgetLedger, type BudgetLedgerEntry, type BudgetSpendBreakdown, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, type CachedBtcRate, type CancelOptions, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type CompletedCreditHistoryPage, type CompletedCreditHistoryQuery, type CompletedCreditHistoryRecord, type CompletedRefundHistoryRecord, type ConfigDirModeResult, CreatedInvoice, type CreditDrainRail, type CreditFundRail, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DIAGNOSTIC_CATALOGUE_VERSION, DbTransport, type DeliveredResult, type DescribeOptions, type DiagnosticCapabilityAuthority, type DiagnosticIdentityAuthority, DrainReceipt, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, DvmError, DvmX402ChannelStorage, type ExpiredCreditLossHistoryRecord, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, type FundValuation, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, JOB_IDENTITY_HEADER, type JobEnvelope, type JobIdentityHeaderResult, type JobPolicy, JobReceipt$1 as JobReceipt, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, MemoryKVStore, Message, type MessagePollOptions, MessageType, type MnemonicValidationResult, MppxChallenge, MppxCredential, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, PaymentRequired, PaymentRequirementsV1, PaymentRequirementsV2, type PendingDrain, type PendingFunding, type PendingMelt, type PendingMint, type PendingMintMintingState, type PendingSubmission, type PendingSubmissionAcceptedUnresolved, type PendingSubmissionContext, type PendingTempoChargeFunding, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailAsset, type RailFlag, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type RecordSpendOptions, type RpcSource, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SpanProjectionResult, type SpanRow, type SpanTransport, SpanWriter, type StatusOptions, type StoredCredit, type StoredCreditX402Binding, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmitOptions, type SwapSendReserve, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_CHARGE_PENDING_STALE_MS, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, TEMPO_SESSION_UPDATED_REASON, type TempoAccount, type TempoChannelAssociation, type TempoChannelController, type TempoChannelDescriptor, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoChannelStoreContext, type TempoCredentialAccount, type TempoNetwork, type TempoSessionClientResolver, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletCredentialConfig, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, type X402VoucherPendingState, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, advanceTempoChannelExit, appendBudgetSpend, appendFundingReceipt, appendReceipt, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertNoRivalX402Voucher, assertSupportedX402Network, assertTempoSessionChallengeWithinAsk, assertTempoSessionDepositWithinCap, assertTempoSessionVoucherWithinAsk, assertX402ChannelPayer, assertX402RequirementDescribesChannel, attestedDvmIdentity, authenticatedBuilderPubkey, backupSecretFile, bindCashuTokenToSubmissionContext, bindDiagnosticCapabilityAuthority, bindDiagnosticIdentityAuthority, breakdownSince, buildAdminAuthHeader, buildAdminChallenge, builderLockPath, canReplaceExpiredX402Deposit, capFor, cashuSubmissionBindingFingerprint, cashuSubmissionBindingFromContext, checkBudgetForLedger, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingFunding, clearPendingTempoChargeFunding, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, computeSmartDenominations, costAnchor, coveringMintsForSpend, createDiagnosticCapabilityAuthority, createMintQuoteRetryState, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoChannelStore, createTempoCloseCredential, createTempoCreditSession, createTempoSessionPaymentFetch, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveAgentRefundSubkey, deriveAgentRefundSubkeyPubkey, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, dvmLocationIdentity, effectiveFundingMint, effectiveMints, ensureAddress, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, extendDiagnosticIdentityAuthority, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, findX402Channel, forgetCredit, formatStaleness, formatUsd, formatUsdcMicrounits, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, generateAgentMnemonic, generateEphemeralReceiptKey, generateX402PrivateKey, getBalance, getBalanceByMint, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isJobIdentityValue, isPublicRequestId, isSignableExactRequirement, isStablecoinFundRail, isStorableJobId, isValidEvmPrivateKey, issueRouterFeedbackClaim, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadBudgetLedger, loadCredit, loadCreditX402Binding, loadIdentities, loadImplicitCredits, loadPendingFunding, loadReceipt, loadReceipts, loadResumableTempoChargeFunding, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelAssociationByKey, loadTempoChannelController, loadTempoChannelEntry, loadWalletConfiguredMints, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markRefillDrainNoticed, markRefillRailUnavailable, maxAdvertisedMicro, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcTimeoutMs, offersTempoCreditCharge, offersTempoCreditFunding, offersTempoCreditSession, offersX402CreditChannel, offersX402CreditFlavour, offersX402CreditFunding, parseCreditMenu, parseCreditTerms, parseJobIdentityHeader, parseLnAddress, parseNwcUri, parseTraceparent, payInvoiceReconciling, pendingDrainById, pendingDrainFor, persistTempoOpenCredential, pinDimension, prepareP2PKMint, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, projectDiagnosticFields, projectEventName, projectSpanRow, providerProseSources, providerTextToString, randomTraceId, readAgentMnemonic, readCompletedCreditHistory, readFundValuation, readX402ChannelGuardFacts, readX402ChannelOnChain, receiptPubkeyFromSecret, receiveToAgentWallet, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingFunding, recordPendingTempoChargeFunding, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordX402ChannelMetadata, redactUrl, redactUrlsInText, refundX402BatchChannel, rehydrateOutputData, repairConfigDirMode, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retirePendingX402Funding, retireTempoChannel, retireTempoChannelScope, retryMintQuoteOperation, saveAgentWallet, saveBudgetLedger, saveIdentities, selectProofsForSpend, serializeOutputData, setEmitter, settleDrainEvidence, sha256hex, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendEntry, swapFeeForProofs, swapSendReserve, tempoAccountFromConfig, tempoBalanceCheckHint, tempoChallengeAmountMicro, tempoChannelControlledBy, tempoChargeCredentialSettleable, tempoCredentialAmountMicro, tempoCredentialValidBefore, tempoDescriptorController, tempoSessionAssociationByKey, tempoSessionChallenge, tempoSessionChallengeChannelScope, tempoSessionChallengeMicro, tempoSessionCredentialChannelScope, tempoSessionCredentialCumulativeMicro, tempoSessionCumulativeCapMicro, tempoSessionPriorCumulativeMicro, tempoTokenReference, toAgentProof, toCashuProofs, transportErrorCode, tryResolveTempoAsset, unsignRequestData, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowEnd, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, withholdsTempoCreditSession, withinAdvertisedTolerance, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402CreditFlavour, x402CreditFundingNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402InstrumentForFlavour, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingState, x402WalletFromConfig };
6497
+ export { ADMIN_STATE_UNAVAILABLE, AGENT_MNEMONIC_FILE, type AgentProof, type AgentRecentSpend, type AgentWallet, type AttestedDvmIdentity, BTC_RATE_FILE, BUDGET_FILE, type BudgetCaps, type BudgetCheckResult, type BudgetLedger, type BudgetLedgerEntry, type BudgetSpendBreakdown, type BudgetSpendKind, type BudgetWindow, type BuilderLockKeypair, CAPABILITY_NAME_RE, COINGECKO_SIMPLE_PRICE_URL, CONFIG_AUDIT_FILE, CONFIG_BACKUP_FILE, CONFIG_DIR, CONFIG_FILE, CONFIG_PINNED_FILE, CREDITS_FILE, CREDIT_DRAIN_RAILS, CREDIT_FUNDING_MODES, CREDIT_FUND_RAILS, type CachedBtcRate, type CancelOptions, type CliIdentityEntry, type CoinGeckoBtcSpot, type CoinGeckoSpot, type CompletedCreditHistoryPage, type CompletedCreditHistoryQuery, type CompletedCreditHistoryRecord, type CompletedRefundHistoryRecord, type ConfigDirModeResult, CreatedInvoice, type CreditDrainRail, type CreditFundRail, type CreditFundingMode, type CreditMenu, type CreditOpResult, type CreditTerms, type CreditWire, DEFAULT_AGENT_MINT_URL, DIAGNOSTIC_CATALOGUE_VERSION, DbTransport, type DeliveredResult, type DescribeOptions, type DiagnosticCapabilityAuthority, type DiagnosticIdentityAuthority, DrainReceipt, type DrainReceiptChecks, type DrainReceiptVerifyResult, type DrainWire, DrawFundingReceipt, type DrawFundingReceiptChecks, type DrawFundingReceiptVerifyResult, type DrawFundingRejection, DvmError, DvmX402ChannelStorage, type ExpiredCreditLossHistoryRecord, FAVORITES_FILE, FEEDBACK_NUDGES_FILE, type FundValuation, FundingReceipt, type FundingReceiptChecks, type FundingReceiptVerifyResult, IDENTITIES_FILE, IDENTITIES_VERSION, type IdentitiesFile, InvoiceStatus, JOBS_FILE, JOB_IDENTITY_HEADER, type JobEnvelope, type JobIdentityHeaderResult, type JobPolicy, JobReceipt$1 as JobReceipt, type JobStatus, JsonValue, LightningBackend, type LightningFundingOffer, LightningPayment, LightningTransactionListOptions, LightningTransactionSnapshot, LightningWalletInfo, type LnAddressParts, MESSAGES_DIR, type MeltQuoteInfo, MemoryKVStore, Message, type MessagePollOptions, MessageType, type MnemonicValidationResult, MppxChallenge, MppxCredential, NwcBackend, type NwcConnection, NwcError, type NwcRequestOptions, type NwcTransaction, type OutboundMessage, PAIRINGS_DIR, PRIVKEY_HEX_RE, type PayInvoiceOutcome, type PayInvoiceReconcilingOptions, type PayInvoiceResult, type PayOutcome, type Payment, PaymentRequired, PaymentRequirementsV1, PaymentRequirementsV2, type PendingDrain, type PendingFunding, type PendingMelt, type PendingMint, type PendingMintMintingState, type PendingSubmission, type PendingSubmissionAcceptedUnresolved, type PendingSubmissionContext, type PendingTempoChargeFunding, type PendingX402ExactFunding, type PendingX402Funding, type PersistedOutputData, PersistentCounterSource, type ProviderInfo, type ProviderRef, type ProviderText, type Quote, RAIL_FLAGS, RECEIPTS_FILE, RECENT_SPENDS_CAP, RECOVERY_MNEMONIC_FILE, REQUEST_INTENTS_DIR, ROUTER_FEEDBACK_CLAIM_HEADER, ROUTER_FEEDBACK_CLAIM_TTL_MS, type Rail, type RailAsset, type RailFlag, type ReceiptChecks, ReceiptCredit, type ReceiptInvalidReason, type ReceiptKeypair, type ReceiptParseError, type ReceiptTrustAnchor, type ReceiptVerification, type ReceiptVerifyResult, type RecordDrawFundingResult, type RecordSpendOptions, type RpcSource, SPANS_INSERTED_CHANNEL, STABLECOIN_FUND_RAILS, SUPPORTED_PROTOCOL_VERSION, type SelectError, type SendMessageOptions, type SendMessageResult, type SpanProjectionResult, type SpanRow, type SpanTransport, SpanWriter, type StatusOptions, type StoredCredit, type StoredCreditX402Binding, type StoredDrawFunding, type StoredFundingMenuSnapshot, type StoredImplicitCredit, type StoredReceipt, type StoredSiblingCredit, type StoredX402ChannelConfig, type StoredX402ChannelMetadata, type StreamOptions, type StreamResult, type SubmitOptions, type SwapSendReserve, TEMPO_CHAIN_ID, TEMPO_CHANNELS_FILE, TEMPO_CHARGE_PENDING_STALE_MS, TEMPO_MODERATO_CHAIN_ID, TEMPO_MODERATO_RPC, TEMPO_PATH_USD_MODERATO, TEMPO_SESSION_UPDATED_REASON, type TempoAccount, type TempoChannelAssociation, type TempoChannelController, type TempoChannelDescriptor, type TempoChannelExitResult, type TempoChannelReconcileResult, type TempoChannelStoreContext, type TempoCredentialAccount, type TempoNetwork, type TempoSessionClientResolver, type Transport, type JobReceipt as TransportJobReceipt, type TrustAnchorRead, type V1InfoCapability, type V1InfoResponse, type VerifyJobReceiptArgs, WALLET_FILE, WALLET_VERSION, type WalletCredentialConfig, type WalletInfo, type X402Asset, type X402Balance, type X402BatchPayment, type X402ChannelChainReport, type X402ChannelClient, type X402ChannelReconciliation, type X402ConnectedWallet, type X402CreditFlavour, type X402CreditInstrument, X402EnvValidationError, type X402Network, type X402RefundArgs, type X402RefundOutcome, type X402RepinnedWallet, type X402UnobservedBalanceProvenance, X402Version, type X402VoucherPendingState, X402Wallet, X402_BATCH_CHANNEL_ABI, X402_BATCH_SETTLEMENT_KEY, X402_BATCH_SETTLEMENT_SCHEME, X402_CHANNELS_FILE, X402_DEFAULT_FACILITATOR, X402_EXACT_AUTHORIZATION_TTL_SECONDS, X402_EXACT_SCHEME, X402_NETWORKS, X402_PENDING_STALE_MS, X402_RECEIVER_AUTHORIZER_KEY, X402_REFUSAL_TRANSACTION_DISCOVERY_WINDOW_MS, X402_RPC_URL_KEY, X402_SELF_RELAY_KEY, acknowledgeReplayedX402Payment, acknowledgeX402ChannelOwner, advanceTempoChannelExit, appendBudgetSpend, appendFundingReceipt, appendReceipt, applyImplicitReceiptCredit, applyReceiptCredit, applyRetryToPool, asProviderText, asProviderTextOpt, assertAgentMnemonicReplaceable, assertNoRivalX402Voucher, assertSupportedX402Network, assertTempoSessionChallengeWithinAsk, assertTempoSessionDepositWithinCap, assertTempoSessionVoucherWithinAsk, assertX402ChannelPayer, assertX402RequirementDescribesChannel, attestedDvmIdentity, authenticatedBuilderPubkey, backupSecretFile, bindCashuTokenToSubmissionContext, bindDiagnosticCapabilityAuthority, bindDiagnosticIdentityAuthority, breakdownSince, buildAdminAuthHeader, buildAdminChallenge, builderLockPath, canReplaceExpiredX402Deposit, capFor, cashuSubmissionBindingFingerprint, cashuSubmissionBindingFromContext, checkBudgetForLedger, checkMeltQuoteState, checkReceiptAttestation, clearCreditSelection, clearPendingDrain, clearPendingFunding, clearPendingTempoChargeFunding, clearPendingX402ExactFunding, clearPendingX402Funding, clearRefillRailUnavailable, generateIdentity as cliIdentityStoreGenerateIdentity, computeSmartDenominations, costAnchor, coveringMintsForSpend, createDiagnosticCapabilityAuthority, createMintQuoteRetryState, createMonotonicClock, createNoopLogger, createStdoutLogger, createTempoChannelStore, createTempoCloseCredential, createTempoCreditSession, createTempoSessionPaymentFetch, createX402BatchPayment, currentContext, deleteAgentMnemonic, deriveAgentMasterKeypair, deriveAgentRefundSubkey, deriveAgentRefundSubkeyPubkey, deriveBuilderLockKeypair, deriveBuilderLockPubkey, deriveIdentityFromPrivkey, derivePubkeyFromPrivkey, deriveReceiptKeypair, deriveReceiptSecret, deriveTempoAddress, dvmLocationIdentity, effectiveFundingMint, effectiveMints, ensureAddress, ensureConfigDir, ensureConfigSubdir, ensureProvisionalCredit, entryKind, extendDiagnosticIdentityAuthority, fetchBtcUsdRate, fetchCoinGeckoBtcUsd, fetchCoinGeckoSpot, fetchLnurlPayInvoice, fetchMeltQuote, findX402Channel, forgetCredit, formatStaleness, formatUsd, formatUsdcMicrounits, fundWireAmountMicro, fundingModeForTempoIntent, fundingModeForX402Flavour, generateAgentMnemonic, generateEphemeralReceiptKey, generateX402PrivateKey, getBalance, getBalanceByMint, getInfo, getInputFeesForProofs, getLastKnownBtcRate, getTempoUsdcBalance, getX402Balance, hashedCanonicalDvmId, identitiesFileExists, initLoggers, insertSpanBatch, isAbortError, isCreditFundRail, isCreditFundingMode, isJobIdentityValue, isPublicRequestId, isSignableExactRequirement, isStablecoinFundRail, isStorableJobId, isValidEvmPrivateKey, issueRouterFeedbackClaim, listCredits, listFundingMenuSnapshots, listImplicitCredits, listPendingFundings, listPendingX402Fundings, listPendingX402FundingsForChannel, listResumableTempoChargeFundings, listResumableX402ExactFundings, listResumableX402Fundings, listTempoChannelAssociations, listTransactions, listX402Channels, loadAgentWallet, loadBudgetLedger, loadCredit, loadCreditX402Binding, loadIdentities, loadImplicitCredits, loadPendingFunding, loadReceipt, loadReceipts, loadResumableTempoChargeFunding, loadResumableX402ExactFunding, loadResumableX402Funding, loadTempoChannelAssociation, loadTempoChannelAssociationByKey, loadTempoChannelController, loadTempoChannelEntry, loadWalletConfiguredMints, loggers, looksLikeMnemonic, lookupInvoice, makeInvoice, markCredit, markImplicitCreditLost, markRefillDrainNoticed, markRefillRailUnavailable, maxAdvertisedMicro, maxKeysetDenomination, microToSats, missingDleqRecoveryDiagnostic, mnemonicFingerprint, msatsToMicro, msatsToUsd, msatsToUsdCents, msatsToUsdc, normalizeCreditEndpoint, normalizeFeedbackEndpointHost, nwcDedupWindowMs, nwcTimeoutMs, offersTempoCreditCharge, offersTempoCreditFunding, offersTempoCreditSession, offersX402CreditChannel, offersX402CreditFlavour, offersX402CreditFunding, parseCreditMenu, parseCreditTerms, parseJobIdentityHeader, parseLnAddress, parseNwcUri, parseTraceparent, payInvoiceReconciling, pendingDrainById, pendingDrainFor, persistTempoOpenCredential, pinDimension, prepareP2PKMint, processX402BatchCorrection, processX402BatchResponse, processX402BatchResponseForWallet, projectDiagnosticFields, projectEventName, projectSpanRow, providerProseSources, providerTextToString, randomTraceId, readAgentMnemonic, readCompletedCreditHistory, readFundValuation, readX402ChannelGuardFacts, readX402ChannelOnChain, receiptPubkeyFromSecret, receiveToAgentWallet, reconcileRefusedX402Deposits, reconcileTempoChannelOnChain, recordBalanceResponse, recordCreditX402Instrument, recordDrainReceipts, recordDrawFunding, recordFundResponse, recordFundingMenuSnapshot, recordPendingDrain, recordPendingFunding, recordPendingTempoChargeFunding, recordPendingX402ExactFunding, recordPendingX402Funding, recordRefusedDrawBalance, recordX402ChannelMetadata, redactUrl, redactUrlsInText, refundX402BatchChannel, rehydrateOutputData, repairConfigDirMode, resolveLnurlPayMetadataUrl, resolveRpcHttpTransportOptions, resolveRpcOverride, resolveTempoAsset, resolveTempoNetwork, resolveX402Asset, resolveX402ChannelRpc, restoreProofsFromOutputs, retirePendingX402Funding, retireTempoChannel, retireTempoChannelScope, retryMintQuoteOperation, saveAgentWallet, saveBudgetLedger, saveIdentities, selectProofsForSpend, serializeOutputData, setEmitter, settleDrainEvidence, sha256hex, shellQuoteArg, signDvmRequestData, signRequestData, signedRequestDomain, spendEntry, swapFeeForProofs, swapSendReserve, tempoAccountFromConfig, tempoBalanceCheckHint, tempoChallengeAmountMicro, tempoChannelControlledBy, tempoChargeCredentialSettleable, tempoCredentialAmountMicro, tempoCredentialValidBefore, tempoDescriptorController, tempoSessionAssociationByKey, tempoSessionChallenge, tempoSessionChallengeChannelScope, tempoSessionChallengeMicro, tempoSessionCredentialChannelScope, tempoSessionCredentialCumulativeMicro, tempoSessionCumulativeCapMicro, tempoSessionPriorCumulativeMicro, tempoTokenReference, toAgentProof, toCashuProofs, transportErrorCode, tryResolveTempoAsset, unsignRequestData, usdToMsats, usdcToMsats, validateAgentMnemonic, validateLnAddress, validateX402Env, verifyCanonicalSignedRequest, verifyChallenge, verifyDrainReceiptChain, verifyDrawFundingReceiptChain, verifyFundingReceiptChain, verifyJobReceipt, verifyRouterFeedbackClaim, walletExists, weakestReceiptVerdict, windowEnd, windowStart, withIdentitiesLock, withInitRetry, withNwcPool, withTempoChannelLock, withTraceContext, withWalletLock, withX402ChannelLock, withholdsTempoCreditSession, withinAdvertisedTolerance, writeAgentMnemonic, x402ChannelBalanceUnreconciledAt, x402ChannelControlledBy, x402ChannelReservation, x402CreditChannelNetworks, x402CreditExactNetworks, x402CreditFlavour, x402CreditFundingNetworks, x402ExactFundingDead, x402FlavourForInstrument, x402InstrumentForFlavour, x402NetworkByCaip2, x402NetworkBySlug, x402NetworkLabel, x402NetworkListForCopy, x402PendingBlockExpiresAt, x402PendingDepositExpiresAt, x402PendingFundingJson, x402PendingRetired, x402PendingStale, x402PendingUnsettled, x402RequiredFromError, x402ReservationRelease, x402SupportedNetworksHint, x402VoucherPendingState, x402WalletFromConfig };