Skip to content

Commit

Permalink
chore(trading): rename package from invity to trading
Browse files Browse the repository at this point in the history
  • Loading branch information
adderpositive committed Jan 27, 2025
1 parent 7b11f3b commit 7da149b
Show file tree
Hide file tree
Showing 67 changed files with 75 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Locator, Page } from '@playwright/test';
import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link';
import { FiatCurrencyCode } from '@suite-common/suite-config';
import { NetworkSymbol } from '@suite-common/wallet-config';
import { regional } from '@suite-common/invity';
import { regional } from '@suite-common/trading';

import { expect } from '../customMatchers';
import { step } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@suite-common/formatters": "workspace:*",
"@suite-common/icons": "workspace:*",
"@suite-common/intl-types": "workspace:*",
"@suite-common/invity": "workspace:*",
"@suite-common/logger": "workspace:*",
"@suite-common/message-system": "workspace:*",
"@suite-common/metadata-types": "workspace:*",
Expand All @@ -50,6 +49,7 @@
"@suite-common/test-utils": "workspace:*",
"@suite-common/toast-notifications": "workspace:*",
"@suite-common/token-definitions": "workspace:*",
"@suite-common/trading": "workspace:*",
"@suite-common/validators": "workspace:*",
"@suite-common/wallet-config": "workspace:*",
"@suite-common/wallet-constants": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api';

import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { configureStore } from 'src/support/tests/configureStore';
import { tradingReducer } from 'src/reducers/wallet/tradingReducer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CryptoId, ExchangeTrade, ExchangeTradeQuoteRequest } from 'invity-api';

import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { configureStore } from 'src/support/tests/configureStore';
import { tradingReducer } from 'src/reducers/wallet/tradingReducer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
selectSelectedDevice,
toggleRememberDevice,
} from '@suite-common/wallet-core';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { GetState, Dispatch } from 'src/types/suite';
import * as modalActions from 'src/actions/suite/modalActions';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/actions/wallet/tradingBuyActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
FiatCurrencyCode,
} from 'invity-api';

import { invityAPI, regional } from '@suite-common/invity';
import { invityAPI, regional } from '@suite-common/trading';

import { Account } from 'src/types/wallet';
import { Dispatch } from 'src/types/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
CryptoId,
} from 'invity-api';

import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { Account } from 'src/types/wallet';
import { Dispatch } from 'src/types/suite';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/actions/wallet/tradingSellActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
SellProviderInfo,
} from 'invity-api';

import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { Account } from 'src/types/wallet';
import { Dispatch } from 'src/types/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMemo } from 'react';

import { selectAccounts, selectSelectedDevice } from '@suite-common/wallet-core';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite';
import { selectAccountLabels } from 'src/reducers/suite/metadataReducer';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { useSelector } from 'src/hooks/suite';
import { selectRouter } from 'src/reducers/suite/routerReducer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { notificationsActions } from '@suite-common/toast-notifications';
import { isDesktop } from '@trezor/env-utils';
import { networks } from '@suite-common/wallet-config';
import { analytics, EventType } from '@trezor/suite-analytics';
import { invityAPI, type TradingBuyType } from '@suite-common/invity';
import { invityAPI, type TradingBuyType } from '@suite-common/trading';

import { useDispatch, useSelector } from 'src/hooks/suite';
import { createQuoteLink, createTxLink, getAmountLimits } from 'src/utils/wallet/trading/buyUtils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useContext } from 'react';

import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { TradingFormContextValues } from 'src/types/trading/tradingForm';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Account } from '@suite-common/wallet-types';
import { notificationsActions } from '@suite-common/toast-notifications';
import { networks } from '@suite-common/wallet-config';
import { analytics, EventType } from '@trezor/suite-analytics';
import { invityAPI, type TradingExchangeType } from '@suite-common/invity';
import { invityAPI, type TradingExchangeType } from '@suite-common/trading';

import { useDispatch, useSelector } from 'src/hooks/suite';
import { saveQuoteRequest, saveQuotes } from 'src/actions/wallet/tradingExchangeActions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTimeoutFn, useUnmount } from 'react-use';

import { ExchangeTrade } from 'invity-api';

import { invityAPI, type TradingExchangeType } from '@suite-common/invity';
import { invityAPI, type TradingExchangeType } from '@suite-common/trading';

import { useDispatch } from 'src/hooks/suite';
import { saveSelectedQuote } from 'src/actions/wallet/tradingExchangeActions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isChanged } from '@suite-common/suite-utils';
import { notificationsActions } from '@suite-common/toast-notifications';
import { networks } from '@suite-common/wallet-config';
import { analytics, EventType } from '@trezor/suite-analytics';
import { invityAPI, type TradingSellType } from '@suite-common/invity';
import { invityAPI, type TradingSellType } from '@suite-common/trading';

import { useDispatch, useSelector } from 'src/hooks/suite';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { useSelector } from 'src/hooks/suite';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useContext } from 'react';

import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { useSelector } from 'src/hooks/suite';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
WatchSellTradeResponse,
} from 'invity-api';

import { invityAPI, type TradingType } from '@suite-common/invity';
import { invityAPI, type TradingType } from '@suite-common/trading';

import { Trade, TradeType } from 'src/types/wallet/tradingCommonTypes';
import { saveTrade as saveBuyTrade } from 'src/actions/wallet/tradingBuyActions';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UI } from '@trezor/connect';
import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { configureStore } from 'src/support/tests/configureStore';
import { tradingReducer, initialState } from 'src/reducers/wallet/tradingReducer';
Expand All @@ -13,7 +13,7 @@ import routerReducer, { RouterState } from 'src/reducers/suite/routerReducer';
import modalReducer, { State as ModalState } from 'src/reducers/suite/modalReducer';
import { MODAL, ROUTER } from 'src/actions/suite/constants';

jest.mock('@suite-common/invity');
jest.mock('@suite-common/trading');
invityAPI.setInvityServersEnvironment = () => {};
invityAPI.createInvityAPIKey = () => {};
invityAPI.getInfo = () =>
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/middlewares/wallet/tradingMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MiddlewareAPI } from 'redux';

import { UI } from '@trezor/connect';
import { accountsActions } from '@suite-common/wallet-core';
import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { AppState, Action, Dispatch } from 'src/types/suite';
import { TRADING_COMMON, TRADING_EXCHANGE, TRADING_SELL } from 'src/actions/wallet/constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/reducers/suite/suiteReducer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import produce from 'immer';

import type { InvityServerEnvironment } from '@suite-common/invity';
import type { InvityServerEnvironment } from '@suite-common/trading';
import { Feature, selectIsFeatureDisabled } from '@suite-common/message-system';
import { isDeviceAcquired } from '@suite-common/suite-utils';
import { discoveryActions, DeviceRootState, selectSelectedDevice } from '@suite-common/wallet-core';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/reducers/wallet/tradingReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {

import type { PrecomposedTransactionFinal } from '@suite-common/wallet-types';
import type { FeeLevel } from '@trezor/connect';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import type { WalletAction, Account } from 'src/types/wallet';
import type { BuyInfo } from 'src/actions/wallet/tradingBuyActions';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/types/trading/trading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type {
TradingPaymentMethodType,
TradingSellType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';

import { GetDefaultAccountLabelParams } from 'src/hooks/suite/useDefaultAccountLabel';
import { State } from 'src/reducers/wallet/tradingReducer';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/types/trading/tradingDetail.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SelectedAccountLoaded } from '@suite-common/wallet-types';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import type { TradingTradeCommonProps } from 'src/reducers/wallet/tradingReducer';
import type { Account } from 'src/types/wallet';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/types/trading/tradingForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type {
TradingSellType,
TradingTradeType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';

import {
TradingAccountOptionsGroupOptionProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
TradingSellType,
TradingTradeType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';

import { FORM_FIAT_CURRENCY_SELECT, FORM_OUTPUT_CURRENCY } from 'src/constants/wallet/trading/form';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/utils/wallet/trading/tradingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
sortByCoin,
} from '@suite-common/wallet-utils';
import { BigNumber } from '@trezor/utils';
import { regional, type TradingTradeType, type TradingType } from '@suite-common/invity';
import { regional, type TradingTradeType, type TradingType } from '@suite-common/trading';

import { Account } from 'src/types/wallet';
import { ExtendedMessageDescriptor, Route, TrezorDevice } from 'src/types/suite';
Expand Down
4 changes: 2 additions & 2 deletions packages/suite/src/views/settings/SettingsDebug/InvityApi.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import type { InvityServerEnvironment } from '@suite-common/invity';
import { invityAPI } from '@suite-common/invity';
import type { InvityServerEnvironment } from '@suite-common/trading';
import { invityAPI } from '@suite-common/trading';

import { SettingsSectionItem } from 'src/components/settings';
import { ActionColumn, ActionSelect, TextColumn } from 'src/components/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { Card } from '@trezor/components';
import type { TradingBuyType } from '@suite-common/invity';
import type { TradingBuyType } from '@suite-common/trading';

import { goto } from 'src/actions/suite/routerActions';
import { useDispatch } from 'src/hooks/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BuyTrade, BuyTradeStatus } from 'invity-api';

import { Button, variables, Image } from '@trezor/components';
import { spacings } from '@trezor/theme';
import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';

import { Translation } from 'src/components/suite/Translation';
import { Account } from 'src/types/wallet';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { Card } from '@trezor/components';
import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';

import { goto } from 'src/actions/suite/routerActions';
import { useDispatch } from 'src/hooks/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { Card } from '@trezor/components';
import type { TradingSellType } from '@suite-common/invity';
import type { TradingSellType } from '@suite-common/trading';

import { goto } from 'src/actions/suite/routerActions';
import { useDispatch } from 'src/hooks/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CryptoId } from 'invity-api';

import { spacingsPx } from '@trezor/theme';
import { Icon } from '@trezor/components';
import type { TradingTradeType } from '@suite-common/invity';
import type { TradingTradeType } from '@suite-common/trading';

import {
getCryptoQuoteAmountProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SellFiatTrade } from 'invity-api';
import { Badge, Button, Card, Text } from '@trezor/components';
import { spacings, spacingsPx } from '@trezor/theme';
import { SCREEN_QUERY } from '@trezor/components/src/config/variables';
import type { TradingTradeType, TradingType } from '@suite-common/invity';
import type { TradingTradeType, TradingType } from '@suite-common/trading';

import { Translation } from 'src/components/suite';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components';

import { spacingsPx } from '@trezor/theme';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { TradingTradeBuySellType, TradingTradeDetailBuySellType } from 'src/types/trading/trading';
import { Translation } from 'src/components/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Control, Controller } from 'react-hook-form';

import { Flag, Select, Row } from '@trezor/components';
import { spacings } from '@trezor/theme';
import { regional } from '@suite-common/invity';
import { regional } from '@suite-common/trading';

import { CountryOption } from 'src/types/wallet/tradingCommonTypes';
import { getCountryLabelParts } from 'src/utils/wallet/trading/tradingUtils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CryptoId } from 'invity-api';

import { Button, TextButton, Row, Column, Paragraph } from '@trezor/components';
import { spacings } from '@trezor/theme';
import type { TradingTradeType, TradingType } from '@suite-common/invity';
import type { TradingTradeType, TradingType } from '@suite-common/trading';

import { useTradingFormContext } from 'src/hooks/wallet/trading/form/useTradingCommonForm';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TradingTradeType } from '@suite-common/invity';
import type { TradingTradeType } from '@suite-common/trading';
import { Row, Spinner, Card, Paragraph } from '@trezor/components';
import { spacings } from '@trezor/theme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { spacings } from '@trezor/theme';
import { Row, Card, Column, Spinner, Paragraph } from '@trezor/components';
import type { TradingTradeType } from '@suite-common/invity';
import type { TradingTradeType } from '@suite-common/trading';

import { Translation } from 'src/components/suite';
import { TradingUtilsProvidersProps } from 'src/types/trading/trading';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CryptoId } from 'invity-api';
import { H3, Icon, Row, Text } from '@trezor/components';
import { formatNetworkAmount } from '@suite-common/wallet-utils';
import { spacings } from '@trezor/theme';
import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';

import { useSelector } from 'src/hooks/suite';
import { FiatValue, FormattedCryptoAmount, Translation } from 'src/components/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from 'styled-components';

import { Row, Select } from '@trezor/components';
import { spacings } from '@trezor/theme';
import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';

import { Translation } from 'src/components/suite';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PropsWithChildren, useMemo } from 'react';
import { IconButton, Row, Box, Button } from '@trezor/components';
import { spacings } from '@trezor/theme';
import { Route } from '@suite-common/suite-types';
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';

import { PageHeader } from 'src/components/suite/layouts/SuiteLayout';
import { BasicName } from 'src/components/suite/layouts/SuiteLayout/PageHeader/PageNames/BasicName';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo } from 'react';

import { ExchangeTrade } from 'invity-api';

import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';

import {
EXCHANGE_COMPARATOR_KYC_FILTER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TradingPaymentMethodType } from '@suite-common/invity';
import type { TradingPaymentMethodType } from '@suite-common/trading';
import { Text } from '@trezor/components';

import { Translation } from 'src/components/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Row } from '@trezor/components';
import { spacings } from '@trezor/theme';
import { invityAPI, type TradingPaymentMethodType } from '@suite-common/invity';
import { invityAPI, type TradingPaymentMethodType } from '@suite-common/trading';

import { TradingPaymentPlainType } from 'src/views/wallet/trading/common/TradingPaymentPlainType';
import { TradingIcon } from 'src/views/wallet/trading/common/TradingIcon';
Expand Down
Loading

0 comments on commit 7da149b

Please sign in to comment.