metamask-extension
metamask-extension copied to clipboard
feat: fetch bridge quotes
Description
Changes included:
- bridge.utils.ts
- add a method that makes requests to the bridge-api
getQuotes
endpoint - copy in bridge-api types
- add a method that makes requests to the bridge-api
- 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
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1448
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [X] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
- [X] I've completed the PR template to the best of my ability
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using JSDoc format if applicable
- [X] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
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.