-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Feat/collectibles send flow #13048
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/collectibles send flow #13048
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
86c870c to
bcbc375
Compare
abee450 to
26085b7
Compare
07ea71a to
714f5df
Compare
Builds ready [714f5df]Page Load Metrics (1339 ± 104 ms)
highlights:storybook
|
481f088 to
1b74aee
Compare
508894e to
9223382
Compare
ui/pages/send/send-content/send-asset-row/send-asset-row.component.js
Outdated
Show resolved
Hide resolved
9223382 to
898f775
Compare
Builds ready [898f775]Page Load Metrics (1211 ± 68 ms)
highlights:storybook
|
Builds ready [845fc2e]Page Load Metrics (1126 ± 43 ms)
highlights:storybook
|
00220aa to
f6d4123
Compare
Builds ready [f6d4123]Page Load Metrics (1098 ± 22 ms)
highlights:storybook
|
| knownCollectible, | ||
| false, | ||
| // TODO add this when checkAndUpdateSingleCollectibleOwnershipStatus is updated | ||
| // { userAddress, chainId }, |
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.
This should/will be added once this PR lands MetaMask/core#672 and a new controllers version is cut.
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 can add this after this PR is merged, correct?
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.
What affect will this call to this.collectiblesController.checkAndUpdateSingleCollectibleOwnershipStatus have before this code is uncommented?
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.
Yea we can add it later. Until the PR is merged and this code is uncommented the following scenario is possible:
- User sends NFT on Account 1
- User switches to Account 2 before transaction is complete
- Transaction is confirmed while user is on Account 2
- The collectibles controller will check whether this collectible is owned by Account 2 and update its status, but the NFT was owned by Account 1 so it won't find it and no status will be updated.
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.
Without the PR merged and code uncommented (in its current state) If however the user hasn't switched accounts between when they sent the NFT and when the transaction was confirmed, the status update will be completed correctly.
Builds ready [127eae4]Page Load Metrics (1215 ± 84 ms)
highlights:storybook
|
| accounts: getMetaMaskAccounts(state), | ||
| nativeCurrency: getNativeCurrency(state), | ||
| nativeCurrencyImage: getNativeCurrencyImage(state), | ||
| testState: state, |
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.
Is this supposed to be here?
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.
nope 😶🌫️
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.
removed here fea5a50
georgewrmarshall
left a comment
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.
Looks great!! A couple nit picky 8px grid suggestions and the collapse state of the collectible dropdowns didn't seem to be working as intended for me? Overall really nice UI work!!
| <Typography | ||
| color={COLORS.UI4} | ||
| variant={TYPOGRAPHY.H6} | ||
| boxProps={{ margin: 0, marginBottom: 3 }} |
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.
Adhere to 8px grid. marginBottom: 3 would be 12px(3*4px). Update to 16px
| boxProps={{ margin: 0, marginBottom: 3 }} | |
| boxProps={{ margin: 0, marginBottom: 4 }} |
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.
fixed here: 2a88844
Builds ready [fea5a50]Page Load Metrics (1157 ± 60 ms)
highlights:storybook
|
2a88844 to
8771e9b
Compare
Builds ready [8771e9b]Page Load Metrics (1168 ± 41 ms)
highlights:storybook
|
georgewrmarshall
left a comment
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.
Looks great to me! Nicely done 💯
| // in which case we will want to check and update ownership status of the transferred collectible. | ||
| if ( | ||
| txMeta.type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM && | ||
| txMeta.txParams !== 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.
Is it possible for txMeta.type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM AND txMeta.txParams === 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.
It seems unlikely. Added here for extra protection against unexpected scenarios.
brad-decker
left a comment
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.
Looks good to me, the additional code in the send duck looks clean and easy to understand, plus builds upon and extend existing standards and patterns. Great work, Alex.
This PR enables sending of ERC721 tokens from within the final piece of bringing the extension to parity with mobile for NFT support. ERC1155 sends are not yet enabled (as is the case on mobile).
Relevant Figma Designs
Screenshots:




Stepping through the Send Flow:
If the user does not own the collectible (if it is in the "Previously Owned" Section) they can still click into view the details,


but they will not see a send button available:
And if the token is an ERC1155 we show but disable the send button with an info tooltip to indicate that we don't yet support sending this type of token:

Manual testing steps:
Related (and non-blocking in my opinion) work still left to do:
Import NFTflow.Import NFTflow)