2017-09-05 14:14:45 +00:00
|
|
|
(ns status-im.native-module.core
|
|
|
|
(:require [status-im.native-module.module :as module-interface]
|
|
|
|
[status-im.native-module.impl.module :as native-module]
|
|
|
|
[status-im.native-module.impl.non-status-go-module :as non-status-go-module]
|
|
|
|
[taoensso.timbre :as log]
|
|
|
|
[status-im.utils.config :as config]))
|
|
|
|
|
|
|
|
(def rns-module
|
|
|
|
(if config/stub-status-go?
|
|
|
|
(non-status-go-module/ReactNativeStatus.)
|
|
|
|
(native-module/ReactNativeStatus.)))
|
|
|
|
|
|
|
|
(def adjust-resize 16)
|
|
|
|
(def adjust-pan 32)
|
|
|
|
|
|
|
|
#_(defn- wrap-and-print-callback [name callback]
|
2018-05-08 08:32:28 +00:00
|
|
|
(fn [& args]
|
|
|
|
(println :callback name (str args))
|
|
|
|
(log/debug :callback name args)
|
|
|
|
(apply callback args)))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
|
|
|
(defn move-to-internal-storage [callback]
|
|
|
|
(module-interface/-move-to-internal-storage rns-module callback))
|
|
|
|
|
2017-08-21 14:49:31 +00:00
|
|
|
(defn start-node [config]
|
|
|
|
(module-interface/-start-node rns-module config))
|
|
|
|
|
|
|
|
(defn stop-node []
|
|
|
|
(module-interface/-stop-node rns-module))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
|
|
|
(defn create-account [password callback]
|
|
|
|
(module-interface/-create-account rns-module password callback))
|
|
|
|
|
|
|
|
(defn recover-account [passphrase password callback]
|
|
|
|
(module-interface/-recover-account rns-module passphrase password callback))
|
|
|
|
|
|
|
|
(defn login [address password callback]
|
|
|
|
(module-interface/-login rns-module address password callback))
|
|
|
|
|
2018-06-03 10:25:14 +00:00
|
|
|
(defn approve-sign-request [id password callback]
|
|
|
|
(module-interface/-approve-sign-request rns-module id password callback))
|
|
|
|
|
|
|
|
(defn approve-sign-request-with-args [id password gas gas-price callback]
|
|
|
|
(module-interface/-approve-sign-request-with-args rns-module id password gas gas-price callback))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2018-04-18 08:49:15 +00:00
|
|
|
(defn discard-sign-request [id]
|
|
|
|
(module-interface/-discard-sign-request rns-module id))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
|
|
|
(defn set-soft-input-mode [mode]
|
|
|
|
(module-interface/-set-soft-input-mode rns-module mode))
|
|
|
|
|
|
|
|
(defn clear-web-data []
|
|
|
|
(module-interface/-clear-web-data rns-module))
|
|
|
|
|
2017-12-04 15:05:15 +00:00
|
|
|
(defn call-web3 [payload callback]
|
|
|
|
(module-interface/-call-web3 rns-module payload callback))
|
2017-09-05 14:14:45 +00:00
|
|
|
|
2018-04-18 08:49:15 +00:00
|
|
|
(defn call-web3-private [payload callback]
|
|
|
|
(module-interface/-call-web3-private rns-module payload callback))
|
|
|
|
|
2017-09-05 14:14:45 +00:00
|
|
|
(defn module-initialized! []
|
|
|
|
(module-interface/-module-initialized! rns-module))
|
|
|
|
|
|
|
|
(defn should-move-to-internal-storage? [callback]
|
|
|
|
(module-interface/-should-move-to-internal-storage? rns-module callback))
|
2017-09-18 14:21:11 +00:00
|
|
|
|
2018-01-04 10:50:14 +00:00
|
|
|
(defn notify-users [{:keys [message payload tokens] :as m} callback]
|
|
|
|
(module-interface/-notify-users rns-module m callback))
|
2017-10-05 11:23:25 +00:00
|
|
|
|
2017-12-05 10:18:30 +00:00
|
|
|
(defn add-peer [enode callback]
|
|
|
|
(module-interface/-add-peer rns-module enode callback))
|
|
|
|
|
2017-10-05 11:23:25 +00:00
|
|
|
(defn close-application []
|
|
|
|
(module-interface/-close-application rns-module))
|
2018-02-26 02:27:29 +00:00
|
|
|
|
|
|
|
(defn connection-change [data]
|
|
|
|
(module-interface/-connection-change rns-module data))
|
2018-03-16 12:01:10 +00:00
|
|
|
|
|
|
|
(defn app-state-change [state]
|
|
|
|
(module-interface/-app-state-change rns-module state))
|
2018-05-01 10:27:04 +00:00
|
|
|
|
|
|
|
(defn get-device-UUID [callback]
|
|
|
|
(module-interface/-get-device-UUID rns-module callback))
|