diff --git a/apps/extension/package.json b/apps/extension/package.json index a2c886559d..58fb09270a 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -44,7 +44,6 @@ "@cosmjs/encoding": "^0.29.0", "@dao-xyz/borsh": "^5.1.5", "@ledgerhq/hw-transport": "^6.31.4", - "@ledgerhq/hw-transport-webhid": "^6.30.0", "@ledgerhq/hw-transport-webusb": "^6.29.4", "@zondax/ledger-namada": "^2.0.0", "bignumber.js": "^9.1.1", diff --git a/apps/extension/src/Setup/Ledger/LedgerConnect.tsx b/apps/extension/src/Setup/Ledger/LedgerConnect.tsx index 8dd0d176a4..012285c0b3 100644 --- a/apps/extension/src/Setup/Ledger/LedgerConnect.tsx +++ b/apps/extension/src/Setup/Ledger/LedgerConnect.tsx @@ -1,6 +1,10 @@ import { chains } from "@namada/chains"; import { ActionButton, Alert, Image, Stack } from "@namada/components"; -import { Ledger as LedgerApp, makeBip44Path } from "@namada/sdk/web"; +import { + Ledger as LedgerApp, + makeBip44Path, + makeSaplingPath, +} from "@namada/sdk/web"; import { Bip44Path } from "@namada/types"; import { LedgerError } from "@zondax/ledger-namada"; import { LedgerStep } from "Setup/Common"; @@ -36,6 +40,10 @@ export const LedgerConnect: React.FC = ({ path, setPath }) => { const { address, publicKey } = await ledger.showAddressAndPublicKey( makeBip44Path(chains.namada.bip44.coinType, path) ); + const { viewingKey, proofGenerationKey } = await ledger.getShieldedKeys( + makeSaplingPath(chains.namada.bip44.coinType, path) + ); + console.log("TODO", { viewingKey, proofGenerationKey }); setIsLedgerConnecting(false); navigate(routes.ledgerImport(), { state: { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 13914fdf4e..5dcbe94d6d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -63,7 +63,6 @@ "@cosmjs/encoding": "^0.29.0", "@dao-xyz/borsh": "^5.1.5", "@ledgerhq/hw-transport": "^6.31.4", - "@ledgerhq/hw-transport-webhid": "^6.30.0", "@ledgerhq/hw-transport-webusb": "^6.29.4", "@zondax/ledger-namada": "^2.0.0", "bignumber.js": "^9.1.1", diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index cd7c35ece4..27e28c38b7 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -1,9 +1,5 @@ // Make Ledger available for direct-import as it is not dependent on Sdk initialization -export { - Ledger, - initLedgerHIDTransport, - initLedgerUSBTransport, -} from "./ledger"; +export { Ledger, initLedgerUSBTransport } from "./ledger"; export type { LedgerAddressAndPublicKey, LedgerShieldedKeys, diff --git a/packages/sdk/src/ledger.ts b/packages/sdk/src/ledger.ts index c7974ee8a8..f9100a59b3 100644 --- a/packages/sdk/src/ledger.ts +++ b/packages/sdk/src/ledger.ts @@ -1,5 +1,4 @@ import Transport from "@ledgerhq/hw-transport"; -import TransportHID from "@ledgerhq/hw-transport-webhid"; import TransportUSB from "@ledgerhq/hw-transport-webusb"; import { chains } from "@namada/chains"; import { @@ -41,15 +40,6 @@ export const initLedgerUSBTransport = async (): Promise => { return await TransportUSB.create(); }; -/** - * Initialize HID transport - * @async - * @returns Transport object - */ -export const initLedgerHIDTransport = async (): Promise => { - return await TransportHID.create(); -}; - export const DEFAULT_LEDGER_BIP44_PATH = makeBip44Path(coinType, { account: 0, change: 0, diff --git a/yarn.lock b/yarn.lock index 5397360ccf..a663448bd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3221,27 +3221,27 @@ __metadata: languageName: node linkType: hard -"@ledgerhq/devices@npm:8.4.4, @ledgerhq/devices@npm:^8.4.4": - version: 8.4.4 - resolution: "@ledgerhq/devices@npm:8.4.4" +"@ledgerhq/devices@npm:^8.4.2": + version: 8.4.2 + resolution: "@ledgerhq/devices@npm:8.4.2" dependencies: - "@ledgerhq/errors": "npm:^6.19.1" + "@ledgerhq/errors": "npm:^6.18.0" "@ledgerhq/logs": "npm:^6.12.0" rxjs: "npm:^7.8.1" semver: "npm:^7.3.5" - checksum: ea4c3dada124c5c0aad59837e1c399bf2f41f8b4da5c996aaf73bbf8719082598808947c505dc728266ff83fc5fea71170d3f0d18a9b5d59e6e2737ae8a38f39 + checksum: b7149c6302d23928fd2d3622d9018af10a56f6960732de0d72e881d19b75b0036f6248ca0845cfe9dfeda32ecb52c352423e79e109c7decf8437948fed7843cd languageName: node linkType: hard -"@ledgerhq/devices@npm:^8.4.2": - version: 8.4.2 - resolution: "@ledgerhq/devices@npm:8.4.2" +"@ledgerhq/devices@npm:^8.4.4": + version: 8.4.4 + resolution: "@ledgerhq/devices@npm:8.4.4" dependencies: - "@ledgerhq/errors": "npm:^6.18.0" + "@ledgerhq/errors": "npm:^6.19.1" "@ledgerhq/logs": "npm:^6.12.0" rxjs: "npm:^7.8.1" semver: "npm:^7.3.5" - checksum: b7149c6302d23928fd2d3622d9018af10a56f6960732de0d72e881d19b75b0036f6248ca0845cfe9dfeda32ecb52c352423e79e109c7decf8437948fed7843cd + checksum: ea4c3dada124c5c0aad59837e1c399bf2f41f8b4da5c996aaf73bbf8719082598808947c505dc728266ff83fc5fea71170d3f0d18a9b5d59e6e2737ae8a38f39 languageName: node linkType: hard @@ -3259,18 +3259,6 @@ __metadata: languageName: node linkType: hard -"@ledgerhq/hw-transport-webhid@npm:^6.30.0": - version: 6.30.0 - resolution: "@ledgerhq/hw-transport-webhid@npm:6.30.0" - dependencies: - "@ledgerhq/devices": "npm:8.4.4" - "@ledgerhq/errors": "npm:^6.19.1" - "@ledgerhq/hw-transport": "npm:^6.31.4" - "@ledgerhq/logs": "npm:^6.12.0" - checksum: 1cb6ddb50127d6cb73d80259e10da687a2b7aa87ebbac8cc3e770ac5b95a3ef0001bdaf77109da0eb62509cb8668a9642858b59cb0ff355c1adb0fe2114c532c - languageName: node - linkType: hard - "@ledgerhq/hw-transport-webusb@npm:^6.29.4": version: 6.29.4 resolution: "@ledgerhq/hw-transport-webusb@npm:6.29.4" @@ -3473,7 +3461,6 @@ __metadata: "@cosmjs/encoding": "npm:^0.29.0" "@dao-xyz/borsh": "npm:^5.1.5" "@ledgerhq/hw-transport": "npm:^6.31.4" - "@ledgerhq/hw-transport-webhid": "npm:^6.30.0" "@ledgerhq/hw-transport-webusb": "npm:^6.29.4" "@svgr/webpack": "npm:^6.3.1" "@types/chrome": "npm:^0.0.237" @@ -3754,7 +3741,6 @@ __metadata: "@cosmjs/encoding": "npm:^0.29.0" "@dao-xyz/borsh": "npm:^5.1.5" "@ledgerhq/hw-transport": "npm:^6.31.4" - "@ledgerhq/hw-transport-webhid": "npm:^6.30.0" "@ledgerhq/hw-transport-webusb": "npm:^6.29.4" "@release-it/conventional-changelog": "npm:^8.0.1" "@types/jest": "npm:^29.5.12"