Commit Graph

435 Commits

Author SHA1 Message Date
Dario Gabriel Lipicar 2a5327d8d2 feat: emit event on received community collectibles 2023-10-12 15:42:45 -03:00
Roman Volosovskyi 778753bb57
Fix checking of ERC20 tail on new blocks scanning 2023-10-12 16:21:09 +02:00
Dario Gabriel Lipicar 28cfeb4bc8 feat: refresh collectibles when testnet mode setting changes 2023-10-12 10:18:25 -03:00
Dario Gabriel Lipicar c2ff377585 chore: moved accounts event watcher to accountsevent package 2023-10-12 10:18:25 -03:00
Cuteivist 5674a010cd
feat: Handle Status Mint transaction (#4137) 2023-10-12 12:21:03 +02:00
Dario Gabriel Lipicar 094228871e feat: trigger collectibles refresh on transfer 2023-10-11 15:22:46 -03:00
Dario Gabriel Lipicar addf6e4aaf feat: implemented openseaV2 api changes 2023-10-11 14:41:18 -03:00
Dario Gabriel Lipicar 544e2ea76f feat: removed soon-to-be-deprecated openseaV1 client 2023-10-11 14:41:18 -03:00
Dario Gabriel Lipicar bc33f6d54c feat: removed soon-to-be-deprecated Infura client 2023-10-11 14:41:18 -03:00
Dario Gabriel Lipicar d1f63a8d71 feat: exponential backoff for Alchemy 2023-10-11 14:41:18 -03:00
Dario Gabriel Lipicar 94ae683bc2 fix: ensure full collectible list is fetched from a single provider 2023-10-11 14:41:18 -03:00
Cuteivist 6798d1ac5c
feat: Handled token mint activity (#4126) 2023-10-11 07:10:08 +02:00
Anthony Laibe 39676c8c01 feat: add sepolia toggle 2023-10-09 12:55:29 +02:00
Ivan Belyakov 01526c344a fix(wallet): new blocks were not found 2023-10-06 15:51:57 +02:00
Anthony Laibe 305b520994 fix: token balance 2023-10-06 11:47:23 +02:00
Roman Volosovskyi d82c50b50a
[#3930] Prevent repeated eth_getLogs calls (ERC20 history tail) 2023-10-05 19:45:40 +02:00
Dario Gabriel Lipicar 80f25d5ff7 fix: misc collectibles fixes 2023-10-05 09:40:18 -03:00
Roman Volosovskyi 6a110ca3df
[#3930] Make sure eth_getLogs for outgoing transfers are not executed for erc20 tail 2023-10-05 11:44:09 +02: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
Patryk Osmaczko 53423e58ba fix: use proper migrations for protocol's test database
- use `appdatabse.DbInitializer{}` in tests to ensure consistent migrations

- remove protocol's open database functions due to improper
  initialization caused by missing node config migration

- introduce `PushNotificationServerConfig` to resolve cyclic dependency
  issues
2023-10-03 15:11:58 +02:00
Cuteivist ecc8b4cb55
feat: Wallet activity collectibles model (#4074) 2023-10-03 12:49:04 +02:00
Cuteivist cff96f99e0
Bug: Refresh recipients model (#4076) 2023-10-02 13:46:05 +02:00
Roman Volosovskyi 382fcde74e
Scanning of ERC20 tail of transfers history 2023-10-01 10:09:11 +02:00
Dario Gabriel Lipicar bd6f9b098b feat: implement collectible connection status 2023-09-27 16:44:37 -03:00
Dario Gabriel Lipicar ba1f8ba923 feat: add api to refetch owned collectibles 2023-09-27 16:44:37 -03:00
Dario Gabriel Lipicar ba5cd9c1a4 feat(wallet): add community info to collectibles 2023-09-22 17:55:30 -03:00
Stefan 5c7748dbf7 feat(wallet) add API to cancel current activity filter
Closes status-desktop #11036
2023-09-21 13:56:44 +02:00
Stefan 579f7e4a52 chore(wallet) optimize the filer query
Main changes:

- Use tr_type instead of IN clause
- Use binary (X'...' syntax) directly into the query instead of
  converting DB values to HEX
  - Found to be slightly faster than query parameters in the dedicated benchmark
  - Didn't see much improvement in filter benchmarks
- Tried various combinations of optimizations but without impressive performance results

Benchmark results:

| Name                   | Original   | tr_type   | join     | hex      | no-db     | db_only   |     last |    net_j |
|:-----------------------|:-----------|:----------|:---------|:---------|:----------|:----------|---------:|---------:|
| RAM_NoFilter-10        | 49580229   | 51253242  | 51112462 | 50915133 | 121217817 | 141691008 | 50908642 | 50239712 |
| SSD_NoFilter-10        | 49963604   | 51393588  | 51213038 | 50881483 | 120785679 | 141063467 | 50462767 | 49676867 |
| SSD_MovingWindow-10    | 53695712   | 54155292  | 54161733 | 54061325 | 126966633 | 146866017 | 53479929 | 53350475 |
| SSD_AllAddr_AllTos-10  | 41382804   | 41195225  | 51684175 | 52107262 | 64348100  | 97608833  | 50523529 | 49968321 |
| SSD_OneAddress-10      | 34945275   | 35103850  | 31066429 | 31328762 | 50927300  | 54322971  | 30098529 | 30252546 |
| FilterSend_AllAddr-10  | 39546808   | 37566604  | 38389725 | 38260738 | 114820458 | 125588408 | 37127625 | 36864575 |
| FilterSend_6Addr-10    | 41221458   | 41111225  | 40848288 | 40135492 | 118629700 | 128200467 | 38942521 | 39012100 |
| FilterThreeNetworks-10 | -          | -         | -        | -        | -         | -         | 50058929 | 49854450 |

Update status-desktop: #11036
2023-09-21 13:56:44 +02:00
Cuteivist bc4093299e
feat: Filter by collectibles (#4028) 2023-09-21 08:58:36 +02:00
Michał 4cab5b6106
feat: expose raw token's balance (#4030) 2023-09-20 12:48:08 +02:00
Cuteivist d29c6c5b6f
feat: Calculate finalize status and filter by it (#3969) 2023-09-20 10:30:31 +02:00
Roman Volosovskyi 1dca3adb89
Basic test for findBlocksCommand 2023-09-19 13:17:36 +02:00
Stefan ad971278d9 chore(wallet) remove activity filter dependency on accounts
Require that the activity filter is passed at least one account address
to extract type sent/received

Updates status-desktop #11980
2023-09-19 09:06:57 +02:00
Dario Gabriel Lipicar e337ab4f13 feat: implement collectible ownership status 2023-09-15 18:55:09 -03:00
Dario Gabriel Lipicar e502ba82ce feat: implement single account fetch on add and partial progress report 2023-09-15 18:55:09 -03:00
Dario Gabriel Lipicar b4d5c22050 feat: implement collectibles ownership update timestamp db 2023-09-15 18:55:09 -03:00
Sale Djenic 6894295ac3 feat: register and maintain keycard local pairing file by `status-go`
Closes: #4003
2023-09-13 17:15:32 +02:00
Dario Gabriel Lipicar eb8f3173e4 fix: proper openseaV2 detailed nft unmarshalling 2023-09-13 08:43:09 -03:00
Dario Gabriel Lipicar 8d1992d2e1 fix: protect token list with a mutex 2023-09-13 08:43:09 -03:00
Anthony Laibe 5d1c766382 perf: avoid call to market manager
Optimise call to market manager for symbol that are going to be displayed only
2023-09-13 08:55:35 +02:00
Anthony Laibe 1b07ecaaf7 fix: send nft in other network than mainnet 2023-09-12 16:28:12 +02:00
Anthony Laibe 01babe3632 feat: route-send-collectible 2023-09-12 14:02:42 +02:00
Stefan 195214765b fix(wallet) fix filter by activity type
The activity type filtering was not stable in relation to addresses
filter which was generating unexpected Send/Receive type in the
corner-case when both sender and receiver was in the address list.

Updates status-desktop #11960
2023-09-12 11:58:24 +02:00
Stefan 70341f85a5 fix(wallet) send/receive for duplicate transactions
Brings consistency in case when sender and receiver are both in the
filter address list. This fixes the case of sender and receiver in
addresses and filters out duplicate entries.

Also

- refactor tests to provide support for owners
- adapt TestGetActivityEntriesWithSameTransactionForSenderAndReceiverInDB
  to the use of owner instead of from
2023-09-12 11:58:24 +02:00
Cuteivist e77fc59f5e
feat: Add activity filtering by contract deploy and minting (#4009) 2023-09-11 11:54:37 +02:00
Anthony Laibe 8ba9f38ce7 chore: mark api deprecated 2023-09-11 11:20:51 +02:00
Ivan Belyakov 81b94b7a4e fix(wallet): added ChainID to balance cache, as now it is shared between
services and contains balances for all addresses and chains.
Made rpc chain client return ChainID property on `NetworkID()` method
2023-09-07 15:00:19 +02:00
Cuteivist 83d1354845
chore: Use proper Gwei decimals (#3990) 2023-09-07 13:02:52 +02:00
Anthony Laibe 22fc83de59 feat: create unknown erc20 2023-09-07 10:04:58 +02:00
Stefan 555aae4d0f fix(wallet) filter by sub-transaction chain ID
Closes status-desktop #12077
2023-09-06 21:08:39 +02:00
Stefan c3d2ff0723 chore(wallet) move filter activity sql query in a separate file
This should make the complex query more readable and maintainable
Embed the file content in the complied binary

Updates status-desktop #12077
2023-09-05 22:15:04 +02:00
Ivan Belyakov 20c585a621 fix(wallet): new transfers were not loaded in real time 2023-09-05 14:19:36 +02:00
Ivan Belyakov 24bf9aada5 feat(wallet): move balance cache to a common place and make it a
parameter to share between transfers and balance history in an upcoming
commit.
Had to refactor its interface for that reason.
2023-09-05 12:20:49 +02:00
Cuteivist a0eb205ca9
feat: Estimate block number (#3973) 2023-09-04 12:18:46 +02:00
Stefan c0f32748b4 feat(wallet) lazy load activity info optimization
Trigger async fetching of extra information on each activity filtering
request. Only emit the update event for incomplete entries.

Other changes:

- Make DataEntry light as event payload by making all the fields
  optional
- Add new required fields to the activity DataEntry
- Add collectibles.ManagerInterface to aid testing

Note: this PR keeps compatibility with current master by always
providing non-optional multi-transaction ID. The TODO will be executed
before merging the status-desktop PR.

Experienced a hang on FetchAssetsByCollectibleUniqueID call with:
[{{5 0x21263a042aFE4bAE34F08Bb318056C181bD96D3b} 1209},
{{5 0x9A95631794a42d30C47f214fBe02A72585df35e1} 237},
{{5 0x9A95631794a42d30C47f214fBe02A72585df35e1} 236},
{{5 0x9A95631794a42d30C47f214fBe02A72585df35e1} 832},
{{5 0x9A95631794a42d30C47f214fBe02A72585df35e1} 830},
{{5 0x9A95631794a42d30C47f214fBe02A72585df35e1} 853}]

Updates status-desktop #11597
2023-09-01 19:11:14 +02:00
Dario Gabriel Lipicar d61677403a feat: add extra collection data to collectible header struct 2023-09-01 11:14:29 -03:00
Stefan 71800a19f1 fix(wallet) fix pending transactions notification
Also, add regression test.
2023-09-01 00:18:26 +02:00
Stefan 9cb5e1d3e6 chore(wallet) move computing totalFees to status-go
Updates status-desktop #11597
2023-08-30 13:59:52 +02:00
Ivan Belyakov c24c3966e2 fix(wallet): balance history used a wrong db for accessing accounts.
Balance history was not checked for all chains if no history on
some chain.
Removed `SetInitialRange` from wallet API as internal implementation.
This method was called on adding a brand new Status account to initialize
blocks_range table to avoid transfers history checks.
2023-08-30 10:17:57 +02:00
Stefan 423991fb30 chore(wallet) lookup symbols for wallet activity filter
Updates status-desktop #11597
2023-08-29 17:25:48 +02:00
Andrea Maria Piana 4fba5647d1
Use NewContractMaker for messenger 2023-08-29 14:17:49 +01:00
Cuteivist dd3e408a4e
feat(wallet/activity): Added API for tx and multiTx details (#3939) 2023-08-24 14:23:40 +02:00
Dario Gabriel Lipicar 8d8bd4fc92 fix: handle opensea v2 api error for accounts holding no collectibles 2023-08-24 08:28:36 +02:00
Dario Gabriel Lipicar c494904f18 fix: use all available providers when fetching collectibles by ID 2023-08-24 08:28:36 +02:00
Stefan 524c21834b fix(wallet) propagate multi-transactions IDs to transfers
Mainly refactor API to have control on pending_transactions operations.
Use the new API to migrate the multi-transaction ID from to transfers
in one SQL transaction.
The refactoring was done to better mirror the purpose of pending_transactions

Also:
- Externalize TransactionManager from WalletService to be used by
  other services
- Extract walletEvent as a dependency for all services that need to
  propagate events
- Batch chain requests
- Remove unused APIs
- Add auto delete option for clients that fire and forget transactions

Updates status-desktop #11754
2023-08-22 18:39:42 +02:00
Stefan afe0fcdcf4 fix(wallet) fix test on checking order of async task
Updates status-desktop: #11404
2023-08-22 18:39:42 +02:00
Anthony Laibe 9d782edb4d feat: wallet custom token with communities 2023-08-22 12:41:35 +02:00
Dario Gabriel Lipicar ae17ad57c3 fix: change cursor of opensea v2 ownership endpoint 2023-08-18 11:55:39 -03:00
Dario Gabriel Lipicar ad0e2c2450 feat: implement opensea v2 endpoints 2023-08-18 09:59:38 -03:00
Dario Gabriel Lipicar 3734f03645 chore: split collection data provider 2023-08-18 09:59:38 -03:00
Ivan Belyakov ea38b788b3 tests: Added unit test for copying 'keypairs_accounts' table to the wallet db.
Added a unit test for changing app and wallet DBs passwords.
Refactored geth_backend to simplify and allow wallet db password changing.
Fixed opening database with wrong password.
2023-08-18 09:00:56 +02:00
Ivan Belyakov 2df9df10ab fix(tests): moved test db setup to a common place 't/helpers', created
interface for initializing db, which is implemented for appdatabase and
walletdatabase. TBD for multiaccounts DB.
Unified DB initializion for all tests using helpers and new interface.
Reduced sqlcipher kdf iterations for all tests to 1.
2023-08-18 09:00:56 +02:00
Ivan Belyakov d106b449b6 feat(wallet): move wallet-related tables to a dedicated db.
The only place where appDB is used in wallet is activity,
which refers to `keycards_accounts` table. So a temporary
table `keycards_accounts` is created in wallet db and updated
before each activity query.
2023-08-18 09:00:56 +02:00
Dario Gabriel Lipicar 25ff1dd758 feat: make collectibles api support multiple clients 2023-08-15 10:17:10 -03:00
Dario Gabriel Lipicar d6aae82566 chore: move multi-client scheduler implementation to separate file 2023-08-15 10:17:10 -03:00
Michal Iskierko 9d0acc2265 feat(OwnerToken): Owner token and master token deployment
Adding new smart contracts and generated go files.
Deploy token owner function and master token address getter.
Adding deployer and privilegesLevel columns to community_tokens table.
Passing addressFrom to API calls.

Issue #11250
2023-08-14 20:57:00 +02:00
Dario Gabriel Lipicar 4b394e088e fix: minor collectible provider fixes 2023-08-09 11:21:59 -03:00
Dario Gabriel Lipicar cd83a5fe00 chore: make use of new collectibles data DB 2023-08-09 11:21:59 -03:00
Dario Gabriel Lipicar 33c116f7b1 chore: implement collectibles data db cache 2023-08-09 11:21:59 -03:00
Dario Gabriel Lipicar e30cba4303 fix: parse collectible ownership response from v3 alchemy endpoint properly
Fixes #11832
2023-08-08 13:20:36 -03:00
Dario Gabriel Lipicar d5974dd52e feat: fetch collection metadata when missing 2023-08-04 09:54:18 -03:00
Cuteivist 1f510eae70
fix: Query token id for transactions (#3851) 2023-08-04 13:40:36 +02:00
Cuteivist 06c4eb5df9
feat: Handle collectible mint (#3852) 2023-08-04 12:47:22 +02:00
Dario Gabriel Lipicar 078f71a235 feat: use new collectible account ownership providers 2023-08-03 12:53:00 -03:00
Dario Gabriel Lipicar c92a10b846 feat: implement alchemy and infura collectible account ownership endpoints 2023-08-03 12:53:00 -03:00
Dario Gabriel Lipicar 51d676bb08 chore: reorganized collectibles clients code 2023-08-03 12:53:00 -03:00
Dario Gabriel Lipicar c2ac108556 chore: rework data structures to accomodate new providers 2023-08-03 12:53:00 -03:00
Anthony Laibe 0cd140c9b2 feat: change network selection strategy
1) Only fetch history for networks that match test mode enabled
* Trade Off: it will be only refetch in 12 hours so changing test mode won't trigger a refetch until app is restarted or 12 hours.
I think it is ok as change test mode is not a common use case
2) Do not consider networks that are enabled or not as this can be change more often than every 12 hours
2023-08-02 12:45:37 +02:00
Anthony Laibe 21d9d17cdc chore: reduce batch size for goerli arbitrum/optimism 2023-08-01 13:37:45 +02:00
Stefan eb8d74e1ae feat(wallet) add request id to activity events
Add and use the optional chainID in the wallet event structure.

Updates status-desktop #11380
2023-07-31 18:22:13 +02:00
Anthony Laibe a139871383 fix: celer check on tokens 2023-07-31 13:16:33 +02:00
Dario Gabriel Lipicar 10a42e639d feat: parallel collectibles fetching per account and chain 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar 57424e076c chore: moved collectibles ownership cache to db 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar 85d8e83394 feat: trigger collectibles fetch on new account 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar 5ba5611a8d feat: implement collectibles service 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar b1cf54974e chore: make opensea client return common types 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar 849be69299 chore: use single opensea client instance 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar f138964a9c chore: move scheduler to async dir 2023-07-27 12:12:03 -03:00
Dario Gabriel Lipicar b5224b3cc5 chore: rename and reorder types 2023-07-27 12:12:03 -03:00
Stefan d956a3e854 feat(wallet) chain id multi-transaction filtering
Updates status-desktop #11631
2023-07-26 13:54:55 +02:00