shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
175 stars 188 forks source link

feat: migrate limit orders to utilize redux for state management #8112

Closed woodenfurniture closed 6 days ago

woodenfurniture commented 2 weeks ago

Description

Migrates the WIP limit orders feature to utilize redux for state management. As the inputs of spot and limit trades are basically identical and contain extremely high risk code, a higher-order slice pattern has been adopted to deduplicate the logic and minimise surface area.

Also includes 2 fixes suggested by @NeOMakinG in #8095:

Issue (if applicable)

closes #8111

Risk

High Risk PRs Require 2 approvals

High risk. The migration to use of a new design pattern for trades means that although the core logic is left totally untouched, we should review and test this with extreme caution.

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

All trades for all protocols, specifically trade input (including receive address, slippage, everything).

Testing

⚠️ For trades, no change from prod should be observed.

A complete regression test of trades should be completed, including various inputs, configs, swappers, multi-hop, custom recipient, different accounts, etc.

Engineering

Operations

Screenshots (if applicable)

Swap via THORChain to manual receive address

Swap via LiFi to custom account number (#1) and custom slippage (1.5%)

Swap via CoW with custom slippage (1.5%)

Swap via 0x