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

Update HW Manager #4766

Closed
9 tasks
Tracked by #4041
soroushm opened this issue Jan 30, 2023 · 0 comments
Closed
9 tasks
Tracked by #4041

Update HW Manager #4766

soroushm opened this issue Jan 30, 2023 · 0 comments

Comments

@soroushm
Copy link
Contributor

soroushm commented Jan 30, 2023

Description

The HW Manager is a singleton class responsible for communicating with a hardware wallet (HW) and providing functionality that the application needs. All communication is event based and working with window.ipc.

Users may connect more than one HW on their PC, Lisk Desktop should provide an ability to select/switch between connected hardware wallet devices .

Acceptance Criteria

  • Add required methods to detect, updated, and return the list of connected devices
  • Once the HW is selected/connected, we should start reading addresses from HW, make API calls to determine if the account is used, and store used accounts in an array on the HWManager class. Stored account include publicKey, address, deviceID, accountIndex. Store the accounts in the format similar to locally resisted accounts (this part is done in Memoize HW Accounts in HWManager #4767).
  • Create getAccounts method to return the list of accounts as generated by the above criteria.
  • Selecting/switching between multiple HWs by device ID
  • Create GetDeviceList method to return the list of connected devices.
  • Retrieve, store and update the list of connected devices on a member in the HWManager class. We should subscribe to HW_CONNECTED and HW_DISCONNECTED events and update the list of connected devices.
  • Create a method to sign transactions. Collect all normalizations, and crypto calculation into a utility function. Then use in HWManager.
  • Create GetCurrentDeviceInfo which returns HW informations such as brand, model, ID, status (connected, standBy, 'isLoading'). The isLoading state is used to determine if the HWManager is pending a response from the HWManager right after connecting to it.
  • Add unit tests

Additional info

The HWManager class should expose the following methods:

  • CreateAccount
  • GetAccounts
  • GetDeviceList
  • SelectDevice
  • GetDeviceByID
  • SignTransaction
  • SignMessage
  • PresistConnection
  • GetCurrentDeviceInfo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants