feat(widget): add limit order mode#793
Draft
effie-ms wants to merge 10 commits into
Draft
Conversation
|
6f66b1a to
14cf8cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Linear task is linked to this PR?
https://linear.app/lifi-linear/issue/EMB-322
Why was it implemented this way?
Adds a limit order mode as a dedicated header tab. The core challenge is keeping three interdependent values — send amount, receive amount, and limit price — coherent without circular updates:
useLinkedLimitFields) implement one-directional derivation per edit: editing send recomputes receive (from price), editing receive recomputes price, editing price recomputes receive. Send never changes without an explicit user edit.LimitPriceCard), so the inversion toggle, market-proximity indicator, and+N%presets all reason about a single source of truth regardless of which direction is shown.@lifi/sdk@4.0.0can carry neither the extra limit fields (toAmount/validUntil/partiallyFillable) nor a per-call base URL, so a dedicated client (services/limitOrder) mirrorsadvanced/routes. It is intentionally inactive pending the limit-order API reaching a stable environment — see TODO(EMB-323) inuseRoutes. Those stub files are added toknip.json's ignore list until they're activated.Visual showcase (Screenshots or Videos)
TODO: attach a screen recording of the limit price card, presets, invert toggle, and expiry/partial-fill settings.
Checklist before requesting a review