shapeshift / hdwallet

A library for interacting with hardware wallets from JS/TS.

Home Page:https://hdwallet.shapeshift.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`core.Keyring`'s API could be better

mrnerdhair opened this issue · comments

core.Keyring's API has some room for improvement:

  • The API doesn't align with the interface a developers might expect for a standard collection
  • The API contains some unused functionality (like .exec())
  • The event emitting functionality isn't well-encapsulated or documented
    • Some wallet implementations mutate the keyring and then emit events like connect/disconnect; some don't
    • From a type perspective, the keyring should in principle be able to tell you what types of events it will emit or its API isn't well-defined

AC:

  • core.Keyring's API should mirror the standard Set interface
  • core.Keyring should emit its own connect/disconnect events, consistently, when adding/removing a wallet

Fixed by #436.