Skip to content

Conversation

wachunei
Copy link
Member

@wachunei wachunei commented Sep 29, 2025

Description

This PR changes Deposit SDK environment to be aligned with the MetaMask Environment and LaunchDarkly API keys.

Changelog

CHANGELOG entry: Remap Deposit SDK environment to use MetaMask Environment.

Related issues

Fixes:

Manual testing steps

Feature: Deposit

  Scenario: user opens the Deposit flow
    Given the app is a dev build

    When user visits the Deposit feature
    Then the app uses non-prod API

  Scenario: user opens the Deposit flow
    Given the app is a prod build

    When user visits the Deposit feature
    Then the app uses prod API

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.

Note

Derives Deposit SDK environment from METAMASK_ENVIRONMENT via new helper, replaces old flag-based logic, adds tests, and updates Babel test config exclusions.

  • Deposit SDK:
    • Env resolution: Introduce app/components/UI/Ramp/Deposit/sdk/getSdkEnvironment.ts to map process.env.METAMASK_ENVIRONMENT to SdkEnvironment (production|beta|rc -> Production; others/default -> Staging).
    • Usage: Replace inline env logic in app/components/UI/Ramp/Deposit/sdk/index.tsx with getSdkEnvironment().
  • Tests:
    • Add getSdkEnvironment.test.ts covering production, staging, defaults, and edge cases.
  • Build/Config:
    • Update babel.config.tests.js to exclude Deposit getSdkEnvironment files from transform-inline-environment-variables.

Written by Cursor Bugbot for commit 2adc2e8. This will update automatically on new commits. Configure here.

@metamaskbot metamaskbot added the team-ramp issues related to Ramp features label Sep 29, 2025
@wachunei wachunei marked this pull request as ready for review September 29, 2025 15:04
@wachunei wachunei requested a review from a team as a code owner September 29, 2025 15:05
cursor[bot]

This comment was marked as outdated.

amitabh94
amitabh94 previously approved these changes Oct 1, 2025
Copy link
Contributor

@amitabh94 amitabh94 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 wachunei added this pull request to the merge queue Oct 1, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 1, 2025
Copy link

sonarqubecloud bot commented Oct 1, 2025

@wachunei wachunei added this pull request to the merge queue Oct 1, 2025
auto-merge was automatically disabled October 1, 2025 16:55

Pull Request is not mergeable

Merged via the queue into main with commit 8867976 Oct 1, 2025
90 checks passed
@wachunei wachunei deleted the refactor/ramp-use-metamask-env branch October 1, 2025 17:02
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
@metamaskbot metamaskbot added the release-7.57.0 Issue or pull request that will be included in release 7.57.0 label Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.57.0 Issue or pull request that will be included in release 7.57.0 size-M team-ramp issues related to Ramp features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants