-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Integrate NFT api to display image & names in simulations includes erc721
s
#12160
base: main
Are you sure you want to change the base?
feat: Integrate NFT api to display image & names in simulations includes erc721
s
#12160
Conversation
erc721
s
Bitrise❌❌❌ Commit hash: 3493505 Note
Tip
|
…nfts-within-simulations-on-mobile
Bitrise❌❌❌ Commit hash: 26e42ea Note
Tip
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12160 +/- ##
==========================================
+ Coverage 55.76% 55.79% +0.03%
==========================================
Files 1785 1786 +1
Lines 40325 40352 +27
Branches 5045 5051 +6
==========================================
+ Hits 22486 22514 +28
+ Misses 16292 16290 -2
- Partials 1547 1548 +1 ☔ View full report in Codecov by Sentry. |
…nfts-within-simulations-on-mobile
Bitrise✅✅✅ Commit hash: 6e5ce92 Note
|
b730f14
Bitrise❌❌❌ Commit hash: e742c68 Note
Tip
|
Bitrise❌❌❌ Commit hash: 19c9a7a Note
Tip
|
Quality Gate passedIssues Measures |
} | ||
|
||
export function useNftCollectionsMetadata(requests: UseDisplayNameRequest[]) { | ||
const chainId = requests?.[0]?.variation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't really assume they all have the same chain ID since they are distinct requests.
I refactored the same hook in the extension to support alternate chains in the requests, can we copy and paste here?
const nftCollections = useNftCollectionsMetadata(requests); | ||
|
||
return requests.map(({ value }) => { | ||
const nftCollectionProperties = nftCollections[value.toLowerCase()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the standard type
check to return undefined
if it's not an Ethereum address?
return requests.map(({ value }) => { | ||
const nftCollectionProperties = nftCollections[value.toLowerCase()]; | ||
|
||
const isNotSpam = nftCollectionProperties?.isSpam === false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, could we also just early return if it is spam?
import { UseDisplayNameRequest } from './useDisplayName'; | ||
import { useNftCollectionsMetadata } from './useNftCollectionsMetadata'; | ||
|
||
export interface UseNFTNameResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, type
rather than interface
?
import { useNftCollectionsMetadata } from './useNftCollectionsMetadata'; | ||
|
||
export interface UseNFTNameResponse { | ||
nftCollectionName: string | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, in this context is name
and image
sufficient as the rest is implied?
Description
This PR integrates NFT api to display name and image of collection for nfts within simulations include
ERC721
nfts.Related issues
Fixes:
Manual testing steps
ERC721
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist