status-react/src/status_im/native_module/core.cljs

84 lines
2.8 KiB
Plaintext
Raw Normal View History

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))
(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))
(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
(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
(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))
(defn notify-users [{:keys [message payload tokens] :as m} callback]
(module-interface/-notify-users rns-module m callback))
(defn add-peer [enode callback]
(module-interface/-add-peer rns-module enode callback))
(defn close-application []
(module-interface/-close-application rns-module))
(defn connection-change [data]
(module-interface/-connection-change rns-module data))
(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))