Skip to content

feat: implements websocks subscription for native ramps orders#26734

Open
georgeweiler wants to merge 37 commits intomainfrom
feat/transak-websockets
Open

feat: implements websocks subscription for native ramps orders#26734
georgeweiler wants to merge 37 commits intomainfrom
feat/transak-websockets

Conversation

@georgeweiler
Copy link
Copy Markdown
Contributor

@georgeweiler georgeweiler commented Mar 1, 2026

Description

Adds mobile support for Transak order WebSocket subscriptions in the native ramps flow.

https://docs.transak.com/api/public/get-webhooks

This PR wires the mobile app up to the new websocket support added in @metamask/ramps-controller, so Transak orders can receive real-time status nudges from Transak via Pusher. The mobile client now passes a React Native Pusher implementation into TransakService, delegates the new websocket messenger actions/events, and includes the required dependency.

This keeps the existing polling path in place as a fallback, while allowing the controller to react faster when Transak emits an order update event.

Changelog

CHANGELOG entry: null

Related issues

Fixes:
Related core PR: MetaMask/core#8075

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

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

Medium Risk
Introduces a new real-time WebSocket path for Transak order updates (via Pusher) and new messenger actions/events, which can affect order status handling and background connectivity; polling remains as a fallback but integration issues could impact order tracking.

Overview
Enables native ramps (Transak) to receive real-time order status updates by wiring a React Native pusher-js implementation into TransakService and delegating new WebSocket-related messenger actions/events (including TransakService:orderUpdate).

Updates ramps initialization to call subscribeToTransakOrderUpdates() once (guarded across repeated remote-flag state changes), swallow subscription failures, and always start startOrderPolling() as a fallback; adds/updates unit tests and Jest mocks accordingly, plus bumps @metamask/ramps-controller and adds the pusher-js dependency.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

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.

@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Mar 1, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 1, 2026

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​base-controller@​9.0.0 ⏵ 9.0.1100 +11007393 +6100
Addednpm/​pusher-js@​8.4.39610010091100
Updatednpm/​@​metamask/​ramps-controller@​12.0.1 ⏵ 12.1.0-preview-a560ee403100 +5100100 +23100 +3100

View full report

@github-actions github-actions bot added the size-S label Mar 1, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 1, 2026

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Network access: npm pusher-js in module http

Module: http

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: 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@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Network access: npm pusher-js in module https

Module: https

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: 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@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Network access: npm pusher-js in module net

Module: net

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: 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@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Network access: npm pusher-js in module tls

Module: tls

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: 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@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
System shell access: npm pusher-js in module child_process

Module: child_process

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is shell access?

Next steps: 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@socket.dev.

Suggestion: Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Network access: npm pusher-js in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.jsonnpm/pusher-js@8.4.3

ℹ Read more on: This package | This alert | What is network access?

Next steps: 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@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pusher-js@8.4.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@georgeweiler georgeweiler changed the title feat: implements websocks subscription for native ramps feat: implements websocks subscription for native ramps orders Mar 1, 2026
Base automatically changed from orders-refactor to main March 2, 2026 17:36
@georgeweiler georgeweiler marked this pull request as ready for review March 30, 2026 21:40
@georgeweiler georgeweiler requested a review from a team as a code owner March 30, 2026 21:40
@github-actions github-actions bot added the risk-high Extensive testing required · High bug introduction risk label Mar 30, 2026
@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 30, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

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.

@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added size-M risk-high Extensive testing required · High bug introduction risk and removed size-S risk-high Extensive testing required · High bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 31, 2026
@github-actions github-actions bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/ramps-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/ramps-controller. Running all tests.

View GitHub Actions results

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.66%. Comparing base (e2bb36a) to head (f73419d).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
...ntrollers/ramps-controller/transak-service-init.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26734      +/-   ##
==========================================
+ Coverage   82.63%   82.66%   +0.02%     
==========================================
  Files        4854     4866      +12     
  Lines      125092   125777     +685     
  Branches    27919    28160     +241     
==========================================
+ Hits       103376   103970     +594     
- Misses      14600    14638      +38     
- Partials     7116     7169      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
66.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ E2E Fixture Validation — Structural changes detected

Category Count
New keys 46
Missing keys 0
Type mismatches 0
Value mismatches 12 (informational)

The committed fixture schema is out of date. To update, comment:

@metamaskbot update-mobile-fixture

View full details | Download diff report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-high Extensive testing required · High bug introduction risk size-M team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants