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 Feb 3, 2025
1 parent ec9fb40 commit 58fcd1e
Show file tree
Hide file tree
Showing 67 changed files with 77 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Locator, Page } from '@playwright/test';

import { regional } from '@suite-common/invity';
import { regional } from '@suite-common/trading';
import { FiatCurrencyCode } from '@suite-common/suite-config';
import { NetworkSymbol } from '@suite-common/wallet-config';

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 { tradingReducer } from 'src/reducers/wallet/tradingReducer';
import { configureStore } from 'src/support/tests/configureStore';
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 { tradingReducer } from 'src/reducers/wallet/tradingReducer';
import { configureStore } from 'src/support/tests/configureStore';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CryptoId } from 'invity-api';

import type { TradingType } from '@suite-common/invity';
import { isDesktop } from '@trezor/env-utils';
import { notificationsActions } from '@suite-common/toast-notifications';
import {
confirmAddressOnDeviceThunk,
Expand All @@ -15,8 +15,8 @@ import {
hasNetworkFeatures,
parseFormDraftKey,
} from '@suite-common/wallet-utils';
import type { TradingType } from '@suite-common/trading';
import { PROTO } from '@trezor/connect';
import { isDesktop } from '@trezor/env-utils';

import * as modalActions from 'src/actions/suite/modalActions';
import { TRADING_BUY, TRADING_COMMON, TRADING_EXCHANGE } from 'src/actions/wallet/constants';
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 * as modalActions from 'src/actions/suite/modalActions';
import { verifyAddress as verifyBuyAddress } from 'src/actions/wallet/trading/tradingCommonActions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ExchangeTradeQuoteRequest,
} from 'invity-api';

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

import * as modalActions from 'src/actions/suite/modalActions';
import { verifyAddress as verifyExchangeAddress } from 'src/actions/wallet/trading/tradingCommonActions';
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 * as modalActions from 'src/actions/suite/modalActions';
import { Dispatch } from 'src/types/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react';

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

import { useDefaultAccountLabel, useSelector } from 'src/hooks/suite';
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 @@ -4,13 +4,13 @@ import { useForm, useWatch } from 'react-hook-form';
import type { BuyTrade, BuyTradeQuoteRequest, CryptoId } from 'invity-api';
import useDebounce from 'react-use/lib/useDebounce';

import { type TradingBuyType, invityAPI } from '@suite-common/invity';
import { type TradingBuyType, invityAPI } from '@suite-common/trading';
import { isChanged } from '@suite-common/suite-utils';
import { notificationsActions } from '@suite-common/toast-notifications';
import { networks } from '@suite-common/wallet-config';
import { formatAmount } from '@suite-common/wallet-utils';
import { isDesktop } from '@trezor/env-utils';
import { EventType, analytics } from '@trezor/suite-analytics';
import { analytics, EventType } from '@trezor/suite-analytics';

import * as routerActions from 'src/actions/suite/routerActions';
import * as tradingCommonActions from 'src/actions/wallet/trading/tradingCommonActions';
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 @@ -9,7 +9,7 @@ import type {
} from 'invity-api';
import useDebounce from 'react-use/lib/useDebounce';

import { type TradingExchangeType, invityAPI } from '@suite-common/invity';
import { type TradingExchangeType, invityAPI } from '@suite-common/trading';
import { isChanged } from '@suite-common/suite-utils';
import { notificationsActions } from '@suite-common/toast-notifications';
import { networks } from '@suite-common/wallet-config';
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 { type TradingExchangeType, invityAPI } from '@suite-common/invity';
import { type TradingExchangeType, invityAPI } from '@suite-common/trading';

import { saveSelectedQuote } from 'src/actions/wallet/tradingExchangeActions';
import { useDispatch } from 'src/hooks/suite';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useForm, useWatch } from 'react-hook-form';
import type { BankAccount, CryptoId, SellFiatTrade, SellFiatTradeQuoteRequest } from 'invity-api';
import useDebounce from 'react-use/lib/useDebounce';

import { type TradingSellType, invityAPI } from '@suite-common/invity';
import { type TradingSellType, invityAPI } from '@suite-common/trading';
import { isChanged } from '@suite-common/suite-utils';
import { notificationsActions } from '@suite-common/toast-notifications';
import { networks } from '@suite-common/wallet-config';
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 { useServerEnvironment } from 'src/hooks/wallet/trading/useServerEnviroment';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
WatchSellTradeResponse,
} from 'invity-api';

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

import { saveTrade as saveBuyTrade } from 'src/actions/wallet/tradingBuyActions';
import { saveTrade as saveExchangeTrade } from 'src/actions/wallet/tradingExchangeActions';
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 { UI } from '@trezor/connect';

import { MODAL, ROUTER } from 'src/actions/suite/constants';
Expand All @@ -13,7 +13,7 @@ import { initialState, tradingReducer } from 'src/reducers/wallet/tradingReducer
import { configureStore } from 'src/support/tests/configureStore';
import { Action } from 'src/types/suite';

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
@@ -1,6 +1,6 @@
import { MiddlewareAPI } from 'redux';

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

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 { NetworkSymbol } from '@suite-common/wallet-config';
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 @@ -11,7 +11,7 @@ import type {
SellFiatTradeQuoteRequest,
} from 'invity-api';

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

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 @@ -20,7 +20,7 @@ import type {
TradingPaymentMethodType,
TradingSellType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';
import { TokenDefinitionsState } from '@suite-common/token-definitions';
import { AccountType, NetworkSymbolExtended } from '@suite-common/wallet-config';
import { AccountsState } from '@suite-common/wallet-core';
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,4 +1,4 @@
import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';
import type { SelectedAccountLoaded } from '@suite-common/wallet-types';

import type { TradingTradeCommonProps } from 'src/reducers/wallet/tradingReducer';
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 @@ -18,7 +18,7 @@ import type {
TradingSellType,
TradingTradeType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';
import { Network } from '@suite-common/wallet-config';
import { AccountsState } from '@suite-common/wallet-core';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
TradingSellType,
TradingTradeType,
TradingType,
} from '@suite-common/invity';
} from '@suite-common/trading';
import { CurrencyOption } from '@suite-common/wallet-types';

import { FORM_FIAT_CURRENCY_SELECT, FORM_OUTPUT_CURRENCY } from 'src/constants/wallet/trading/form';
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
@@ -1,7 +1,7 @@
import { BuyTrade, CryptoId, ExchangeTrade, SellFiatTrade } from 'invity-api';
import { v4 as uuidv4 } from 'uuid';

import { type TradingTradeType, type TradingType, regional } from '@suite-common/invity';
import { type TradingTradeType, type TradingType, regional } from '@suite-common/trading';
import { DefinitionType, isTokenDefinitionKnown } from '@suite-common/token-definitions';
import {
Network,
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 { setDebugMode } from 'src/actions/suite/suiteActions';
import { SettingsSectionItem } from 'src/components/settings';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

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

import { goto } from 'src/actions/suite/routerActions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from 'react';
import { BuyTrade, BuyTradeStatus } from 'invity-api';
import styled from 'styled-components';

import { invityAPI } from '@suite-common/invity';
import { invityAPI } from '@suite-common/trading';
import { Button, Image, variables } 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 styled from 'styled-components';

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

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

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

import { goto } from 'src/actions/suite/routerActions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { CryptoId } from 'invity-api';
import styled, { useTheme } from 'styled-components';

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SellFiatTrade } from 'invity-api';
import styled, { useTheme } from 'styled-components';

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

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

import { Translation } from 'src/components/suite';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Control, Controller } from 'react-hook-form';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';

import { CryptoId } from 'invity-api';

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

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 { Card, Paragraph, Row, Spinner } from '@trezor/components';
import { spacings } from '@trezor/theme';

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 { Card, Column, Paragraph, Row, Spinner } from '@trezor/components';
import { spacings } from '@trezor/theme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CryptoId } from 'invity-api';
import { useTheme } from 'styled-components';

import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';
import { formatNetworkAmount } from '@suite-common/wallet-utils';
import { H3, Icon, Row, Text } 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 styled from 'styled-components';

import type { TradingExchangeType } from '@suite-common/invity';
import type { TradingExchangeType } from '@suite-common/trading';
import { Row, Select } 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 { PropsWithChildren, useMemo } from 'react';

import type { TradingType } from '@suite-common/invity';
import type { TradingType } from '@suite-common/trading';
import { Route } from '@suite-common/suite-types';
import { Box, Button, IconButton, Row } from '@trezor/components';
import { spacings } from '@trezor/theme';
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,4 +1,4 @@
import { type TradingPaymentMethodType, invityAPI } from '@suite-common/invity';
import { type TradingPaymentMethodType, invityAPI } from '@suite-common/trading';
import { Row } from '@trezor/components';
import { spacings } from '@trezor/theme';

Expand Down
Loading

0 comments on commit 58fcd1e

Please sign in to comment.