diff --git a/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts b/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts index f72c6a6c359..02cdddf3bfd 100644 --- a/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts +++ b/packages/suite/src/hooks/wallet/trading/useTradingWatchTrade.ts @@ -11,17 +11,13 @@ import { WatchSellTradeResponse, } from 'invity-api'; -import { invityAPI, type TradingType } from '@suite-common/trading'; +import { invityAPI, type TradingTradeStatusType, type TradingType } from '@suite-common/trading'; import { Trade, TradeType } from 'src/types/wallet/tradingCommonTypes'; import { saveTrade as saveBuyTrade } from 'src/actions/wallet/tradingBuyActions'; import { saveTrade as saveExchangeTrade } from 'src/actions/wallet/tradingExchangeActions'; import { saveTrade as saveSellTrade } from 'src/actions/wallet/tradingSellActions'; -import { - TradingTradeStatusType, - TradingUseWatchTradeProps, - TradingWatchTradeProps, -} from 'src/types/trading/trading'; +import { TradingUseWatchTradeProps, TradingWatchTradeProps } from 'src/types/trading/trading'; import { useFormDraft } from 'src/hooks/wallet/useFormDraft'; export const tradeFinalStatuses: Record = { diff --git a/packages/suite/src/types/trading/trading.ts b/packages/suite/src/types/trading/trading.ts index b66b11a0e90..9865822d5ca 100644 --- a/packages/suite/src/types/trading/trading.ts +++ b/packages/suite/src/types/trading/trading.ts @@ -2,15 +2,12 @@ import { BuyCryptoPaymentMethod, BuyProviderInfo, BuyTrade, - BuyTradeStatus, CryptoId, ExchangeProviderInfo, ExchangeTrade, - ExchangeTradeStatus, FiatCurrencyCode, SellFiatTrade, SellProviderInfo, - SellTradeStatus, } from 'invity-api'; import { AnyAction, Dispatch } from 'redux'; @@ -100,8 +97,6 @@ export interface TradingGetTypedTradeProps { transactionId: string | undefined; } -export type TradingTradeStatusType = BuyTradeStatus | SellTradeStatus | ExchangeTradeStatus; - export interface TradingGetDetailDataProps { trading: State; tradeType: TradeType; @@ -138,14 +133,6 @@ export interface TradingCryptoListProps { cryptoName?: string | undefined; // full name } -export type TradingUtilsProvidersProps = { - [name: string]: { - logo: string; - companyName: string; - brandName?: string; - }; -}; - export interface TradingInfoProps { cryptoIdToPlatformName: (cryptoId: CryptoId) => string | undefined; cryptoIdToCoinName: (cryptoId: CryptoId) => string | undefined; diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx index 21b4c0752c9..3b64101afa1 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOfferItem.tsx @@ -1,9 +1,8 @@ -import type { TradingTradeType } from '@suite-common/trading'; +import type { TradingTradeType, TradingUtilsProvidersProps } from '@suite-common/trading'; import { Row, Spinner, Card, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; import { Translation } from 'src/components/suite'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; import { TradingUtilsProvider } from 'src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider'; interface TradingFormOfferItemProps { diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx index a81b7d4fd8a..7f2ab92bcb2 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcher.tsx @@ -1,9 +1,8 @@ import { spacings } from '@trezor/theme'; import { Row, Card, Column, Spinner, Paragraph } from '@trezor/components'; -import type { TradingTradeType } from '@suite-common/trading'; +import type { TradingTradeType, TradingUtilsProvidersProps } from '@suite-common/trading'; import { Translation } from 'src/components/suite'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; import { TradingExchangeFormContextProps } from 'src/types/trading/tradingForm'; import { FORM_EXCHANGE_CEX, diff --git a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx index ef3f10de060..b252ab597fb 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingForm/TradingFormOffersSwitcherItem.tsx @@ -3,8 +3,8 @@ import styled from 'styled-components'; import { Badge, Radio, Tooltip, Row, Text, useElevation } from '@trezor/components'; import { borders, spacings, spacingsPx, mapElevationToBackground, Elevation } from '@trezor/theme'; +import type { TradingUtilsProvidersProps } from '@suite-common/trading'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; import { Translation } from 'src/components/suite'; import { ExchangeType } from 'src/types/trading/tradingForm'; import { FORM_EXCHANGE_CEX, FORM_EXCHANGE_DEX } from 'src/constants/wallet/trading/form'; diff --git a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx index 6c1832a543f..aa526226d55 100644 --- a/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx +++ b/packages/suite/src/views/wallet/trading/common/TradingUtils/TradingUtilsProvider.tsx @@ -2,10 +2,9 @@ import styled from 'styled-components'; import { spacings } from '@trezor/theme'; import { Row } from '@trezor/components'; -import { invityAPI } from '@suite-common/trading'; +import { invityAPI, type TradingUtilsProvidersProps } from '@suite-common/trading'; import { Translation } from 'src/components/suite'; -import { TradingUtilsProvidersProps } from 'src/types/trading/trading'; const Icon = styled.img` flex: none; diff --git a/suite-common/trading/src/types.ts b/suite-common/trading/src/types.ts index 7c0d37bf7f7..4c83725f9d8 100644 --- a/suite-common/trading/src/types.ts +++ b/suite-common/trading/src/types.ts @@ -1,9 +1,12 @@ import type { BuyCryptoPaymentMethod, BuyTrade, + BuyTradeStatus, ExchangeTrade, + ExchangeTradeStatus, SellCryptoPaymentMethod, SellFiatTrade, + SellTradeStatus, WatchBuyTradeResponse, WatchExchangeTradeResponse, WatchSellTradeResponse, @@ -27,3 +30,11 @@ export type TradingWatchTradeResponsePropsMap = { }; export type TradingPaymentMethodType = BuyCryptoPaymentMethod | SellCryptoPaymentMethod; +export type TradingTradeStatusType = BuyTradeStatus | SellTradeStatus | ExchangeTradeStatus; +export type TradingUtilsProvidersProps = { + [name: string]: { + logo: string; + companyName: string; + brandName?: string; + }; +};