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: add live staking data with geo-blocking support #11891

Merged
merged 54 commits into from
Oct 23, 2024

Conversation

amitabh94
Copy link
Contributor

@amitabh94 amitabh94 commented Oct 19, 2024

Description

This PR replaces mock staking data with actual staking positions for users and integrates the Staking SDK. It also implements geo-blocking based on user location and displays real vault data.

Changes made:

  • Integrated the Staking SDK to fetch and display actual user staking positions
  • Implemented geo-blocking to restrict access based on region
  • Updated the UI to display live vault data

Additional Context:

  • Replaced mock data that was previously used in staking-related views
  • Users will now see their actual staking positions within the app
  • Geo-blocking ensures compliance with regional restrictions
  • Vault data is dynamically fetched and displayed in real-time

Related issues

Fixes: STAKE 785, STAKE 806

Manual testing steps

  1. Enable the staking feature flag in js.env locally.
  2. Log in as a user with staking positions and verify that the staking section shows live data.
  3. Access the staking feature from a geo-blocked region to verify the geo-blocking functionality.
  4. Ensure that vault data is correctly displayed based on the user’s chain and staking status.

Screenshots/Recordings

Live.Staking.Data.mp4

Pre-merge author checklist

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.

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.

@amitabh94 amitabh94 added team-stake Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 19, 2024
@amitabh94 amitabh94 changed the base branch from STAKE-785--fe-integrate-staking-eligibility to main October 19, 2024 22:56
Copy link

socket-security bot commented Oct 19, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 21, 2024
Copy link
Contributor

github-actions bot commented Oct 21, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e408753
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3911f571-61e5-4288-99b6-dee3ffa0af92

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@amitabh94 amitabh94 changed the title feat: integrate staking SDK for user positions, geo-blocking, and vault data feat: integrate staking sdk for user positions, geo-blocking, and reward data Oct 21, 2024
@amitabh94 amitabh94 changed the title feat: integrate staking sdk for user positions, geo-blocking, and reward data feat: integrate staking sdk for user positions, geo-blocking and reward data Oct 21, 2024
@amitabh94
Copy link
Contributor Author

@SocketSecurity ignore-all

@metamask/Stake-sdk uses fetch to communicate with staking backend api service

@amitabh94 amitabh94 marked this pull request as ready for review October 21, 2024 03:00
@amitabh94 amitabh94 requested review from a team as code owners October 21, 2024 03:00
@amitabh94 amitabh94 enabled auto-merge October 21, 2024 03:01
@amitabh94 amitabh94 changed the title feat: integrate staking sdk for user positions, geo-blocking and reward data feat: enable live staking positions, geo-blocking, and real-time vault data display Oct 21, 2024
@amitabh94 amitabh94 changed the title feat: enable live staking positions, geo-blocking, and real-time vault data display feat: enable live staking positions, geo-blocking and real-time vault data display Oct 21, 2024
@amitabh94 amitabh94 changed the title feat: enable live staking positions, geo-blocking and real-time vault data display feat: add live staking data and geo-blocking functionality Oct 21, 2024
@amitabh94 amitabh94 changed the title feat: add live staking data and geo-blocking functionality feat: add live staking data and enable geo-blocking Oct 21, 2024
@amitabh94 amitabh94 changed the title feat: add live staking data and enable geo-blocking feat: add live staking data with geo-blocking support Oct 21, 2024
@amitabh94 amitabh94 force-pushed the STAKE-806--fe-integrate-stake-and-vault-data branch from 9c06569 to e408753 Compare October 21, 2024 04:50
@siibars siibars mentioned this pull request Oct 21, 2024
7 tasks
siibars added a commit that referenced this pull request Oct 21, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
PR from [this
one](#11891) onto a uat
branch so that we can create a QA release from it.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes: stake-806

## **Manual testing steps**

1. When merged get the apk built from the test/mobile-staking-uat branch
and test it on your device.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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**

- [ ] 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: Amitabh Aggarwal <aggarwal.amitabh@gmail.com>
@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 23, 2024
Copy link
Contributor

github-actions bot commented Oct 23, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: fbad41c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9752330b-ec20-455a-9ce5-7db8bb65848e

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Matt561 Matt561 self-requested a review October 23, 2024 06:04
Matt561
Matt561 previously approved these changes Oct 23, 2024
salimtb
salimtb previously approved these changes Oct 23, 2024
@amitabh94 amitabh94 dismissed stale reviews from salimtb and Matt561 via 74be242 October 23, 2024 14:25
@amitabh94 amitabh94 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 23, 2024
Copy link
Contributor

github-actions bot commented Oct 23, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: f5596eb
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/346de2b6-09ff-4e64-be6f-790f42dff7c3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Matt561 Matt561 self-requested a review October 23, 2024 14:54
Copy link

@amitabh94 amitabh94 added this pull request to the merge queue Oct 23, 2024
Merged via the queue into main with commit 2ca3591 Oct 23, 2024
37 checks passed
@amitabh94 amitabh94 deleted the STAKE-806--fe-integrate-stake-and-vault-data branch October 23, 2024 15:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2024
@metamaskbot metamaskbot added the release-7.35.0 Issue or pull request that will be included in release 7.35.0 label Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.35.0 Issue or pull request that will be included in release 7.35.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-stake
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants