Notable Changes
Reorganization
It is easy to get lost when scrolling through code in monolithic long files, and it is also equally easy to get lost in too many layers of project file hierarchy. This update aims to find a balance between the two and has separated key behavior into smaller modules while resisting a deeply-nested directory structure. Basically, this update moved files around.
import methods are now load methods
To avoid confusion with the import JavaScript keyword, import() methods like Wallet.import() and Account.import() have been renamed to load().
Expanded account info
The wallet.refresh() method now uses batch endpoints to fetch basic account data like balance, frontier, and representative. The account.refresh() method now fetches all available data from the relevant endpoint, including confirmed block information. In practical use, the wallet method should be called when viewing multiple accounts and basic data should be presented to the end user, and the account method should be called when viewing an individual account or creating and processing transactions.
Ledger aligned with other wallet types
The various functions of the Ledger wallet have been abstracted away under the hood of the overarching Wallet class. Account derivation, secret verification, and block signing can all be done with the same methods for a 'Ledger'-type wallet in libnemo as its 'BIP-44' and 'BLAKE2b' counterparts.
Comments