2017-09-05 14:14:45 +00:00
|
|
|
(ns status-im.native-module.core
|
2018-07-30 03:47:08 +00:00
|
|
|
(:require [status-im.native-module.impl.module :as native-module]))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
|
|
|
(def adjust-resize 16)
|
|
|
|
|
2018-09-07 09:53:43 +00:00
|
|
|
(defn start-node [config]
|
|
|
|
(native-module/start-node config))
|
2017-08-21 14:49:31 +00:00
|
|
|
|
2018-12-19 12:20:03 +00:00
|
|
|
(def node-started (atom false))
|
|
|
|
|
2018-11-26 15:52:29 +00:00
|
|
|
(defn node-ready []
|
2018-12-19 12:20:03 +00:00
|
|
|
(reset! node-started true)
|
2018-11-26 15:52:29 +00:00
|
|
|
(native-module/node-ready))
|
|
|
|
|
2017-08-21 14:49:31 +00:00
|
|
|
(defn stop-node []
|
2018-12-19 12:20:03 +00:00
|
|
|
(reset! node-started false)
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/stop-node))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2019-07-03 14:29:01 +00:00
|
|
|
(defn create-multiaccount [password callback]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/create-account password callback))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2019-07-03 14:29:01 +00:00
|
|
|
(defn recover-multiaccount [passphrase password callback]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/recover-account passphrase password callback))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2019-07-19 14:11:10 +00:00
|
|
|
(defn multiaccount-store-derived [account-id paths password callback]
|
|
|
|
(native-module/multiaccount-store-derived account-id paths password callback))
|
2019-05-13 07:58:41 +00:00
|
|
|
|
2019-07-19 14:11:10 +00:00
|
|
|
(defn multiaccount-generate-and-derive-addresses [n mnemonic-length paths callback]
|
|
|
|
(native-module/multiaccount-generate-and-derive-addresses n mnemonic-length paths callback))
|
2019-05-13 07:58:41 +00:00
|
|
|
|
2019-07-19 14:11:10 +00:00
|
|
|
(defn login [address password main-account watch-addresses callback]
|
|
|
|
(native-module/login address password main-account watch-addresses callback))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2018-11-26 15:52:29 +00:00
|
|
|
(defn verify [address password callback]
|
|
|
|
(native-module/verify address password callback))
|
|
|
|
|
2018-12-04 13:49:09 +00:00
|
|
|
(defn login-with-keycard
|
|
|
|
[{:keys [whisper-private-key encryption-public-key on-result]}]
|
|
|
|
(native-module/login-with-keycard whisper-private-key encryption-public-key on-result))
|
|
|
|
|
2017-09-05 14:14:45 +00:00
|
|
|
(defn set-soft-input-mode [mode]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/set-soft-input-mode mode))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
|
|
|
(defn clear-web-data []
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/clear-web-data))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2018-08-10 17:15:16 +00:00
|
|
|
(defn call-rpc [payload callback]
|
2018-12-19 12:20:03 +00:00
|
|
|
(when @node-started
|
|
|
|
(native-module/call-rpc payload callback)))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2018-08-10 17:15:16 +00:00
|
|
|
(defn call-private-rpc [payload callback]
|
2018-12-19 12:20:03 +00:00
|
|
|
(when @node-started
|
|
|
|
(native-module/call-private-rpc payload callback)))
|
2018-08-10 17:15:16 +00:00
|
|
|
|
|
|
|
(defn sign-message [rpcParams callback]
|
|
|
|
(native-module/sign-message rpcParams callback))
|
|
|
|
|
2019-07-19 14:11:10 +00:00
|
|
|
(defn sign-typed-data [data account password callback]
|
|
|
|
(native-module/sign-typed-data data account password callback))
|
2019-03-05 14:44:50 +00:00
|
|
|
|
2018-08-10 17:15:16 +00:00
|
|
|
(defn send-transaction [rpcParams password callback]
|
|
|
|
(native-module/send-transaction rpcParams password callback))
|
2018-04-18 08:49:15 +00:00
|
|
|
|
2019-02-28 15:09:21 +00:00
|
|
|
(defn hash-transaction [rpcParams callback]
|
|
|
|
(native-module/hash-transaction rpcParams callback))
|
|
|
|
|
2019-04-03 08:46:53 +00:00
|
|
|
(defn hash-message [message callback]
|
|
|
|
(native-module/hash-message message callback))
|
|
|
|
|
|
|
|
(defn hash-typed-data [data callback]
|
|
|
|
(native-module/hash-typed-data data callback))
|
|
|
|
|
2019-02-28 15:09:21 +00:00
|
|
|
(defn send-transaction-with-signature [rpcParams sig callback]
|
|
|
|
(native-module/send-transaction-with-signature rpcParams sig callback))
|
|
|
|
|
2019-01-17 22:46:48 +00:00
|
|
|
(defn send-data-notification [m callback]
|
|
|
|
(native-module/send-data-notification m callback))
|
2017-10-05 11:23:25 +00:00
|
|
|
|
2019-04-30 11:49:45 +00:00
|
|
|
(defn send-logs [dbJson js-logs callback]
|
|
|
|
(native-module/send-logs dbJson js-logs callback))
|
2018-12-15 18:57:00 +00:00
|
|
|
|
2017-12-05 10:18:30 +00:00
|
|
|
(defn add-peer [enode callback]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/add-peer enode callback))
|
2017-12-05 10:18:30 +00:00
|
|
|
|
2017-10-05 11:23:25 +00:00
|
|
|
(defn close-application []
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/close-application))
|
2018-02-26 02:27:29 +00:00
|
|
|
|
|
|
|
(defn connection-change [data]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/connection-change data))
|
2018-03-16 12:01:10 +00:00
|
|
|
|
|
|
|
(defn app-state-change [state]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/app-state-change state))
|
2018-05-01 10:27:04 +00:00
|
|
|
|
|
|
|
(defn get-device-UUID [callback]
|
2018-07-30 03:47:08 +00:00
|
|
|
(native-module/get-device-UUID callback))
|
2018-08-03 16:43:37 +00:00
|
|
|
|
2019-05-08 12:26:39 +00:00
|
|
|
(defn set-blank-preview-flag [flag]
|
|
|
|
(native-module/set-blank-preview-flag flag))
|
|
|
|
|
2018-08-03 16:43:37 +00:00
|
|
|
(defn is24Hour []
|
|
|
|
(native-module/is24Hour))
|
2018-07-19 15:51:06 +00:00
|
|
|
|
2019-05-30 14:01:20 +00:00
|
|
|
(defn get-device-model-info []
|
|
|
|
(native-module/get-device-model-info))
|
|
|
|
|
2018-10-01 08:47:20 +00:00
|
|
|
(def extract-group-membership-signatures native-module/extract-group-membership-signatures)
|
2018-07-19 15:51:06 +00:00
|
|
|
|
|
|
|
(def sign-group-membership native-module/sign-group-membership)
|
2018-11-02 13:48:45 +00:00
|
|
|
|
Add mailservers confirmations & use peer count for online status
We now check that we are only connected to some `peers` instead of using `NetInfo` from `react-native`.
This is because it has been reported to be quite flaky at times, not reporting online status after sleeping, and for privacy concerns (on ios it pings `apple.com`, on desktop `google.com`).
Adds a new banner `Wallet Offline` and change `Connecting to peers` to `Chat offline`.
A message will be marked as `Sent` only if it made it to the mailserver you are connected to, which will increase the guarantees that we can make about a message (if you see it as sent, it has reached at least a mailserver), this has the consequence that:
- If you are not connected to any mailserver or the mailserver is non responsive/down, and you send a message, it will be marked as `Not sent`, although it might have been actually made it in the network.
Probably this is something that we would like to communicate to the user through UX (i.e. tick if made it to at least a peer, double tick if it made to a mailserver )
Currently I have only enabled this feature in nightlies & devs, I would give it a run and see how we feel about it.
2018-12-06 10:53:45 +00:00
|
|
|
(def update-mailservers native-module/update-mailservers)
|
2018-11-06 12:19:11 +00:00
|
|
|
|
|
|
|
(def rooted-device? native-module/rooted-device?)
|
2019-03-22 13:57:27 +00:00
|
|
|
|
|
|
|
(def chaos-mode-update native-module/chaos-mode-update)
|
2019-03-29 18:00:12 +00:00
|
|
|
|
|
|
|
(def get-nodes-from-contract native-module/get-nodes-from-contract)
|