T3322
A new Swap component powered by Sideshift.
**Design considerations for further discussion:**
- The way this sideshift button is embedded is via setting the FROM and TO sides of the swap in the React app’s index.html header, which makes it somewhat challenging to be changing on the fly (is this even possible?). Without this it’ll just be a static directional swap e.g. USDT -> XEC.
-- Edit: No longer a material issue after discussions, since the user can just adjust the From and To currencies when the overlay widget appears. In which case there's no need for the Cashtab component to have selection dropdowns and just trigger the widget upon a useEffect() block.
- Do we need to add event listeners for when a shift (swap) has been settled with at least one deposit, an order is made or upon other deposit events?
- Do we need to increase implementation complexity even further by trying to automatically transfer a completed USDT -> XEC swap into the active Cashtab wallet? Similar to the swap direction, the settlement address is also defined in index.html’s header tag, which presents a similar challenge in changing on the fly.
- The sideshift widget currently hovers above Cashtab, which is probably ok since Cashtab’s UI real estate is very limited. It is closed via the X button on the top right.
- The sideshift widget’s theme is at odds with Cashtab’s.
- Rico from the sideshift team also mentioned the GraphQL errors around missing x-sideshift-secret headers can be safety ignored for now but they are looking to resolve it. Will keep an eye on this.
{F7084139}
{F7084140}
{F7084141}