Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ledger key ring protocol #7964

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/ten-paws-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@ledgerhq/hw-ledger-key-ring-protocol": minor
"@ledgerhq/ledger-key-ring-protocol": minor
"ledger-live-desktop": minor
"live-mobile": minor
"@ledgerhq/live-wallet": minor
"@ledgerhq/web-tools": minor
---

Use Ledger Key Ring Protocol naming
4 changes: 2 additions & 2 deletions apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@ledgerhq/hw-transport-node-hid-singleton": "workspace:^",
"@ledgerhq/hw-transport-node-speculos-http": "workspace:^",
"@ledgerhq/hw-transport-vault": "workspace:^",
"@ledgerhq/hw-trustchain": "workspace:^",
"@ledgerhq/hw-ledger-key-ring-protocol": "workspace:^",
"@ledgerhq/live-common": "workspace:^",
"@ledgerhq/live-config": "workspace:^",
"@ledgerhq/live-countervalues": "workspace:^",
Expand All @@ -78,7 +78,7 @@
"@ledgerhq/live-wallet": "workspace:^",
"@ledgerhq/logs": "workspace:^",
"@ledgerhq/react-ui": "workspace:^",
"@ledgerhq/trustchain": "workspace:^",
"@ledgerhq/ledger-key-ring-protocol": "workspace:^",
"@ledgerhq/types-cryptoassets": "workspace:^",
"@ledgerhq/types-devices": "workspace:^",
"@ledgerhq/types-live": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import WalletSyncRow from "~/renderer/screens/settings/sections/General/WalletSync";
import { getSdk } from "@ledgerhq/trustchain/index";
import { getSdk } from "@ledgerhq/ledger-key-ring-protocol/index";
import { EMPTY } from "rxjs";
import { Flow, initialStateWalletSync, Step } from "~/renderer/reducers/walletSync";
import getWalletSyncEnvironmentParams from "@ledgerhq/live-common/walletSync/getEnvironmentParams";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import {
memberCredentialsSelector,
setTrustchain,
trustchainSelector,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useDispatch, useSelector } from "react-redux";
import { setFlow } from "~/renderer/actions/walletSync";
import { Flow, Step } from "~/renderer/reducers/walletSync";
import { useTrustchainSdk } from "./useTrustchainSdk";
import { TrustchainResult, TrustchainResultType } from "@ledgerhq/trustchain/types";
import { TrustchainResult, TrustchainResultType } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useCallback, useEffect, useRef, useState } from "react";
import {
TrustchainAlreadyInitialized,
TrustchainAlreadyInitializedWithOtherSeed,
} from "@ledgerhq/trustchain/errors";
} from "@ledgerhq/ledger-key-ring-protocol/errors";

export function useAddMember({ device }: { device: Device | null }) {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
trustchainSelector,
resetTrustchainStore,
memberCredentialsSelector,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useMutation } from "@tanstack/react-query";
import { setFlow } from "~/renderer/actions/walletSync";
import { Flow, Step } from "~/renderer/reducers/walletSync";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { trustchainSelector } from "@ledgerhq/trustchain/store";
import { trustchainSelector } from "@ledgerhq/ledger-key-ring-protocol/store";
import { useDispatch, useSelector } from "react-redux";
import { setFlow } from "~/renderer/actions/walletSync";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { memberCredentialsSelector, trustchainSelector } from "@ledgerhq/trustchain/store";
import {
memberCredentialsSelector,
trustchainSelector,
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useSelector } from "react-redux";
import { useTrustchainSdk } from "./useTrustchainSdk";
import { QueryKey } from "./type.hooks";
import { useQuery } from "@tanstack/react-query";
import { useEffect } from "react";
import { useLifeCycle } from "./walletSync.hooks";
import { TrustchainNotFound } from "@ledgerhq/trustchain/errors";
import { TrustchainNotFound } from "@ledgerhq/ledger-key-ring-protocol/errors";

export function useGetMembers() {
const sdk = useTrustchainSdk();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { memberCredentialsSelector, setMemberCredentials } from "@ledgerhq/trustchain/store";
import {
memberCredentialsSelector,
setMemberCredentials,
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useCallback, useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useTrustchainSdk } from "./useTrustchainSdk";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { useQueries, UseQueryResult } from "@tanstack/react-query";
import { QueryKey } from "./type.hooks";
import getTrustchainApi, { StatusAPIResponse as TrustchainStatus } from "@ledgerhq/trustchain/api";
import getTrustchainApi, {
StatusAPIResponse as TrustchainStatus,
} from "@ledgerhq/ledger-key-ring-protocol/api";
import getCloudSyncApi, {
StatusAPIResponse as CloudSyncStatus,
} from "@ledgerhq/live-wallet/cloudsync/api";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import getWalletSyncEnvironmentParams from "@ledgerhq/live-common/walletSync/getEnvironmentParams";
import { trustchainSelector } from "@ledgerhq/trustchain/store";
import { trustchainSelector } from "@ledgerhq/ledger-key-ring-protocol/store";
import { useSelector } from "react-redux";
import { walletSelector } from "~/renderer/reducers/wallet";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { useCallback } from "react";
import { useDispatch } from "react-redux";
import { MemberCredentials, Trustchain, TrustchainSDK } from "@ledgerhq/trustchain/types";
import { setTrustchain, resetTrustchainStore } from "@ledgerhq/trustchain/store";
import { TrustchainEjected } from "@ledgerhq/trustchain/errors";
import {
MemberCredentials,
Trustchain,
TrustchainSDK,
} from "@ledgerhq/ledger-key-ring-protocol/types";
import { setTrustchain, resetTrustchainStore } from "@ledgerhq/ledger-key-ring-protocol/store";
import { TrustchainEjected } from "@ledgerhq/ledger-key-ring-protocol/errors";
import { log } from "@ledgerhq/logs";

export function useOnTrustchainRefreshNeeded(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { useCallback, useState } from "react";
import { createQRCodeHostInstance } from "@ledgerhq/trustchain/qrcode/index";
import { createQRCodeHostInstance } from "@ledgerhq/ledger-key-ring-protocol/qrcode/index";
import {
InvalidDigitsError,
NoTrustchainInitialized,
QRCodeWSClosed,
TrustchainAlreadyInitialized,
} from "@ledgerhq/trustchain/errors";
import { MemberCredentials } from "@ledgerhq/trustchain/types";
} from "@ledgerhq/ledger-key-ring-protocol/errors";
import { MemberCredentials } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useDispatch, useSelector } from "react-redux";
import { setFlow, setQrCodePinCode } from "~/renderer/actions/walletSync";
import { Flow, Step } from "~/renderer/reducers/walletSync";
import {
trustchainSelector,
memberCredentialsSelector,
setTrustchain,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useTrustchainSdk } from "./useTrustchainSdk";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import getWalletSyncEnvironmentParams from "@ledgerhq/live-common/walletSync/getEnvironmentParams";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import {
memberCredentialsSelector,
setTrustchain,
trustchainSelector,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { useDispatch, useSelector } from "react-redux";
import { setFlow } from "~/renderer/actions/walletSync";
import { Flow, Step } from "~/renderer/reducers/walletSync";
import { useTrustchainSdk } from "./useTrustchainSdk";
import { TrustchainMember, Trustchain } from "@ledgerhq/trustchain/types";
import { TrustchainMember, Trustchain } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useCallback, useEffect, useRef, useState } from "react";
import { TrustchainNotAllowed } from "@ledgerhq/trustchain/errors";
import { TrustchainNotAllowed } from "@ledgerhq/ledger-key-ring-protocol/errors";

type Props = {
device: Device | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
memberCredentialsSelector,
trustchainSelector,
setTrustchain,
} from "@ledgerhq/trustchain/store";
import { Trustchain, MemberCredentials } from "@ledgerhq/trustchain/types";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { Trustchain, MemberCredentials } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useQuery } from "@tanstack/react-query";
import { useDispatch, useSelector } from "react-redux";
import { QueryKey } from "./type.hooks";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useMemo } from "react";
import { getEnv } from "@ledgerhq/live-env";
import { getSdk } from "@ledgerhq/trustchain/index";
import { getSdk } from "@ledgerhq/ledger-key-ring-protocol/index";
import { withDevice } from "@ledgerhq/live-common/hw/deviceAccess";
import { trustchainLifecycle } from "@ledgerhq/live-wallet/walletsync/index";
import { useStore } from "react-redux";
import { walletSelector } from "~/renderer/reducers/wallet";
import { walletSyncStateSelector } from "@ledgerhq/live-wallet/store";
import { TrustchainSDK } from "@ledgerhq/trustchain/types";
import { TrustchainSDK } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import getWalletSyncEnvironmentParams from "@ledgerhq/live-common/walletSync/getEnvironmentParams";
import { useInstanceName } from "./useInstanceName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import walletsync, {
} from "@ledgerhq/live-wallet/walletsync/index";
import { getAccountBridge } from "@ledgerhq/live-common/bridge/index";
import { walletSelector } from "~/renderer/reducers/wallet";
import { memberCredentialsSelector, trustchainSelector } from "@ledgerhq/trustchain/store";
import {
memberCredentialsSelector,
trustchainSelector,
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { State } from "~/renderer/reducers";
import { cache as bridgeCache } from "~/renderer/bridge/cache";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resetTrustchainStore } from "@ledgerhq/trustchain/store";
import { resetTrustchainStore } from "@ledgerhq/ledger-key-ring-protocol/store";
import { useDispatch } from "react-redux";
import { ErrorType } from "./type.hooks";
import { setFlow } from "~/renderer/actions/walletSync";
Expand All @@ -7,7 +7,7 @@ import {
TrustchainEjected,
TrustchainNotAllowed,
TrustchainOutdated,
} from "@ledgerhq/trustchain/errors";
} from "@ledgerhq/ledger-key-ring-protocol/errors";
import { useRestoreTrustchain } from "./useRestoreTrustchain";
import { useTrustchainSdk } from "./useTrustchainSdk";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { mockedEventEmitter } from "~/renderer/components/debug/DebugMock";
import connectApp from "@ledgerhq/live-common/hw/connectApp";
import { Device } from "@ledgerhq/live-common/hw/actions/types";
import { createAction } from "@ledgerhq/live-common/hw/actions/app";
import { TRUSTCHAIN_APP_NAME } from "@ledgerhq/hw-trustchain";
import { TRUSTCHAIN_APP_NAME } from "@ledgerhq/hw-ledger-key-ring-protocol";

const action = createAction(getEnv("MOCK") ? mockedEventEmitter : connectApp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { AnalyticsPage, useLedgerSyncAnalytics } from "../../hooks/useLedgerSync
import TrackPage from "~/renderer/analytics/TrackPage";
import { TinyCard } from "../../components/TinyCard";
import { useInstances } from "./useInstances";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import { useDispatch, useSelector } from "react-redux";
import { memberCredentialsSelector } from "@ledgerhq/trustchain/store";
import { memberCredentialsSelector } from "@ledgerhq/ledger-key-ring-protocol/store";
import styled from "styled-components";
import { setFlow } from "~/renderer/actions/walletSync";
import { Flow, Step } from "~/renderer/reducers/walletSync";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import FollowStepsOnDevice from "../DeviceActions/FollowStepsOnDevice";
import ErrorDisplay from "~/renderer/components/ErrorDisplay";
import { useRemoveMember } from "LLD/features/WalletSync/hooks/useRemoveMember";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { Error } from "../../components/Error";
import { useTranslation } from "react-i18next";
import { Flex } from "@ledgerhq/react-ui";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";

export type FinalStepProps = {
instance: TrustchainMember | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import DeviceActionInstanceStep from "./02-DeviceActionInstanceStep";
import DeleteInstanceWithTrustchain from "./03-DeleteInstanceWithTrustchain";
import DeletionFinalStep from "./04-DeletionFinalStep";
import { DeletionError, ErrorReason } from "./04-DeletionError";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import DeletionErrorFinalStep from "./04-DeletionFinalErrorStep";

const WalletSyncManageInstances = forwardRef<BackRef, BackProps>((_props, ref) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dispatch } from "redux";
import { importTrustchainStoreState } from "@ledgerhq/trustchain/store";
import { importTrustchainStoreState } from "@ledgerhq/ledger-key-ring-protocol/store";
import { getKey } from "~/renderer/storage";

export const fetchTrustchain = () => async (dispatch: Dispatch) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import { ChangeFlowPayload } from "../reducers/walletSync";

export const setFlow = (payload: ChangeFlowPayload) => ({
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/src/renderer/middlewares/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import {
trustchainStoreActionTypePrefix,
trustchainStoreSelector,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";

import { marketStoreSelector } from "../reducers/market";

Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/src/renderer/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import wallet from "./wallet";
import { WalletState } from "@ledgerhq/live-wallet/store";
import walletSync, { WalletSyncState } from "./walletSync";
import trustchain from "./trustchain";
import { TrustchainStore } from "@ledgerhq/trustchain/store";
import { TrustchainStore } from "@ledgerhq/ledger-key-ring-protocol/store";

export type State = {
accounts: AccountsState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
trustchainHandlers,
TrustchainHandlersPayloads,
TrustchainHandlers,
} from "@ledgerhq/trustchain/store";
} from "@ledgerhq/ledger-key-ring-protocol/store";
import { handleActions } from "redux-actions";

export default handleActions<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { handleActions } from "redux-actions";
import { Handlers } from "./types";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";

export enum Flow {
Activation = "Activation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "~/renderer/actions/walletSync";
import { useHistory } from "react-router";
import styled, { useTheme } from "styled-components";
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import { FlowOptions } from "LLD/features/WalletSync/hooks/useFlows";
import { useTranslation } from "react-i18next";

Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/src/renderer/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { CounterValuesStatus, RateMapRaw } from "@ledgerhq/live-countervalues/ty
import { hubStateSelector } from "@ledgerhq/live-common/postOnboarding/reducer";
import { settingsExportSelector } from "./reducers/settings";
import logger from "./logger";
import { trustchainStoreSelector } from "@ledgerhq/trustchain/store";
import { trustchainStoreSelector } from "@ledgerhq/ledger-key-ring-protocol/store";
import { marketStoreSelector } from "./reducers/market";
import { ExportedWalletState } from "@ledgerhq/live-wallet/store";

Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/__tests__/test-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { INITIAL_STATE as WALLETSYNC_INITIAL_STATE } from "~/reducers/walletSync

import { initialState as WALLET_INITIAL_STATE } from "@ledgerhq/live-wallet/store";
import QueuedDrawersContextProvider from "LLM/components/QueuedDrawer/QueuedDrawersContextProvider";
import { INITIAL_STATE as TRUSTCHAIN_INITIAL_STATE } from "@ledgerhq/trustchain/store";
import { INITIAL_STATE as TRUSTCHAIN_INITIAL_STATE } from "@ledgerhq/ledger-key-ring-protocol/store";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const initialState = {
Expand Down
4 changes: 2 additions & 2 deletions apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@ledgerhq/ethereum-provider": "workspace:^",
"@ledgerhq/hw-transport": "workspace:^",
"@ledgerhq/hw-transport-http": "workspace:^",
"@ledgerhq/hw-trustchain": "workspace:^",
"@ledgerhq/hw-ledger-key-ring-protocol": "workspace:^",
"@ledgerhq/icons-ui": "workspace:^",
"@ledgerhq/live-common": "workspace:^",
"@ledgerhq/live-config": "workspace:^",
Expand All @@ -102,7 +102,7 @@
"@ledgerhq/native-ui": "workspace:^",
"@ledgerhq/react-native-hid": "workspace:^",
"@ledgerhq/react-native-hw-transport-ble": "workspace:^",
"@ledgerhq/trustchain": "workspace:^",
"@ledgerhq/ledger-key-ring-protocol": "workspace:^",
"@ledgerhq/types-cryptoassets": "workspace:^",
"@ledgerhq/types-devices": "workspace:^",
"@ledgerhq/types-live": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TrustchainMember } from "@ledgerhq/trustchain/types";
import { TrustchainMember } from "@ledgerhq/ledger-key-ring-protocol/types";
import { ScreenName } from "~/const";

export type WalletSyncNavigatorStackParamList = {
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/src/context/LedgerStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { INITIAL_STATE as settingsState } from "~/reducers/settings";
import { listCachedCurrencyIds, hydrateCurrency } from "~/bridge/cache";
import { getCryptoCurrencyById, listSupportedFiats } from "@ledgerhq/live-common/currencies/index";
import { importMarket } from "~/actions/market";
import { importTrustchainStoreState } from "@ledgerhq/trustchain/store";
import { importTrustchainStoreState } from "@ledgerhq/ledger-key-ring-protocol/store";
import { importWalletState } from "@ledgerhq/live-wallet/store";

export default class LedgerStoreProvider extends Component<
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Dispatch, SetStateAction } from "react";
import store from "./logic/storeWrapper";
import type { User } from "./types/store";
import type { BleState, MarketState, ProtectState, SettingsState } from "./reducers/types";
import { TrustchainStore } from "@ledgerhq/trustchain/store";
import { TrustchainStore } from "@ledgerhq/ledger-key-ring-protocol/store";
import { ExportedWalletState } from "@ledgerhq/live-wallet/store";

export type Notifications = {
Expand Down
Loading
Loading