Commit Graph

967 Commits

Author SHA1 Message Date
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
Mikhail Rogachev 0950721a6d
feat: add 'GetCommunityMembersForWalletAddresses' endpoint (#3854)
For https://github.com/status-im/status-desktop/issues/11143
2023-08-14 12:59:02 +04:00
Sale Djenic 6ee7038809 fix: synced from field updated if recovered keypairs made fully operable 2023-08-10 16:09:29 +02:00
Jonathan Rainville b4b0d26aa4
feat(api): add api to get members revealed accounts (#3864) 2023-08-09 11:08:20 -04: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
Pascal Precht 4b07960fba feat: rehydrate community_tokens table upon account recovery
Closes https://github.com/status-im/status-desktop/issues/11188
2023-08-09 13:38:59 +02:00
Sale Djenic 70c29a828e feat: new endpoints added
- `HasPairedDevices`
- `MakePrivateKeyKeypairFullyOperable`
- `MakeSeedPhraseKeypairFullyOperable`
2023-08-09 10:31:11 +02: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
Volodymyr Kozieiev 7560540392
Regularly update the list of curated communities (#3827)
Regularly update the list of curated communities
2023-08-07 13:54:00 +01:00
Patryk Osmaczko ce82a8c0e5 chore: remove community invitations 2023-08-05 11:49:00 +02: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
Igor Sirotin bbb8e99492
Fix syncing `blocked` contacts (#3799)
* fix(messenger_testing_utils): Always return response
* feat: test blocking/unblocking contacts with paired devices 
* fix: Remove recursive sync on contact blocking
* rename `syncing` flag to `fromSyncing`
2023-08-04 13:41:24 +03: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
frank 60143556ff
add api to create community for testing (#3818) 2023-08-03 08:24:11 +08:00
Jonathan Rainville 9267e58143
feat(api): add GetCommunityPublicKeyFromPrivateKey to api (#3828) 2023-08-02 13:11:26 -04: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
Michal Iskierko 1592d2a079 feat(RemoteDestructedAmount): Add RemoteDestructedAmount function
Issue #1182
2023-08-02 12:19:03 +02:00
Mikhail Rogachev 4ad84d80cc
feat: Collecting community messages count metrics (#3802)
* feat: proposal for collecting community metrics

https://github.com/status-im/status-desktop/issues/11152

* feat: collecting community message metrics with test

* feat: implement both strategies for fetching community metrics

* fix: review fixes

* fix: calc counts for timestamps
2023-08-01 17:08:57 +04: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
Patryk Osmaczko 0465ab668d fix: populate API Chat with channel members 2023-07-27 11:35:59 +02:00
Patryk Osmaczko fa5b316324 chore: deprecate InviteUsersToCommunity 2023-07-27 08:45:01 +02:00
Pascal Precht 3d1b1bab57 feat: introduce messenger API to remove community tokens
This is to allow users to remove a community token if the deployment
transaction has been rejected.
2023-07-26 15:57:08 +02:00
Pascal Precht e8bac916ec !refactor: introduce `SaveCommunityToken()` and change `AddCommunityToken()`
**This is a breaking change!**

Prior to this commit we had `AddCommunityToken(token *communities,
croppedImage CroppedImage)` that we used to

1. add a `CommunityToken` to the user's database and
2. to create a `CommunityTokenMetadata` from it which is then added to
   the community's `CommunityDescription` and published to its members

However, I've then discovered that we need to separate these two things,
such that we can deploy a community token, then add it to the database
only for tracking purposes, **then** add it to the community description
(and propagate to members) once we know that the deploy tx indeed went
through.

To implement this, this commit introduces a new API
`SaveCommunityToken(token *communities.CommunityToken, croppedImage
CroppedImage)` which adds the token to the database only and doesn't
touch the community description.

The `AddCommunityToken` API is then changed that it's exclusively used
for adding an already saved `CommunityToken` to the community
description so it can be published to members. Hence, the signature is
now `AddCommunityToken(communityID string, chainID int, address
string)`, which makes this a breaking change.

Clients that used `AddCommunityToken()` before now need to ensure that
they first call `SaveCommunityToken()` as `AddCommunityToken()` will
fail otherwise.
2023-07-26 14:45:02 +02:00
Stefan d956a3e854 feat(wallet) chain id multi-transaction filtering
Updates status-desktop #11631
2023-07-26 13:54:55 +02:00
Anthony Laibe e5ce2c7c03 feat: make activity check optional 2023-07-26 09:07:55 +02:00
Sale Djenic 20bc27619b fix: function name change
`GetWatchOnlyAccounts(includeRemoved bool)` removed
`GetActiveWatchOnlyAccounts()` added
`GetAllWatchOnlyAccounts()` added
2023-07-26 08:23:55 +02:00
Sale Djenic 6a5cdbaa8b fix: review comments applied
`GetKeypairs(includeRemoved bool)` removed
`GetActiveKeypairs()` added
`GetAllKeypairs()` added

`GetAccounts(includeRemoved bool)` removed
`GetActiveAccounts()` added
`GetAllAccounts()` added
2023-07-25 18:11:05 +02:00
Sale Djenic d5bba5d80f chore: wallet accounts improvements - soft delete 2023-07-25 18:11:05 +02:00
Sale Djenic 7c72d5ec99 fix: discard backed up messages if `ProcessBackedupMessages` is not set to `true`
If user followed onboarding flow to recover his account using seed phrase or keycard,
then `ProcessBackedupMessages` property of node config json object should be set to
`true`, otherwise it should be set to `false` or be omitted.
2023-07-25 07:50:43 +02:00
Mikhail Rogachev 631962ce88
feat: add api to remove private key (#3772)
* feat: add api to remove private key and separete owner from private key ownership

For https://github.com/status-im/status-desktop/issues/11475

* feat: introduce IsControlNode for Community

* feat: remove community private key from syncing

* feat: add IsControlNode flag to Community json serialisation

* Update protocol/protobuf/pairing.proto

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>

---------

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2023-07-21 13:41:26 +04:00
Cuteivist 84bfdf4aab
feat: Add contract deployment tx type (#3770) 2023-07-20 16:04:30 +02:00
Sale Djenic 543b087896 fix: wallet accounts ordering improvements 2023-07-20 14:32:41 +02:00
Stefan 8926990c2d chore(wallet) retrieve all required activity header data as metadata
Add missing fields to activity metadata.

Updates status-desktop #11173
2023-07-20 11:34:41 +02:00
John Ngei cf2d72bfa8
Mute and Unmute community
* mute and unmute all community chats when community mute status changes

* unmute community when atleast one channel is unmuted

* fix: save community, extend the function to save muted state and mute duration
2023-07-19 15:14:42 +03:00
Dario Gabriel Lipicar 1f379aec1f feat: implemented multi chain collectible ownership provider 2023-07-19 07:58:05 -03:00
Michal Iskierko 7d9092e295 fix(Collectibles): Trigger transaction event when creating transaction
Issue #11565
2023-07-18 16:21:20 +02:00
frank 71ca35bf34
Feat/sync customization color (#3702)
* sync customization color

* addressed feedback from @cammellos

* add param customizationColorClock to function generateOrImportAccount
2023-07-18 21:35:06 +08:00
Anthony Laibe 0f8347dc59 feat: get chain id for url api 2023-07-18 13:50:13 +02:00
Stefan 64f7706567 chore(wallet) index activity filter columns to speed up queries
Implemented required benchmarks

Also

- refactor tests as needed
- don't filter temporary or incomplete transfers (transfers.loaded != 1)

Updates status-desktop #11351
2023-07-14 16:11:14 +02:00
Stefan e6705f264c chore(wallet) refactor activity tests 2023-07-14 16:11:14 +02:00
Dario Gabriel Lipicar 40eed0fd01 fix: ensure correct initialization order for wallet and mesenger services 2023-07-13 16:16:31 -03:00
Anthony Laibe 104d9c8ff6
feat: add related chain id to networks (#3697) 2023-07-13 16:03:49 +02:00
Stefan 8bfcb80ed6 fix(wallet) fix scan to/from hash when for multi_transactions 2023-07-13 00:24:36 +02:00
Dario Gabriel Lipicar 9ee523be99 fix: remove unsupported chainIDs from opensea client 2023-07-12 15:49:18 -03:00
Michal Iskierko ff0628c23b feat(Collectibles): Handle ERC20 burn and mint
Modify API to handle also ERC20 tokens.
Modify community_tokens table - keep supply as string since string is easly convertible to bigint.BigInt.
Use bigint.BigInt for supply functions and fields.

Issue #11129
2023-07-12 10:41:17 +02:00
Stefan 69412cf3a3 fix(wallet) fix scan of default NULL multi_transactions.*_network_id 2023-07-12 10:34:32 +02:00
Anthony Laibe 23492467b9 feat: clear balance cache after usage 2023-07-12 09:23:56 +02:00
Stefan 3ce851b84b feat(wallet) report new multi-transactions updates
Updates status-desktop #11233
2023-07-11 22:34:43 +02:00
Ivan Belyakov 09dff82db5 feat(wallet): Move pending transactions to `transactions` module.
Handle creation and deletion of pending transactions automatically
on status-go side.
2023-07-11 16:07:42 +02:00
Sale Djenic 7063ad11aa chore: synchronization improvements applied to keycards
This is the second step of improvements over keypairs/keycards/accounts.
- `SyncKeycardAction` protobuf removed
- `SyncKeypair` protobuf is used for syncing keycards state as well as for all
keycards related changes
- `last_update_clock` column removed from `keypairs` table cause as well as
for accounts, any keycard related change is actually a change made on a related
keypair, thus a keypair's clock keeps the clock of the last change
- `position` column added to `keypairs` table, needed to display keycards in
the same order accross devices
2023-07-11 15:14:49 +02:00
Jonathan Rainville 2c275058ad
feat(community): add api to edit shared address (#3723) 2023-07-10 10:11:37 -04:00
Dario Gabriel Lipicar 66a21aa7e4 feat(wallet): detect ETH L2 to L1/L2 bridge transactions 2023-07-10 09:59:05 -03:00
Dario Gabriel Lipicar e6711c8cc8 feat(wallet): detect ETH L1 to L2 bridge transactions 2023-07-10 09:59:05 -03:00
Dario Gabriel Lipicar fb6e2a41f7 chore(wallet): reorganize multitx processing code 2023-07-10 09:59:05 -03:00
Anthony Laibe bc92df79d5 fix: fourbyte integration no arg 2023-07-10 12:26:42 +02:00
Stefan 9a30674590 feat(wallet) deliver pending changed events to clients
Add wallet events feed to TransactionManager and send pending changed
events on add and delete

Also

- Remove hardcoded values in the filter query
- Small improvement to query

Updates status-desktop #11233
2023-07-07 15:06:14 +02:00
Anthony Laibe dffcb708ea feat: add fourbyte github integration 2023-07-06 11:31:14 +02:00
Sale Djenic 61527f8c78 chore: synchronization improvements applied to keypairs/accounts
This is the first step of improvements over keypairs/keycards/accounts.
- `SyncKeypairFull` protobuf removed
- `SyncKeypair` protobuf is used for syncing all but the watch only accounts
- `SyncAccount` is used only for syncing watch only accounts
- related keycards are synced together with a keypair
- on any keypair change (either it's just a keypair name or any change made over an
account which belongs to that keypair) entire keypair is synced including related keycards
- on any watch only account related change, that account is synced with all its details
2023-07-05 14:41:26 +02:00
Anthony Laibe b5d5fa828c fix: allow l2 bridges 2023-07-05 13:14:19 +02:00
Pascal Precht 4305147f7a feat: add cropping support for community token assets
This commit extends the `AddCommunityToken` API to also expect an
optional `CroppedImage`, which will be used instead of the `ImageBase64`
path provided by `CommunityToken`, to calculate the actual base64
encoded image.
2023-07-05 11:46:23 +02:00
Stefan 0b9555bf31 fix(wallet) returning wrong address identity in filter
This fixes returning address identity after that was changed by
the real to/from fix. Previously the address was wrongly used as from

Updates status-desktop #11233
2023-07-05 10:36:45 +02:00
Anthony Laibe 1cb1c63e82 fix: bonder fees must be lower than amount 2023-07-04 22:32:51 +02:00
Stefan 3b0f4ee2c1 fix(wallet) fix GetMultiTransactions for to_amount nil
Updates status-desktop #11233
2023-07-04 16:49:08 +02:00
Stefan 293fa9d248 fix(wallet) fix filtering failing with NULL values in to_address
Added test to validate the fix

Also change JOIN to LEFT JOIN between `multi_transactions` and `transactions` table so that we return all entries from `multi_transactions` table even if there is no matching entry in `transactions` table, which might be the case for multi transactions that that could not be detected. This will postpone the error case until we get into details of the multi transaction.

Updates status-desktop #11233
2023-07-04 15:51:33 +02:00
Mikhail Rogachev 511d6bfc54
feat: add parsing for new links format (#3665)
* feat(share-links): Add protobuf and encode/decode url data methods

* feat(new-links-format): Adds generators for new links format

* feat: add parsing for new links format

* feat: add messenger-level pubkey serialization and tests

* feat: fix and test CreateCommunityURLWithChatKey

* feat: impl and test parseCommunityURLWithChatKey

* feat: fix and test CreateCommunityURLWithData

* feat:  impl and test parseCommunityURLWithData (not working)

* feat: UrlDataResponse as response share urls api

* feat: impl& tested ShareCommunityChannelURLWithChatKey

* feat: impl & tested ParseCommunityChannelURLWithChatKey

* fix: bring urls to new format

* feat: add regexp for community channel urls

* feat: impl & test contact urls with chatKey, Ens and data

* fix: encodeDataURL/encodeDataURL patch from Samyoul

* fix: fix unmarshalling protobufs

* fix: fix minor issues, temporary comment TestParseUserURLWithENS

* fix: allow url to contain extra `#` in the signature

* fix: check signatures with SigToPub

* chore: lint fixes

* fix: encode the signature

* feat: Check provided channelID is Uuid

* fix(share-community-url): Remove if community encrypted scope

* fix: review fixes

* fix: use proto.Unmarshal instead of json.Marshal

* feat(share-urls): Adds TagsIndices to community data

* feat: support tag indices to community url data

---------

Co-authored-by: Boris Melnik <borismelnik@status.im>
2023-07-04 17:48:52 +04:00
Stefan e5e5229e6a feat(tests) disable 4byte remote server dependent tests 2023-07-03 16:50:48 +02:00
Stefan c61a4000d8 feat(wallet) make remaining filter apis async
Implement activity.Scheduler to serialize and limit the number of
calls on the activity service. This way we protect form inefficient
parallel queries and easy support async and rate limiting based on the
API requirements.

Refactor the activity APIs async and use the Scheduler for managing
the activity service calls configured with one of the two rules: cancel
ignore.

Updates status-desktop #11170
2023-07-03 16:50:48 +02:00
Ivan Belyakov 1efecbf73b Fixed concurrent write to blockchain status map 2023-06-30 14:59:07 +02:00
Michal Iskierko 6ec50d52aa feat(AssetsDeployment): Assets deployment
- Add ERC20 contract
- Add decimals field to community_tokens db table
- Adjusting API to handle assets deployment
- Add decimals field to CommunityTokenMetadata

Issue #10987
2023-06-29 16:10:05 +02:00
Ivan Belyakov 2f515447d2 fix(wallet): Fixed missing loop for transfers loading.
Made channel for transfers loading buffered - non-blocking
2023-06-28 16:18:43 +02:00
Dario Gabriel Lipicar ce45a7b1e8 fix: properly initialize NFTMetadataProvider in wallet service 2023-06-28 09:22:40 -03:00
Stefan f07a79cd18 fix(wallet) fix crash if to_address is NULL in transfers
Add nill tests for TestGetRecipients, GetOldestTimestamp
Also fix returning duplicate addresses in TestGetRecipients

Updates status-desktop #11170
2023-06-28 09:55:43 +02:00
Dario Gabriel Lipicar afb9621f01 fix: protect OpenSea instances with a mutex 2023-06-27 11:09:02 -03:00
Pascal Precht b8b402da8d feat: store check channel permission responses
This commit adds new tables to the database and APIs in `Messenger` and
communities `Manager` to store `CheckChannelPermissionsResponse`s.

The responses are stored whenever channel permissions have been checked.

The reason we're doing this is so that clients can retrieve the last
known channel permission state before waiting for onchain checks to
finish.
2023-06-27 12:13:59 +02:00
Anthony Laibe da2f155f2d feat: add account position 2023-06-26 16:15:48 +02:00
Stefan ea7a389075 feat(wallet) api to retrieve last activity timestamp
Also fix the lookup source for `GetRecipients` API

Updates status-desktop #11169
2023-06-22 14:06:55 +02:00
Dario Gabriel Lipicar 0f305df3b5 fix: identify ETH asset properly in swap transactions 2023-06-21 12:20:22 -03:00
Dario Gabriel Lipicar bf54a57780 fix: correct transfer type detection 2023-06-21 12:10:25 -03:00
Anthony Laibe 8ef3c52f4d fix: parse input data with bytes 2023-06-21 11:42:40 +01: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
Pascal Precht bf64f97d5a feat: introduce `CheckAllCommunityChannelsPermissions()` API
This API is used to get a permission status of all channels of a given
community.

Clients can use this API to get the provided information for all
community channels with a single RPC call instead of doing one call
for each channel separately.
2023-06-20 10:06:44 +02:00
Pascal Precht 7938297606 feat: introduce `CheckChannelPermissions` API
Similar to `CheckPermissionToJoin()` we now get
a `CheckChannelPermissions()` API.

It will rely on the same `PermissionResponse` types, but gives
information about both `ViewOnlyPermissions` and
`ViewAndPostPermissions`.
2023-06-20 09:42:10 +02:00
Boris Melnik 1eb92a19a2
feat(communities): Adds muting interval to community (#3549) 2023-06-17 11:19:05 +03:00
Jonathan Rainville a46bf97bf3
fix(chat/api): don't count muted chats' unviewed count unless mentioned (#3619) 2023-06-16 14:10:04 -04:00
Dario Gabriel Lipicar 60b160997c fix(wallet): properly parse multitransaction amounts 2023-06-16 10:05:49 -03:00
Emil Sawicki ad9ad4026b feat: add signature id 2023-06-16 12:10:22 +01:00
Anthony Laibe 9d5b123c95 feat: add api to parse tx input 2023-06-16 12:10:22 +01:00
Anthony Laibe 2375b10b03 feat: load token list in code 2023-06-16 09:00:06 +01:00
Dario Gabriel Lipicar e26c2a7095 feat: add transaction amounts to activity entry 2023-06-15 22:04:19 -03:00
Dario Gabriel Lipicar 86350379b1 chore: rework activity test utils 2023-06-15 22:04:19 -03:00
Stefan 6f2c338f72 feat(wallet) add filter api to retrieve recipients of a wallet
The new API returns all known recipients of a wallet, by
sourcing transfers, pending_transactions and multi_transactions tables
The API is synchronous. Future work will be to make it async.
In some corner cases, when watching a famous wallet, it can
be that there are too many recipients to be returned in one go. Offset
and limit can be used to paginate through the results.

Updates status-desktop #10025
2023-06-15 20:40:44 -03:00
Dario Gabriel Lipicar a2b1640ad7 fix(wallet): respect limits for collectibles fetching 2023-06-15 16:44:02 -03:00
Michal Iskierko ccde92377d feat(BurnCollectibles): Add burn collectibles functionality
Change smart contract with new API.
Update gas amount for deployment.
Add Burn() and EstimateBurn() functions.
Add RemainingSupply() functions.

Issue #10816
2023-06-15 15:38:19 +02:00
Mykhailo Prakhov e058b50a2e
feat: community admin permission functionality (#3569)
* feat: community admin implementation

* fix: code review fixes

* chore: request admin permissions in CheckPermissionToJoin, unit test fix
2023-06-14 10:15:46 -04:00
Ivan Belyakov 30af25198e feat(wallet): Improved performance of fetching tranfers for Sequential
fetch strategy:
Before:
 - block fetching commands for different accounts were in the same wait
group, making them dependent on each iteration.
 - transfers loading command was checking database for new unloaded
blocks on timeout and was in the same wait group with block fetching, so
it was often blocked until all block fetching commands finish for
iteration.
Now:
 - block fetching commands run independently for each account
 - transfers fetching command is run once on startup for unloaded blocks
from DB
 - fetch history blocks commands are launched once on startup for
accounts with no full history loaded
 - transfers are loaded on each iteration of block range check
without waiting for all ranges to be checked
2023-06-14 15:12:12 +02:00
Ivan Belyakov 2b02968819 fix(wallet): Fixed nil pointer dereferencing for multiTransaction.ToAmount
when sending tx on Optimism
2023-06-14 07:24:18 -03:00
Dario Gabriel Lipicar ffc959a9e3 chore(wallet): split multitransaction command from full struct
Part of #10791
2023-06-13 07:58:40 -03:00
Stefan 4c8fd538ba feat(wallet) return offset in the activity result
Updates status-desktop #10994
2023-06-12 23:04:12 +02:00
Stefan d8eb038d7d feat(wallet): make filer API async
Refactor the filter interface to be an async call which returns
the result using a wallet event
A call to the filter API will cancel the ongoing filter and receive
an error result event

Closes status-desktop #10994
2023-06-12 15:42:26 +02:00
Stefan 87ce6cfbcd feat(wallet) filter activity by status
Main changes:

- extend DB query include status for transactions and pending_transactions
- extend DB query to aggregate data from complex activity entries
- extend tests to include the new status values

Other changes:

- Improve tests with mocked addresses in DB to have a true to/from state

Update status-desktop #10746
2023-06-10 11:43:00 +02:00
frank b6d4e75cf1
Feat/sync activity center notification (#3535)
fix flaky test: TestRetrieveBlockedContact

resolve conflict when rebase origin/develop

Feat/sync activity center notification (#3581)

* feat: sync activity center notification

* add test

* fix lint issue

* fix failed test

* addressed feedback from sale

* fix failed test

* addressed feedback from ilmotta

go generate ./protocol/migrations/sqlite/...

feat: add updated_at for syncing activity center notification
2023-06-10 10:00:17 +08:00
Sale Djenic 56cad423f0 chore: `forceFetchingBackup` param added to `RequestAllHistoricMessages` and `RequestAllHistoricMessagesWithRetries` functions 2023-06-09 17:42:11 +02:00
Dario Gabriel Lipicar 4eb3d7485a fix(wallet): handle error when calling ERC721 TokenURI function
Fixes #10959
2023-06-08 10:37:20 -03:00
Stefan 5b6f7226bb feat(wallet) extract json blobs and add custom migration support
Extended the migration process with a generic way of applying custom
migration code on top of the SQL files. The implementation provides
a safer way to run GO code along with the SQL migrations and possibility
of rolling back the changes in case of failure to keep the database
consistent.
This custom GO migration is needed to extract the status from
the JSON blob receipt and store it in transfers table.

Other changes:
- Add NULL DB value tracking to JSONBlob helper
- Index status column on transfers table
- Remove unnecessary panic calls
- Move log_parser to wallet's common package and use to extract token
  identity from the logs

Notes:
- there is already an index on transfers table, sqlite creates one for
  each unique constraint therefore add only status to a new index
- the planned refactoring and improvements to the database have been
  postponed due to time constraints. Got the time to migrate the data
  though, extracting it can be done later for a more efficient
  implementation

Update status-desktop #10746
2023-06-08 13:54:40 +02:00
Dario Gabriel Lipicar d73c886d3b fix(wallet) limit nft description length
Fixes #10923
2023-06-07 15:11:29 -03:00
Ivan Belyakov d74d930b70 feat(wallet): enable sequential transfers fetching by default.
"EventNewTransfers' event is sent on each block processed, otherwise
it could take minutes or longer before first 'EventNewTransfers'
is sent.
2023-06-07 08:45:45 +02:00
Michal Iskierko fb4b93e8be feat(EstimateMintTo): Add EstimateMintTo to collectibles API
Issue #10536
2023-06-06 17:09:09 +02:00
Sale Djenic cff7d2f693 fix: profile social links updated 2023-06-06 09:59:12 +02:00
Patryk Osmaczko 15d2b4fe80 feat: add configurable throttling mechanism for importing msgs
part of: status-im/status-desktop#10815
2023-06-06 08:49:02 +02:00
Dario Gabriel Lipicar 449314a4dc feat(Wallet) detect uniswapV3 swap events
Part of #10251
2023-06-05 12:08:18 -03:00
Dario Gabriel Lipicar 2fc79fb9b5 feat(Wallet) detect uniswapV2 swap events
Part of #10251
2023-06-05 12:08:18 -03:00
Dario Gabriel Lipicar 7557f0c799 feat(Wallet): add function to get erc20 token by contract address
Part of #10251
2023-06-05 12:08:18 -03:00
Dario Gabriel Lipicar da8e8716b2 fix(wallet): Fix block hash for detected blocks with ETH transfers
Part of #10251
2023-06-05 12:08:18 -03:00
Ivan Belyakov ad1b8b6d43 fix(wallet): added `remove` event for accounts. Stop loading
transfers for removed account

Updates #10246
2023-06-05 08:22:08 +02:00
Khushboo-dev-cpp 8b91e3aaaf
chore: Add ColorId for Wallet accounts that can be shared with mobile (#3521) 2023-06-02 17:06:51 +02:00
Boris Melnik 5935339c19
feat(categories): Add muted type to category muting shortcut (#3534) 2023-06-02 14:25:32 +03:00
Jonathan Rainville 3f00869e1f
fix(contacts): add contact to ban and unban responses (#3558) 2023-06-01 13:26:12 -04:00
IvanBelyakoff 7adfbb5467
feat(wallet): SequentialFetchStrategy improvements: (#3551)
- reverted a change that stopped looking for ERC20 transfers if no nonce
  and balance change found within a block range for ETH
- implemented sending EventRecentHistoryReady event at a proper time
- moved EventFetchingRecentHistory event to Strategy type as it does not make
sense to send this event in loop
- moved iterating through blocks logic to inside of `loadTransfers` command, which
now accepts a block range.
- reuse `uniqueHeaders` function in commands.go
- clean up

Updates #10246
2023-06-01 16:09:50 +03:00
Jonathan Rainville a6285cc827
Fix chats reseting when a Sync signal comes for communities (#3539)
* fix(community): stop re-joining comm when receiving a sync community msg

Fixes an issue with chats being reset. Since joining a community resaves the chats with the synced default value, it resets the sate of the chats, losing the unread messages, the muted state and more.
The solution is to block the re-joining of the community. In the case of the sync, we catch that error and just continue on.

* fix(import): fix HandleImport not saving the chat

Doesn't change much, but it could have caused issues in the future, so since we might have modified the chat, we make sure to save them
Also adds a test

* fix tests
2023-05-29 13:57:05 -04:00
Anthony Laibe 645cd5d03b feat: return only enabled networks from the reader 2023-05-29 08:37:08 +02:00
IvanBelyakoff 2dc6700e38
chore(wallet): fix annoying error on missing argument while logging (#3532)
error on token fetch from store
2023-05-26 11:41:33 +03:00
IvanBelyakoff dc84afb751
Add new transfers fetching for sequential strategy (#3520)
* chore(wallet): refactor sequential transfers commands

* feat(desktop/wallet): add fetching new blocks and transfers for
transfers SequentialFetchStrategy

Updates #10246
2023-05-26 11:27:48 +03:00
Sale Djenic 03d9af0b95 feat: `AddressExists` endpoint added 2023-05-26 07:12:40 +02:00
Roman Volosovskyi ee4003279a
Changes necessary to restore wallet on mobile app 2023-05-25 21:08:34 +02:00
Sale Djenic 34f5ef031c feat: a profile keypair name follows display name
As part of this commit `UpdateKeypairName` endpoint added,
will be used to rename all but the profile keypairs.
2023-05-25 19:46:47 +02:00
Sale Djenic 0eca7f5088 fix: issues after rebase fixed 2023-05-25 19:46:47 +02:00
Sale Djenic eeaaf0ce3f feat: accounts improvements applied
- old `accounts` table is moved/mapped to `keypairs` and `keypairs_accounts`
- `keycards` table has foreign key which refers to `keypairs.key_uid`
- `Keypair` introduced as a new type
- api endpoints updated according to this change
2023-05-25 19:46:47 +02:00
Michal Iskierko 1c17fbeacc feat(RemoteBurn): Add remote burn collectibles functionality
* Updating smart contract (new burn function)
* remoteBurn() and estimateRemoteBurn() functions
2023-05-25 13:34:53 +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
Anthony Laibe 8b05ba6d8b fix: check balance for address details 2023-05-22 09:13:09 +02:00
Andrea Maria Piana 6acb34bab7 Allow setting up wallet with new config
This commit does a few things:

1) Extend create/import account endpoint to get wallet config, some of
   which has been moved to the backend
2) Set up a loop for retrieving balances every 10 minutes, caching the
   balances
3) Return information about which checks are not passing when trying to
   join a token gated community
4) Add tests to the token gated communities
5) Fixes an issue with addresses not matching when checking for
   permissions

The move to the wallet as a background task is not yet complete, I need
to publish a signal, and most likely I will disable it before merging
for now, as it's currently not used by desktop/mobile, but the PR was
  getting to big
2023-05-19 13:23:21 +01:00
IvanBelyakoff 17aaaf1dca
fix(desktop/wallet): fix bug in balance_cache - balances and nonces (#3509)
were stored in cache by pointers, which caused falsy cache hits in loop
because pointers with same address were created for different block
numbers. Now cache uses block numbers of uint64 as key, which can
overflow but it is not a problem since we use this cache for values
comparison, not as user data.
Fix crash on nil pointer in log.
Remove some unused code.
Protect nonceRanges with mutex while reading.

Updates #10246
2023-05-19 14:46:54 +03:00