Skip to content

feat: MUSD-681 support remote vault config feature flag in money account balance service#29932

Merged
Matt561 merged 5 commits into
mainfrom
feat/musd-681-support-remote-vault-config-feature-flag-in-money-account-balance-service
May 11, 2026
Merged

feat: MUSD-681 support remote vault config feature flag in money account balance service#29932
Matt561 merged 5 commits into
mainfrom
feat/musd-681-support-remote-vault-config-feature-flag-in-money-account-balance-service

Conversation

@Matt561

@Matt561 Matt561 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Description

  • Bumps @metamask/money-account-balance-service to TBD
  • Removed the MoneyAccountBalanceService's constructor-based config. This config is now fetched internally via the RemoteFeatureFlagController

Changelog

CHANGELOG entry: bumped @metamask/money-account-balance-service to TBD; removed the MoneyAccountBalanceService's constructor-based config since its fetched internally now via remote feature flag

Related issues

Fixes: MUSD-681: Support remote vault config feature flag in Money Balance Service

Manual testing steps

Feature: Money Account Balance Fetching

  Scenario: user can fetch money account balance
    Given user has money account created

    When user views the wallet home screen
    Then user sees the money account balance and APY rendered

Screenshots/Recordings

Before

N/A - No visual change

After

N/A - No visual change

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
Bumps to a new major version of @metamask/money-account-balance-service and changes Engine initialization/messaging to support remote feature-flag-driven configuration, which could affect balance fetching behavior if the flag plumbing is wrong.

Overview
Updates Money balance integration to rely on the upgraded @metamask/money-account-balance-service@^1.0.0, which now fetches vault configuration internally via remote feature flags.

Engine wiring is adjusted accordingly: moneyAccountBalanceServiceInit no longer passes hardcoded vault config, explicitly calls controller.init(), and the service messenger now delegates RemoteFeatureFlagController:getState plus listens for RemoteFeatureFlagController:stateChange.

Front-end balance calculations/tests are updated for the service response shape change by reading musdEquivalentBalanceQuery.data.balanceOfInAssets (replacing the previous musdEquivalentValue-based fields).

Reviewed by Cursor Bugbot for commit 08fe865. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added the size-S label May 8, 2026
@socket-security

socket-security Bot commented May 8, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​money-account-balance-service@​0.2.0 ⏵ 1.0.074 +110075 +292 +1100

View full report

@Matt561 Matt561 changed the title ON HOLD - feat: MUSD-681 support remote vault config feature flag in money account balance service feat: MUSD-681 support remote vault config feature flag in money account balance service May 8, 2026
@Matt561 Matt561 marked this pull request as ready for review May 8, 2026 21:23
@Matt561 Matt561 requested review from a team as code owners May 8, 2026 21:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6854883. Configure here.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMoney, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are focused on the Money/Card feature area:

  1. money-account-balance-service-init.ts: Removed hardcoded test vault configuration (VEDA_TEST_VAULT, VEDA_TEST_ACCOUNTANT, ARB_USDC_ADDRESS constants) and added controller.init() call. The service now self-configures, likely via feature flags.

  2. money-account-balance-service-messenger.ts: Added RemoteFeatureFlagController:getState action and RemoteFeatureFlagController:stateChange event - the balance service now dynamically reads vault configuration from feature flags rather than hardcoded values.

  3. useMoneyAccountBalance.ts: Updated to use balanceOfInAssets instead of musdEquivalentValue from the query response - this is a breaking API field rename from the major version bump.

  4. package.json: Major version bump of @metamask/money-account-balance-service from ^0.2.0 to ^1.0.0 - confirms breaking API changes.

Tag Selection:

  • SmokeMoney: Primary tag - changes directly affect the Money/Card balance service, which powers the Card home screen balance display and Add Funds flows. The useMoneyAccountBalance hook is used in MoneyHomeView, MoneyBalanceCard, MoneyAddMoneySheet, and related components.
  • SmokeConfirmations: Required per SmokeMoney tag description - Card Add Funds flows that execute swaps/deposits involve transaction confirmations. Also, useMoneyAccountBalance is used in confirmation components (money-account-withdraw-info, projected-five-year-balance, useTransactionCustomAmount, useInsufficientMoneyAccountBalanceAlert).

Excluded tags reasoning:

  • SmokeWalletPlatform: Not selected as the changes are specifically to the Money/Card balance service, not to general wallet activity display or Trending features.
  • SmokeSwap: Not selected as the core swap infrastructure is unchanged; only the Money card balance service is affected.
  • Other tags: No impact on accounts, networks, snaps, browser, identity, or other areas.

Performance Test Selection:
The changes are focused on the Money/Card balance service API field rename and feature flag integration. While balance loading is involved, these changes don't introduce new rendering paths, list components, or significant state management changes that would impact measurable performance metrics. The major version bump is a breaking API change (field rename from musdEquivalentValue to balanceOfInAssets) rather than a performance-impacting architectural change. No performance test tags are applicable.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 8, 2026

Copy link
Copy Markdown

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Matt561 Matt561 added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 6bdb484 May 11, 2026
175 of 177 checks passed
@Matt561 Matt561 deleted the feat/musd-681-support-remote-vault-config-feature-flag-in-money-account-balance-service branch May 11, 2026 13:40
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-S team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants