@dvmkit/sdk 0.7.0-rc.4 → 0.7.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ARGYJ7SB.js → chunk-3VFEX2Y3.js} +35 -4
- package/dist/{chunk-CYTV76CG.js → chunk-6RYCZLCK.js} +1 -1
- package/dist/{chunk-3CNYUUD7.js → chunk-BDHJVTWA.js} +1 -1
- package/dist/{chunk-UEYUFBSV.js → chunk-BIZR5ORK.js} +2 -2
- package/dist/{chunk-O3JEEW5V.js → chunk-BQP3LU2O.js} +1 -1
- package/dist/{chunk-5WOKIGLM.js → chunk-CBKQK2KI.js} +30 -26
- package/dist/{chunk-AE2ITUMA.js → chunk-FOJKZ4E7.js} +1 -1
- package/dist/{chunk-WIQLTSJY.js → chunk-FXDQMJQ2.js} +18 -0
- package/dist/{chunk-76W5MYFF.js → chunk-GDCIHJAR.js} +1 -1
- package/dist/{chunk-LZHBNR5C.js → chunk-HG2CZPRJ.js} +1 -1
- package/dist/{chunk-RBCHIOVB.js → chunk-JUEEUV5X.js} +1 -1
- package/dist/{chunk-C6YFACIM.js → chunk-KYCLHWKO.js} +1 -1
- package/dist/{chunk-XYLF33BJ.js → chunk-LQQ6H4UB.js} +1 -1
- package/dist/{chunk-H2XKINRX.js → chunk-MYJOV4R4.js} +1 -1
- package/dist/{chunk-MU3UX5M4.js → chunk-NUPEAWRM.js} +1 -1
- package/dist/{chunk-DY2MIZ6E.js → chunk-QTH7CIA3.js} +1 -1
- package/dist/{chunk-KIPJRLGP.js → chunk-SX4WCPW7.js} +1 -1
- package/dist/{chunk-EN7VI7T5.js → chunk-WP7UX6RF.js} +2 -2
- package/dist/{chunk-QFRU6W34.js → chunk-X5RY2G3C.js} +1 -1
- package/dist/{chunk-WNX22IND.js → chunk-XEOTTFLH.js} +1 -1
- package/dist/{chunk-MCIIDEXH.js → chunk-YK54BJ2L.js} +1 -1
- package/dist/{content-retention-ChFSSVO0.d.ts → content-retention-BL3uao3h.d.ts} +1 -1
- package/dist/{credit-ledger-4ZIL7IX2.js → credit-ledger-SW4BGMNH.js} +3 -3
- package/dist/{credit-menu-D7lF-100.d.ts → credit-menu-DvV-IX3P.d.ts} +7 -4
- package/dist/{fx-4TFUkedZ.d.ts → fx-DmuqWgL-.d.ts} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/internal/caller.d.ts +6 -6
- package/dist/internal/caller.js +6 -6
- package/dist/internal/server.d.ts +7 -7
- package/dist/internal/server.js +21 -21
- package/dist/{job-store-DkfNE9sv.d.ts → job-store-CopBPkne.d.ts} +1 -1
- package/dist/{lightning-backend-C3Gf1XpP.d.ts → lightning-backend-IYYVkad1.d.ts} +1 -1
- package/dist/{memory-credit-ledger-HCECP6R7.js → memory-credit-ledger-E4C3VQE4.js} +4 -4
- package/dist/{mpp-setup-OL22TIDP.js → mpp-setup-BYKGEYFA.js} +2 -2
- package/dist/{payout-reporter-WSLDLMKK.js → payout-reporter-3UVWPGMO.js} +6 -4
- package/dist/{postgres-consumed-credential-store-7ONNOW37.js → postgres-consumed-credential-store-EZ4KETWH.js} +1 -1
- package/dist/{postgres-job-store-36GJGQMB.js → postgres-job-store-E6AUHNKB.js} +2 -2
- package/dist/{postgres-replay-store-JJ6XPVIU.js → postgres-replay-store-GIYZS4LJ.js} +2 -2
- package/dist/{pricing-FM6WVLCR.js → pricing-DG5IJ5QF.js} +3 -3
- package/dist/{revenue-reporter-CAWZMYQK.js → revenue-reporter-E56J3NZK.js} +2 -2
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +26 -25
- package/dist/{step-cache-DDTwd4SK.d.ts → step-cache-MUyQVNFX.d.ts} +17 -1
- package/dist/{tempo-charge-store-MVZH6CEB.js → tempo-charge-store-WTBIX2JX.js} +2 -2
- package/dist/{tempo-session-store-CCCG4HL7.js → tempo-session-store-AWIFUAA6.js} +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +5 -5
- package/dist/{usd-DkRy9nfU.d.ts → usd-Bpt6Pmr3.d.ts} +1 -1
- package/dist/{x402-RHVRGUUI.js → x402-BN26TQZ6.js} +3 -3
- package/package.json +1 -1
|
@@ -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-
|
|
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-
|
|
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-IYYVkad1.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-IYYVkad1.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-
|
|
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-
|
|
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-MUyQVNFX.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-MUyQVNFX.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-
|
|
13
|
-
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-
|
|
12
|
+
export { h as FX_CACHE_TTL_MS, i as FX_RETRY_COUNT, w as warmFxSnapshot } from '../fx-DmuqWgL-.js';
|
|
13
|
+
export { c as InvalidUsdPriceError, p as parseUsdPrice } from '../usd-Bpt6Pmr3.js';
|
|
14
14
|
import 'hono';
|
|
15
15
|
import 'mppx';
|
|
16
16
|
import '@x402/core/server';
|
package/dist/internal/caller.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
sha256hex,
|
|
33
33
|
validateX402Env,
|
|
34
34
|
withNwcPool
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-BDHJVTWA.js";
|
|
36
36
|
import {
|
|
37
37
|
MemoryKVStore
|
|
38
38
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
withWalletLock,
|
|
140
140
|
writeAgentMnemonic,
|
|
141
141
|
writeIdentity
|
|
142
|
-
} from "../chunk-
|
|
142
|
+
} from "../chunk-QTH7CIA3.js";
|
|
143
143
|
import {
|
|
144
144
|
X402_BATCH_SETTLEMENT_SCHEME,
|
|
145
145
|
X402_DEFAULT_FACILITATOR,
|
|
@@ -193,7 +193,7 @@ import {
|
|
|
193
193
|
randomTraceId,
|
|
194
194
|
setEmitter,
|
|
195
195
|
withTraceContext
|
|
196
|
-
} from "../chunk-
|
|
196
|
+
} from "../chunk-SX4WCPW7.js";
|
|
197
197
|
import {
|
|
198
198
|
redactUrl,
|
|
199
199
|
redactUrlsInText
|
|
@@ -207,11 +207,11 @@ import {
|
|
|
207
207
|
InvalidUsdPriceError,
|
|
208
208
|
parseUsdPrice,
|
|
209
209
|
warmFxSnapshot
|
|
210
|
-
} from "../chunk-
|
|
210
|
+
} from "../chunk-LQQ6H4UB.js";
|
|
211
211
|
import {
|
|
212
212
|
applyRetryToPool,
|
|
213
213
|
withInitRetry
|
|
214
|
-
} from "../chunk-
|
|
214
|
+
} from "../chunk-6RYCZLCK.js";
|
|
215
215
|
import {
|
|
216
216
|
DvmError,
|
|
217
217
|
X402_NETWORKS,
|
|
@@ -234,7 +234,7 @@ import {
|
|
|
234
234
|
projectDiagnosticFields,
|
|
235
235
|
projectEventName,
|
|
236
236
|
projectSpanRow
|
|
237
|
-
} from "../chunk-
|
|
237
|
+
} from "../chunk-FXDQMJQ2.js";
|
|
238
238
|
|
|
239
239
|
// src/lib/budget-core.ts
|
|
240
240
|
function checkBudgetForLedger(ledger, opts) {
|
|
@@ -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-
|
|
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-
|
|
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-MUyQVNFX.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-MUyQVNFX.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-
|
|
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-
|
|
11
|
-
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-
|
|
9
|
+
import { C as ConsumedCredentialStore, L as LockPubkeyStateLoader } from '../credit-menu-DvV-IX3P.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-DvV-IX3P.js';
|
|
11
|
+
export { O as OutgoingMessage, S as StaleJobReapable, i as isStaleJobReapable } from '../job-store-CopBPkne.js';
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
-
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-
|
|
13
|
+
export { f as LockPubkeyStoreLockPubkey, t as lockPubkeyStoreToLockPubkey } from '../lightning-backend-IYYVkad1.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-
|
|
19
|
+
import '../fx-DmuqWgL-.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>;
|
package/dist/internal/server.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoSessionStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GDCIHJAR.js";
|
|
4
4
|
import {
|
|
5
5
|
verifyX402Payment
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-BIZR5ORK.js";
|
|
7
7
|
import {
|
|
8
8
|
RevenueReporter
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import {
|
|
11
|
-
PayoutReporter
|
|
12
|
-
} from "../chunk-ARGYJ7SB.js";
|
|
9
|
+
} from "../chunk-YK54BJ2L.js";
|
|
13
10
|
import {
|
|
14
11
|
PostgresTempoChargeStore
|
|
15
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-BQP3LU2O.js";
|
|
16
13
|
import {
|
|
17
14
|
DEFAULT_LOCK_PUBKEY_GRACE_SECONDS,
|
|
18
15
|
MintHealthTracker,
|
|
@@ -64,28 +61,31 @@ import {
|
|
|
64
61
|
verifyUpfrontPayment,
|
|
65
62
|
x402RequiredUsdcMicro,
|
|
66
63
|
x402SettledShare
|
|
67
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-CBKQK2KI.js";
|
|
68
65
|
import {
|
|
69
66
|
_testing,
|
|
70
67
|
wrapMppx
|
|
71
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-KYCLHWKO.js";
|
|
69
|
+
import {
|
|
70
|
+
PayoutReporter
|
|
71
|
+
} from "../chunk-3VFEX2Y3.js";
|
|
72
72
|
import {
|
|
73
73
|
settleWithFacilitator,
|
|
74
74
|
verifyWithFacilitator
|
|
75
|
-
} from "../chunk-
|
|
76
|
-
import "../chunk-
|
|
77
|
-
import "../chunk-
|
|
75
|
+
} from "../chunk-XEOTTFLH.js";
|
|
76
|
+
import "../chunk-FOJKZ4E7.js";
|
|
77
|
+
import "../chunk-JUEEUV5X.js";
|
|
78
78
|
import "../chunk-YG7G4DPZ.js";
|
|
79
79
|
import {
|
|
80
80
|
SIGNED_ENVELOPE_FIELDS,
|
|
81
81
|
SIGNED_ENVELOPE_TYPES,
|
|
82
82
|
createDefaultReplayStore,
|
|
83
83
|
humanizeZodError
|
|
84
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-X5RY2G3C.js";
|
|
85
85
|
import {
|
|
86
86
|
createInstrumentedFetch,
|
|
87
87
|
isStaleJobReapable
|
|
88
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-MYJOV4R4.js";
|
|
89
89
|
import {
|
|
90
90
|
JobCancelledError,
|
|
91
91
|
abortJob,
|
|
@@ -97,14 +97,14 @@ import {
|
|
|
97
97
|
} from "../chunk-AFV77S4C.js";
|
|
98
98
|
import {
|
|
99
99
|
toLockPubkey
|
|
100
|
-
} from "../chunk-
|
|
100
|
+
} from "../chunk-QTH7CIA3.js";
|
|
101
101
|
import "../chunk-62FI3NJF.js";
|
|
102
102
|
import "../chunk-UKD3R2KU.js";
|
|
103
|
-
import "../chunk-
|
|
103
|
+
import "../chunk-SX4WCPW7.js";
|
|
104
104
|
import "../chunk-KXWROQGK.js";
|
|
105
105
|
import "../chunk-BQJIFRAZ.js";
|
|
106
|
-
import "../chunk-
|
|
107
|
-
import "../chunk-
|
|
106
|
+
import "../chunk-NUPEAWRM.js";
|
|
107
|
+
import "../chunk-LQQ6H4UB.js";
|
|
108
108
|
import {
|
|
109
109
|
NON_CHANNEL_BITCOIN_RAILS,
|
|
110
110
|
depleteLots,
|
|
@@ -114,10 +114,10 @@ import {
|
|
|
114
114
|
isNonChannelBitcoinRail,
|
|
115
115
|
lotOwedSats,
|
|
116
116
|
netOwedSats
|
|
117
|
-
} from "../chunk-
|
|
118
|
-
import "../chunk-
|
|
117
|
+
} from "../chunk-WP7UX6RF.js";
|
|
118
|
+
import "../chunk-6RYCZLCK.js";
|
|
119
119
|
import "../chunk-BPYMEMQX.js";
|
|
120
|
-
import "../chunk-
|
|
120
|
+
import "../chunk-FXDQMJQ2.js";
|
|
121
121
|
import "../chunk-XRLKGCAW.js";
|
|
122
122
|
import "../chunk-COYKJRMM.js";
|
|
123
123
|
export {
|
|
@@ -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-
|
|
2
|
+
import { a4 as Message, ai as FundingMethod, _ as FundingReceipt, bP as CreditSnapshot, $ as JobReceipt, ax as StepRecord, a0 as MessageType } from './step-cache-MUyQVNFX.js';
|
|
3
3
|
|
|
4
4
|
type JobStatus = "processing" | "completed" | "failed" | "awaiting-input" | "cancelled" | "working";
|
|
5
5
|
interface JobRecord {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemoryCreditLedger
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-FOJKZ4E7.js";
|
|
4
|
+
import "./chunk-WP7UX6RF.js";
|
|
5
|
+
import "./chunk-6RYCZLCK.js";
|
|
6
6
|
import "./chunk-BPYMEMQX.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-FXDQMJQ2.js";
|
|
8
8
|
import "./chunk-COYKJRMM.js";
|
|
9
9
|
export {
|
|
10
10
|
MemoryCreditLedger
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
parseMppMethodsAllowlist,
|
|
20
20
|
resolveTempoNetwork,
|
|
21
21
|
wrapMppx
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-KYCLHWKO.js";
|
|
23
|
+
import "./chunk-FXDQMJQ2.js";
|
|
24
24
|
export {
|
|
25
25
|
MPPX_HMAC_MISMATCH_REASON,
|
|
26
26
|
TEMPO_MAINNET_CHAIN_ID,
|
|
@@ -2,13 +2,15 @@ import {
|
|
|
2
2
|
MemoryX402BatchStore,
|
|
3
3
|
PAYOUT_SNAPSHOT_INTERVAL_MS,
|
|
4
4
|
PayoutReporter,
|
|
5
|
-
PostgresX402BatchStore
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
PostgresX402BatchStore,
|
|
6
|
+
x402EarnedCeiling
|
|
7
|
+
} from "./chunk-3VFEX2Y3.js";
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresJobStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JUEEUV5X.js";
|
|
4
4
|
import "./chunk-AFV77S4C.js";
|
|
5
5
|
import "./chunk-BQJIFRAZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FXDQMJQ2.js";
|
|
7
7
|
import "./chunk-COYKJRMM.js";
|
|
8
8
|
export {
|
|
9
9
|
PostgresJobStore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildUpfront
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NUPEAWRM.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_FX_CURRENCIES,
|
|
6
6
|
DEFAULT_FX_RATE_SOURCE,
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
satsToFiat,
|
|
23
23
|
validateCurrency,
|
|
24
24
|
warmFxSnapshot
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-LQQ6H4UB.js";
|
|
26
|
+
import "./chunk-FXDQMJQ2.js";
|
|
27
27
|
export {
|
|
28
28
|
DEFAULT_FX_CURRENCIES,
|
|
29
29
|
DEFAULT_FX_RATE_SOURCE,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-MUyQVNFX.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-MUyQVNFX.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-
|
|
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-
|
|
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-DvV-IX3P.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-DvV-IX3P.js';
|
|
6
6
|
import { Context, Hono } from 'hono';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { F as FxFetcher } from '../fx-
|
|
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-
|
|
10
|
-
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-
|
|
11
|
-
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-
|
|
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-
|
|
8
|
+
import { F as FxFetcher } from '../fx-DmuqWgL-.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-CopBPkne.js';
|
|
10
|
+
export { a as JobStatus, h as isStreamableJobStore } from '../job-store-CopBPkne.js';
|
|
11
|
+
import { C as ContentHoldHistory, a as ContentHoldMutation } from '../content-retention-BL3uao3h.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-BL3uao3h.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-
|
|
20
|
+
import '../lightning-backend-IYYVkad1.js';
|
|
21
21
|
import '@cashu/cashu-ts';
|
|
22
22
|
|
|
23
23
|
/** Lifetime of a per-call implicit credit before the ledger refuses new draws. */
|
package/dist/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresReplayStore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HG2CZPRJ.js";
|
|
4
4
|
import {
|
|
5
5
|
PostgresKVStore
|
|
6
6
|
} from "../chunk-V5ZRATJH.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseNwcUri,
|
|
19
19
|
validateX402Env,
|
|
20
20
|
withNwcPool
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-BDHJVTWA.js";
|
|
22
22
|
import {
|
|
23
23
|
MemoryKVStore
|
|
24
24
|
} from "../chunk-SDK6KDJN.js";
|
|
@@ -80,31 +80,32 @@ import {
|
|
|
80
80
|
stripProtocolEnvelope,
|
|
81
81
|
toCreditView,
|
|
82
82
|
unknownRouteNotFound
|
|
83
|
-
} from "../chunk-
|
|
83
|
+
} from "../chunk-CBKQK2KI.js";
|
|
84
84
|
import {
|
|
85
85
|
TEMPO_MODERATO_CHAIN_ID,
|
|
86
86
|
TEMPO_MODERATO_RPC,
|
|
87
87
|
TEMPO_SETTLEMENT_DEFAULT_LOW_BALANCE_MICRO,
|
|
88
88
|
TempoSettlementReadiness,
|
|
89
89
|
resolveTempoNetwork
|
|
90
|
-
} from "../chunk-
|
|
91
|
-
import "../chunk-
|
|
90
|
+
} from "../chunk-KYCLHWKO.js";
|
|
91
|
+
import "../chunk-3VFEX2Y3.js";
|
|
92
|
+
import "../chunk-XEOTTFLH.js";
|
|
92
93
|
import {
|
|
93
94
|
MemoryCreditLedger
|
|
94
|
-
} from "../chunk-
|
|
95
|
+
} from "../chunk-FOJKZ4E7.js";
|
|
95
96
|
import {
|
|
96
97
|
PostgresJobStore
|
|
97
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-JUEEUV5X.js";
|
|
98
99
|
import "../chunk-YG7G4DPZ.js";
|
|
99
100
|
import {
|
|
100
101
|
SignedRequestError,
|
|
101
102
|
createDefaultReplayStore,
|
|
102
103
|
createSignedRequestVerifier,
|
|
103
104
|
signedRequestInput
|
|
104
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-X5RY2G3C.js";
|
|
105
106
|
import {
|
|
106
107
|
isStreamableJobStore
|
|
107
|
-
} from "../chunk-
|
|
108
|
+
} from "../chunk-MYJOV4R4.js";
|
|
108
109
|
import {
|
|
109
110
|
ContentHoldError,
|
|
110
111
|
baselineContentExpiry,
|
|
@@ -115,7 +116,7 @@ import {
|
|
|
115
116
|
IMPLICIT_CREDIT_TTL_MS,
|
|
116
117
|
generateEphemeralReceiptKey,
|
|
117
118
|
receiptPubkeyFromSecret
|
|
118
|
-
} from "../chunk-
|
|
119
|
+
} from "../chunk-QTH7CIA3.js";
|
|
119
120
|
import {
|
|
120
121
|
X402_DEFAULT_FACILITATOR,
|
|
121
122
|
X402_DEFAULT_NETWORK,
|
|
@@ -129,11 +130,11 @@ import {
|
|
|
129
130
|
} from "../chunk-UKD3R2KU.js";
|
|
130
131
|
import {
|
|
131
132
|
initLoggers
|
|
132
|
-
} from "../chunk-
|
|
133
|
+
} from "../chunk-SX4WCPW7.js";
|
|
133
134
|
import "../chunk-KXWROQGK.js";
|
|
134
135
|
import "../chunk-BQJIFRAZ.js";
|
|
135
|
-
import "../chunk-
|
|
136
|
-
import "../chunk-
|
|
136
|
+
import "../chunk-NUPEAWRM.js";
|
|
137
|
+
import "../chunk-LQQ6H4UB.js";
|
|
137
138
|
import {
|
|
138
139
|
CreditLedger,
|
|
139
140
|
CreditLedgerError,
|
|
@@ -141,16 +142,16 @@ import {
|
|
|
141
142
|
PostgresX402ChannelStorage,
|
|
142
143
|
X402RelaySubmissionLockError,
|
|
143
144
|
allocateDrawValue
|
|
144
|
-
} from "../chunk-
|
|
145
|
+
} from "../chunk-WP7UX6RF.js";
|
|
145
146
|
import {
|
|
146
147
|
applyRetryToPool
|
|
147
|
-
} from "../chunk-
|
|
148
|
+
} from "../chunk-6RYCZLCK.js";
|
|
148
149
|
import {
|
|
149
150
|
assertSupportedX402Network
|
|
150
151
|
} from "../chunk-BPYMEMQX.js";
|
|
151
152
|
import {
|
|
152
153
|
diagnosticConsole
|
|
153
|
-
} from "../chunk-
|
|
154
|
+
} from "../chunk-FXDQMJQ2.js";
|
|
154
155
|
import {
|
|
155
156
|
MemoryProcessedPaymentStore,
|
|
156
157
|
PostgresProcessedPaymentStore,
|
|
@@ -1146,7 +1147,7 @@ function createDVMHost(opts = {}) {
|
|
|
1146
1147
|
});
|
|
1147
1148
|
applyRetryToPool(pool, "dvm-host");
|
|
1148
1149
|
pgPool = pool;
|
|
1149
|
-
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-
|
|
1150
|
+
const { PostgresJobStore: PostgresJobStore2 } = await import("../postgres-job-store-E6AUHNKB.js");
|
|
1150
1151
|
const pgJobStore = new PostgresJobStore2(pool);
|
|
1151
1152
|
pendingInits.push(pgJobStore.init(), pgJobStore.initStreaming());
|
|
1152
1153
|
jobStore = pgJobStore;
|
|
@@ -1239,11 +1240,11 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1239
1240
|
let tempoChargeBackend = "user-supplied";
|
|
1240
1241
|
const mppTempoRecipient = envMaybe.DVMKIT_TEMPO_RECIPIENT;
|
|
1241
1242
|
if (!mpp && mppTempoRecipient) {
|
|
1242
|
-
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-
|
|
1243
|
+
const { createMppFromOpts, createDualKeyMppxFromOpts, parseMppMethodsAllowlist } = await import("../mpp-setup-BYKGEYFA.js");
|
|
1243
1244
|
tempoChargeBackend = pgPool ? "postgres" : "memory";
|
|
1244
1245
|
let tempoCharge;
|
|
1245
1246
|
if (pgPool) {
|
|
1246
|
-
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-
|
|
1247
|
+
const { PostgresTempoChargeStore } = await import("../tempo-charge-store-WTBIX2JX.js");
|
|
1247
1248
|
const chargeStore = new PostgresTempoChargeStore(pgPool);
|
|
1248
1249
|
tempoChargeStore = chargeStore;
|
|
1249
1250
|
pendingInits.push(chargeStore.init());
|
|
@@ -1263,7 +1264,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1263
1264
|
{ createPublicClient, createWalletClient, erc20Abi, http },
|
|
1264
1265
|
{ tempo: tempoMainnet, tempoModerato }
|
|
1265
1266
|
] = await Promise.all([
|
|
1266
|
-
import("../tempo-session-store-
|
|
1267
|
+
import("../tempo-session-store-AWIFUAA6.js"),
|
|
1267
1268
|
import("viem/accounts"),
|
|
1268
1269
|
import("viem"),
|
|
1269
1270
|
import("viem/chains")
|
|
@@ -1416,7 +1417,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1416
1417
|
}
|
|
1417
1418
|
}
|
|
1418
1419
|
const fxSource = envMaybe.DVMKIT_FX_SOURCE;
|
|
1419
|
-
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-
|
|
1420
|
+
const { createFxFetcher, resolveFxSourceFromEnv, warmFxSnapshot } = await import("../pricing-DG5IJ5QF.js");
|
|
1420
1421
|
const fxFetcher = opts.fx ?? createFxFetcher({ source: resolveFxSourceFromEnv(envMaybe) });
|
|
1421
1422
|
const hostRailConfigured = (opts.paymentMethods?.length ?? 0) > 0 || (effectiveMints?.length ?? 0) > 0 || !!x402WithDualServe || !!mpp;
|
|
1422
1423
|
if (mounts.some((entry) => mountNeedsFx(entry, hostRailConfigured))) warmFxSnapshot(fxFetcher);
|
|
@@ -1426,7 +1427,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1426
1427
|
assertReceiptIdentity(envMaybe, opts.builder, receiptKey, cashuOpts.dvmId, opts.devMode);
|
|
1427
1428
|
let sharedPgReplayStore;
|
|
1428
1429
|
if (pgPool) {
|
|
1429
|
-
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-
|
|
1430
|
+
const { PostgresReplayStore: PostgresReplayStore2 } = await import("../postgres-replay-store-GIYZS4LJ.js");
|
|
1430
1431
|
const store2 = new PostgresReplayStore2(pgPool);
|
|
1431
1432
|
pendingInits.push(store2.init());
|
|
1432
1433
|
sharedPgReplayStore = store2;
|
|
@@ -1454,13 +1455,13 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1454
1455
|
}
|
|
1455
1456
|
let sharedPgConsumedStore;
|
|
1456
1457
|
if (pgPool) {
|
|
1457
|
-
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-
|
|
1458
|
+
const { PostgresConsumedCredentialStore } = await import("../postgres-consumed-credential-store-EZ4KETWH.js");
|
|
1458
1459
|
const consumedStore = new PostgresConsumedCredentialStore(pgPool);
|
|
1459
1460
|
pendingInits.push(consumedStore.init());
|
|
1460
1461
|
sharedPgConsumedStore = consumedStore;
|
|
1461
1462
|
}
|
|
1462
1463
|
if (pgPool) {
|
|
1463
|
-
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-
|
|
1464
|
+
const { CreditLedger: CreditLedger2 } = await import("../credit-ledger-SW4BGMNH.js");
|
|
1464
1465
|
const pgLedger = new CreditLedger2(pgPool, tempoSessionStore);
|
|
1465
1466
|
pendingInits.push(pgLedger.init());
|
|
1466
1467
|
creditLedger = pgLedger;
|
|
@@ -1469,7 +1470,7 @@ ${config.facilitatorAuth?.keyId ?? ""}`;
|
|
|
1469
1470
|
pendingInits.push(pgProcessed.init());
|
|
1470
1471
|
processedPayments = pgProcessed;
|
|
1471
1472
|
} else {
|
|
1472
|
-
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-
|
|
1473
|
+
const { MemoryCreditLedger: MemoryCreditLedger2 } = await import("../memory-credit-ledger-E4C3VQE4.js");
|
|
1473
1474
|
creditLedger = disposableCashu?.ledger ?? new MemoryCreditLedger2();
|
|
1474
1475
|
const { MemoryProcessedPaymentStore: MemoryProcessedPaymentStore2 } = await import("../processed-payment-store-GKMAWOM3.js");
|
|
1475
1476
|
processedPayments = new MemoryProcessedPaymentStore2();
|
|
@@ -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
|
-
*
|
|
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>;
|
|
@@ -2167,6 +2176,13 @@ interface CreditDepositPayload {
|
|
|
2167
2176
|
fundedAt: number;
|
|
2168
2177
|
/** Current credit expiry after this funding committed (epoch ms). */
|
|
2169
2178
|
expiryMs: number;
|
|
2179
|
+
/**
|
|
2180
|
+
* The stablecoin instrument behind the funded credit, read from the
|
|
2181
|
+
* credit's stored binding rather than inferred from `fundingId`'s shape.
|
|
2182
|
+
* Present on every x402 and Tempo deposit; absent on Cashu and Lightning,
|
|
2183
|
+
* which have only one instrument each.
|
|
2184
|
+
*/
|
|
2185
|
+
instrument?: "x402_exact" | "x402_channel" | "tempo_charge" | "tempo_session";
|
|
2170
2186
|
/**
|
|
2171
2187
|
* Tempo session funding only: the TIP-1034 channel this deposit
|
|
2172
2188
|
* arrived on, registered so the platform's close observer can route a
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PostgresTempoChargeStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BQP3LU2O.js";
|
|
4
4
|
import "./chunk-YG7G4DPZ.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-FXDQMJQ2.js";
|
|
6
6
|
import "./chunk-COYKJRMM.js";
|
|
7
7
|
export {
|
|
8
8
|
PostgresTempoChargeStore
|