Skip to content

Commit e8f218a

Browse files
fix(ramps): pass cryptocurrency on Transak callback OrderDetails reset
Align non-headless Transak redirect with Checkout: optional cryptocurrency from selected token for OrderDetails toast fallback. Include selectedToken in handleNavigationStateChange deps. Extend tests (symbol mock + headless registry-miss path). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c3b4b09 commit e8f218a

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

app/components/UI/Ramp/hooks/useTransakRouting.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jest.mock('react-redux', () => ({
2929
selected: {
3030
chainId: 'eip155:1',
3131
assetId: 'eip155:1/erc20:0xasset',
32+
symbol: 'ETH',
3233
},
3334
})),
3435
}));
@@ -1206,6 +1207,7 @@ describe('useTransakRouting', () => {
12061207
providerCode: 'transak-native',
12071208
walletAddress: MOCK_WALLET_ADDRESS,
12081209
showCloseButton: true,
1210+
cryptocurrency: 'ETH',
12091211
}),
12101212
}),
12111213
],
@@ -1245,12 +1247,13 @@ describe('useTransakRouting', () => {
12451247
routes: [
12461248
expect.objectContaining({
12471249
name: 'RampsOrderDetails',
1248-
params: {
1250+
params: expect.objectContaining({
12491251
callbackUrl,
12501252
providerCode: 'transak-native',
12511253
walletAddress: MOCK_WALLET_ADDRESS,
12521254
showCloseButton: true,
1253-
},
1255+
cryptocurrency: 'ETH',
1256+
}),
12541257
}),
12551258
],
12561259
}),
@@ -1580,6 +1583,7 @@ describe('useTransakRouting', () => {
15801583
providerCode: 'transak-native',
15811584
walletAddress: MOCK_WALLET_ADDRESS,
15821585
showCloseButton: true,
1586+
cryptocurrency: 'ETH',
15831587
}),
15841588
}),
15851589
],

app/components/UI/Ramp/hooks/useTransakRouting.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ export const useTransakRouting = (config?: UseTransakRoutingConfig) => {
478478

479479
// Same pattern as unified Buy WebView Checkout: leave the webview
480480
// immediately; OrderDetails resolves the order via callback params.
481+
const cryptoSymbol = selectedToken?.symbol;
481482
navigation.reset({
482483
index: 0,
483484
routes: [
@@ -488,6 +489,7 @@ export const useTransakRouting = (config?: UseTransakRoutingConfig) => {
488489
providerCode: normalizeProviderCode('transak-native'),
489490
walletAddress: walletAddress || '',
490491
showCloseButton: true,
492+
...(cryptoSymbol ? { cryptocurrency: cryptoSymbol } : {}),
491493
},
492494
},
493495
],
@@ -502,6 +504,7 @@ export const useTransakRouting = (config?: UseTransakRoutingConfig) => {
502504
refreshOrder,
503505
regionIsoCode,
504506
trackEvent,
507+
selectedToken,
505508
],
506509
);
507510

0 commit comments

Comments
 (0)