import { E as EscrowClaimGuard } from '../manager-CNcr_RGt.cjs'; export { C as CreateEscrowParams, a as CreateEscrowQuoteParams, b as EscrowContract, c as EscrowInventoryState, d as EscrowInventoryStore, e as EscrowKeeper, f as EscrowKeeperEvents, g as EscrowKeeperOptions, h as EscrowManager, i as EscrowManagerConfig, j as EscrowManagerEvents, k as EscrowOnChainState, l as EscrowRecord, m as EscrowResolution, n as EscrowStatus, o as EscrowStatusCode, p as EscrowStatusCodeValue, M as MemoryEscrowInventoryStore, S as SqliteEscrowInventoryStore, s as statusCodeToString } from '../manager-CNcr_RGt.cjs'; import '../wallet-rpc-sY1qJ24S.cjs'; import '../rpc/index.cjs'; /** * Durable claim guards for the escrow quote -> claim window. * * The in-memory status flip in {@link EscrowManager.claimEscrow} is atomic only * within a single process. In a multi-process server, two workers can both read * a "quoted" quote and both deploy — a TOCTOU that re-opens the buyer-seat * hijack. An {@link EscrowClaimGuard} performs an atomic conditional write so * exactly one caller wins the transition; the loser rejects instead of deploying * a second contract. */ /** * Single-process guard backed by an in-memory set. Atomic within one process * (JS is single-threaded and there is no await between the check and the add), * but provides NO cross-process guarantee. Use with the in-memory store or in * tests; use {@link SqliteEscrowClaimGuard} for a real multi-process server. */ declare class MemoryEscrowClaimGuard implements EscrowClaimGuard { /** Process-local: NOT safe across workers. The engine fails loud if a * multi-process server is configured with this guard (O4). */ readonly durable = false; private readonly claimed; tryClaim(id: string): Promise; releaseClaim(id: string): Promise; recordDeployTxid(id: string, txid: string): Promise; listClaims(): Promise>; listExpiredClaims(leaseMs: number): Promise>; } /** * Durable, multi-process guard backed by a SQLite table with a unique primary * key. `tryClaim` uses `INSERT OR IGNORE`: the first caller to insert the row * wins (changes === 1); any concurrent caller sees changes === 0 and loses. This * is atomic across processes and connections sharing the database file. * * Pass the same `better-sqlite3` Database the store uses so the claim lives in * one file; the table is created on construction. */ declare class SqliteEscrowClaimGuard implements EscrowClaimGuard { /** Atomic across processes/connections sharing the db file. */ readonly durable = true; private readonly db; constructor(db: any); tryClaim(id: string): Promise; releaseClaim(id: string): Promise; recordDeployTxid(id: string, txid: string): Promise; listClaims(): Promise>; listExpiredClaims(leaseMs: number): Promise>; } export { EscrowClaimGuard, MemoryEscrowClaimGuard, SqliteEscrowClaimGuard };