Skip to content

[PeerX Backlog # 77] Add a Stripe-like pattern: pre-flight validation function #77

Description

@ameeribro4-sudo

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

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26apiPeerX Backlog label api (bulk-imported)dxPeerX Backlog label dx (bulk-imported)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions