bitflow-market-maker-public/test
Bought 49d5276028
fix: re-stamp the router deadline on every sign so fee bumps can succeed (#14)
The add, withdraw and swap calls fixed their `(optional uint)` deadline at
prepare time (now + TX_DEADLINE_SECONDS, 120s), and submitWithConfirmation
re-signed that same call on every replace-by-fee bump. The first bump only
fires after TX_CONFIRMATION_TIMEOUT_MS (also 120s), so every replacement
carried an expired deadline and could only be mined as ERR_DEADLINE_PASSED
(err u5009) while paying the higher fee (0.05 -> 0.075 -> 0.1125 -> 0.15 STX).

- Builders record which argument holds the deadline (`deadlineArgIndex`)
- `signAndBroadcast` (v6) and `broadcastLiquidity` (v7) re-stamp it to
  sign time + TX_DEADLINE_SECONDS via `withFreshDeadline`, so every broadcast
  gets its own full window; calls without a deadline pass through unchanged
- Shared `txDeadline()` replaces the duplicate `deadline()` helpers in
  swap.ts and liquidity.ts

Fixing it at sign time covers every path: tick primitives, manual runners
and cash-out. A replaced tx can now mine up to ~8 minutes after the plan
(default 3 bumps); the min-out / min-dlp / active-bin-tolerance bounds from
prepare time still apply.

test/txDeadline.test.ts drives the real submitWithConfirmation loop with only
signing/broadcast stubbed and asserts each of the 4 signed txs carries a
deadline 120s after its own sign time; an old-API version of that test fails
on the previous code. typecheck, build and 230 tests pass.
2026-11-19 00:50:52 -07:00
..
fixtures Migrate BFF reads to the v2 engine API 2026-09-15 20:05:15 -07:00
bff.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
binShares.test.ts Gate ticks on engine tip freshness and resolve bin shares on-chain 2026-09-15 20:20:44 -07:00
bitflow.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
coingeckoFeed.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
console.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
curve.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
curveShape.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
fee.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
fetchErrors.test.ts fix: name the BFF host and cause on fetch failures; refresh audited deps (#13) 2026-11-11 14:37:13 -07:00
insights.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
liquidity.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
metrics.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
mm.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
pid.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
pools.test.ts feat: local web console with sBTC and USDCx bridging 2026-10-28 16:13:58 -07:00
swap.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
tokenMeta.test.ts Initial commit: Bitflow DLMM curve market maker (public edition) 2026-09-09 15:53:05 -07:00
txDeadline.test.ts fix: re-stamp the router deadline on every sign so fee bumps can succeed (#14) 2026-11-19 00:50:52 -07:00