diff --git a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx index 8778317ea..32169978d 100644 --- a/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx +++ b/apps/trading/lib/hooks/use-vega-transaction-toasts.tsx @@ -484,7 +484,9 @@ const VegaTxCompleteToastsContent = ({ tx }: VegaTxToastContentProps) => { const VegaTxErrorToastContent = ({ tx }: VegaTxToastContentProps) => { let label = t('Error occurred'); let errorMessage = `${tx.error?.message} ${ - tx.error?.data ? `: ${tx.error?.data}` : '' + tx.error instanceof WalletError && tx.error?.data + ? `: ${tx.error?.data}` + : '' }`; const reconnectVegaWallet = useReconnectVegaWallet(); diff --git a/libs/wallet/src/use-vega-transaction.tsx b/libs/wallet/src/use-vega-transaction.tsx index d786020a4..118962d93 100644 --- a/libs/wallet/src/use-vega-transaction.tsx +++ b/libs/wallet/src/use-vega-transaction.tsx @@ -7,6 +7,7 @@ import type { Intent } from '@vegaprotocol/ui-toolkit'; import type { Transaction } from './connectors'; import { ClientErrors } from './connectors'; import { WalletError } from './connectors'; +import type { WalletClientError } from '@vegaprotocol/wallet-client'; export interface DialogProps { intent?: Intent; @@ -25,7 +26,7 @@ export enum VegaTxStatus { export interface VegaTxState { status: VegaTxStatus; - error: WalletError | Error | null; + error: WalletError | WalletClientError | Error | null; txHash: string | null; signature: string | null; dialogOpen: boolean;