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

feat: add mobile keyring bridge #225

Merged

Conversation

stanleyyconsensys
Copy link
Contributor

@stanleyyconsensys stanleyyconsensys commented Mar 28, 2024

Description

This PR adds the mobile ledger bridge into the eth-ledger-bridge-keyring. The mobile ledger bridge shares the same interface as the ledger iframe bridge. This changes decouples the previous code into 3 parts,

  • mobile-ledger-bridge.ts: Component to use the same interface as the ledger iframe bridge
  • mobile-ledger-bridge/middleware: Component to wrap the bluetooth transport layer and the eth app layer
  • mobile-ledger-bridge/ledger-hw-app: Extended from the ledger eth app, this component offers some extra methods to the ledger hardware, such as open eth app, get name, and version of the current app

Related Issues

fixes: #228

@stanleyyconsensys stanleyyconsensys requested a review from a team as a code owner March 28, 2024 10:34
…n TransactionController 8.0.1 to fix all transaction broken issue.

Fix the signPersonalMessage in ledger always return 0x0 in v value in test-dapp
Copy link

socket-security bot commented Mar 28, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/[email protected] environment +10 184 kB nicolo-ribaudo
npm/@babel/[email protected] environment, filesystem, unsafe Transitive: shell +23 4.56 MB nicolo-ribaudo
npm/@babel/[email protected] None +3 624 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 11.7 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 1.88 MB nicolo-ribaudo
npm/@babel/[email protected] None 0 68.9 kB nicolo-ribaudo
npm/@babel/[email protected] None +5 701 kB nicolo-ribaudo
npm/@babel/[email protected] environment +3 2.5 MB nicolo-ribaudo
npm/@eslint-community/[email protected] None 0 431 kB eslint-community-bot
npm/@jridgewell/[email protected] None 0 53.2 kB jridgewell
npm/@jridgewell/[email protected] None 0 169 kB jridgewell
npm/@ledgerhq/[email protected] None 0 195 kB ldg-github-ci
npm/@ledgerhq/[email protected] Transitive: environment, network +24 9.21 MB gre
npm/@ledgerhq/[email protected] None +3 4.92 MB ldg-github-ci
npm/@ledgerhq/[email protected] None 0 36.3 kB sergii-shkolin
npm/@ledgerhq/[email protected] None 0 71.4 kB ldg-github-ci
npm/@ledgerhq/[email protected] None 0 30.9 kB ldg-github-ci
npm/@metamask/[email protected] Transitive: filesystem +7 730 kB metamaskbot
npm/@metamask/[email protected] None +4 697 kB metamaskbot
npm/@metamask/[email protected] None +6 1.6 MB metamaskbot
npm/@noble/[email protected] None +1 2.15 MB paulmillr
npm/@scure/[email protected] None 0 80.4 kB paulmillr
npm/@types/[email protected] None 0 84.1 kB types
npm/@types/[email protected] None 0 4.3 kB types
npm/@types/[email protected] None 0 5.45 kB types
npm/@types/[email protected] None 0 1.8 MB types
npm/[email protected] None 0 531 kB marijn
npm/[email protected] network 0 31.2 kB tootallnate
npm/[email protected] None +4 87.8 kB ljharb
npm/[email protected] None +2 50.4 kB ljharb
npm/[email protected] filesystem, unsafe Transitive: environment, eval +50 7.87 MB rumpl
npm/[email protected] None +46 3.37 MB ljharb
npm/[email protected] None 0 12.3 kB ljharb
npm/[email protected] None 0 11 kB ljharb
npm/[email protected] filesystem, unsafe Transitive: environment +19 1.95 MB ljharb
npm/[email protected] filesystem 0 325 kB simenb
npm/[email protected] environment, filesystem Transitive: eval, unsafe +61 8.2 MB eslintbot
npm/[email protected] None +2 517 kB paulmillr
npm/[email protected] filesystem +6 263 kB mrmlnc
npm/[email protected] eval +1 73.1 kB ljharb
npm/[email protected] Transitive: environment, shell +18 1.53 MB isaacs
npm/[email protected] None +1 22.7 kB ljharb
npm/[email protected] None 0 12 kB ljharb
npm/[email protected] None 0 17.6 kB ljharb
npm/[email protected] None +1 40.2 kB ljharb
npm/[email protected] None 0 51.5 kB kael
npm/[email protected] None 0 30.2 kB ljharb
npm/[email protected] None 0 18.7 kB ljharb
npm/[email protected] None 0 34.4 kB oss-bot
npm/[email protected] filesystem 0 533 kB isaacs
npm/[email protected] Transitive: environment, filesystem +13 171 kB matzkoh
npm/[email protected] environment, filesystem +2 159 kB ljharb
npm/[email protected] None +1 110 kB npm-cli-ops
npm/[email protected] network +4 558 kB joshglazebrook
npm/[email protected] environment, filesystem, unsafe +12 1.39 MB blakeembrey
npm/[email protected] None 0 73.1 kB ethan_arrowood
npm/[email protected] None +4 92.7 kB ljharb

🚮 Removed packages: npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@eslint-community/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@ethersproject/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@noble/[email protected], npm/@noble/[email protected], npm/@scure/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

* feat: this is a backup of flat directory version of eth-ledger-bridge-keyring to successfully solve the metamask-mobile not able to resovle all the module under the subdirectory during build process.

* feat: improve the unit tests coverage for some API.

* feat: run `yarn lint:fix` and update the correct import in index.ts file.
Copy link

socket-security bot commented Apr 29, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@ampproject/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@eslint-community/[email protected], npm/@eslint/[email protected], npm/@eslint/[email protected], npm/@gar/[email protected], npm/@humanwhocodes/[email protected], npm/@humanwhocodes/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@jridgewell/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@ledgerhq/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@noble/[email protected], npm/@noble/[email protected], npm/@noble/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@pkgr/[email protected], npm/@scure/[email protected], npm/@scure/[email protected], npm/@scure/[email protected], npm/@tsconfig/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@ungap/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

scripts/prepack.sh Outdated Show resolved Hide resolved
src/ledger-transport-middleware.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.ts Show resolved Hide resolved
src/ledger-mobile-bridge.ts Show resolved Hide resolved
src/ledger-mobile-bridge.test.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.test.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.test.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.test.ts Outdated Show resolved Hide resolved
src/ledger-mobile-bridge.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

Hey @dawnseeker8, I left a lot of suggestions about the test names in accordance to our guidelines. The code is looking good so far.

https://github.com/MetaMask/contributor-docs/blob/main/docs/e2e-testing.md#guidelines

src/ledger-hw-app.test.ts Outdated Show resolved Hide resolved
src/ledger-hw-app.test.ts Outdated Show resolved Hide resolved
src/ledger-hw-app.test.ts Outdated Show resolved Hide resolved
src/ledger-hw-app.test.ts Outdated Show resolved Hide resolved
src/ledger-hw-app.test.ts Outdated Show resolved Hide resolved
src/ledger-keyring.test.ts Outdated Show resolved Hide resolved
src/ledger-keyring.test.ts Outdated Show resolved Hide resolved
src/ledger-keyring.test.ts Outdated Show resolved Hide resolved
src/ledger-keyring.test.ts Outdated Show resolved Hide resolved
src/ledger-keyring.test.ts Outdated Show resolved Hide resolved
@dawnseeker8 dawnseeker8 requested a review from gantunesr June 20, 2024 12:31
@dawnseeker8
Copy link
Contributor

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package Note Source CI
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/@npmcli/[email protected]

🚫
Deprecated npm/@npmcli/[email protected]

  • Reason: This functionality has been moved to @npmcli/fs

  • package.json

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
New author npm/[email protected]

🚫
Network access npm/[email protected]

🚫
Network access npm/[email protected]

🚫
Network access npm/[email protected]

🚫
Network access npm/[email protected]

🚫
Network access npm/@npmcli/[email protected]

🚫
Network access npm/@npmcli/[email protected]

🚫
Network access npm/@npmcli/[email protected]

🚫
Network access npm/@npmcli/[email protected]

🚫
Network access npm/@npmcli/[email protected]

🚫
View full report↗︎

Next steps

** What is new author? **
** What is a deprecated package? **
** What is network access? **
This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

** Take a deeper look at the dependency **
** Remove the package **
If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

@SocketSecurity ignore-all

@dawnseeker8
Copy link
Contributor

@SocketSecurity ignore-all

@dawnseeker8 dawnseeker8 merged commit 8979b63 into MetaMask:main Jun 24, 2024
19 checks passed
@dawnseeker8 dawnseeker8 deleted the feat/add-mobile-keyring-bridge branch June 24, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add mobile communication bridge
4 participants