Merged
Conversation
398bc10 to
fe94e1b
Compare
mcmire
reviewed
Mar 18, 2024
Contributor
mcmire
left a comment
There was a problem hiding this comment.
This looks pretty good. Most of my suggestions below were about JSDocs/TypeDocs.
Merged
bergeron
reviewed
Mar 19, 2024
bergeron
reviewed
Mar 19, 2024
Contributor
|
Generally looks good to me! Love that we can get more information in fewer requests |
bergeron
previously approved these changes
Mar 20, 2024
mcmire
previously approved these changes
Mar 20, 2024
Contributor
mcmire
left a comment
There was a problem hiding this comment.
This looks good to me! Just one comment, but is non-blocking.
Contributor
|
This is also non-blocking, but it seems there are a few breaking changes in this PR. Can you note those in Changes? Perhaps we want this: - **REMOVED**: **BREAKING:** Removed opensea map functions from assetsUtil.ts like `mapOpenSeaNftV2ToV1`, `mapOpenSeaDetailedNftV2ToV1` and `mapOpenSeaContractV2ToV1`.
- **ADDED**: Added `NFT_API_BASE_URL` in constants.ts
- **ADDED**: Added reservoir types in NftDetectionController.ts
- **REMOVED**: **BREAKING:** Call to openseaV2 to get user nfts in NftDetectionController.ts
- **Added**: Call to reservoir to get user nfts in NftDetectionController.ts
- **REMOVED**: **BREAKING:** Removed Opensea types from NftController.ts
- **REMOVED**: **BREAKING:** Removed call Opensea to get NFT information and added call to reservoir in NftController.ts
- **REMOVED**: **BREAKING:** Removed fct getNftContractInformationFromApi that calls OS
- **CHANGED**: Changed fct `getNftContractInformation` to receive `nftMetadataFromApi` as arg (which contains contract information fetched already from reservoir and aggregate the result with `getNftContractInformationFromContract`
- **CHANGED**: Changed the call to `getNftInformation` inside `addNft` function to be before `addNftContract`, because the nftInformation received from reservoir already includes collection metadata, no need to make another separate call to fetch it. |
ff83052 to
e517dd8
Compare
e517dd8 to
87d899f
Compare
7 tasks
mcmire
approved these changes
Mar 22, 2024
13 tasks
bergeron
approved these changes
Mar 25, 2024
Merged
montelaidev
added a commit
that referenced
this pull request
Apr 17, 2024
## Explanation ## References ## Changelog ## [13.0.0] Accounts Controller ### Changed - Fix update setSelectedAccount to throw if the id is not found ([#4167](#4167)) - Fix normal account indexing naming with index gap ([#4089](#4089)) - **BREAKING** Bump peer dependency `@metamask/snaps-controllers` to `^6.0.3` and dependencies `@metamask/snaps-sdk` to `^3.1.1`, `@metamask/eth-snap-keyring` to `^3.0.0`([#4090](#4090)) ## [28.0.0] Assets Controller ### Added - Add reservoir migration ([#4030](#4030)) ### Changed - Fix getting nft tokenURI ([#4136](#4136)) - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` ([#4090](#4090)) - Fix token detection during account change ([#4133](#4133)) - Fix update nft metadata when toggles off ([#4096](#4096)) - Adds `tokenMethodIncreaseAllowance` ([#4069](#4069)) - Fix mantle token mispriced ([#4045](#4045)) ## [15.0.0] Keyring Controller ### Changed - **BREAKING** use getAccounts on HD Keyring when calling addNewAccount ([#4158](#4158)) - Pass CAIP-2 scope to execution context ([#4090](#4090)) - Allow gas limits to be changed during #addPaymasterData ([#3942](#3942)) ## [10.0.0] Preferences Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` ([#4090](#4090)) - Restore previous behavior of toChecksumHexAddress ([#4046](#4046)) ## [15.0.0] Signature Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` ([#4090](#4090)) ## [8.0.0] User Operation Controller ### Changed - **BREAKING** Bump peer dependency on `@metamask/keyring-controller` to `^15.0.0` and Pass CAIP-2 scope to execution context ([#4090](#4090)) - Allow gas limits to be changed during #addPaymasterData ([#3942](#3942)) ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate
7 tasks
sahar-fehri
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
May 8, 2024
## **Description** This PR adds patches to mobile to enable Open Sea (OS) migration. ## **Related issues** [MMASSETS-156.](https://consensyssoftware.atlassian.net/jira/software/projects/MMASSETS/boards/640/backlog?selectedIssue=MMASSETS-156) (Restricted access Jira issue) Main core PR: MetaMask/core#4030 Core Compare link used to create the assets patch: https://github.com/MetaMask/core/compare/patch/mobile-assets-controllers-v-18-0-0...patch/mobile-assets-controllers-v-18-0-0-os-migration-v2?expand=1 ## **Context** Problem: We want to roll out Reservoir to Extension and Mobile similar to how we have done in Portfolio. Requirements: Define a way to compare OpenSea’s spam filtering and Reservoir’s spam filtering. Ideally the spam filtering is similar. Create Core PR to migrate calls from OS to Reservoir. Create PR on mobile to migrate from OS to Reservoir. Create Extension PR to migrate from OS to Reservoir Define roll out plan for Extension and Mobile Roll out Reservoir to Extension and Mobile Today, to get the NFTs core is calling opensea V2 api to fetch user nfts and to add new nfts (get NFT metadata) In this ticket we wanted to call Reservoir API instead of calling openseaV2. We are not changing any of the functional behaviors of the app, we are just swapping third party providers. So the app should behave the exact same regarding any NFT related functionality: Like showing NFT details when clicking on the NFT And being able to remove/add the NFT Mark it as favorite Sending NFts ## **Manual testing steps** 1. Go to the NFT tab 2. You should see your NFTs 3. Adding/removing NFTs should still work as expected 4. clicking on the NFT and seeing the NFT details should work as expected. ## **Screenshots/Recordings** The NFT tab should behave the same. You should be able to see the same NFTs you had. Only thing noticed while testing is for some collections you might see either a different image or the mobile default image (if the new third party provider was not able to return the image) ### **Before** https://github.com/MetaMask/metamask-mobile/assets/10994169/27d6e580-adb3-47f3-8bfe-5d2b9238a3f1 https://github.com/MetaMask/metamask-mobile/assets/10994169/f3eee367-1dcf-4e78-b738-d6e29f1bef86 ### **After** https://github.com/MetaMask/metamask-mobile/assets/10994169/920747e7-ab27-41ab-961a-88004f087c9a https://github.com/MetaMask/metamask-mobile/assets/10994169/17fa6860-a7b5-4897-a543-d58bb0cdbd5e ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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.
Andepande
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
May 21, 2024
## **Description** This PR adds patches to mobile to enable Open Sea (OS) migration. ## **Related issues** [MMASSETS-156.](https://consensyssoftware.atlassian.net/jira/software/projects/MMASSETS/boards/640/backlog?selectedIssue=MMASSETS-156) (Restricted access Jira issue) Main core PR: MetaMask/core#4030 Core Compare link used to create the assets patch: https://github.com/MetaMask/core/compare/patch/mobile-assets-controllers-v-18-0-0...patch/mobile-assets-controllers-v-18-0-0-os-migration-v2?expand=1 ## **Context** Problem: We want to roll out Reservoir to Extension and Mobile similar to how we have done in Portfolio. Requirements: Define a way to compare OpenSea’s spam filtering and Reservoir’s spam filtering. Ideally the spam filtering is similar. Create Core PR to migrate calls from OS to Reservoir. Create PR on mobile to migrate from OS to Reservoir. Create Extension PR to migrate from OS to Reservoir Define roll out plan for Extension and Mobile Roll out Reservoir to Extension and Mobile Today, to get the NFTs core is calling opensea V2 api to fetch user nfts and to add new nfts (get NFT metadata) In this ticket we wanted to call Reservoir API instead of calling openseaV2. We are not changing any of the functional behaviors of the app, we are just swapping third party providers. So the app should behave the exact same regarding any NFT related functionality: Like showing NFT details when clicking on the NFT And being able to remove/add the NFT Mark it as favorite Sending NFts ## **Manual testing steps** 1. Go to the NFT tab 2. You should see your NFTs 3. Adding/removing NFTs should still work as expected 4. clicking on the NFT and seeing the NFT details should work as expected. ## **Screenshots/Recordings** The NFT tab should behave the same. You should be able to see the same NFTs you had. Only thing noticed while testing is for some collections you might see either a different image or the mobile default image (if the new third party provider was not able to return the image) ### **Before** https://github.com/MetaMask/metamask-mobile/assets/10994169/27d6e580-adb3-47f3-8bfe-5d2b9238a3f1 https://github.com/MetaMask/metamask-mobile/assets/10994169/f3eee367-1dcf-4e78-b738-d6e29f1bef86 ### **After** https://github.com/MetaMask/metamask-mobile/assets/10994169/920747e7-ab27-41ab-961a-88004f087c9a https://github.com/MetaMask/metamask-mobile/assets/10994169/17fa6860-a7b5-4897-a543-d58bb0cdbd5e ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Migrates the calls from OpenseaV2 to Reservoir.
Removes unused Opensea types and add Reservoir types.
Ideally the types are shared from NFT-API to other consuming clients rather than hardcoding them on core. We will address this in the future.
References
Changelog
@metamask/assets-controllersmapOpenSeaNftV2ToV1,mapOpenSeaDetailedNftV2ToV1andmapOpenSeaContractV2ToV1.NFT_API_BASE_URLin constants.tsgetNftContractInformationto receivenftMetadataFromApias arg (which contains contract information fetched already from reservoir and aggregate the result withgetNftContractInformationFromContractgetNftInformationinsideaddNftfunction to be beforeaddNftContract, because the nftInformation received from reservoir already includes collection metadata, no need to make another separate call to fetch it.Checklist