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 aggregated portfolio balance cross chains #12505

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented Dec 2, 2024

Description

PR that adds cross chain aggregated balance display on main wallet view and in account picker component.

This branch was created from salim/multichain-detect-tokens-feat

Related issues

Fixes:

Manual testing steps

Build using PORTFOLIO_VIEW flag

PORTFOLIO_VIEW=true yarn watch
yarn start:ios
  1. Go to main page and see the network filter
  2. Click on current network and notice that you see aggregated balance in fiat (native balance in fiat + token balances in fiat)
  3. Click on all Networks and notice that the aggregated fiat balance changes to the sum of all (token + native) fiat values of all networks
  4. Click on Account picker and you should see correct aggregated balances

Screenshots/Recordings

Before

After

Screen.Recording.2024-12-03.at.00.45.10.mov

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

github-actions bot commented Dec 2, 2024

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.

@salimtb salimtb force-pushed the salim/multichain-detect-tokens-feat branch from 6878c10 to ea8ee34 Compare December 2, 2024 09:57
@sahar-fehri sahar-fehri marked this pull request as ready for review December 2, 2024 23:47
@sahar-fehri sahar-fehri requested review from a team as code owners December 2, 2024 23:47
@sahar-fehri sahar-fehri added Run Smoke E2E Triggers smoke e2e on Bitrise team-assets needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. portfolio-view Used for PRs and issues related to Q4 2024 portfolio view labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: a4b9b7e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2e71277a-2b59-4eb8-93e8-d0303b6f5598

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

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@salimtb
Copy link
Contributor

salimtb commented Dec 3, 2024

i just did some QA, works as expected. Here are the tests I performed:

  • Adding or deleting a network with funds updates the aggregated balance.
  • Adding or removing tokens with funds adjusts the aggregated balance.
  • Switching accounts reflects a change in the aggregated balance.
  • The balance displayed in the account selector is accurate.
  • Performing a send operation updates the balance accordingly.

Tests not yet conducted:

  • Swapping tokens and verifying the impact on the aggregated balance.
  • Using the ramp flow to buy tokens and confirming the aggregated balance updates.

@sahar-fehri sahar-fehri requested a review from a team as a code owner December 3, 2024 12:16
@sahar-fehri sahar-fehri added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 741c585
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/27ade8ac-6d76-4703-9665-f51568ae9318

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

@sahar-fehri sahar-fehri added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: b74da86
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2226a742-42e0-41da-a975-8ae96926acd1

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

Base automatically changed from salim/multichain-detect-tokens-feat to main December 3, 2024 17:01
@sahar-fehri sahar-fehri force-pushed the feat/cross-chain-aggregated-balance-feature branch from 5808bd1 to 156924f Compare December 3, 2024 20:20
@sahar-fehri sahar-fehri added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 156924f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c076ee69-4748-49be-9b40-cf14ec3c22dc

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

Copy link

sonarcloud bot commented Dec 3, 2024

<View style={styles.wrapper}>
<SensitiveText
isHidden={privacyMode}
length="10"
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird that this is a string and not a number isn't it?

Comment on lines +113 to +121
if (isPortfolioViewEnabled) {
total = totalFiatBalance ?? 0;
} else {
const tokenFiatTotal = balance?.tokenFiat ?? 0;
const ethFiatTotal = balance?.ethFiat ?? 0;
total = tokenFiatTotal + ethFiatTotal;
}
} else if (isPortfolioViewEnabled) {
total = totalTokenFiat ?? 0;
Copy link
Contributor

@gambinish gambinish Dec 3, 2024

Choose a reason for hiding this comment

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

Hopefully we can remove these isPortfolioViewEnabled checks not long after release. We should probably do this for extension too once the feature is deemed stable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would hate for these checks to be long lived on production

@@ -160,7 +160,7 @@ export const selectNetworkClientId = createSelector(

export const selectIsAllNetworks = createSelector(
selectNetworkConfigurations,
selectTokenNetworkFilter,
(state: RootState) => selectTokenNetworkFilter(state),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you help me understand this change? I'm not sure if I've seen this pattern before.

Copy link
Contributor

@gambinish gambinish left a comment

Choose a reason for hiding this comment

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

LGTM ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. portfolio-view Used for PRs and issues related to Q4 2024 portfolio view Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants