diff --git a/.changeset/forty-turtles-mix.md b/.changeset/forty-turtles-mix.md new file mode 100644 index 000000000000..cd0642d59f1b --- /dev/null +++ b/.changeset/forty-turtles-mix.md @@ -0,0 +1,10 @@ +--- +"@ledgerhq/cryptoassets": minor +"@ledgerhq/types-live": minor +"@ledgerhq/coin-cosmos": minor +"ledger-live-desktop": minor +"live-mobile": minor +"@ledgerhq/live-common": minor +--- + +move crypto_org into cosmos coin module diff --git a/apps/ledger-live-desktop/src/renderer/families/cosmos/shared/components/CosmosFamilyValidatorRow.tsx b/apps/ledger-live-desktop/src/renderer/families/cosmos/shared/components/CosmosFamilyValidatorRow.tsx index 22597bcdb259..5aed436c8858 100644 --- a/apps/ledger-live-desktop/src/renderer/families/cosmos/shared/components/CosmosFamilyValidatorRow.tsx +++ b/apps/ledger-live-desktop/src/renderer/families/cosmos/shared/components/CosmosFamilyValidatorRow.tsx @@ -25,12 +25,12 @@ type Props = { }; function CosmosFamilyValidatorRow({ validator, active, onClick, unit, currency }: Props) { const explorerView = getDefaultExplorerView(currency); - const currencyName = currency.name.toLowerCase(); + const currencyID = currency.id; const ledgerValidatorUrl = useLocalizedUrl(urls.ledgerValidator); const onExternalLink = useCallback( (address: string) => { - const ledgerValidator = cryptoFactory(currencyName).ledgerValidator; + const ledgerValidator = cryptoFactory(currencyID).ledgerValidator; if (address === ledgerValidator) { openURL(ledgerValidatorUrl); } else { @@ -38,7 +38,7 @@ function CosmosFamilyValidatorRow({ validator, active, onClick, unit, currency } if (srURL) openURL(srURL); } }, - [currencyName, explorerView, ledgerValidatorUrl], + [currencyID, explorerView, ledgerValidatorUrl], ); return ( ; -} diff --git a/apps/ledger-live-desktop/src/renderer/families/crypto_org/MemoValueField.tsx b/apps/ledger-live-desktop/src/renderer/families/crypto_org/MemoValueField.tsx deleted file mode 100644 index 4d7b3eb8d3f5..000000000000 --- a/apps/ledger-live-desktop/src/renderer/families/crypto_org/MemoValueField.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { useCallback } from "react"; -import { getAccountBridge } from "@ledgerhq/live-common/bridge/index"; -import { - CryptoOrgAccount, - Transaction, - TransactionStatus, -} from "@ledgerhq/live-common/families/crypto_org/types"; -import MemoTagField from "LLD/features/MemoTag/components/MemoTagField"; - -const MemoValueField = ({ - onChange, - account, - transaction, - status, - autoFocus, -}: { - onChange: (t: Transaction) => void; - account: CryptoOrgAccount; - transaction: Transaction; - status: TransactionStatus; - autoFocus?: boolean; -}) => { - const bridge = getAccountBridge(account); - const onMemoValueChange = useCallback( - (memo: string) => { - onChange( - bridge.updateTransaction(transaction, { - memo, - }), - ); - }, - [onChange, transaction, bridge], - ); - - // We use transaction as an error here. - // It will be usefull to block a memo wrong format - // on the ledger-live mobile - return ( - - ); -}; -export default MemoValueField; diff --git a/apps/ledger-live-desktop/src/renderer/families/crypto_org/SendRecipientFields.tsx b/apps/ledger-live-desktop/src/renderer/families/crypto_org/SendRecipientFields.tsx deleted file mode 100644 index 94e39c35b959..000000000000 --- a/apps/ledger-live-desktop/src/renderer/families/crypto_org/SendRecipientFields.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from "react"; -import Box from "~/renderer/components/Box"; -import MemoValueField from "./MemoValueField"; -import { CryptoOrgFamily } from "./types"; - -const Root: NonNullable["component"] = props => { - return ( - - - - ); -}; -export default { - component: Root, - // Transaction is used here to prevent user to forward - // If he format a memo incorrectly - fields: ["memo", "transaction"], -}; diff --git a/apps/ledger-live-desktop/src/renderer/families/crypto_org/index.ts b/apps/ledger-live-desktop/src/renderer/families/crypto_org/index.ts deleted file mode 100644 index 2bbd4db6f381..000000000000 --- a/apps/ledger-live-desktop/src/renderer/families/crypto_org/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import AccountSubHeader from "./AccountSubHeader"; -import sendRecipientFields from "./SendRecipientFields"; -import { CryptoOrgFamily } from "./types"; - -const family: CryptoOrgFamily = { - AccountSubHeader, - sendRecipientFields, -}; - -export default family; diff --git a/apps/ledger-live-desktop/src/renderer/families/crypto_org/types.ts b/apps/ledger-live-desktop/src/renderer/families/crypto_org/types.ts deleted file mode 100644 index aa9f26eca2d9..000000000000 --- a/apps/ledger-live-desktop/src/renderer/families/crypto_org/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - CryptoOrgAccount, - CryptoOrgOperation, - Transaction, - TransactionStatus, -} from "@ledgerhq/live-common/families/crypto_org/types"; -import { LLDCoinFamily } from "../types"; - -export type CryptoOrgFamily = LLDCoinFamily< - CryptoOrgAccount, - Transaction, - TransactionStatus, - CryptoOrgOperation ->; diff --git a/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-darwin.json b/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-darwin.json index b68c11c448b1..eee2e9e5feb1 100644 --- a/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-darwin.json +++ b/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-darwin.json @@ -211,7 +211,7 @@ "id": "crypto_org", "ticker": "CRO", "name": "Cronos POS Chain", - "family": "crypto_org", + "family": "cosmos", "color": "#0e1c37", "decimals": 8 }, @@ -220,7 +220,7 @@ "id": "crypto_org_croeseid", "ticker": "CRO", "name": "Cronos POS Chain Croeseid", - "family": "crypto_org", + "family": "cosmos", "color": "#0e1c37", "decimals": 8 }, diff --git a/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-linux.json b/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-linux.json index b68c11c448b1..eee2e9e5feb1 100644 --- a/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-linux.json +++ b/apps/ledger-live-desktop/tests/specs/services/wallet-api.spec.ts-snapshots/wallet-api-currencies-linux.json @@ -211,7 +211,7 @@ "id": "crypto_org", "ticker": "CRO", "name": "Cronos POS Chain", - "family": "crypto_org", + "family": "cosmos", "color": "#0e1c37", "decimals": 8 }, @@ -220,7 +220,7 @@ "id": "crypto_org_croeseid", "ticker": "CRO", "name": "Cronos POS Chain Croeseid", - "family": "crypto_org", + "family": "cosmos", "color": "#0e1c37", "decimals": 8 }, diff --git a/apps/ledger-live-mobile/src/components/RootNavigator/types/SendFundsNavigator.ts b/apps/ledger-live-mobile/src/components/RootNavigator/types/SendFundsNavigator.ts index ea80b326f7ba..cad605f2a3c0 100644 --- a/apps/ledger-live-mobile/src/components/RootNavigator/types/SendFundsNavigator.ts +++ b/apps/ledger-live-mobile/src/components/RootNavigator/types/SendFundsNavigator.ts @@ -22,10 +22,6 @@ import { CosmosAccount, Transaction as CosmosTransaction, } from "@ledgerhq/live-common/families/cosmos/types"; -import { - CryptoOrgAccount, - Transaction as CryptoOrgTransaction, -} from "@ledgerhq/live-common/families/crypto_org/types"; import { Transaction as HederaTransaction } from "@ledgerhq/live-common/families/hedera/types"; import { SolanaAccount, @@ -248,20 +244,6 @@ export type SendFundsNavigatorStackParamList = { | ScreenName.SendSelectDevice | ScreenName.SwapForm; }; - [ScreenName.CryptoOrgEditMemo]: { - accountId: string; - parentId?: string; - account: CryptoOrgAccount; - transaction: CryptoOrgTransaction; - currentNavigation: - | ScreenName.SignTransactionSummary - | ScreenName.SendSummary - | ScreenName.SwapForm; - nextNavigation: - | ScreenName.SignTransactionSelectDevice - | ScreenName.SendSelectDevice - | ScreenName.SwapForm; - }; [ScreenName.HederaEditMemo]: { accountId: string; parentId?: string; diff --git a/apps/ledger-live-mobile/src/components/RootNavigator/types/SignTransactionNavigator.ts b/apps/ledger-live-mobile/src/components/RootNavigator/types/SignTransactionNavigator.ts index 8b81d49ddf40..9dd7e2e9e4a0 100644 --- a/apps/ledger-live-mobile/src/components/RootNavigator/types/SignTransactionNavigator.ts +++ b/apps/ledger-live-mobile/src/components/RootNavigator/types/SignTransactionNavigator.ts @@ -17,10 +17,6 @@ import { CosmosAccount, Transaction as CosmosTransaction, } from "@ledgerhq/live-common/families/cosmos/types"; -import { - CryptoOrgAccount, - Transaction as CryptoOrgTransaction, -} from "@ledgerhq/live-common/families/crypto_org/types"; import { SolanaAccount, Transaction as SolanaTransaction, @@ -210,20 +206,6 @@ export type SignTransactionNavigatorParamList = { | ScreenName.SendSelectDevice | ScreenName.SwapForm; }; - [ScreenName.CryptoOrgEditMemo]: { - accountId: string; - parentId?: string; - account: CryptoOrgAccount; - transaction: CryptoOrgTransaction; - currentNavigation: - | ScreenName.SignTransactionSummary - | ScreenName.SendSummary - | ScreenName.SwapForm; - nextNavigation: - | ScreenName.SignTransactionSelectDevice - | ScreenName.SendSelectDevice - | ScreenName.SwapForm; - }; [ScreenName.HederaEditMemo]: { accountId: string; parentId?: string; diff --git a/apps/ledger-live-mobile/src/components/RootNavigator/types/SwapNavigator.ts b/apps/ledger-live-mobile/src/components/RootNavigator/types/SwapNavigator.ts index fabdb2249ade..7bc8272f5b3e 100644 --- a/apps/ledger-live-mobile/src/components/RootNavigator/types/SwapNavigator.ts +++ b/apps/ledger-live-mobile/src/components/RootNavigator/types/SwapNavigator.ts @@ -27,10 +27,6 @@ import { CosmosAccount, Transaction as CosmosTransaction, } from "@ledgerhq/live-common/families/cosmos/types"; -import { - CryptoOrgAccount, - Transaction as CryptoOrgTransaction, -} from "@ledgerhq/live-common/families/crypto_org/types"; import { SolanaAccount, Transaction as SolanaTransaction, @@ -208,20 +204,6 @@ export type SwapNavigatorParamList = { | ScreenName.SendSelectDevice | ScreenName.SwapForm; }; - [ScreenName.CryptoOrgEditMemo]: { - accountId: string; - parentId?: string; - account: CryptoOrgAccount; - transaction: CryptoOrgTransaction; - currentNavigation: - | ScreenName.SignTransactionSummary - | ScreenName.SendSummary - | ScreenName.SwapForm; - nextNavigation: - | ScreenName.SignTransactionSelectDevice - | ScreenName.SendSelectDevice - | ScreenName.SwapForm; - }; [ScreenName.HederaEditMemo]: { accountId: string; parentId?: string; diff --git a/apps/ledger-live-mobile/src/const/navigation.ts b/apps/ledger-live-mobile/src/const/navigation.ts index 8006569c73a5..e57a7a95944b 100644 --- a/apps/ledger-live-mobile/src/const/navigation.ts +++ b/apps/ledger-live-mobile/src/const/navigation.ts @@ -320,9 +320,6 @@ export enum ScreenName { // ton TonEditComment = "TonEditComment", - // crypto_org - CryptoOrgEditMemo = "CryptoOrgEditMemo", - // Algorand AlgorandEditMemo = "AlgorandEditMemo", AlgorandClaimRewardsInfo = "AlgorandClaimRewardsInfo", diff --git a/apps/ledger-live-mobile/src/families/crypto_org/AccountSubHeader.tsx b/apps/ledger-live-mobile/src/families/crypto_org/AccountSubHeader.tsx deleted file mode 100644 index 25a23826567c..000000000000 --- a/apps/ledger-live-mobile/src/families/crypto_org/AccountSubHeader.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react"; -import AccountSubHeader from "~/components/AccountSubHeader"; - -function CryptoOrgAccountSubHeader() { - return ; -} - -export default CryptoOrgAccountSubHeader; diff --git a/apps/ledger-live-mobile/src/families/crypto_org/EditMemo.tsx b/apps/ledger-live-mobile/src/families/crypto_org/EditMemo.tsx deleted file mode 100644 index 5fb77c4ae388..000000000000 --- a/apps/ledger-live-mobile/src/families/crypto_org/EditMemo.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import React, { useCallback, useState } from "react"; -import { View, StyleSheet, ScrollView } from "react-native"; -import { SafeAreaView } from "react-native-safe-area-context"; -import { useTranslation } from "react-i18next"; -import i18next from "i18next"; -import { getAccountBridge } from "@ledgerhq/live-common/bridge/index"; -import { useTheme } from "@react-navigation/native"; -import KeyboardView from "~/components/KeyboardView"; -import Button from "~/components/Button"; -import { ScreenName } from "~/const"; -import TextInput from "~/components/FocusedTextInput"; -import { StackNavigatorProps } from "~/components/RootNavigator/types/helpers"; -import { SendFundsNavigatorStackParamList } from "~/components/RootNavigator/types/SendFundsNavigator"; - -type Props = StackNavigatorProps; - -function CryptoOrgEditMemo({ navigation, route }: Props) { - const { colors } = useTheme(); - const { t } = useTranslation(); - const [memo, setMemo] = useState(route.params.transaction.memo); - const account = route.params.account; - const onValidateText = useCallback(() => { - const bridge = getAccountBridge(account); - const { transaction } = route.params; - navigation.navigate(ScreenName.SendSummary, { - ...route.params, - accountId: account.id, - transaction: bridge.updateTransaction(transaction, { - memo, - }), - }); - }, [navigation, route.params, account, memo]); - return ( - - - - - - -