Problem Statement
Traders get a single error after they sign and submit. UX cost.
A validate_swap_pre_flight(user, from, to, amount, slippage) would
short-circuit invalid intent before signing.
Expected Outcome
A read-only preflight_swap returning Result<(), SwapChecklistError>.
Acceptance Criteria
- Returns struct with: balance_ok, kyc_ok, rate_limit_ok, slippage_ok,
oracle_fresh_ok, pool_depth_ok.
- Same Rust function shared between validator and post-check.
Files Affected
peerx-contracts/counter/src/lib.rs, validation.rs.
Dependencies Issue #72.
Difficulty / Effort 🥈 / M
Labels dx, api
Problem Statement
Traders get a single error after they sign and submit. UX cost.
A
validate_swap_pre_flight(user, from, to, amount, slippage)wouldshort-circuit invalid intent before signing.
Expected Outcome
A read-only
preflight_swapreturningResult<(), SwapChecklistError>.Acceptance Criteria
oracle_fresh_ok, pool_depth_ok.
Files Affected
peerx-contracts/counter/src/lib.rs,validation.rs.Dependencies Issue #72.
Difficulty / Effort 🥈 / M
Labels
dx,api