Commit Graph

5 Commits

Author SHA1 Message Date
Ivan Belyakov bd816f1e29 chore(wallet)_: tests for wallet.Reader fetching balances
chore(wallet)_: split getWalletTokenBalances into multiple functions

Removed some unused balances methods from wallet API

chore(wallet)_: refactored FetchOrGetWalletTokenBalances

- getWalletTokenBalances only returns cached ones
- update of balances is done in a separate method

chore(wallet)_: fix isVisible in getWalletTokenBalances is overwritten

It is overwritten and in some cases its value is desrespected

chore(wallet)_: simplify getWalletTokenBalance even further

chore(wallet)_: remove accountsDB from wallet.Reader

Call GetTestNetworkEnabled from NetworkManager instead

chore(wallet)_: remove rpc.Client from wallet.Reader.

Added GetActiveNetworks() method for NetworkManager
Removed adding native tokens from networks, as this is done already
in NetworkManager

chore(wallet)_: moved Persistence to token package

As it works with token_balances table, moved Persistence to token package.
Fixed TokenManager's Mark/Get previously owned tokens to use persistence
storage instead of direct SQL calls.
Introduced StorageToken that aggregates Token type, because when
Persistence moved to token package, names clash

test(wallet)_: tests for wallet.Reader.FetchorGetCachedBalances
2024-06-19 16:57:50 +01:00
IvanBelyakoff 9d6577049f
Implemented balance history based on transfers (#4022)
* feat(wallet): implement balance history based on fetched transfers
* Added vendor 'ttlcache'
2023-10-04 15:00:12 +03:00
Stefan 8e63f44735 feat(wallet) filter activity by erc20
Main changes:

- Refactor activity API to propagate token identities.
- Extend service to convert token identities to symbols for filtering
  multi-transaction
- Filter transfers, pending_transactions and multi-transactions based
  on the provided token identities
- Return involved token identities in activity API
- Test token filtering

Also:

- Fixed calling cancel on a filer activity completed task to release
  resources

Notes:

- Found limitations with the token identity which complicates things
  by not allowing to filter by token groups (like token-code does)

Updates status-desktop #11025
2023-06-20 14:06:49 +02:00
Stefan e78a73bd9f feat(Wallet) complete the filter API
It uses the current data only and doesn't extend with new types or
include new features in activity sources DBs.

Major changes:
- Partially filter by chain IDs
- Partially filter by Status if it is the case
- Partially filter by token types
- Filter by counterparty addresses
- Use wallet accounts for TO/FROM instead of filters

Closes: #10634
2023-05-23 14:48:29 +02:00
Stefan c020222f1b feat(Wallet): add activity filter api prototype
Add the possibility of retrieving the metadata of wallet activity based
on the given filter criteria.

Current implementation relies that after fetching the metadata, user
will follow up with more requests for details. However, after some
experimenting I'm considering extracting all required information
for the summary viewing while filtering. This way there will be no
need for another batch requests for transfers, multi-transactions and
pending transactions to show the summary. Only when user wants to see
the details for one will specifically request it.

For this first prototype, the filter criteria is limited to:
- time
- type
- addresses

Major changes:
- Add the filter definition to be used in propagating the filter
  information
- Add GetActivityEntries API to return the list of activity entries
  for the given addresses/chainIDs by a view in the complete list
- GetTransfersForIdentities to batch retrieve further details of the
  transfers
- GetPendingTransactionsForIdentities to batch retrieve further details
  of the pending transactions
- Added a new package testutils for tests.
- Added tests

Updates status-desktop #10366
Closes status-desktop #10633
2023-05-14 23:05:28 +02:00