Skip to content

Commit 0d20df1

Browse files
authored
feat: OS to Reservoir migration (#9547)
## **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.
1 parent fc79f40 commit 0d20df1

File tree

4 files changed

+1255
-478
lines changed

4 files changed

+1255
-478
lines changed

app/components/UI/CollectibleMedia/CollectibleMedia.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ const CollectibleMedia: React.FC<CollectibleMediaProps> = ({
4545
const fallback = useCallback(() => setSourceUri(null), []);
4646

4747
useEffect(() => {
48-
const { image, imagePreview, address } = collectible;
48+
const { image, imageOriginal, imagePreview, address } = collectible;
4949
if (address) {
5050
if (small && imagePreview && imagePreview !== '')
5151
setSourceUri(imagePreview);
52-
else setSourceUri(image);
52+
else setSourceUri((image || imageOriginal) ?? null);
5353
}
5454
}, [collectible, small, big, setSourceUri]);
5555

app/components/UI/CollectibleMedia/CollectibleMedia.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface Collectible {
1111
tokenURI: string;
1212
contractName?: string;
1313
standard: string;
14+
imageOriginal?: string;
1415
error: string | undefined;
1516
}
1617

0 commit comments

Comments
 (0)