diff --git a/src/constants/wallets.ts b/src/constants/wallets.ts index a2fe1ee..a205516 100644 --- a/src/constants/wallets.ts +++ b/src/constants/wallets.ts @@ -339,12 +339,12 @@ export type EvmAddress = `0x${string}`; export type DydxAddress = `dydx${string}`; export const DYDX_CHAIN_INFO: Parameters[0] = { - rpc: '13.59.4.93:26657', - rest: '13.59.4.93:1317', + rpc: 'https://dydx-testnet-archive.allthatnode.com:26657', + rest: 'https://dydx-testnet-archive.allthatnode.com:1317', chainId: 'dydx-testnet-3', chainName: 'dYdX Public Testnet', chainSymbolImageUrl: - 'https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/dydx-testnet-2/chain.png', + 'https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/dydx-testnet-3/chain.png', bech32Config: { bech32PrefixAccPub: 'dydxpub', bech32PrefixValPub: 'dydxvaloperpub', diff --git a/src/hooks/useLocalNotifications.tsx b/src/hooks/useLocalNotifications.tsx index a4b7352..4bad35c 100644 --- a/src/hooks/useLocalNotifications.tsx +++ b/src/hooks/useLocalNotifications.tsx @@ -6,7 +6,7 @@ import { LocalStorageKey } from '@/constants/localStorage'; import { type TransferNotifcation } from '@/constants/notifications'; import { useAccounts } from '@/hooks/useAccounts'; -import { useSquid } from '@/hooks/useSquid'; +import { SQUID_ERROR_TYPES, useSquid } from '@/hooks/useSquid'; import { useLocalStorage } from './useLocalStorage'; const LocalNotificationsContext = createContext< @@ -71,7 +71,7 @@ const useLocalNotificationsContext = () => { if (status) statuses[txHash] = status; } catch (error) { // ignore not found errors since the route might not be available yet - if (error?.errors?.length && error.errors[0].errorType !== 'NotFoundError') { + if (error?.errors?.length && error.errors[0].errorType !== SQUID_ERROR_TYPES.NotFoundError) { statuses[txHash] = error; } } diff --git a/src/hooks/useNotificationTypes.tsx b/src/hooks/useNotificationTypes.tsx index 280c3f1..fa6a81d 100644 --- a/src/hooks/useNotificationTypes.tsx +++ b/src/hooks/useNotificationTypes.tsx @@ -129,16 +129,19 @@ export const notificationTypes = [ const description = (
- {type === 'deposit' ? 'Deposit of ' : 'Withdraw of'}{' '} + {type === 'deposit' ? 'Deposit of ' : 'Withdraw of '} {error && ( - + {stringGetter({ key: STRING_KEYS.SOMETHING_WENT_WRONG_WITH_MESSAGE, + params: { + ERROR_MESSAGE: error.message || stringGetter({ key: STRING_KEYS.UNKNOWN_ERROR }), + }, })} - + )}
); @@ -179,3 +182,7 @@ Styled.TransferText = styled.span` align-items: center; gap: 0.5ch; ` + +Styled.ErrorMessage = styled.div` + max-width: 13rem; +`; \ No newline at end of file diff --git a/src/hooks/useSquid.tsx b/src/hooks/useSquid.tsx index 8fed15a..5aa5438 100644 --- a/src/hooks/useSquid.tsx +++ b/src/hooks/useSquid.tsx @@ -1,14 +1,17 @@ import { createContext, useContext, useEffect, useMemo, useState } from 'react'; import { useSelector } from 'react-redux'; -import { TESTNET_CHAIN_ID } from '@dydxprotocol/v4-client-js'; import { Squid } from '@0xsquid/sdk'; -import { CLIENT_NETWORK_CONFIGS, DydxV4Network, isDydxV4Network } from '@/constants/networks'; +import { CLIENT_NETWORK_CONFIGS, isDydxV4Network } from '@/constants/networks'; import { getSelectedNetwork } from '@/state/appSelectors'; export const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; +export enum SQUID_ERROR_TYPES { + NotFoundError = 'NotFoundError', +} + const useSquidContext = () => { const selectedNetwork = useSelector(getSelectedNetwork); const [_, setInitialized] = useState(false); diff --git a/src/views/TransferStatusSteps.tsx b/src/views/TransferStatusSteps.tsx index 17bc419..cf3d551 100644 --- a/src/views/TransferStatusSteps.tsx +++ b/src/views/TransferStatusSteps.tsx @@ -59,7 +59,7 @@ export const TransferStatusSteps = ({ status }: ElementProps) => { }, ]; - const currentStatus = routeStatus ? routeStatus[routeStatus?.length - 1] : undefined; + const currentStatus = routeStatus?.[routeStatus?.length - 1]; let currentStep = TransferStatusStep.Bridge;