Skip to content
Open
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
7 changes: 0 additions & 7 deletions .yarn/versions/81e941ed.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/versions/8cbbf8cb.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ enableGlobalCache: false

nodeLinker: node-modules

npmRegistryServer: "https://registry.yarnpkg.com/"

yarnPath: .yarn/releases/yarn-4.5.1.cjs
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
"watch-ts": "nodemon --exec 'yarn run build:all && node scripts/compile-done.js'",
"upgrade": "yarn upgrade-interactive",
"version:bump:patch": "yarn workspaces foreach --worktree -pv --exclude @enkryptcom/extension exec 'yarn version --immediate patch'",
"publish": "yarn workspaces foreach --worktree -pv --exclude @enkryptcom/extension exec 'yarn npm publish --access public --otp 312003'",
"publish": "yarn workspaces foreach --worktree -pv --exclude @enkryptcom/extension exec 'yarn npm publish --access public --otp 151351'",
"version:apply": "yarn version apply --all",
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "^20.2.0",
"@commitlint/config-conventional": "^20.2.0",
"@swc/core": "^1.15.3",
"@commitlint/cli": "^20.3.1",
"@commitlint/config-conventional": "^20.3.1",
"@swc/core": "^1.15.10",
"concurrently": "^9.2.1",
"husky": "^9.1.7",
"node-notifier": "^10.0.1",
"nodemon": "^3.1.11",
"ultra-runner": "^3.10.5",
"vite-plugin-node-polyfills": "0.24.0"
"vite-plugin-node-polyfills": "0.25.0"
},
"resolutions": {
"@zondax/ledger-cosmos-js/vue": "^3.5.12",
Expand Down
18 changes: 9 additions & 9 deletions packages/extension-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@
],
"dependencies": {
"nanoevents": "^9.1.0",
"serialize-error": "12.0.0",
"serialize-error": "13.0.1",
"tiny-uid": "^1.1.2",
"webextension-polyfill": "^0.12.0"
},
"devDependencies": {
"@types/node": "^22.19.2",
"@types/node": "^22.19.7",
"@types/webextension-polyfill": "^0.12.4",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"bumpp": "^10.3.2",
"eslint": "^9.39.1",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"bumpp": "^10.4.0",
"eslint": "^9.39.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.5.1",
"type-fest": "^5.3.1",
"type-fest": "^5.4.2",
"typescript": "^5.9.3",
"typescript-eslint": "8.49.0"
"typescript-eslint": "8.54.0"
}
}
46 changes: 23 additions & 23 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"watch:firefox": "yarn prebuild && cross-env BROWSER='firefox' vite"
},
"dependencies": {
"@amplitude/analytics-browser": "^2.32.0",
"@amplitude/analytics-browser": "^2.34.0",
"@enkryptcom/extension-bridge": "workspace:^",
"@enkryptcom/hw-wallets": "workspace:^",
"@enkryptcom/keyring": "workspace:^",
Expand All @@ -38,7 +38,7 @@
"@ethereumjs/wallet": "^2.0.4",
"@kadena/client": "^1.18.3",
"@kadena/pactjs-cli": "^1.18.3",
"@ledgerhq/hw-transport-webusb": "^6.29.13",
"@ledgerhq/hw-transport-webusb": "^6.30.0",
"@massalabs/massa-web3": "^5.3.0",
"@metamask/eth-sig-util": "^8.2.0",
"@metaplex-foundation/mpl-bubblegum": "^5.0.2",
Expand Down Expand Up @@ -67,9 +67,9 @@
"echarts": "^6.0.0",
"ethereum-cryptography": "^2.2.1",
"ethereumjs-abi": "^0.6.8",
"eventemitter3": "^5.0.1",
"eventemitter3": "^5.0.4",
"jdenticon": "^3.3.0",
"lodash": "^4.17.21",
"lodash": "^4.17.23",
"memoize-one": "^6.0.0",
"moment": "^2.30.1",
"nanoevents": "^9.1.0",
Expand All @@ -79,9 +79,9 @@
"switch-ts": "^2.0.0",
"url-parse": "^1.5.10",
"uuid": "^13.0.0",
"vue": "^3.5.25",
"vue": "^3.5.27",
"vue-echarts": "8.0.1",
"vue-router": "^4.6.3",
"vue-router": "^4.6.4",
"vue3-lottie": "^3.3.1",
"vuedraggable": "^4.1.0",
"web3-eth": "^1.10.4",
Expand All @@ -100,46 +100,46 @@
"@rollup/plugin-typescript": "^12.3.0",
"@tsconfig/node20": "^20.1.8",
"@types/bs58": "^5.0.0",
"@types/chrome": "^0.1.32",
"@types/chrome": "^0.1.36",
"@types/ethereumjs-abi": "^0.6.5",
"@types/events": "^3.0.3",
"@types/fs-extra": "^11.0.4",
"@types/less": "^3.0.8",
"@types/lodash": "^4.17.21",
"@types/node": "^22.19.2",
"@types/lodash": "^4.17.23",
"@types/node": "^22.19.7",
"@types/semver": "^7.7.1",
"@types/url-parse": "^1.4.11",
"@types/utf-8-validate": "^5.0.2",
"@types/uuid": "^11.0.0",
"@types/wif": "^2.0.5",
"@types/zxcvbn": "^4.4.5",
"@vitejs/plugin-vue": "^6.0.2",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.6.0",
"@vue/tsconfig": "^0.8.1",
"@vueuse/core": "^14.1.0",
"cross-env": "^10.1.0",
"eslint": "^9.39.1",
"eslint-plugin-vue": "^10.6.2",
"fs-extra": "^11.3.2",
"jsdom": "^27.3.0",
"less": "^4.4.2",
"eslint": "^9.39.2",
"eslint-plugin-vue": "^10.7.0",
"fs-extra": "^11.3.3",
"jsdom": "^27.4.0",
"less": "^4.5.1",
"less-loader": "^12.3.0",
"npm-run-all2": "^8.0.4",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"rimraf": "^6.1.2",
"rollup": "^4.53.3",
"rollup": "^4.57.0",
"rollup-plugin-visualizer": "^6.0.5",
"semver": "^7.7.3",
"systeminformation": "^5.27.14",
"systeminformation": "^5.30.6",
"tsup": "^8.5.1",
"typescript": "~5.9.3",
"url": "^0.11.4",
"vite": "^7.2.7",
"vite-plugin-node-polyfills": "0.24.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^4.0.15",
"vue-tsc": "^3.1.8",
"vite": "^7.3.1",
"vite-plugin-node-polyfills": "0.25.0",
"vite-tsconfig-paths": "^6.0.5",
"vitest": "^4.0.18",
"vue-tsc": "^3.2.4",
"webextension-polyfill": "^0.12.0"
},
"installConfig": {
Expand Down
38 changes: 19 additions & 19 deletions packages/hw-wallets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/hw-wallets",
"version": "0.0.13",
"version": "0.0.16",
"description": "Hardware wallet manager for enkrypt",
"type": "module",
"main": "src/index.ts",
Expand All @@ -22,22 +22,22 @@
"node": ">=14.15.0"
},
"devDependencies": {
"@types/node": "^24.10.2",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"eslint": "^9.39.1",
"@types/node": "^25.0.10",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check `@types/node` versions across all package.json files in the monorepo

fd package.json --type f --exec grep -l "@types/node" {} \; | xargs -I {} sh -c 'echo "=== {} ===" && grep "@types/node" {}'

Repository: enkryptcom/enKrypt

Length of output: 1180


Inconsistent @types/node version across packages.

This package uses @types/node: ^25.0.10, but most other packages in the monorepo use ^22.19.7 (name-resolution, keyring, types, storage, utils, signers/massa, swap, extension-bridge, request, extension). Only five packages share the ^25.0.10 version (hw-wallets, signers/bitcoin, signers/polkadot, signers/ethereum, signers/kadena). This major version mismatch should be reconciled to prevent type definition inconsistencies and potential build issues. Consider aligning with the majority version or document the reason for the divergence.

🤖 Prompt for AI Agents
In `@packages/hw-wallets/package.json` at line 25, The package.json dependency
"@types/node" is pinned to "^25.0.10" which is inconsistent with the majority of
monorepo packages using "^22.19.7"; update the "@types/node" entry in
packages/hw-wallets's package.json to match the monorepo majority (e.g.,
"^22.19.7") or, if intentional, add a clear comment in the package README
explaining why this package requires "^25.x" and document the divergence; ensure
the change is applied to the "@types/node" key so TypeScript type resolution
across modules remains consistent.

"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"typescript-eslint": "8.49.0",
"vitest": "^4.0.15"
"typescript-eslint": "8.54.0",
"vitest": "^4.0.18"
},
"repository": {
"type": "git",
Expand All @@ -52,24 +52,24 @@
"@ethereumjs/rlp": "^5.0.2",
"@ethereumjs/tx": "^5.4.0",
"@ethereumjs/util": "^9.1.0",
"@ledgerhq/hw-app-btc": "^10.13.0",
"@ledgerhq/hw-app-eth": "^6.47.1",
"@ledgerhq/hw-app-solana": "^7.6.0",
"@ledgerhq/hw-transport": "^6.31.13",
"@ledgerhq/hw-transport-webusb": "^6.29.13",
"@ledgerhq/hw-app-btc": "^10.17.0",
"@ledgerhq/hw-app-eth": "^7.3.1",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

@ledgerhq/hw-app-eth v7 breaking changes API migration guide

💡 Result:

I couldn’t find any official “v7 breaking changes / migration guide” specifically for @ledgerhq/hw-app-eth—only evidence that v7.x exists and is published (e.g., jsDelivr shows the package is at v7.x and marked esm, and NewReleases lists @ledgerhq/hw-app-eth@7.0.0) [1][2]. Snyk also reports a latest major around 7.0.0 for this package [3].

Practical way to build your own v6 → v7 migration checklist (works even without a guide)

  1. Inspect the v7 package metadata (especially package.json):

    • Check for an "exports" map (often the source of breaking changes by disallowing “deep imports” like .../lib/...).
    • Confirm module format (ESM vs CJS) and required Node version.
    • You can do this quickly via CDN package views (jsDelivr/unpkg) starting from the package page [1].
  2. Search your codebase for deep imports and be ready to replace them:

    • Example pattern (seen in Ledger tutorials for v6): @ledgerhq/hw-app-eth/lib/services/ledger (deep path).
    • If v7 adds strict "exports", these typically must become public entrypoints (whatever v7 exposes) rather than lib/*.
  3. Diff the public API surface between v6 and v7

    • Generate TypeScript types / API reports for both versions (or use tsc --traceResolution) and compare.
    • Update any changed method signatures/return shapes accordingly.

If you paste:

  • your current imports from @ledgerhq/hw-app-eth,
  • your current version (6.x exact),
  • and the errors you see after bumping to 7.x,

I can turn that into an exact, line-by-line migration patch.

Sources: [1] [2] [3]


🏁 Script executed:

# Find all files that import or use `@ledgerhq/hw-app-eth`
rg "@ledgerhq/hw-app-eth" --type json --type js --type ts -B 2 -A 2

Repository: enkryptcom/enKrypt

Length of output: 1208


🏁 Script executed:

# Check if there are any version-specific comments or compatibility notes in the codebase
rg "hw-app-eth|ledgerhq.*eth" -A 3 -B 3

Repository: enkryptcom/enKrypt

Length of output: 3454


🌐 Web query:

@ledgerhq/hw-app-eth 7.3.1 package.json exports lib/services/ledger

💡 Result:

In @ledgerhq/hw-app-eth@7.3.1, you should not deep-import lib/services/ledger (e.g. @ledgerhq/hw-app-eth/lib/services/ledger), because the package is meant to be consumed via its public entrypoints (and deep imports commonly fail under Node’s exports restrictions with ERR_PACKAGE_PATH_NOT_EXPORTED). The package documents ledgerService as a named export from the package root. [1][2]

Use:

import Eth, { ledgerService } from "@ledgerhq/hw-app-eth";

Sources: jsDelivr shows the package version 7.3.1 [3], and the README examples show ledgerService imported from the root entry. [1][2]

References:
[1] (npm.io)
[2] (tessl.io)
[3] (jsdelivr.com)

Citations:


🏁 Script executed:

# Check the actual structure and exports of the installed package
# Look for any TypeScript errors or build warnings
rg "lib/services/ledger" --type ts --type js -B 3 -A 3

Repository: enkryptcom/enKrypt

Length of output: 716


🏁 Script executed:

# Search for any error messages, issues, or discussions about this import in commits/PRs
git log --all --oneline | head -20

Repository: enkryptcom/enKrypt

Length of output: 196


🏁 Script executed:

# Check if there's a tsconfig or build configuration that might indicate issues
find . -name "tsconfig.json" -o -name ".eslintrc*" -o -name "vite.config*" | head -5

Repository: enkryptcom/enKrypt

Length of output: 254


🏁 Script executed:

# Check for any build or test output that might reveal errors with the hw-app-eth import
rg "hw-app-eth|ledgerService" --type log --type txt 2>/dev/null | head -20

Repository: enkryptcom/enKrypt

Length of output: 44


The deep import path is incompatible with v7.x and will fail at runtime.

Version 7.3.1 enforces strict package exports that disallow the current deep import: @ledgerhq/hw-app-eth/lib/services/ledger. This will throw ERR_PACKAGE_PATH_NOT_EXPORTED.

Fix: Update packages/hw-wallets/src/ledger/ethereum/index.ts to use the public API:

Import change required
- import ledgerService from "@ledgerhq/hw-app-eth/lib/services/ledger";
- import EthApp from "@ledgerhq/hw-app-eth";
+ import EthApp, { ledgerService } from "@ledgerhq/hw-app-eth";
🤖 Prompt for AI Agents
In `@packages/hw-wallets/package.json` at line 56, The code currently uses a deep
import from "@ledgerhq/hw-app-eth/lib/services/ledger" which is blocked by v7.x
package exports; open packages/hw-wallets/src/ledger/ethereum/index.ts, locate
the import statement that references "@ledgerhq/hw-app-eth/lib/services/ledger"
(and any usages of the exported symbol from that path, e.g., LedgerService,
createLedger*, or similar), and replace it with the public API from
"@ledgerhq/hw-app-eth" (use the exported Eth class and public transport helpers
from "@ledgerhq/hw-transport" or the documented public exports). Update any code
that constructs or types the ledger service (e.g., functions or classes named
like LedgerEthereum, createLedgerEthereumService, or getLedgerEthereumTransport)
to instantiate/use the Eth class and public transport types instead of the
deep-imported symbol so runtime import resolution uses the package's public
exports.

"@ledgerhq/hw-app-solana": "^7.7.0",
"@ledgerhq/hw-transport": "^6.32.0",
"@ledgerhq/hw-transport-webusb": "^6.30.0",
"@ledgerhq/live-common": "^34.20.0",
"@metamask/eth-sig-util": "^8.2.0",
"@polkadot/types": "^16.5.4",
"@polkadot/util": "^14.0.1",
"@trezor/connect": "^9.6.4",
"@trezor/connect-plugin-ethereum": "^9.1.3",
"@trezor/connect-web": "^9.6.4",
"@trezor/connect-webextension": "^9.6.4",
"@zondax/ledger-substrate": "^2.0.0",
"@trezor/connect": "^9.7.1",
"@trezor/connect-plugin-ethereum": "^9.1.5",
"@trezor/connect-web": "^9.7.1",
"@trezor/connect-webextension": "^9.7.1",
"@zondax/ledger-substrate": "^2.1.2",
"bitcoinjs-lib": "^6.1.7",
"bs58": "^6.0.0",
"hdkey": "^2.1.0",
"ledger-bitcoin": "^0.2.3",
"ledger-bitcoin": "^0.3.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

ledger-bitcoin 0.3.0 changelog release notes breaking changes

💡 Result:

I couldn’t find any official 0.3.0 changelog / release notes / “breaking changes” for the ledger-bitcoin Python package published on PyPI—PyPI lists the release, but doesn’t include release notes, and the linked upstream repo doesn’t surface a ledger-bitcoin-specific 0.3.0 changelog in an easily accessible public page.

What is publicly confirmed:

  • ledger-bitcoin 0.3.0 was released on February 15, 2024 (PyPI). [1]

If you need to identify breaking changes for an upgrade, the practical approach is to diff the upstream source corresponding to that release (often tagged in the upstream repo) against the previous version and scan API changes; however, I wasn’t able to retrieve a public “0.3.0 release notes” page directly from the available sources during this lookup.

Sources
[1] (pypi.org)

Citations:


🌐 Web query:

ledger-bitcoin GitHub repository source code

💡 Result:

The “ledger-bitcoin” Python package (ledger_bitcoin, published on PyPI) points to Ledger’s main GitHub repository for the Bitcoin client + app source code: LedgerHQ/app-bitcoin-new. (pypi.org)

Relevant source folders inside that repo include:

  • bitcoin_client (Python client library source)
  • bitcoin_client_js (JavaScript client)
  • bitcoin_client_rs (Rust client)
  • src (the Ledger Bitcoin app itself) (github.com)

Repo (source code):

https://github.com/LedgerHQ/app-bitcoin-new

Legacy (older) Bitcoin app source code repo:

https://github.com/LedgerHQ/app-bitcoin
``` ([github.com](https://github.com/LedgerHQ/app-bitcoin?utm_source=openai))

Citations:

- 1: https://pypi.org/project/ledger-bitcoin/?utm_source=openai
- 2: https://github.com/LedgerHQ/app-bitcoin-new
- 3: https://github.com/LedgerHQ/app-bitcoin?utm_source=openai

---

🌐 Web query:

`site:github.com LedgerHQ app-bitcoin-new ledger-bitcoin 0.3.0 release`

💡 Result:

- In `LedgerHQ/app-bitcoin-new`, there is a **Git tag `jsclient-0.3.0`**, dated **Jan 13, 2026**. [1]  
- The Python package **`ledger-bitcoin` v0.3.0** (PyPI) was released on **Feb 15, 2024**. [2]  
- The npm package **`ledger-bitcoin`** currently shows **version 0.2.3** (last published ~2 years ago) and points back to `LedgerHQ/app-bitcoin-new` as its repository. [3]

**Sources:** [1] [2] [3]

---

🌐 Web query:

`npm ledger-bitcoin package versions available`

💡 Result:

Versions available for the **`ledger-bitcoin`** package on npm (per Socket’s npm mirror) are: **0.2.0, 0.2.1, 0.2.2, 0.2.3 (latest)**. [1]

npm’s package page also shows the current published version as **0.2.3**. [2]

(Separately, jsDelivr’s npm index shows **0.3.0**, which may indicate an additional tag/version in the CDN index.) [3]

**Sources:** [1] [2] [3]

---

🌐 Web query:

`"ledger-bitcoin" "0.3.0" npm published versions history`

💡 Result:

For the **npm** package **`ledger-bitcoin`**:

- The published versions visible from npm ecosystem mirrors are: **0.2.0, 0.2.1, 0.2.2, 0.2.3 (latest)**. [2]  
- The npm package page also shows **current version 0.2.3** (published “2 years ago” at the time it was crawled). [1]  
- I **do not see an npm release `0.3.0`** for `ledger-bitcoin` in these npm sources; `0.3.0` appears to be associated with the **Python (PyPI)** project `ledger-bitcoin` (released **Feb 15, 2024**). [4]

Note: jsDelivr’s npm page for `ledger-bitcoin` shows **“Version 0.3.0”**, which conflicts with npm/Socket’s version list. [3]

**Sources:** npm package page [1], Socket version list [2], jsDelivr package page [3], PyPI release history [4].

---



</details>

**Update `ledger-bitcoin` version—0.3.0 is not published on npm.**

The npm registry only contains versions 0.2.0 through 0.2.3. Specifying `^0.3.0` will fail during `npm install`. Use `^0.2.3` (the latest available version) or confirm the intended version.

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @packages/hw-wallets/package.json at line 72, The package.json currently pins
"ledger-bitcoin" to an unavailable version "^0.3.0"; update the dependency entry
for "ledger-bitcoin" in package.json to a published version (e.g., "^0.2.3") or
replace it with the intended valid version, then run npm install to verify
resolution and update any lockfile if present; target the "ledger-bitcoin"
dependency string when making this change.


</details>

<!-- fingerprinting:phantom:poseidon:ocelot -->

<!-- This is an auto-generated comment by CodeRabbit -->

"webextension-polyfill": "^0.12.0"
}
}
5 changes: 3 additions & 2 deletions packages/hw-wallets/src/trezor/trezorConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ const getTrezorConnect = async () => {
} else {
const TrezorConnect = ((await import("@trezor/connect-web")) as any)
.default;
await TrezorConnect.default.init({
const initFunc = TrezorConnect.init ? TrezorConnect : TrezorConnect.default;
await initFunc.init({
lazyLoad: true,
manifest: {
email: "info@enkrypt.com",
appUrl: "http://www.myetherwallet.com",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Manifest appUrl references MyEtherWallet instead of Enkrypt.

The appUrl is set to "http://www.myetherwallet.com" while line 9 (webextension path) correctly uses "https://www.enkrypt.com". This appears to be a copy-paste inconsistency that predates this PR, but worth addressing for consistency and proper attribution.

Suggested fix
       manifest: {
         email: "info@enkrypt.com",
-        appUrl: "http://www.myetherwallet.com",
+        appUrl: "https://www.enkrypt.com",
       },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
appUrl: "http://www.myetherwallet.com",
appUrl: "https://www.enkrypt.com",
🤖 Prompt for AI Agents
In `@packages/hw-wallets/src/trezor/trezorConnect.ts` at line 24, Update the
manifest's appUrl value to point to Enkrypt instead of MyEtherWallet: locate the
appUrl entry in trezorConnect.ts (the manifest object where appUrl is defined)
and change the string from "http://www.myetherwallet.com" to
"https://www.enkrypt.com" to match the webextension path and ensure correct
attribution and consistency.

},
});
return TrezorConnect.default as TrezorConnectType;
return initFunc as TrezorConnectType;
Comment on lines 17 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Find the complete trezorConnect.ts file to understand full context
find . -name "trezorConnect.ts" -type f | head -5

Repository: enkryptcom/enKrypt

Length of output: 111


🏁 Script executed:

# Search for TrezorConnect usage patterns in the codebase
rg -n "TrezorConnect" --type ts -A 3 -B 3 -g '!node_modules' | head -100

Repository: enkryptcom/enKrypt

Length of output: 7851


🏁 Script executed:

# Check package.json for `@trezor/connect-web` version
rg '"@trezor/connect-web"' --type json

Repository: enkryptcom/enKrypt

Length of output: 131


🏁 Script executed:

# Look at imports and usage of the trezorConnect module itself
rg -n "from.*trezorConnect\|import.*trezorConnect" --type ts -A 3 -B 3

Repository: enkryptcom/enKrypt

Length of output: 44


🏁 Script executed:

# Read the complete trezorConnect.ts file
cat -n packages/hw-wallets/src/trezor/trezorConnect.ts

Repository: enkryptcom/enKrypt

Length of output: 1323


🏁 Script executed:

# Check for TrezorConnectType definition and imports in the file
rg -n "TrezorConnectType|import" packages/hw-wallets/src/trezor/trezorConnect.ts

Repository: enkryptcom/enKrypt

Length of output: 395


🏁 Script executed:

# Check if there are any tests for trezorConnect.ts
find . -name "*trezor*test*" -o -name "*test*trezor*" -type f | grep -v node_modules | head -20

Repository: enkryptcom/enKrypt

Length of output: 44


🏁 Script executed:

# Search for `@trezor/connect-web` documentation or type definitions if available locally
find . -path "*/node_modules/@trezor/connect-web*" -name "*.d.ts" -o -name "package.json" 2>/dev/null | grep -v ".map" | head -5

Repository: enkryptcom/enKrypt

Length of output: 218


🏁 Script executed:

# Check if there's any documentation or comments about the module structure in the codebase
rg -n "trezor.*init|@trezor/connect" packages/ -A 2 -B 2 --type ts --type js | grep -E "(init|connect|default)" | head -30

Repository: enkryptcom/enKrypt

Length of output: 2130


🏁 Script executed:

# Check the webextension branch to see how it handles the same scenario
rg -n "@trezor/connect-webextension" packages/hw-wallets/src/trezor/ -A 10 -B 2

Repository: enkryptcom/enKrypt

Length of output: 1252


🌐 Web query:

@trezor/connect-web 9.7.1 module exports ESM CJS interop

💡 Result:

In @trezor/connect-web 9.7.1, the published package is CJS-first:

  • No exports map and no "type": "module"; entrypoint is main: "lib/index.js" (so Node treats it as CommonJS). [1]
  • The typings declare a default export (export default TrezorConnect) and also export * from '@trezor/connect/lib/exports', but that “re-export surface” is type-level and may not be reliably available as true ESM named exports at runtime in Node (because the package itself is CJS). [2]

Practical interop guidance

CJS (require):

const TrezorConnect = require('@trezor/connect-web');

ESM (Node / bundlers): prefer default import or namespace import

import TrezorConnect from '@trezor/connect-web';
// or
import * as TrezorConnect from '@trezor/connect-web';

If you need named exports, import them from the source package that actually defines them:

import { UI_EVENT } from '@trezor/connect/lib/exports';

Sources: [1] [2]


🏁 Script executed:

# Check if there are any actual error logs or issues related to this code path
rg -n "initFunc|TrezorConnect.*default" packages/hw-wallets/ --type ts -B 3 -A 3

Repository: enkryptcom/enKrypt

Length of output: 2248


🏁 Script executed:

# Look at how the function is called and if there's any error handling around it
rg -n "getTrezorConnect\(\)" packages/hw-wallets/ --type ts -B 5 -A 5

Repository: enkryptcom/enKrypt

Length of output: 2584


Add defensive check for undefined initFunc and fix inconsistent appUrl.

Line 19's fallback logic (TrezorConnect.init ? TrezorConnect : TrezorConnect.default) could result in undefined if both properties are falsy, causing a runtime error on line 20. Additionally, the appUrl on line 24 is hardcoded to a third-party URL instead of the Enkrypt domain used in the webextension branch (line 9).

Suggested improvements
     const TrezorConnect = ((await import("@trezor/connect-web")) as any)
       .default;
     const initFunc = TrezorConnect.init ? TrezorConnect : TrezorConnect.default;
+    if (!initFunc?.init) {
+      throw new Error("Failed to resolve TrezorConnect init function");
+    }
     await initFunc.init({
       lazyLoad: true,
       manifest: {
         email: "info@enkrypt.com",
-        appUrl: "http://www.myetherwallet.com",
+        appUrl: "https://www.enkrypt.com",
       },
     });
🤖 Prompt for AI Agents
In `@packages/hw-wallets/src/trezor/trezorConnect.ts` around lines 17 - 27, The
code risks calling init on an undefined initFunc (computed as TrezorConnect.init
? TrezorConnect : TrezorConnect.default) and uses an incorrect hardcoded appUrl;
update the loader to defensive-check that initFunc is defined and has an init
method (TrezorConnect / initFunc) before calling init and throw or return a
clear error if not, and change the manifest.appUrl to the correct Enkrypt domain
used elsewhere (use the same URL string as the webextension branch) so
TrezorConnect.init is only invoked on a valid object and the appUrl is
consistent.

}
};

Expand Down
14 changes: 7 additions & 7 deletions packages/keyring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
"bip39": "^3.1.0"
},
"devDependencies": {
"@types/node": "^22.19.2",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"eslint": "^9.39.1",
"@types/node": "^22.19.7",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"typescript-eslint": "8.49.0",
"vitest": "^4.0.15"
"typescript-eslint": "8.54.0",
"vitest": "^4.0.18"
},
"repository": {
"type": "git",
Expand Down
16 changes: 8 additions & 8 deletions packages/name-resolution/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
"node": ">=14.15.0"
},
"devDependencies": {
"@types/node": "^22.19.2",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"eslint": "^9.39.1",
"@types/node": "^22.19.7",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"typescript-eslint": "8.49.0",
"viem": "^2.41.2",
"vitest": "^4.0.15"
"typescript-eslint": "8.54.0",
"viem": "^2.45.0",
"vitest": "^4.0.18"
},
"repository": {
"type": "git",
Expand Down
18 changes: 9 additions & 9 deletions packages/request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@
},
"dependencies": {
"@enkryptcom/types": "workspace:^",
"eventemitter3": "^5.0.1",
"eventemitter3": "^5.0.4",
"isomorphic-ws": "^5.0.0",
"json-rpc-2.0": "^1.7.1",
"reconnecting-websocket": "^4.4.0",
"uuid": "^13.0.0",
"ws": "^8.18.3"
"ws": "^8.19.0"
},
"devDependencies": {
"@types/node": "^22.19.2",
"@typescript-eslint/eslint-plugin": "^8.49.0",
"@typescript-eslint/parser": "^8.49.0",
"eslint": "^9.39.1",
"@types/node": "^22.19.7",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-module-resolver": "^1.5.0",
"prettier": "^3.7.4",
"prettier": "^3.8.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"typescript-eslint": "8.49.0",
"vitest": "^4.0.15"
"typescript-eslint": "8.54.0",
"vitest": "^4.0.18"
},
"repository": {
"type": "git",
Expand Down
Loading
Loading