Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade @metamask/swaps-controller to 12.0.0 #12470

Closed
1 of 9 tasks
mcmire opened this issue Nov 27, 2024 · 0 comments · Fixed by #12378
Closed
1 of 9 tasks

Upgrade @metamask/swaps-controller to 12.0.0 #12470

mcmire opened this issue Nov 27, 2024 · 0 comments · Fixed by #12378
Assignees
Labels
release-7.40.0 Issue or pull request that will be included in release 7.40.0 team-wallet-framework

Comments

@mcmire
Copy link
Contributor

mcmire commented Nov 27, 2024

What is this about?

This PR to add support for multichain to SwapsController is released under 12.0.0. We should upgrade mobile to bring in this change.

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

No response

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@mcmire mcmire self-assigned this Nov 27, 2024
@mcmire mcmire changed the title Upgrade @metamask/swaps-controller to 12.0.0 Upgrade @metamask/swaps-controller to 12.0.0 (when it is released) Nov 27, 2024
@mcmire mcmire changed the title Upgrade @metamask/swaps-controller to 12.0.0 (when it is released) Upgrade @metamask/swaps-controller to 12.0.0 Dec 9, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 8, 2025
## Description

This version upgrades `@metamask/swaps-controller` so that it is less
reliant on the global network. Specifically:

- The `setChainId` and `setProvider` methods have been removed from
SwapsController.
- The `fetchGasFeeEstimates` and `fetchEstimatedMultiLayerL1Fee`
SwapsController constructor options are now expected to take a
`networkClientId`.
- The SwapsController constructor no longer takes a `chainId` option.
- `startFetchAndSetQuotes`, `fetchTokenWithCache`,
`fetchTopAssetsWithCache`, and `fetchAggregatorMetadataWithCache` now
take a `networkClientId`.
- The `fetchParamsMetaData` SwapsController state property now includes
a `networkClientId`.
- The chain cache in SwapsController state will now automatically be
updated whenever the network has changed.

See full changelog here:
https://github.com/MetaMask/swaps-controller/blob/main/CHANGELOG.md#1200

At the moment, the global network client ID is still passed into
SwapsController whenever it is used, but now that can be changed to use
a dapp-level network client ID without needing to update
SwapsController.

## Related issues

Fixes #12470.

Also see:

- MetaMask/swaps-controller#347
- MetaMask/swaps-controller#204

## Manual testing steps

- Tap on the Swap button
- Select a destination token and proceed
- You should see new quotes
- Ideally, you should be able to complete the swaps flow and create a
transaction

## Screenshots/Recordings

The Swaps flow should work exactly like it does now.

Here is a video demonstrating fetching Swaps quotes:


https://github.com/user-attachments/assets/62a490c9-32c4-49a2-886d-136328761658

## Pre-merge author checklist

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [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](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.
@metamaskbot metamaskbot added the release-7.40.0 Issue or pull request that will be included in release 7.40.0 label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-7.40.0 Issue or pull request that will be included in release 7.40.0 team-wallet-framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants