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

chore/poc with device patch #7852

Closed
wants to merge 3 commits into from
Closed
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
1 change: 1 addition & 0 deletions apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@ledgerhq/coin-cosmos": "workspace:^",
"@ledgerhq/coin-evm": "workspace:^",
"@ledgerhq/coin-framework": "workspace:^",
"@ledgerhq/device-sdk-core": "0.0.0-develop-20240919001041",
"@ledgerhq/devices": "workspace:*",
"@ledgerhq/domain-service": "workspace:^",
"@ledgerhq/errors": "workspace:^",
Expand Down
35 changes: 35 additions & 0 deletions apps/ledger-live-desktop/src/main/window-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,41 @@ export async function createMainWindow(
};
mainWindow = new BrowserWindow(windowOptions);

mainWindow.webContents.session.on("select-hid-device", (event, details, callback) => {
console.log("select-hid-device FIRED WITH", event, details);
event.preventDefault();
if (details.deviceList && details.deviceList.length > 0) {
// TODO: filter ledger vendorId
callback(details.deviceList[0].deviceId);
}
});

mainWindow.webContents.session.on("hid-device-added", (event, device) => {
console.log("hid-device-added FIRED WITH", device);
});

mainWindow.webContents.session.on("hid-device-removed", (event, device) => {
console.log("hid-device-removed FIRED WITH", device);
});

mainWindow.webContents.session.setPermissionCheckHandler(
(webContents, permission, requestingOrigin, details) => {
console.log("setPermissionCheckHandler FIRED WITH", permission, requestingOrigin, details);
if (permission === "hid") return true;

return false;
},
);

mainWindow.webContents.session.setDevicePermissionHandler(details => {
console.log("setDevicePermissionHandler FIRED WITH", details);
if (details.deviceType === "hid" && details.device.vendorId === 0x2c97) {
return true;
}

return false;
});

mainWindow.name = "MainWindow";
loadWindow();
if (DEV_TOOLS && !DISABLE_DEV_TOOLS) {
Expand Down
1 change: 1 addition & 0 deletions libs/ledger-live-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"@ledgerhq/crypto-icons-ui": "workspace:^",
"@ledgerhq/cryptoassets": "workspace:^",
"@ledgerhq/device-core": "workspace:^",
"@ledgerhq/device-sdk-core": "0.0.0-develop-20240919001041",
"@ledgerhq/devices": "workspace:^",
"@ledgerhq/errors": "workspace:^",
"@ledgerhq/hw-app-algorand": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion libs/ledger-live-common/src/account/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isAccountDelegating } from "../families/tezos/staking";
import { BitcoinAccount, initialBitcoinResourcesValue } from "@ledgerhq/coin-bitcoin/types";
import type { Account, AccountLike } from "@ledgerhq/types-live";
import { TronAccount } from "@ledgerhq/coin-tron/types";
import { TronAccount } from "@ledgerhq/coin-tron/types/index";
import { CosmosAccount } from "../families/cosmos/types";
import {
getMainAccount,
Expand Down
8 changes: 4 additions & 4 deletions libs/ledger-live-common/src/config/sharedConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { cosmosConfig } from "../families/cosmos/config";
import { cryptoOrgConfig } from "../families/crypto_org/config";
import { elrondConfig } from "../families/elrond/config";
import { evmConfig } from "../families/evm/config";
import { fileCoinConfig } from "../families/filecoin/config";
// import { fileCoinConfig } from "../families/filecoin/config";
import { hederaConfig } from "../families/hedera/config";
import { internetComputerConfig } from "../families/internet_computer/config";
import { nearConfig } from "../families/near/config";
import { polkadotConfig } from "../families/polkadot/config";
import { xrpConfig } from "../families/xrp/config";
import { solanaConfig } from "../families/solana/config";
import { stacksConfig } from "../families/stacks/config";
// import { stacksConfig } from "../families/stacks/config";
import { stellarConfig } from "../families/stellar/config";
import { tezosConfig } from "../families/tezos/config";
import { tonConfig } from "../families/ton/config";
Expand Down Expand Up @@ -51,14 +51,14 @@ export const liveConfig: ConfigSchema = {
...cryptoOrgConfig,
...elrondConfig,
...evmConfig,
...fileCoinConfig,
// ...fileCoinConfig,
...hederaConfig,
...internetComputerConfig,
...nearConfig,
...polkadotConfig,
...xrpConfig,
...solanaConfig,
...stacksConfig,
// ...stacksConfig,
...stellarConfig,
...tezosConfig,
...tronConfig,
Expand Down

This file was deleted.

Loading
Loading