Commit Graph

195 Commits

Author SHA1 Message Date
Stefan d024d36718 fix: fix wallet.history.TestServiceAtEnd
First check was relying on sorting result of two items that had the same
weight and is not guaranteed to be deterministic.
2023-01-30 20:11:01 +04:00
Stefan 90b39eeb41 fix: merge balance history using block time
This change improves on the previous implementation which used
the block number that doesn't work with incompatible blockchains e.g. L1 vs. L2

Closes: #9205
2023-01-27 16:28:59 +04:00
Stefan a2ff03c79e feat: retrieve balance history for tokens and cache it to DB
Extends wallet module with the history package with the following
components:

BalanceDB (balance_db.go)

- Keeps track of balance information (token count, block, block timestamp)
for a token identity (chain, address, currency)
- The cached data is stored in `balance_history` table.
- Uniqueness constrained is enforced by the `balance_history_identify_entry`
UNIQUE index.
- Optimal DB fetching is ensured by the `balance_history_filter_entries`
index

Balance (balance.go)

- Provides two stages:
    - Fetch of balance history using RPC calls (Balance.update function)
    - Retrieving of cached balance data from the DB it exists (Balance.get
    function)
- Fetching and retrieving of data is done for specific time intervals
    defined by TimeInterval "enumeration"
- Update process is done for a token identity by the Balance.Update function
- The granularity of data points returned is defined by the constant
increment step define in `timeIntervalToStride` for each time interval.
- The `blocksStride` values have a common divisor to have cache hit
between time intervals.

Service (service.go)

- Main APIs
    - StartBalanceHistory: Regularly updates balance history for all
    enabled networks, available accounts and provided tokens.
    - GetBalanceHistory: retrieves cached token count for a token identity
    (chain, address, currency) for multiple chains
    - UpdateVisibleTokens: will set the list of tokens to have historical
    balance fetched. This is a simplification to limit tokens to a small
    list that make sense

Fetch balance history for ECR20 tokens

- Add token.Manager.GetTokenBalanceAt to fetch balance of a specific
block number of ECR20.
- Add tokenChainClientSource concrete implementation of DataSource
to fetch balance of ECR20 tokens.
- Chose the correct DataSource implementation based on the token
"is native" property.

Tests

Tests are implemented using a mock of `DataSource` interface used
to intercept the RPC calls.

Notes:

- the timestamp used for retrieving block balance is constant

Closes status-desktop: #8175, #8226, #8862
2023-01-25 22:25:50 +04:00
Anthony Laibe e8cd779e35 feat: api to return service up or down 2023-01-21 13:11:03 +01:00
dlipicar c2a8dd8a0c
feat(wallet): add price cache (#3107) 2023-01-19 11:49:48 -03:00
Andrea Maria Piana ed9ca8392c Upgrade linter to 1.50.0 2023-01-13 17:52:03 +00:00
dlipicar 77a56e2b93
Feature/8640 unified currency rounding (#3079)
* feat(@desktop/wallet): added iso4217 library for fiat currency display decimals

* feat(@desktop/wallet): added token peg info and use numbers for token market values

* feat(@desktop/wallet): added
2023-01-12 14:54:14 -03:00
Anthony Laibe 883f9677c5 feat: nonce management in multi tx 2023-01-12 12:56:57 +01:00
Anthony Laibe 04de916cba fix: wallet downloader for l2 chain 2023-01-11 09:56:08 +01:00
Anthony Laibe 78795ce3e0 feat: reduce infura call
check if token exists before making the call
2023-01-10 09:42:08 +01:00
dlipicar 7d04be3613
Revert "feat/currency rounding (#3041)" (#3046)
This reverts commit 3d22f4a86d.
2023-01-04 09:40:26 -03:00
Anthony Laibe 99ff0a18b0 feat: cbridge integration 2023-01-04 08:23:18 +01:00
dlipicar 3d22f4a86d
feat/currency rounding (#3041)
* feat(@desktop/wallet): added iso4217 library for fiat currency display decimals

* feat(@desktop/wallet): added token peg info and use numbers for token market values

* feat(@desktop/wallet): extend wallet api to fetch prices in multiple currencies

* chore(@desktop/wallet): rename token peg field for clarity
2023-01-03 10:24:55 -03:00
frank 9137257638
synchronize display name (#2989) 2022-12-29 14:16:19 +08:00
Anthony Laibe 6abbe98cd2 feat: allow to lock amount in router 2022-12-21 16:58:33 +01:00
Anthony Laibe d7bf19fdbb feat: allow to get wallet token for specific addresses 2022-12-08 09:16:17 +01:00
Anthony Laibe c735e2a6bb feat: add wallet ticker 2022-12-02 10:53:21 +01:00
Anthony Laibe 0d1837f858 feat: add ticker in backend rather than in clients 2022-12-02 10:53:21 +01:00
Anthony Laibe eff02a79a9 feat: add wallet token endpoint 2022-12-02 09:32:07 +01:00
Anthony Laibe f3b1448efa fix: router preferred chains 2022-12-02 09:27:44 +01:00
Anthony Laibe 4c29c97591 feat: bridge tx 2022-11-30 09:18:24 +01:00
dlipicar ba053c8a5d
fix: keep original case for collectible trait types (#2984) 2022-11-29 09:28:37 -03:00
Khushboo-dev-cpp d41fcaf8a9
feat: delete message for new design (#2922) (#2965)
Co-authored-by: yqrashawn <namy.19@gmail.com>
2022-11-22 11:12:16 +01:00
Anthony Laibe 7ea9a3f230 fix: router fees for EIP1559 2022-11-14 13:32:29 +01:00
Stefan 601484af3e feat: Retrieve balance history for native token
Add functionality to sample and retrieve balance history and cache
it in memory for the current transfer controller.

The end of the balance history is snapped at twice per day to
avoid having to query the blockchain again for each fetching within
12 hours interval

The functionality will be extended with DB caching, API call batching,
"smarter" cache hitting and syncing between devices

Updates: #7662
2022-11-07 22:39:21 +01:00
Sale Djenic b0b23076a0 feat: `GetDerivedAddressDetails` added to accounts api 2022-10-28 13:27:55 +02:00
Anthony Laibe 32ffb30bf0 feat: stt market data handler 2022-10-28 10:21:27 +02:00
Anthony Laibe 63eb3d71ba feat: run go mod tiny/vendor 2022-10-26 09:39:30 +02:00
Andrea Maria Piana fc836e4c76 upgrade ethereum 2022-10-26 09:39:30 +02:00
Anthony Laibe b11643e66d feat: hop integration 2022-10-26 09:39:30 +02:00
Anthony Laibe 37c9eb1a9d
fix: token override when scanning (#2910) 2022-10-24 08:45:14 +02:00
Roman Volosovskyi 5c3435c12f
Changes necessary to make wallet work pokt networks 2022-10-19 10:40:13 +02:00
Anthony Laibe d9b44777c9
feat: update opensea testnet to use goerli (#2894) 2022-10-12 09:59:38 +02:00
Khushboo-dev-cpp 3364c159f4
feat: Added API for getting historical data for a token (#2882) 2022-10-10 21:02:04 +02:00
Stefan b9d6e6d8c8 feat: sync saved addresses
Main changes:
- Extend saved addresses DB with sync info: sync timestamp, update timestamp
and soft removed flag
- Create custom protobuf message payload to sync saved addresses
- Cleanup saved addresses on each start of messenger, by deleting
soft removed older entries
- Sync all saved addresses on Messenger.SyncDevices calls
- Sync particular changes to saved addresses
- Add SavedAddressManager instance to messenger
  - Note, can't find a clean way to pass the SavedAddressManager to the
  messenger, so we create another one
- Add tests for sync and new DB API

Closes: #7229
2022-10-10 11:26:35 +02:00
Richard Ramos bf9abfc350
feat: make kdf iterations configurable when creating a multiaccount (#2796) 2022-09-27 16:27:20 -04:00
Roman Volosovskyi 506921509e
Add effective gas price to tx view 2022-09-27 17:15:56 +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
Stefan aa4d95917c feat: merge favourites with saved address
Remove Favourites APIs and update the saved address APIs

Added up migration scripts that move the favourites from the old table
to the saved_addresses table with true flag and then drop the favourites table.

Required by #6546
2022-09-12 13:46:04 +02:00
Khushboo-dev-cpp 1485b3b4c8
feat: Added new BaseFee param inside transactions (#2847) 2022-09-09 20:22:59 +02:00
Samuel Hawksby-Robinson 41cb9d7bea Added httptest.NewServer to DecodeFromURL and CryptoOnRamp tests 2022-09-09 15:07:48 +01:00
Anthony Laibe 48f678052c
feat: batch balance (#2833) 2022-09-09 08:58:36 +02:00
Khushboo-dev-cpp 6376ad6e2d
feat: Add param for change24Hour to get 24 hours change value for a token from cryptocompare (#2817) 2022-08-30 10:21:01 +02:00
Khushboo-dev-cpp 25a80cf20b
feat(CryptoCompareApi): Get token details from crypto compare (#2793) 2022-08-23 10:46:15 +02:00
Richard Ramos 2edcf0e360
fix: ens release username hash (#2756)
* fix: ens release username hash
* fix: IN parameters when obtaining multiple pending trxs
2022-08-08 14:25:53 -04:00
Khushboo-dev-cpp 6967732a06
feat: Update the asset traist to have the correct uppercase formats for trait values (#2781) 2022-08-03 09:42:56 +02:00
Anthony Laibe 19807ce338
feat: add arbitrum tokens (#2778) 2022-08-02 11:11:27 +02:00
Anthony Laibe 9e0c9a5875
fix: remove duplicate token (#2777) 2022-07-29 09:40:07 +02:00
Anthony Laibe 4e2b02bedd feat: add goerli contracts 2022-07-29 08:57:38 +02:00
Churikova Tetiana 3cd92fda78
goerli: contracts, bump version 2022-07-20 14:15:15 +02:00
Jakub Sokołowski 530f3c7a3a
rename status-react to status-mobile
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-07-17 15:37:14 +02:00
Anthony Laibe ce0caa0f7f
feat: multi transaction (#2751) 2022-07-15 10:53:56 +02:00
Khushboo-dev-cpp b2ce92fd41
feat: Add logic to re caculate route for sending a transaction based on networks disabled by the user (#2742) 2022-07-14 16:22:42 +02:00
Anthony Laibe 35c4001e57
feat: estimate time for a transaction (#2744) 2022-07-12 14:25:32 +02:00
Vitaliy Vlasov 3dee94e505 Wallet sync for generated accounts 2022-07-06 19:24:43 +03:00
Anthony Laibe 4a3c4ad0ca
feat: allows to pass array of chain ids (#2733) 2022-07-04 09:48:30 +02:00
Churikova Tetiana 63d6119794
goerli: add assets 2022-07-01 12:42:06 +02:00
Anthony Laibe 8c0f230644
feat: Simple transaction router (#2686) 2022-06-09 15:09:56 +02:00
Anthony Laibe 97a99d6254
fix: get balance with multiple chain (#2689) 2022-05-26 06:44:29 -04:00
Vitaliy Vlasov 011238b1d1 Wallet sync 2022-05-18 15:25:20 +03:00
Khushboo-dev-cpp 15e5584ed2
feat: Add hasActivity param to derived addresses (#2663)
Added functionality to find target address when 6th param in path is added
for ex: "m'/44'/60'/0'/0/500" reperents the Address at the 500th index

Added a api to get the Address derived from a private key
2022-05-18 13:31:45 +02:00
Anthony Laibe e199ddbe9d
feat: get wallet api (#2619) 2022-05-10 09:48:05 +02: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
Anthony Laibe 907ba8ee5c
feat: visible token api (#2624) 2022-04-13 09:55:38 +02:00
Anthony Laibe 4d39547b81
Feat/expose registrar address (#2600)
* feat: expose registrar address

* fix code gen
2022-04-04 12:54:44 -04:00
Anthony Laibe 16311512cb
feat: add suggested fees api (#2604) 2022-03-29 17:12:05 -04:00
Samuel Hawksby-Robinson e67592d556
Sync Settings (#2478)
* Sync Settings

* Added valueHandlers and Database singleton

Some issues remain, need a way to comparing incoming sql.DB to check if the connection is to a different file or not. Maybe make singleton instance per filename

* Added functionality to check the sqlite filename

* Refactor of Database.SaveSyncSettings to be used as a handler

* Implemented inteface for setting sync protobuf factories

* Refactored and completed adhoc send setting sync

* Tidying up

* Immutability refactor

* Refactor settings into dedicated package

* Breakout structs

* Tidy up

* Refactor of bulk settings sync

* Bug fixes

* Addressing feedback

* Fix code dropped during rebase

* Fix for db closed

* Fix for node config related crashes

* Provisional fix for type assertion - issue 2

* Adding robust type assertion checks

* Partial fix for null literal db storage and json encoding

* Fix for passively handling nil sql.DB, and checking if elem has len and if len is 0

* Added test for preferred name behaviour

* Adding saved sync settings to MessengerResponse

* Completed granular initial sync and clock from network on save

* add Settings to isEmpty

* Refactor of protobufs, partially done

* Added syncSetting receiver handling, some bug fixes

* Fix for sticker packs

* Implement inactive flag on sync protobuf factory

* Refactor of types and structs

* Added SettingField.CanSync functionality

* Addressing rebase artifact

* Refactor of Setting SELECT queries

* Refactor of string return queries

* VERSION bump and migration index bump

* Deactiveate Sync Settings

* Deactiveated preferred_name and send_status_updates

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2022-03-23 18:47:00 +00:00
andrey 3f9d689f90 [#13197] Update moonpay onramp URL 2022-03-23 10:29:49 +01:00
Anthony Laibe b629d6fa74
feat: move fetch prices to status-go (#2595) 2022-03-23 09:35:58 +01:00
Richard Ramos 0a758b0f7d feat: stickerpacks service 2022-03-02 17:46:16 -04:00
Anthony Laibe 66d511e33f
feat: add opensea api key (#2528) 2022-02-16 10:22:19 +01:00
andrey 2e8007c12d use token list from status-react 2022-02-01 12:44:34 +01:00
Anthony Laibe 76436f7768 fix: Add user agent for opensea query 2022-01-18 16:30:38 +00:00
Anthony Laibe 9d8ec4432e
feat: Add token store API (#2482) 2022-01-14 10:21:00 +01:00
Richard Ramos ee41e30881
feat: extract node config from settings to individual tables (#2470) 2022-01-12 16:04:43 -04:00
Roman Volosovskyi 7ef2efaabd
Support for binance chains 2021-11-27 10:47:57 +02:00
Richard Ramos 38cc695753
waku2: log envelope hash and ids for all messages (#2427) 2021-11-11 12:13:55 -04:00
Samuel Hawksby-Robinson 20b6f8d96e
Added currency filter to ramp (#2390) 2021-10-01 14:25:54 +01:00
Anthony Laibe 26bfeddad4
feat: Rpc client manage multiple eth client (#2359) 2021-09-22 13:49:20 -04:00
Anthony Laibe 5d1fe07544 fix: get token balance 2021-09-22 16:44:22 +02:00
Anthony Laibe 95dcbef5e5
feat: enable rinkeby for opensea (#2357) 2021-09-20 12:24:07 -04:00
Anthony Laibe fb3ef387ac
feat: Add more attributes from opensea (#2354)
* feat: Add more attributes from opensea

Add sale / orders information as well as collection traits

* feat: add background color to opensea response

* feat: Add max value and handle float to opensea response
2021-09-17 10:01:35 +02:00
Eric Mastro 06d4163de8
feat: Add Saved Addresses CRUD (#2356) 2021-09-10 14:08:22 -04:00
Anthony Laibe 07651d4d06
feat: enable wallet without network binding (#2349)
* feat: enable wallet without network binding

* feat: make transfer network aware

* feat: allow to pass initial networks via config

* fix: nil check and feed

* feat: Add documentation with better function name

* fix: do not init the manager more than once

* fix: PR feedbacks

* Bump version

* Update Jenkinsfile.tests

* Convert int to string

Co-authored-by: RichΛrd <info@richardramos.me>
2021-09-09 16:28:54 +02:00
Anthony Laibe 048511cc99 feat: Add trait to collectible
Build a custom unmarshaller for field that can be int or string

see: https://docs.opensea.io/reference/asset-object
2021-09-01 09:56:26 +02:00
Anthony Laibe 8f9c644dae
feat: fetch assets from opensea (#2320) 2021-08-20 15:53:24 -04:00
Roman Volosovskyi c78eac8d94
Add MaxFeePerGas and MaxPriorityFeePerGas to TransferView 2021-08-12 19:42:13 +03:00
Andrea Maria Piana b3a5455c46 Fix some tests & upgrade contracts 2021-07-20 10:57:38 +02:00
Andrea Maria Piana d84da4f515 Fix some tests and restore private/public RPC client 2021-07-20 10:57:38 +02:00
Andrea Maria Piana 1e8688ac56 Upgrade to london signer and cleanup 2021-07-20 10:57:38 +02:00
Andrea Maria Piana 4b0daeb47b Move services to status-node
Move all the services to status-node, as some of them were there, some
of them were in the geth backend and scattered around.
2021-07-20 10:57:38 +02:00
Andrea Maria Piana d092a2bb49 Fix wallet big int conversion 2021-07-20 10:57:38 +02:00
Andrea Maria Piana 799bd93451 Memove mailserver registry and update ierc20 contract bindings
This commit removes the mailserver contract registry, as not used
anymore, and upgrade the ERC20 contract bindings.
2021-07-20 10:57:38 +02:00
Roman Volosovskyi d1dc5f1e27
[wallet] Add wallet_getChachedBalances method 2021-05-25 10:03:05 +03:00
Samuel Hawksby-Robinson bb58d82661
Updated Ramp siteUrl to use URL in docs and use the referral code (#2218)
* Updated Ramp siteUrl to use URL in docs and use the referral code

see https://docs.ramp.network/configuration

* Moved Ramp to the top

* Removed local cryptos and transak
2021-05-17 15:51:33 +01:00
Roman Volosovskyi 6037570901
[wallet] Pending transactions API 2021-04-23 18:20:38 +03:00
Roman Volosovskyi fd49876a47
[wallet] fix UpsertRange 2021-04-20 10:37:26 +03:00
Samuel Hawksby-Robinson 07a713cc71
Removed Wyre from on ramp options (#2207)
* Removed Wyre from on ramp options

* VERSION bump
2021-04-19 12:17:34 +01:00
Roman Volosovskyi ddc48c7cf4
[wallet] Download transactions with unspecified chainId 2021-04-15 16:39:08 +03:00
Roman Volosovskyi f3ee49c110
[wallet] cleanup 2021-04-08 23:30:27 +03:00