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

135 lines
4.2 KiB
Plaintext
Raw Normal View History

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)
(defn init-keystore []
(native-module/init-keystore))
(defn start-node [config]
(native-module/start-node config))
(def node-started (atom false))
(defn node-ready []
(reset! node-started true)
(native-module/node-ready))
(defn stop-node []
(reset! node-started false)
2018-07-30 03:47:08 +00:00
(native-module/stop-node))
2017-09-05 14:14:45 +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
(defn multiaccount-store-account [account-id password callback]
(native-module/multiaccount-store-account account-id password callback))
(defn multiaccount-load-account [address password callback]
(native-module/multiaccount-load-account address password callback))
(defn multiaccount-reset [callback]
(native-module/multiaccount-reset callback))
(defn multiaccount-derive-addresses [account-id paths callback]
(native-module/multiaccount-derive-addresses account-id paths callback))
(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-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))
(defn multiaccount-import-mnemonic [mnemonic password callback]
(native-module/multiaccount-import-mnemonic mnemonic password callback))
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
(defn verify [address password callback]
(native-module/verify address password callback))
(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
(defn call-rpc [payload callback]
(when @node-started
(native-module/call-rpc payload callback)))
2017-09-05 14:14:45 +00:00
(defn call-private-rpc [payload callback]
(when @node-started
(native-module/call-private-rpc payload callback)))
(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))
(defn send-transaction [rpcParams password callback]
(native-module/send-transaction rpcParams password callback))
(defn hash-transaction [rpcParams callback]
(native-module/hash-transaction rpcParams callback))
(defn hash-message [message callback]
(native-module/hash-message message callback))
(defn hash-typed-data [data callback]
(native-module/hash-typed-data data callback))
(defn send-transaction-with-signature [rpcParams sig callback]
(native-module/send-transaction-with-signature rpcParams sig callback))
(defn send-data-notification [m callback]
(native-module/send-data-notification m callback))
2019-04-30 11:49:45 +00:00
(defn send-logs [dbJson js-logs callback]
(native-module/send-logs dbJson js-logs callback))
(defn add-peer [enode callback]
2018-07-30 03:47:08 +00:00
(native-module/add-peer enode callback))
(defn close-application []
2018-07-30 03:47:08 +00:00
(native-module/close-application))
(defn connection-change [data]
2018-07-30 03:47:08 +00:00
(native-module/connection-change data))
(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))
(defn set-blank-preview-flag [flag]
(native-module/set-blank-preview-flag flag))
(defn is24Hour []
(native-module/is24Hour))
(defn get-device-model-info []
(native-module/get-device-model-info))
(def extract-group-membership-signatures native-module/extract-group-membership-signatures)
(def sign-group-membership native-module/sign-group-membership)
(def update-mailservers native-module/update-mailservers)
(def rooted-device? native-module/rooted-device?)
(def chaos-mode-update native-module/chaos-mode-update)
(def get-nodes-from-contract native-module/get-nodes-from-contract)