This commit moves the management of installations to status-go, and
migrates the data from realm.
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
All the code has been implemented in statusgo: status-im/status-go#1466
Basically all the whisper filter management is done at that level.
Technical description
On startup we load all chats and send a list of them to status go:
For a public chat: {:chatId "status"}, we create a single filter, based on the name of the chat.
For each contact added by us, each user in a group chat and each one to one chat open, we send:
{:chatId "0x", :oneToOne true}. This will create a chats, to listen to their contact code.
Any previously negotiated topic is also returned.
Once loaded, we create our filters, and upsert the mailserver topics, both of which are solely based on the filters loaded.
In order to remove a chat, we delete/stopwatching first the the filter in status-react and then ask status-go to remove the filter. For a public chat we always remove, for a one-to-one we remove only if the user is not in our contacts, or in a group chat or we have a chat open. Negotiated topics are never removed, as otherwise the other user won't be able to contact us anymore.
On stopping whisper we don't have to ask status-go to remove filters as they are removed automatically.
Some more logic can be pushed in status-go, but that will be in subsequent PRs.
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
All resources loaded by slurp are moved to status-modules/resources dir
in release builds and are loaded only by demand instead of being bundled into
index.*.js.
- replace web3-prototype wherever possible
- currently only the money namespace is left
for future refactoring, the ideal solution
would be to use strings for big numbers all
the time and only convert for arithmetic operations
- use json-rpc call to replace trivial web3 calls
Signed-off-by: yenda <eric@status.im>
- remove font-weight and font-style on mobile because otherwise android
falls back to default font and doesn't use the font-family
- since nested text inherits from parent, only put the needed styling
in nested text style
- use parens instead of brackets to resolve components
- upgrade to realm 2.28 to benefit from perf improvements
- remove user-statuses and replace by seen and outgoing-status fields
to get rid of a lot of bloat queries and computations
- remove unused seen message, bottom-infos
- remove unused fields in transport schema
- use objectForPrimaryKey whenever possible instead of get by field
Signed-off-by: yenda <eric@status.im>
This concerns:
- touchable-opacity
- animated-view
- scroll-view
Tip for rebasing:
search in project for `scroll-view)` `animated-view)` and `touchable-opacity)`
Signed-off-by: yenda <eric@status.im>
- allows transaction flow started by an internal feature to show
the right asset in the overview and in transaction messages
(required for tribute to talk)
Signed-off-by: yenda <eric@status.im>
Connect to stubs of status-go protocol API, behind the flag. Since status-go isn't updated yet, setting this flag will break the app.
What needs to be tested is no regressions in a normal mode.
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
the defn macro knows register the function as an events under the
keywords provided in the :events key of the attributes map. It also
adds the interceptors provided in the :interceptors map
exemple:
```clojure
(fx/defn hello4
{:doc "this function is useless as well"
:events [:test/valid1 :test/valid2]}
[{:keys [db]} b]
{:db (assoc db :a b) :b (:a db)})
```
Signed-off-by: yenda <eric@status.im>
move utils.ethereum.tokens to ethereum.tokens
move utils.ethereum.abi-spec to ethereum.abi-spec
move utils.ethereum.core to ethereum.core
move utils.ethereum.eip165 to ethereum.eip165
move utils.ethereum.eip55 to ethereum.eip55
move utils.ethereum.eip681 to ethereum.eip681
move utils.ethereum.ens to ethereum.ens
move utils.ethereum.erc721 to ethereum.erc721
move utils.ethereum.mnemonics to ethereum.mnemonics
move utils.ethereum.resolver to ethereum.resolver
move utils.ethereum.macros to ethereum.macros
Signed-off-by: yenda <eric@status.im>
in many places in the codebase, we are doing various destructuring
and function calls to get the normalized current address and the chain
keyword for the current network
this PR replace all usages by utility functions introduced recently
Signed-off-by: yenda <eric@status.im>
- temporary fix before visible assets are fixed
- the problem is that you can't hide an asset with the way it currently
works, it will come back every time as long as there is a balance for it
Signed-off-by: yenda <eric@status.im>
- introduce json-rpc namespace, which provides `call` and `eth-call`,
a generic way of calling a json-rpc method taking care of conversions
and error handling
- remove web3 usage from wallet
- clean up effects, reducing the amount of computations when login in
`wallet-autoconfig-token` is a very expensive call on mainnet
because it checks the balance of every known token.
it is called:
- when wallet is refreshed by pulling
- when user goes on any wallet screen
this PR changes that by:
- calling it only when the wallet is initialized and there is no
visible-token configuration
it only calls update-wallet when a new transaction arrives
- remove the transaction fetching loop entirely to rely only on subscription
for live transactions and token transfer updates
- fetch token transfers history via etherscan API to lift the 100000 blocks
limit on token transfers history
- inbound token transfers are catched via a filter on ethlogs
- outbound token transfers and other transactions are catched by filtering
transaction in current block that have the wallet address as to or from field
- removes fetching of last 100000 blocks of token transfers from
the wallet pull loop
- fetches the last 100000 blocks of token transfers at startup
- replaces pulling by subscriptions to ethlogs for token transfers
For associative collections, using reduce-kv should
give a small performance gain over reduce as there is
no allocation of tuples for key/value pairs
Signed-off-by: yenda <eric@status.im>
- use signal subscriptions to get latest block signals
- compute confirmations in transaction details from current block
dynamically
Signed-off-by: yenda <eric@status.im>
- settings are stored in a manifest that is pointed at by the contract
- during login the contract is checked to fetch the settings
Signed-off-by: yenda <eric@status.im>
- when login in after a different account using a different network
the new account inherited the network from the previous one
- this fixes it by using the account network when initializing app-db
instead of reusing current network
Signed-off-by: yenda <eric@status.im>
- previously wallet transaction fetching was quite hazardous
- most of the time the `:wallet/all-tokens` map was nil so no token
was recognized
- the query for transfers was made accross 100000 blocks, now it
only checks that the first time, then from latest block checked minus
12 to follow progress of unconfirmed transactions
Signed-off-by: yenda <eric@status.im>
- change `ethereum/get-transaction` to use call-private-rpc instead
of web3 object
- implement a version for erc20 tokens SNT and STT that provides enriches
result of get-transaction with `:recipient` and `:snt-amount`
Signed-off-by: yenda <eric@status.im>
- turn :send-transaction-message event into an fx producing function
- allow transaction with defined on-result event to also send transaction
message
Signed-off-by: yenda <eric@status.im>
This PR is part of network incentivisation. It adds a way for a client
to pull nodes from a contract.
This is done by selecting the `eth.contract` fleet. If that is selected
on login it will fetch nodes from a contract and pass them to status-go.
If these can't be fetched, it will default to `eth.beta`.
Currently contract information are hard-coded, but eventually the user
will be able to add their own (probably).
Toggled off in release.
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
[#7454] fix add basic copy to public chat empty screen state + chat messages-views intro screens for all chats
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
* `open-sign-transaction-flow` cleaner version of
`open-modal-wallet-for-transaction`
* The contract namespace provides the `call` effect:
- takes contract identifier from contracts, method, params and callback
- select the correct contract address based on current network
- encode params, decodes results
- start wallet transaction flow for write calls
Signed-off-by: yenda <eric@status.im>
- support for ipfs only
- provides fns to encode and decode contenthashes as defined in EIP1577
- provides cat fx to retrieve contenthash
Signed-off-by: yenda <eric@status.im>
- remove web3 parameter for ethereum/call
- remove first parameter for callback of ethereum/call which
was always nil
Signed-off-by: yenda <eric@status.im>