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

Stake 806 to uat #11912

Merged
merged 37 commits into from
Oct 21, 2024
Merged

Stake 806 to uat #11912

merged 37 commits into from
Oct 21, 2024

Conversation

siibars
Copy link
Contributor

@siibars siibars commented Oct 21, 2024

Description

PR from this one onto a uat branch so that we can create a QA release from it.

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

Before

After

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.

The stakeSdkProvider component has been updated to use the new stakingApiService from the @metamask/stake-sdk library.
- Added usePooledStakes hook to fetch pooled stakes data from the staking API service
- Added useStakingChain hook to check if the current chain is supported for staking
- Added useStakingEligibility hook to fetch staking eligibility data from the staking API service
- Added useVaultData hook to fetch vault data from the staking API service

These hooks provide the necessary functionality for staking operations and data retrieval in the UI.
This commit adds a new hook called useStakingEarnings to calculate staking earnings. The hook utilizes the useVaultData, useBalance, and usePooledStakes hooks to fetch necessary data and perform calculations. It calculates the lifetime rewards in ETH and fiat, as well as the estimated annual earnings in ETH and fiat.
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.

Copy link

socket-security bot commented Oct 21, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/stake-sdk@0.2.13 network 0 165 kB metamaskbot
npm/follow-redirects@1.15.9 network 0 29.9 kB rubenverborgh
npm/form-data@4.0.1 filesystem, network 0 31.4 kB ljharb

🚮 Removed packages: npm/@metamask/stake-sdk@0.2.11

View full report↗︎

Copy link

socket-security bot commented Oct 21, 2024

👍 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.

Ignoring: npm/follow-redirects@1.15.9, npm/form-data@4.0.1, npm/@metamask/stake-sdk@0.2.13

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@siibars siibars marked this pull request as ready for review October 21, 2024 12:40
@siibars siibars requested review from a team as code owners October 21, 2024 12:40
@siibars
Copy link
Contributor Author

siibars commented Oct 21, 2024

@SocketSecurity ignore-all

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

Copy link

sonarcloud bot commented Oct 21, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

@siibars siibars merged commit ced542a into test/mobile-staking-uat Oct 21, 2024
42 checks passed
@siibars siibars deleted the stake-806-to-uat branch October 21, 2024 13:16
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants