From 1d04f047fd8dc988f0798bfa8387caa2f2f08ce9 Mon Sep 17 00:00:00 2001 From: Jiri Zbytovsky Date: Thu, 5 Sep 2024 17:25:32 +0200 Subject: [PATCH] chore(wallet-types): Remove useless type reexport --- packages/suite/src/components/suite/AccountLabel.tsx | 6 +++--- .../suite/src/components/suite/AccountTypeBadge.tsx | 3 ++- .../suite/labeling/MetadataLabeling/definitions.ts | 2 +- .../wallet-core/src/accounts/accountsConstants.ts | 3 +-- suite-common/wallet-types/src/account.ts | 11 ++--------- suite-native/config/package.json | 1 - suite-native/config/src/supportedNetworks.ts | 2 +- suite-native/config/tsconfig.json | 3 --- yarn.lock | 1 - 9 files changed, 10 insertions(+), 22 deletions(-) diff --git a/packages/suite/src/components/suite/AccountLabel.tsx b/packages/suite/src/components/suite/AccountLabel.tsx index 91ef38b2fb..700cc082ea 100644 --- a/packages/suite/src/components/suite/AccountLabel.tsx +++ b/packages/suite/src/components/suite/AccountLabel.tsx @@ -4,7 +4,7 @@ import { BadgeSize, Row, TOOLTIP_DELAY_LONG, TruncateWithTooltip } from '@trezor import { useCallback } from 'react'; import { useTranslation } from '../../hooks/suite'; import { spacings } from '@trezor/theme'; -import { AccountSymbol, AccountType } from '@suite-common/wallet-types'; +import { AccountType, NetworkSymbol } from '@suite-common/wallet-config'; import { AccountTypeBadge } from './AccountTypeBadge'; const TabularNums = styled.span` @@ -16,7 +16,7 @@ const TabularNums = styled.span` export interface AccountLabelProps { accountLabel?: string; accountType: AccountType; - symbol: AccountSymbol; + symbol: NetworkSymbol; index?: number; showAccountTypeBadge?: boolean; accountTypeBadgeSize?: BadgeSize; @@ -32,7 +32,7 @@ export const useAccountLabel = () => { index = 0, }: { accountType: AccountType; - symbol: AccountSymbol; + symbol: NetworkSymbol; index?: number; }) => { if (accountType === 'coinjoin') { diff --git a/packages/suite/src/components/suite/AccountTypeBadge.tsx b/packages/suite/src/components/suite/AccountTypeBadge.tsx index 3347ca9d03..3f45482da3 100644 --- a/packages/suite/src/components/suite/AccountTypeBadge.tsx +++ b/packages/suite/src/components/suite/AccountTypeBadge.tsx @@ -1,4 +1,5 @@ -import { AccountType, UppercaseAccountType } from '@suite-common/wallet-types'; +import { UppercaseAccountType } from '@suite-common/wallet-types'; +import { AccountType } from '@suite-common/wallet-config'; import { toUppercaseType } from '@suite-common/suite-utils'; import { Badge, BadgeSize } from '@trezor/components'; import { Translation } from './Translation'; diff --git a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts index 9343635006..9ded000537 100644 --- a/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts +++ b/packages/suite/src/components/suite/labeling/MetadataLabeling/definitions.ts @@ -1,7 +1,7 @@ import { ReactNode } from 'react'; import { DropdownMenuItemProps } from '@trezor/components'; import { MetadataAddPayload } from 'src/types/suite/metadata'; -import { AccountType } from '@suite-common/wallet-types'; +import { AccountType } from '@suite-common/wallet-config'; export interface Props { accountType?: AccountType; diff --git a/suite-common/wallet-core/src/accounts/accountsConstants.ts b/suite-common/wallet-core/src/accounts/accountsConstants.ts index 302059782e..681a59836a 100644 --- a/suite-common/wallet-core/src/accounts/accountsConstants.ts +++ b/suite-common/wallet-core/src/accounts/accountsConstants.ts @@ -1,5 +1,4 @@ -import { NetworkType } from '@suite-common/wallet-config'; -import { AccountType } from '@suite-common/wallet-types'; +import { AccountType, NetworkType } from '@suite-common/wallet-config'; export const ACCOUNTS_MODULE_PREFIX = '@common/wallet-core/accounts'; diff --git a/suite-common/wallet-types/src/account.ts b/suite-common/wallet-types/src/account.ts index 1481e20d62..de8d292e68 100644 --- a/suite-common/wallet-types/src/account.ts +++ b/suite-common/wallet-types/src/account.ts @@ -1,8 +1,4 @@ -import { - AccountType as NetworkAccountType, - BackendType, - NetworkSymbol, -} from '@suite-common/wallet-config'; +import { AccountType, BackendType, NetworkSymbol } from '@suite-common/wallet-config'; import { AccountEntityKeys } from '@suite-common/metadata-types'; import { AccountInfo, PROTO, TokenInfo } from '@trezor/connect'; import { @@ -91,7 +87,7 @@ export type Account = { unlockPath?: PROTO.UnlockPath; // parameter used to unlock SLIP-25/coinjoin keychain descriptor: string; descriptorChecksum?: string; - accountType: NetworkAccountType; + accountType: AccountType; symbol: NetworkSymbol; empty: boolean; visible: boolean; @@ -113,9 +109,6 @@ export type Account = { } & AccountBackendSpecific & AccountNetworkSpecific; -export type AccountType = Account['accountType']; -export type AccountSymbol = Account['symbol']; - export type UppercaseAccountType = Uppercase; export type WalletParams = diff --git a/suite-native/config/package.json b/suite-native/config/package.json index ee40420e79..7f08c06425 100644 --- a/suite-native/config/package.json +++ b/suite-native/config/package.json @@ -13,7 +13,6 @@ "dependencies": { "@mobily/ts-belt": "^3.13.1", "@suite-common/wallet-config": "workspace:*", - "@suite-common/wallet-types": "workspace:*", "@suite-common/wallet-utils": "workspace:*", "expo-constants": "16.0.2" } diff --git a/suite-native/config/src/supportedNetworks.ts b/suite-native/config/src/supportedNetworks.ts index 2294397eba..0759230ea3 100644 --- a/suite-native/config/src/supportedNetworks.ts +++ b/suite-native/config/src/supportedNetworks.ts @@ -2,12 +2,12 @@ import { A } from '@mobily/ts-belt'; import { isTestnet } from '@suite-common/wallet-utils'; import { + AccountType, NetworkCompatible, NetworkSymbol, getMainnetsCompatible, getTestnetsCompatible, } from '@suite-common/wallet-config'; -import { AccountType } from '@suite-common/wallet-types'; export const orderedAccountTypes: AccountType[] = [ 'normal', diff --git a/suite-native/config/tsconfig.json b/suite-native/config/tsconfig.json index 51c72d1ea3..18f7dc8a7e 100644 --- a/suite-native/config/tsconfig.json +++ b/suite-native/config/tsconfig.json @@ -5,9 +5,6 @@ { "path": "../../suite-common/wallet-config" }, - { - "path": "../../suite-common/wallet-types" - }, { "path": "../../suite-common/wallet-utils" } diff --git a/yarn.lock b/yarn.lock index f408beb9a7..979d5e7c3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9717,7 +9717,6 @@ __metadata: dependencies: "@mobily/ts-belt": "npm:^3.13.1" "@suite-common/wallet-config": "workspace:*" - "@suite-common/wallet-types": "workspace:*" "@suite-common/wallet-utils": "workspace:*" expo-constants: "npm:16.0.2" languageName: unknown