@@ -19,14 +19,17 @@ import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
1919import type { AppMetadata } from "../../../../wallets/types.js" ;
2020import type { WalletId } from "../../../../wallets/wallet-types.js" ;
2121import { CustomThemeProvider } from "../../../core/design-system/CustomThemeProvider.js" ;
22- import type { Theme } from "../../../core/design-system/index.js" ;
22+ import { iconSize , type Theme } from "../../../core/design-system/index.js" ;
2323import type { SiweAuthOptions } from "../../../core/hooks/auth/useSiweAuth.js" ;
2424import type { ConnectButton_connectModalOptions } from "../../../core/hooks/connection/ConnectButtonProps.js" ;
2525import type { SupportedTokens } from "../../../core/utils/defaultTokens.js" ;
26+ import { AccentFailIcon } from "../ConnectWallet/icons/AccentFailIcon.js" ;
2627import { useConnectLocale } from "../ConnectWallet/locale/getConnectLocale.js" ;
2728import { EmbedContainer } from "../ConnectWallet/Modal/ConnectEmbed.js" ;
2829import { DynamicHeight } from "../components/DynamicHeight.js" ;
30+ import { Spacer } from "../components/Spacer.js" ;
2931import { Spinner } from "../components/Spinner.js" ;
32+ import { Text } from "../components/text.js" ;
3033import type { LocaleId } from "../types.js" ;
3134import { BridgeOrchestrator , type UIOptions } from "./BridgeOrchestrator.js" ;
3235import { UnsupportedTokenScreen } from "./UnsupportedTokenScreen.js" ;
@@ -297,7 +300,19 @@ export function TransactionWidget(props: TransactionWidgetProps) {
297300 props . client ,
298301 checksumAddress ( tokenAddress ) ,
299302 props . transaction . chain . id ,
300- ) ;
303+ ) . catch ( ( e ) => {
304+ if ( e instanceof Error && e . message . includes ( "not supported" ) ) {
305+ return null ;
306+ }
307+ throw e ;
308+ } ) ;
309+ if ( ! token ) {
310+ return {
311+ chain : props . transaction . chain ,
312+ tokenAddress : checksumAddress ( tokenAddress ) ,
313+ type : "unsupported_token" ,
314+ } ;
315+ }
301316
302317 erc20Value = {
303318 amountWei : toUnits ( props . amount , token . decimals ) ,
@@ -324,6 +339,7 @@ export function TransactionWidget(props: TransactionWidgetProps) {
324339 } ;
325340 } ,
326341 queryKey : [ "bridgeData" , stringify ( props ) ] ,
342+ retry : 1 ,
327343 } ) ;
328344
329345 let content = null ;
@@ -340,6 +356,24 @@ export function TransactionWidget(props: TransactionWidgetProps) {
340356 < Spinner color = "secondaryText" size = "xl" />
341357 </ div >
342358 ) ;
359+ } else if ( bridgeDataQuery . error ) {
360+ content = (
361+ < div
362+ style = { {
363+ alignItems : "center" ,
364+ display : "flex" ,
365+ flexDirection : "column" ,
366+ justifyContent : "center" ,
367+ minHeight : "350px" ,
368+ } }
369+ >
370+ < AccentFailIcon size = { iconSize [ "3xl" ] } />
371+ < Spacer y = "lg" />
372+ < Text color = "secondaryText" size = "md" >
373+ { bridgeDataQuery . error . message }
374+ </ Text >
375+ </ div >
376+ ) ;
343377 } else if ( bridgeDataQuery . data ?. type === "unsupported_token" ) {
344378 // Show unsupported token screen
345379 content = (
0 commit comments