kumulynja / ldk_node_flutter_demo

App to demonstrate how ldk_node in Flutter can be used to create a Lightning wallet app
12 stars 4 forks source link

Onboarding flow #1

Closed kumulynja closed 1 year ago

kumulynja commented 1 year ago

This PR finishes up the onboarding flow in case the user wants to create a new wallet. Recovering an existing wallet is not implemented yet since using a newly created wallet with ldk_node is of higher priority.

The creation of a new wallet generates and stores a mnemonic in secure storage. A secure store data layer and mnemonic repository where created as separate packages, this way the secure storage data layer can be reused for other data that needs secure storage, but should not be accessed directly by the main app, the main app can directly use mnemonic repository, since it needs to store a mnemonic securely without necessary knowing about the internals of secure storage.

The MnemonicBloc gets the MnemonicRepository injected and manages the event and states that are triggered and emitted on storing the mnemonic through the repository.