Commit Graph

138 Commits

Author SHA1 Message Date
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
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
frank c7aebfeed3
Fix/mobile issue 15899 : error when trying login under updated password (#3493)
* fix: unable to reset password for newly created account using CreateAccountAndLogin

* remove unnecessary print

* add TestCreateAccountAndLogin

* update TestCreateAccountAndLogin

* bump version
2023-05-18 22:00:55 +08:00
yqrashawn 23138d0dbb
feat: start media server with no db right after logout (#3505) 2023-05-18 19:22:20 +08:00
yqrashawn 6fed50ce53
feat: media server and colorhash related change (#3500) 2023-05-18 14:27:16 +08:00
Sale Djenic 189c7a6919 chore: `keypairs` package which actually refers to keycards is renamed to `keycards` package
This commit renames few api endpoints:
- old `AddMigratedKeyPairOrAddAccountsIfKeyPairIsAdded` renamed to `AddKeycardOrAddAccountsIfKeycardIsAdded`
- old `GetAllMigratedKeyPairs` renamed to `GetAllKnownKeycardsGroupedByKeyUID`
- old `GetMigratedKeyPairByKeyUID` renamed to `GetKeycardByKeyUID`
- old `DeleteKeypair` renamed to `DeleteAllKeycardsWithKeyUID`
2023-05-10 09:27:51 +02:00
Sale Djenic 31144ed5a3 chore: `password` removed from the `DeleteAccount` function
Asking for a password when removing a key is not necessary.
2023-05-09 10:48:44 +02:00
frank a2ed1b78dd
feat:support backup/sync ens name (#3415) 2023-04-26 23:37:18 +08:00
Sale Djenic c8ef2c1a7f fix: deleting derived from address keystore file applied to all keypairs being migrated instead to a profile keypair only 2023-04-25 14:03:32 +02:00
Andrea Maria Piana 522c578a35 Set keystore dir & network id 2023-03-30 13:39:54 +01:00
Andrea Maria Piana 3b97f94ccc Fix logging directory, and allow a few more fields to be set by the
client
2023-03-30 13:39:54 +01:00
Roman Volosovskyi 91c6949cd2
Return keyUID on succesfull validation of mnemonic 2023-03-28 10:52:06 +02:00
Roman Volosovskyi bcca0b399d
Add PreviewPrivacy to CreateAccountRequest 2023-03-27 09:33:03 +02:00
Andrea Maria Piana e2082bf5bd Add customization color 2023-03-24 14:22:29 +00:00
Pascal Precht 2cbced95c5 Check token funds when handling community requests to join
This adds checks to `HandleCommunityRequestToJoin` and
`AcceptRequestToJoinCommunity` that ensure a given user's revealed
wallet addresses own the token funds required by a community.

When community has token permissions of type `BECOME_MEMBER`, the
following happens when the owner receives a request:

1. Upon verifying provided wallet addresses by the requester, the owner
   node accumulates all token funds related to the given wallets that
   match the token criteria in the configured permissions
2. If the requester does not meet the necessary requirements, the
   request to join will be declined. If the requester does have the
   funds, he'll either be automatically accepted to the community, or
   enters the next stage where an owner needs to manually accept the
   request.
3. The the community does not automatically accept users, then the funds
   check will happen again, when the owner tries to manually accept the
   request. If the necessary funds do not exist at this stage, the
   request will be declined
4. Upon accepting, whether automatically or manually, the owner adds the
   requester's wallet addresses to the `CommunityDescription`, such that
   they can be retrieved later when doing periodic checks or when
   permissions have changed.
2023-03-23 08:40:31 +01:00
Andrea Maria Piana 31ae4c958b Add RestoreAccountAndLogin endpoint 2023-03-22 13:31:16 +00:00
Andrea Maria Piana 6775e79920 Make image path optional 2023-03-20 19:36:41 +00:00
Andrea Maria Piana ba2aa3f83e Support display name/images/password/mnemonic 2023-03-20 17:26:25 +00:00
Andrea Maria Piana 4be978a2fe Address feedback 2023-03-16 17:02:11 +00:00
Andrea Maria Piana 3d2fd26d80 Add CreateAccount endpoint 2023-03-16 17:02:11 +00:00
Andrea Maria Piana 5d0e08ec7b Add spiff workflow cmd 2023-03-16 14:31:34 +00:00
Pascal Precht 6859a1d3b7 Add methods to sign and recover messages/signatures to AccountManager
Also, make AccountManager a dependency of Messenger.
This is needed for community token permissions as we'll need a way to access wallet accounts
and sign messages when sending requests to join a community.

The APIs have been mostly taken from GethStatusBackend and personal service.
2023-03-16 12:25:06 +01:00
frank 837bf2ca42
support local pairing after logged in as receiver; pair installation;(#3202) 2023-02-28 20:32:45 +08:00
Anthony Laibe c786528965 feat: improve change db password without need to be logged in 2023-02-18 22:18:14 +01:00
Siddarth Kumar cf84c40320
PR to fix media server sleep issue (#3189)
* fix media-server sleep wake up issue

we now use waku v2 and hence messenger was nil.
Since it was nil, the logic in place responsible for triggering app state events was not firing and hence media server would become un-responsive after a sleep event.

this commit fixes that.

Co-Authored-By: Andrea Maria Piana <andrea.maria.piana@gmail.com>


---------

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2023-02-15 13:44:00 +05:30
Andrea Maria Piana dfe40ff6bd Init keystore fix
We delegate to services to init the keystore file, but there's a race
condition that can be triggered, whereby the keystore file is not
initialized before login, and that results in the user not being able to
login.

This commit changes the services so that the keystore is initialized
before login, I have left also the code in services just to make sure
nothing relies on it, but it could probably be removed.
Initializing keystore twice seems like a noop if already initialized.
2023-02-10 11:17:16 +00:00
Roman Volosovskyi 551715f493
Adjust ConvertToKeycardAccount to make it compatible with mobile version 2023-02-02 11:50:13 +01:00
Sale Djenic c8994fe175 test: `TestConvertAccount` test update
This tests the entire process of converting a regular account to a keycard
account and then converting that keycard account back to a regular account.

For the need of this test I had to improve `DeleteAccount` function, cause the
previous implementation didn't remove account from the keystore cache, but
only from the keystore.
2023-01-27 13:20:52 +01:00
Sale Djenic 6e656448ba feat(keycard): `ConvertToRegularAccount` endpoint added
It converts a keycard user to a regular user, setting all necessary details
that logged in account looks like it has never been a keycard account.
2023-01-27 13:20:52 +01:00
Sale Djenic 902d4b7501 fix(keycard): convert regular to a keycard account process fixed 2023-01-27 13:20:52 +01:00
frank dc87d6bb0f
get messenger from account service when local pairing (#3069) 2023-01-11 19:30:54 +08:00
frank ec7c0e9c7d
Sync all devices after initial pairing (#3047) 2023-01-06 20:21:14 +08:00
Sale Djenic 1340a55c1d feat: backup profile data to waku and sync them from waku
Changes applied here introduce backing up profile data (display name and identity
images) to waku and fetch them from waku. Information about those data is sent
as a separate signal to a client via `sync.from.waku.profile` signal.

New signal `sync.from.waku.progress` is introduced which will be used to notify a client
about the progress of fetching data from waku.
2022-12-23 15:07:14 +01:00
Sale Djenic 77b7ce5a09 fix: corresponding keystore files are deleted when account is migrated to a keycard 2022-11-09 18:07:16 +03:00
Richard Ramos 6300751e36 chore: upgrade go-waku and log about messages sent/received 2022-11-09 17:39:17 +03:00
Andrea Maria Piana fc836e4c76 upgrade ethereum 2022-10-26 09:39:30 +02:00
Richard Ramos bf9abfc350
feat: make kdf iterations configurable when creating a multiaccount (#2796) 2022-09-27 16:27:20 -04:00
Sale Djenic d89c0c8d9e fix(keycard): convert to keycard action removes keystore and doesn't change the pass properly fixed 2022-09-27 12:13:50 +02:00
Anthony Laibe cdca3d86e2
feat(token): enable changing token address from the node config (#2848)
Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2022-09-13 11:30:52 +02:00
Samuel Hawksby-Robinson 9fda3a968e Added and integrated StartUpPairingServer
Also moved Mount() calls into the respective Server/Client send() funcs
2022-09-09 13:24:56 +01:00
saledjenic 2e51450393
fix: avoid imported wallet account deletion while converting it to keycard account (#2827)
- imported wallet accounts via seed phrase or private key are not deleted anymore
when migrating any of those key pairs to a keycard
2022-08-31 18:11:42 +02:00
Richard Ramos 86054875a4
fix: add mode build param and change ipfs gateway accordingly
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-08-26 18:57:55 +02:00
Samuel Hawksby-Robinson 26b33aa09d Added AccountType to enforce strict typing on Accounts
Also a tpyo was fixed, probably introduced by me.
2022-08-25 22:01:43 +01:00
Vitaliy Vlasov 3dee94e505 Wallet sync for generated accounts 2022-07-06 19:24:43 +03:00
Anthony Laibe 8c0f230644
feat: Simple transaction router (#2686) 2022-06-09 15:09:56 +02:00
Sale Djenic 82550fca34 the way of initializing networks list is updated 2022-05-26 16:21:06 +02:00
Anthony Laibe 7227ae1c8e
fix: merge node config allows overide (#2664) 2022-05-24 12:57:45 +02:00
Vitaliy Vlasov 011238b1d1 Wallet sync 2022-05-18 15:25:20 +03:00
Richard Ramos 0048aaebcc
feat: add IPFS rate limiter for downloading stickers and use http server for retrieving stickers (#2611) 2022-05-09 09:07:57 -04:00
Pascal Precht 07c6808385 Make `GetNodeConfig` retrieve config from DB
Prior to this commit, this API returns the in memory `NodeConfig` which
might not be the latest state.
This is the case when for example clients update any `NodeConfig` and
retrieve it right afterwards via `GetNodeConfig`.
To get the latest state of `NodeConfig` it has to be fetched from DB
instead.
2022-05-04 10:25:00 +02:00