metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Ability to buy tokens with Moonpay

Open nikoferro opened this issue 2 years ago • 6 comments

Explanation

This extends this already merged PR: https://github.com/MetaMask/metamask-extension/pull/15551 and adds Moonpay as an extra onramp provider

Current State: Only native currencies can be bought through Moonpay using the buy button After Change: Ability to purchase tokens defined in BUYABLE_CHAINS_MAP using Moonpay

More Information

See ONRAMP-189 and ONRAMP-190

Screenshots/Screencaps

Before

Screenshot 2022-09-21 at 16 12 46

After

Screenshot 2022-09-21 at 16 12 32

Manual Testing Steps

These changes apply only to Ethereum mainnet

Import a token If token is on the Moonpay lists it should display a "Buy" button

Moonpay lists:

Mainnet BSC: Polygon Avalanche C-Chain Celo

Depending on which list it shows, it should give you the option to buy the token on Moonpay Once you click on the provider's "Continue to" button, a window on said provider should open, and the token to buy should already be preselected

Pre-Merge Checklist

  • [x] PR template is filled out
  • [ ] IF this PR fixes a bug, a test that would have caught the bug has been added
  • [ ] PR is linked to the appropriate GitHub issue
  • [ ] PR has been added to the appropriate release Milestone

+ If there are functional changes:

  • [ ] Manual testing complete & passed
  • [ ] "Extension QA Board" label has been applied

nikoferro avatar Sep 21 '22 14:09 nikoferro

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.

github-actions[bot] avatar Sep 21 '22 14:09 github-actions[bot]

@brad-decker tagging you here since you also went through the previous PR and you are already familiar with these changes

nikoferro avatar Sep 21 '22 14:09 nikoferro

@nikoferro did this pass locally for you? I have a feeling that the "type is too complex" issue will come back here due to how long supported currencies list is.

brad-decker avatar Sep 21 '22 14:09 brad-decker

@brad-decker yes, worked fine on my end, and seems to be passing tests now. had to do a couple of changes on how we handle supported currencies for moonpay.

i.e: triple checked and symbols are not actually required to be lowercase

nikoferro avatar Sep 21 '22 14:09 nikoferro

Looks like junit test results got commited somehow

brad-decker avatar Sep 21 '22 19:09 brad-decker

Looks like junit test results got commited somehow

@brad-decker yeah i noticed that file, but since it wasn't on the gitignore, i understood that it was intended to be included (maybe just for an extra check, idk)

removed the results and added test-results/ to the gitignore as i get from your comment that this was not intended to be included

nikoferro avatar Sep 21 '22 20:09 nikoferro