feat: enhance useTransakRouting to resolve wallet address from headle…#31021
Conversation
…ss session assetId
|
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #31021 +/- ##
=======================================
Coverage 82.84% 82.84%
=======================================
Files 5574 5574
Lines 143873 143864 -9
Branches 33409 33408 -1
=======================================
- Hits 119187 119185 -2
+ Misses 16693 16688 -5
+ Partials 7993 7991 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The PR description says that changes need to be made to transaction messenger file but I don't see any changes there. Did we miss that or do we need to update the PR description. |
We need a PR description update, I needed to merge with latest main as someone working on transaction pay controller told me that they fixed that already on the latest main. |
Description
This PR fixes the Headless Ramps "Add funds" (fiat deposit) flow used by MM Pay for Perps/Money Account deposits. After OTP login the Transak checkout prompted the user to enter a wallet address instead of going straight to payment, and it "fixed itself" on a second attempt.
This is a state-propagation race.
startHeadlessBuyseeds the selected token asynchronously viasetSelectedToken, butrouteAfterAuthenticationderived the wallet address fromselectedToken?.chainId, which was still undefined on the first pass — souseRampAccountAddressreturnednull, an emptywalletAddress=was sent to Transak, and Transak re-prompted. The fix derives the chain for the wallet address from the headless session'sassetId(known synchronously the moment the session is created) and falls back toselectedTokenonly for the non-headless BuildQuote flow, so the address resolves correctly on the first attempt.The asset, environment, and feature flags were all correct throughout; this was purely a seeding race.
Changelog
CHANGELOG entry: Fixed the "Add funds" fiat deposit flow (Perps/Money Account): the Transak checkout no longer prompts for a wallet address after OTP login.
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3598
Manual testing steps
Screenshots/Recordings
Before
ScreenRecording_06-03-2026.17-41-21_1.mp4
After
ScreenRecording_06-03-2026.17-45-25_1.mp4
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist