@@ -39,6 +39,7 @@ import {
3939 setIsSubmittingTx ,
4040 selectIsSolanaToEvm ,
4141 selectDestAddress ,
42+ selectIsSolanaSourced ,
4243} from '../../../../../core/redux/slices/bridge' ;
4344import {
4445 useNavigation ,
@@ -70,6 +71,8 @@ import { BridgeToken, BridgeViewMode } from '../../types';
7071import { useSwitchTokens } from '../../hooks/useSwitchTokens' ;
7172import { ScrollView } from 'react-native' ;
7273import useIsInsufficientBalance from '../../hooks/useInsufficientBalance' ;
74+ import { selectSelectedInternalAccountFormattedAddress } from '../../../../../selectors/accountsController' ;
75+ import { isHardwareAccount } from '../../../../../util/address' ;
7376
7477export interface BridgeRouteParams {
7578 token ?: BridgeToken ;
@@ -119,10 +122,17 @@ const BridgeView = () => {
119122 } = useBridgeQuoteData ( ) ;
120123 const { quotesLastFetched } = useSelector ( selectBridgeControllerState ) ;
121124 const { handleSwitchTokens } = useSwitchTokens ( ) ;
125+ const selectedAddress = useSelector (
126+ selectSelectedInternalAccountFormattedAddress ,
127+ ) ;
128+ const isHardwareAddress = selectedAddress
129+ ? ! ! isHardwareAccount ( selectedAddress )
130+ : false ;
122131
123132 const isEvmSolanaBridge = useSelector ( selectIsEvmSolanaBridge ) ;
124133 const isSolanaSwap = useSelector ( selectIsSolanaSwap ) ;
125134 const isSolanaToEvm = useSelector ( selectIsSolanaToEvm ) ;
135+ const isSolanaSourced = useSelector ( selectIsSolanaSourced ) ;
126136 // inputRef is used to programmatically blur the input field after a delay
127137 // This gives users time to type before the keyboard disappears
128138 // The ref is typed to only expose the blur method we need
@@ -156,9 +166,9 @@ const BridgeView = () => {
156166 sourceAmount !== undefined && sourceAmount !== '.' && sourceToken ?. decimals ;
157167
158168 const hasValidBridgeInputs =
159- isValidSourceAmount &&
160- ! ! sourceToken &&
161- ! ! destToken &&
169+ isValidSourceAmount &&
170+ ! ! sourceToken &&
171+ ! ! destToken &&
162172 // Prevent quote fetching when destination address is not set
163173 // Destinations address is only needed for EVM <> Solana bridges
164174 ( ! isEvmSolanaBridge || ( isEvmSolanaBridge && ! ! destAddress ) ) ;
@@ -326,7 +336,9 @@ const BridgeView = () => {
326336 }
327337
328338 const isSwap = route . params . bridgeViewMode === BridgeViewMode . Swap ;
329- return isSwap ? strings ( 'bridge.confirm_swap' ) : strings ( 'bridge.confirm_bridge' ) ;
339+ return isSwap
340+ ? strings ( 'bridge.confirm_swap' )
341+ : strings ( 'bridge.confirm_bridge' ) ;
330342 } ;
331343
332344 useEffect ( ( ) => {
@@ -379,12 +391,26 @@ const BridgeView = () => {
379391 activeQuote &&
380392 quotesLastFetched && (
381393 < Box style = { styles . buttonContainer } >
394+ { isHardwareAddress && (
395+ < BannerAlert
396+ severity = { BannerAlertSeverity . Error }
397+ description = {
398+ isSolanaSourced
399+ ? strings ( 'bridge.hardware_wallet_not_supported_solana' )
400+ : strings ( 'bridge.hardware_wallet_not_supported' )
401+ }
402+ />
403+ ) }
382404 < Button
383405 variant = { ButtonVariants . Primary }
384406 label = { getButtonLabel ( ) }
385407 onPress = { handleContinue }
386408 style = { styles . button }
387- isDisabled = { hasInsufficientBalance || isSubmittingTx }
409+ isDisabled = {
410+ hasInsufficientBalance ||
411+ isSubmittingTx ||
412+ isHardwareAddress
413+ }
388414 />
389415 < Button
390416 variant = { ButtonVariants . Link }
0 commit comments