Skip to content
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(off-ramp): add off-ramp feature #7037

Merged
merged 61 commits into from
Nov 17, 2023
Merged

feat(off-ramp): add off-ramp feature #7037

merged 61 commits into from
Nov 17, 2023

Conversation

wachunei
Copy link
Member

@wachunei wachunei commented Aug 22, 2023

Warning
This branch (feat/off-ramp) must not contain any direct commits to it and will only server as the collection of other PRs that contribute to the development of the off-ramp feature, while keeping the changes in sync with main branch.

Note
This PR is a work in progress

Description

This PR contains the off-ramp feature and is a collection of the work of multiple other PRs. PRs that have been reviewed and approved by MetaMask members are marked as "✅ Approved".

Merged and Open PRs

  1. ✅ - refactor(ramp): add common, buy, sell folders #7014 - Approved
  2. ✅ - refactor(ramp): rename routes and SDK variables. #7016 - Approved
  3. ✅ - feat(ramp): add NetworkSwitcher view #7169 - Approved
  4. ✅ - refactor(ramp): amount to buy rename to build quote + hooks  #7227 - Approved
  5. ✅ - feat(ramp): use ServicesSignatures in useSDKMethod #7378 - Approved
  6. ✅ - feat(ramp): add initial sell navigation #7325 - Approved
  7. ✅ - feat(ramp): add getStarted flag for sell #7401 - Approved
  8. ✅ - feat(ramp): build quote ui sell version #7477 - Approved
  9. ✅ - refactor(ramp): use isBuy, isSell instead of rampType compare #7495 - Approved
  10. ✅ - feat(ramp): add orders list and list items #7498 - Approved
  11. ✅ - feat(ramp): redirect to details after adding sell order #7522 - Approved
  12. ✅ - refactor(ramp): refactor screen layout props #7539 - Approved
  13. ✅ - feat(ramp): add initial send transaction view #7556 - Approved
  14. ✅ - feat(ramp): add sell tx hash type and redux actions #7625 - Approved
  15. ✅ - feat(ramp): add sell tx hash to state when sending sell tx #7715 - Approved
  16. ✅ - feat(ramp): offramp welcome screen copy updates #7576 - Approved
  17. ✅ - feat(ramp): offramp unsupported region copy update #7577 - Approved
  18. ✅ - feat(ramp): offramp analytics #7637
  19. ✅ - fix(ramp): update AvatarVariants to AvatarVariant #7748 - Approved
  20. ✅ - chore(ramp): upgrade sdk to 1.25.4 #7800 - Approved
  21. ✅ - feat(ramp): add sell fields to order details view #7742
  22. ✅ - refactor(ramp): order list button labels #7830
  23. ✅ - feat(ramp): offramp transaction analytics #7850
  24. ✅ - feat(ramp): use sell get order from callback #7852
  25. ✅ - refactor(ramp): update copy for sell #7854
  26. ✅ - feat(ramp): updates copy on order details page for pre-transacted orders #7858
  27. ✅ - fix(ramp): fix sell copy for unsupported region in build quote #7872

Draft PRs

Design Document
https://www.figma.com/file/PsKqriAOpJDQpaHt373D45/Off-Ramp?type=design&node-id=3227-193475&mode=design&t=RY1XXYsSUIkqG1Di-0

Related issues

Refer to each PR

Manual testing steps

Refer to each PR

Screenshots/Recordings

Refer to each PR

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

@wachunei wachunei added the team-ramp issues related to Ramp features label Aug 22, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2023

Codecov Report

Attention: 294 lines in your changes are missing coverage. Please review.

Comparison is base (9ed32a5) 35.31% compared to head (49e031d) 37.42%.
Report is 2 commits behind head on main.

Files Patch % Lines
...ents/UI/Ramp/buy/hooks/useHandleSuccessfulOrder.ts 0.00% 40 Missing ⚠️
app/components/UI/Ramp/index.tsx 0.00% 24 Missing ⚠️
app/components/UI/Ramp/common/hooks/useBalance.ts 0.00% 21 Missing ⚠️
.../components/UI/Ramp/buy/hooks/useFiatCurrencies.ts 0.00% 19 Missing ⚠️
...omponents/UI/Ramp/buy/hooks/useCryptoCurrencies.ts 0.00% 18 Missing ⚠️
...nents/UI/Ramp/common/hooks/useFetchRampNetworks.ts 0.00% 16 Missing ⚠️
...ents/UI/Ramp/common/hooks/useRampNetworksDetail.ts 0.00% 15 Missing ⚠️
app/components/UI/Ramp/common/sdk/index.tsx 22.22% 14 Missing ⚠️
app/components/UI/Ramp/buy/hooks/useLimits.ts 9.09% 10 Missing ⚠️
app/components/UI/Ramp/buy/Views/Quotes/Quotes.tsx 81.63% 2 Missing and 7 partials ⚠️
... and 33 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7037      +/-   ##
==========================================
+ Coverage   35.31%   37.42%   +2.10%     
==========================================
  Files        1040     1052      +12     
  Lines       27718    28176     +458     
  Branches     2339     2516     +177     
==========================================
+ Hits         9789    10544     +755     
+ Misses      17404    17033     -371     
- Partials      525      599      +74     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

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.

wachunei and others added 9 commits September 28, 2023 14:52
<!--
Thanks for your contribution!

Please ensure that any applicable requirements below are satisfied
before submitting this pull request. This will help ensure a quick and
efficient review cycle.
-->

**Development & PR Process**
1. Follow MetaMask [Mobile Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/coding_guidelines/CODING_GUIDELINES.md)
2. Add `release-xx` label to identify the PR slated for a upcoming
release (will be used in release discussion)
3. Add `needs-dev-review` label when work is completed
4. Add the appropiate QA label when dev review is completed
    - `needs-qa`: PR requires manual QA.
- `No QA/E2E only`: PR does not require any manual QA effort. Prior to
merging, ensure that you have successful end-to-end test runs in
Bitrise.
- `Spot check on release build`: PR does not require feature QA but
needs non-automated verification. In the description section, provide
test scenarios. Add screenshots, and or recordings of what was tested.
5. Add `QA Passed` label when QA has signed off (Only required if the PR
was labeled with `needs-qa`)
6. Add your team's label, i.e. label starting with `team-` (or
`external-contributor` label if your not a MetaMask employee)

**Description**

This PR renames the "Amount To Buy" View to "Build Quote". It also
extracts the logic for crypto currencies, fiat currencies and limits
into hooks. These hooks in the future will accept a ramp type value,
either buy or sell.

**Screenshots/Recordings**

~~_If applicable, add screenshots and/or recordings to visualize the
before and after of your change_~~

**Issue**

fixes #???

**Checklist**

* [ ] There is a related GitHub issue
* [ ] Tests are included if applicable
* [ ] Any added code is fully documented

---------

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
@socket-security
Copy link

socket-security bot commented Oct 16, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

wachunei and others added 7 commits November 16, 2023 10:42
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
## **Description**

Adds analytics events to the offramp flow to track when the user
attempts, succeeds or cancels the the transaction which will send funds
to the provider.

## **Related issues**
N/A

## **Manual testing steps**
Verify the analytics events are called by checking logs when navigating
through the transaction flow

## **Screenshots/Recordings**
n/a
### **Before**
n/a
### **After**
n/a
## **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 clearly explained what problem this PR is solving and how it
is solved.
- [ ] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] 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.
- [ ] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to
"non-draft".

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] 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.

---------

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: George Weiler <georgejweiler@gmail.com>
@wachunei wachunei marked this pull request as ready for review November 17, 2023 20:30
@wachunei wachunei requested a review from a team as a code owner November 17, 2023 20:30
@wachunei wachunei added the needs-ramp-qa Tickets that need feature QA on the ramps flows label Nov 17, 2023
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ac1736b4-3672-42e1-978f-d220c7f0835f
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@sethkfman
Copy link
Contributor

@wachunei Add figma documentation for expected behavior

@wachunei
Copy link
Member Author

wachunei commented Nov 17, 2023

sethkfman
sethkfman previously approved these changes Nov 17, 2023
Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wachunei
Copy link
Member Author

@sethkfman We have added a new PR with a fix during QA #7872

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

sonarcloud bot commented Nov 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 297 Code Smells

64.2% 64.2% Coverage
1.6% 1.6% Duplication

@bkirb
Copy link
Contributor

bkirb commented Nov 17, 2023

@wachunei @georgeweiler LGTM I finished verifying iOS and Android with the latest changes ✅

@wachunei wachunei merged commit 7bfa7bc into main Nov 17, 2023
28 checks passed
@wachunei wachunei deleted the feat/off-ramp branch November 17, 2023 23:22
@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2023
@wachunei wachunei added ramp-qa-passed and removed needs-ramp-qa Tickets that need feature QA on the ramps flows labels Nov 17, 2023
@metamaskbot metamaskbot added the release-7.12.0 Issue or pull request that will be included in release 7.12.0 label Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ramp-qa-passed release-7.12.0 Issue or pull request that will be included in release 7.12.0 team-ramp issues related to Ramp features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants