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

Persistence - Wallet Addresses Storage #41

Draft
wants to merge 24 commits into
base: add_arrr
Choose a base branch
from

Conversation

naezith
Copy link
Collaborator

@naezith naezith commented Jun 27, 2023

The AccountAddressesApiHive class stores/retrieves a list of the user’s coin addresses. This will be used to populate the trading view (and possibly the home screen), where the user selects the trading pair.

Usage:

void main() async {
  AccountAddressesApiHive api = await AccountAddressesApiHive.initialize();
  // use API as needed
}

Currently Hive.registerAdapter(WalletAddressAdapter()); line is inside the initialize function. You might want to take it outside.

@CharlVS CharlVS self-requested a review June 27, 2023 21:06
@CharlVS
Copy link
Member

CharlVS commented Jun 27, 2023

@naezith

Currently Hive.registerAdapter(WalletAddressAdapter()); line is inside the initialize function. You might want to take it outside.

If we need to do implementation-specific initialisation, we should limit it to our specific implementation. We want the concern of Hive to be separated from the rest of the app. This makes it cleaner in the future if we want to change to a different storage medium.

See the optional parameter in registerAdapter(...), which prevents an exception from being thrown if an adapter registration is repeated. Alternatively, create a boolean variable in the implementation which keeps track of if the API has been initialised. In this case, you'd check in the first line of the init() method and return if it was already initialised.

@naezith naezith requested a review from CharlVS June 28, 2023 10:41
@naezith naezith requested a review from CharlVS June 29, 2023 22:21
@naezith naezith requested a review from CharlVS July 3, 2023 06:46
CharlVS added 3 commits July 4, 2023 11:00
Save wallet changes in DB class methods instead of polling for changes.
Emit a full list of wallet addresses whenever a change happens. This will be useful in blocs where we want to show a list of all the data.
@CharlVS CharlVS marked this pull request as draft August 3, 2023 15:29
@ca333
Copy link
Contributor

ca333 commented Feb 4, 2024

status on this @naezith @CharlVS ? plz close if outdated / irrelevant.

@naezith
Copy link
Collaborator Author

naezith commented Feb 4, 2024

status on this @naezith @CharlVS ? plz close if outdated / irrelevant.

We ended up not using this, can close I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants