metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: fetch bridge quotes

Open micaelae opened this issue 5 months ago • 1 comments

Description

Changes included:

  • bridge.utils.ts
    • add a method that makes requests to the bridge-api getQuotes endpoint
    • copy in bridge-api types
  • bridge-controller.ts
    • extend the StaticIntervalPollingController in order to poll the bridge-api for quotes
    • new state values for tracking active quoteRequest object
  • ui/pages/bridge/quotes/*
    • display recommended quote
    • add a placeholder modal for alternative quotes
  • fetch-with-timeout.ts
    • accept additional abort signals as arguments and apply them
  • reset bridge state on page load and unload
  • abort fetchQuote requests when inputs change or when page loads/unloads

Known issues

  • [ ] Unable to fetch quotes with ERC20 src token due to missing provider when controller queries balances
  • [X] Fee calculations not implemented yet - separate PR

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1448

Manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

micaelae avatar Sep 18 '24 05:09 micaelae