reformat status-im.data-store.* namespaces

reformat status-im.utils.* namespaces
This commit is contained in:
Roman Volosovskyi 2018-05-07 17:09:06 +03:00
parent dc4e1569cf
commit 6c620728da
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
33 changed files with 783 additions and 790 deletions

View File

@ -9,16 +9,16 @@
(data-store/get-by-address address))
(re-frame/reg-cofx
:data-store/get-all-accounts
(fn [coeffects _]
(assoc coeffects :all-accounts (data-store/get-all-as-list))))
:data-store/get-all-accounts
(fn [coeffects _]
(assoc coeffects :all-accounts (data-store/get-all-as-list))))
(re-frame/reg-fx
:data-store/save-account
(fn [{:keys [after-update-event] :as account}]
(let [account-to-save (dissoc account :after-update-event)]
(async/go (async/>! core/realm-queue #(if after-update-event
(do (data-store/save account-to-save true)
(re-frame/dispatch after-update-event))
(data-store/save account-to-save true)))))))
:data-store/save-account
(fn [{:keys [after-update-event] :as account}]
(let [account-to-save (dissoc account :after-update-event)]
(async/go (async/>! core/realm-queue #(if after-update-event
(do (data-store/save account-to-save true)
(re-frame/dispatch after-update-event))
(data-store/save account-to-save true)))))))

View File

@ -6,16 +6,16 @@
(:refer-clojure :exclude [exists?]))
(re-frame/reg-cofx
:data-store/all-browsers
(fn [cofx _]
(assoc cofx :all-stored-browsers (data-store/get-all))))
:data-store/all-browsers
(fn [cofx _]
(assoc cofx :all-stored-browsers (data-store/get-all))))
(re-frame/reg-fx
:data-store/save-browser
(fn [{:keys [browser-id] :as browser}]
(async/go (async/>! core/realm-queue #(data-store/save browser (data-store/exists? browser-id))))))
:data-store/save-browser
(fn [{:keys [browser-id] :as browser}]
(async/go (async/>! core/realm-queue #(data-store/save browser (data-store/exists? browser-id))))))
(re-frame/reg-fx
:data-store/remove-browser
(fn [browser-id]
(async/go (async/>! core/realm-queue #(data-store/delete browser-id)))))
:data-store/remove-browser
(fn [browser-id]
(async/go (async/>! core/realm-queue #(data-store/delete browser-id)))))

View File

@ -6,37 +6,37 @@
(:refer-clojure :exclude [exists?]))
(re-frame/reg-cofx
:data-store/all-chats
(fn [cofx _]
(assoc cofx :all-stored-chats (data-store/get-all))))
:data-store/all-chats
(fn [cofx _]
(assoc cofx :all-stored-chats (data-store/get-all))))
(re-frame/reg-fx
:data-store/save-chat
(fn [{:keys [chat-id] :as chat}]
(async/go (async/>! core/realm-queue #(data-store/save chat (data-store/exists? chat-id))))))
:data-store/save-chat
(fn [{:keys [chat-id] :as chat}]
(async/go (async/>! core/realm-queue #(data-store/save chat (data-store/exists? chat-id))))))
; Only used in debug mode
(re-frame/reg-fx
:data-store/delete-chat
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete chat-id)))))
:data-store/delete-chat
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete chat-id)))))
(re-frame/reg-fx
:data-store/deactivate-chat
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/set-inactive chat-id)))))
:data-store/deactivate-chat
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/set-inactive chat-id)))))
(re-frame/reg-fx
:data-store/add-chat-contacts
(fn [[chat-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/add-contacts chat-id contacts)))))
:data-store/add-chat-contacts
(fn [[chat-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/add-contacts chat-id contacts)))))
(re-frame/reg-fx
:data-store/remove-chat-contacts
(fn [[chat-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/remove-contacts chat-id contacts)))))
:data-store/remove-chat-contacts
(fn [[chat-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/remove-contacts chat-id contacts)))))
(re-frame/reg-fx
:data-store/save-chat-property
(fn [[chat-id prop value]]
(async/go (async/>! core/realm-queue #(data-store/save-property chat-id prop value)))))
:data-store/save-chat-property
(fn [[chat-id prop value]]
(async/go (async/>! core/realm-queue #(data-store/save-property chat-id prop value)))))

View File

@ -6,29 +6,29 @@
(:refer-clojure :exclude [exists?]))
(re-frame/reg-cofx
:data-store/get-all-contact-groups
(fn [cofx _]
(assoc cofx :all-contact-groups (into {}
(map (juxt :group-id identity))
(data-store/get-all-as-list)))))
:data-store/get-all-contact-groups
(fn [cofx _]
(assoc cofx :all-contact-groups (into {}
(map (juxt :group-id identity))
(data-store/get-all-as-list)))))
(re-frame/reg-fx
:data-store/save-contact-group
(fn [{:keys [group-id] :as group}]
(async/go (async/>! core/realm-queue #(data-store/save group (data-store/exists? group-id))))))
:data-store/save-contact-group
(fn [{:keys [group-id] :as group}]
(async/go (async/>! core/realm-queue #(data-store/save group (data-store/exists? group-id))))))
(re-frame/reg-fx
:data-store/save-contact-groups
(fn [groups]
(doseq [{:keys [group-id] :as group} groups]
(async/go (async/>! core/realm-queue #(data-store/save group (data-store/exists? group-id)))))))
:data-store/save-contact-groups
(fn [groups]
(doseq [{:keys [group-id] :as group} groups]
(async/go (async/>! core/realm-queue #(data-store/save group (data-store/exists? group-id)))))))
(re-frame/reg-fx
:data-store/save-contact-group-property
(fn [[group-id property-name value]]
(async/go (async/>! core/realm-queue #(data-store/save-property group-id property-name value)))))
:data-store/save-contact-group-property
(fn [[group-id property-name value]]
(async/go (async/>! core/realm-queue #(data-store/save-property group-id property-name value)))))
(re-frame/reg-fx
:data-store/add-contacts-to-contact-group
(fn [[group-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/add-contacts group-id contacts)))))
:data-store/add-contacts-to-contact-group
(fn [[group-id contacts]]
(async/go (async/>! core/realm-queue #(data-store/add-contacts group-id contacts)))))

View File

@ -6,9 +6,9 @@
(:refer-clojure :exclude [exists?]))
(re-frame/reg-cofx
:data-store/get-all-contacts
(fn [coeffects _]
(assoc coeffects :all-contacts (data-store/get-all-as-list))))
:data-store/get-all-contacts
(fn [coeffects _]
(assoc coeffects :all-contacts (data-store/get-all-as-list))))
(defn- get-by-id
[whisper-identity]
@ -26,17 +26,17 @@
(data-store/save contact' (boolean contact-db))))
(re-frame/reg-fx
:data-store/save-contact
(fn [contact]
(async/go (async/>! core/realm-queue #(save contact)))))
:data-store/save-contact
(fn [contact]
(async/go (async/>! core/realm-queue #(save contact)))))
(re-frame/reg-fx
:data-store/save-contacts
(fn [contacts]
(doseq [contact contacts]
(async/go (async/>! core/realm-queue #(save contact))))))
:data-store/save-contacts
(fn [contacts]
(doseq [contact contacts]
(async/go (async/>! core/realm-queue #(save contact))))))
(re-frame/reg-fx
:data-store/delete-contact
(fn [contact]
(async/go (async/>! core/realm-queue #(data-store/delete contact)))))
:data-store/delete-contact
(fn [contact]
(async/go (async/>! core/realm-queue #(data-store/delete contact)))))

View File

@ -5,11 +5,11 @@
[status-im.data-store.realm.local-storage :as data-store]))
(re-frame/reg-cofx
:data-store/get-local-storage-data
(fn [cofx _]
(assoc cofx :get-local-storage-data (comp :data data-store/get-by-chat-id))))
:data-store/get-local-storage-data
(fn [cofx _]
(assoc cofx :get-local-storage-data (comp :data data-store/get-by-chat-id))))
(re-frame/reg-fx
:data-store/set-local-storage-data
(fn [data]
(async/go (async/>! core/realm-queue #(data-store/save data)))))
:data-store/set-local-storage-data
(fn [data]
(async/go (async/>! core/realm-queue #(data-store/save data)))))

View File

@ -27,9 +27,9 @@
:to nil})
(re-frame/reg-cofx
:data-store/get-message
(fn [cofx _]
(assoc cofx :get-stored-message data-store/get-by-id)))
:data-store/get-message
(fn [cofx _]
(assoc cofx :get-stored-message data-store/get-by-id)))
(defn get-by-chat-id
([chat-id]
@ -42,24 +42,24 @@
message))))))
(re-frame/reg-cofx
:data-store/get-messages
(fn [cofx _]
(assoc cofx :get-stored-messages get-by-chat-id)))
:data-store/get-messages
(fn [cofx _]
(assoc cofx :get-stored-messages get-by-chat-id)))
(re-frame/reg-cofx
:data-store/message-ids
(fn [cofx _]
(assoc cofx :stored-message-ids (data-store/get-stored-message-ids))))
:data-store/message-ids
(fn [cofx _]
(assoc cofx :stored-message-ids (data-store/get-stored-message-ids))))
(re-frame/reg-cofx
:data-store/unviewed-messages
(fn [{:keys [db] :as cofx} _]
(assoc cofx
:stored-unviewed-messages
(into {}
(map (fn [[chat-id user-statuses]]
[chat-id (into #{} (map :message-id) user-statuses)]))
(group-by :chat-id (data-store/get-unviewed (:current-public-key db)))))))
:data-store/unviewed-messages
(fn [{:keys [db] :as cofx} _]
(assoc cofx
:stored-unviewed-messages
(into {}
(map (fn [[chat-id user-statuses]]
[chat-id (into #{} (map :message-id) user-statuses)]))
(group-by :chat-id (data-store/get-unviewed (:current-public-key db)))))))
(defn- prepare-content [content]
(if (string? content)
@ -97,14 +97,14 @@
(data-store/delete message-id)))
(re-frame/reg-fx
:data-store/save-message
(fn [message]
(async/go (async/>! core/realm-queue #(save message)))))
:data-store/save-message
(fn [message]
(async/go (async/>! core/realm-queue #(save message)))))
(re-frame/reg-fx
:data-store/delete-message
(fn [message-id]
(async/go (async/>! core/realm-queue #(delete message-id)))))
:data-store/delete-message
(fn [message-id]
(async/go (async/>! core/realm-queue #(delete message-id)))))
(defn update-message
[{:keys [message-id] :as message}]
@ -112,24 +112,24 @@
(data-store/save (prepare-message (assoc message :chat-id chat-id)))))
(re-frame/reg-fx
:data-store/update-message
(fn [message]
(async/go (async/>! core/realm-queue #(update-message message)))))
:data-store/update-message
(fn [message]
(async/go (async/>! core/realm-queue #(update-message message)))))
(re-frame/reg-fx
:data-store/update-messages
(fn [messages]
(doseq [message messages]
(async/go (async/>! core/realm-queue #(update-message message))))))
:data-store/update-messages
(fn [messages]
(doseq [message messages]
(async/go (async/>! core/realm-queue #(update-message message))))))
(re-frame/reg-fx
:data-store/delete-messages
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete-by-chat-id chat-id)))))
:data-store/delete-messages
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete-by-chat-id chat-id)))))
(re-frame/reg-fx
:data-store/hide-messages
(fn [chat-id]
(async/go (async/>! core/realm-queue #(doseq [message-id (data-store/get-message-ids-by-chat-id chat-id)]
(data-store/save {:message-id message-id
:show? false}))))))
:data-store/hide-messages
(fn [chat-id]
(async/go (async/>! core/realm-queue #(doseq [message-id (data-store/get-message-ids-by-chat-id chat-id)]
(data-store/save {:message-id message-id
:show? false}))))))

View File

@ -5,7 +5,6 @@
(->> (realm/all-clj (realm/get-all @realm/base-realm :account) :account)
(mapv #(update % :settings realm/deserialize))))
(defn get-by-address [address]
(-> @realm/base-realm
(realm/get-by-field :account :address address)

View File

@ -7,7 +7,7 @@
(:refer-clojure :exclude [exists?]))
(defn- normalize-chat [{:keys [chat-id] :as chat}]
(let [last-clock-value (messages/get-last-clock-value chat-id)]
(let [last-clock-value (messages/get-last-clock-value chat-id)]
(assoc chat :last-clock-value (or last-clock-value 0))))
(defn get-all

View File

@ -22,19 +22,19 @@
(defn realm-version
[file-name encryption-key]
(if encryption-key
(.schemaVersion rn-dependencies/realm file-name (to-buffer encryption-key))
(.schemaVersion rn-dependencies/realm file-name)))
(if encryption-key
(.schemaVersion rn-dependencies/realm file-name (to-buffer encryption-key))
(.schemaVersion rn-dependencies/realm file-name)))
(defn open-realm
[options file-name encryption-key]
(log/debug "Opening realm at " file-name "...")
(let [options-js (clj->js (assoc options :path file-name))]
(when encryption-key
(log/debug "Using encryption key...")
(set! (.-encryptionKey options-js) (to-buffer encryption-key)))
(when (cljs.core/exists? js/window)
(rn-dependencies/realm. options-js))))
(log/debug "Opening realm at " file-name "...")
(let [options-js (clj->js (assoc options :path file-name))]
(when encryption-key
(log/debug "Using encryption key...")
(set! (.-encryptionKey options-js) (to-buffer encryption-key)))
(when (cljs.core/exists? js/window)
(rn-dependencies/realm. options-js))))
(defn- delete-realm
[file-name]

View File

@ -6,7 +6,7 @@
:properties {:group-id :string
:name :string
:timestamp :int
:order :int
:order :int
:contacts {:type "string[]"}}})
(defn migration [old-realm new-realm]

View File

@ -5,16 +5,16 @@
[status-im.data-store.realm.requests :as data-store]))
(re-frame/reg-cofx
:data-store/get-unanswered-requests
(fn [cofx _]
(assoc cofx :stored-unanswered-requests (data-store/get-all-unanswered))))
:data-store/get-unanswered-requests
(fn [cofx _]
(assoc cofx :stored-unanswered-requests (data-store/get-all-unanswered))))
(re-frame/reg-fx
:data-store/save-request
(fn [request]
(async/go (async/>! core/realm-queue #(data-store/save request)))))
:data-store/save-request
(fn [request]
(async/go (async/>! core/realm-queue #(data-store/save request)))))
(re-frame/reg-fx
:data-store/mark-request-as-answered
(fn [{:keys [chat-id message-id]}]
(async/go (async/>! core/realm-queue #(data-store/mark-as-answered chat-id message-id)))))
:data-store/mark-request-as-answered
(fn [{:keys [chat-id message-id]}]
(async/go (async/>! core/realm-queue #(data-store/mark-as-answered chat-id message-id)))))

View File

@ -5,7 +5,6 @@
[status-im.data-store.realm.transport :as data-store]
[status-im.data-store.realm.core :as core]))
(defn deserialize-chat [serialized-chat]
(-> serialized-chat
(dissoc :chat-id)
@ -15,14 +14,14 @@
(update :pending-send edn/read-string)))
(re-frame/reg-cofx
:data-store/transport
(fn [cofx _]
(assoc cofx
:data-store/transport
(reduce (fn [acc {:keys [chat-id] :as chat}]
(assoc acc chat-id (deserialize-chat chat)))
{}
(data-store/get-all)))))
:data-store/transport
(fn [cofx _]
(assoc cofx
:data-store/transport
(reduce (fn [acc {:keys [chat-id] :as chat}]
(assoc acc chat-id (deserialize-chat chat)))
{}
(data-store/get-all)))))
(defn save [chat-id chat]
(let [serialized-chat (-> chat
@ -34,11 +33,11 @@
(data-store/save serialized-chat)))
(re-frame/reg-fx
:data-store.transport/save
(fn [{:keys [chat-id chat]}]
(async/go (async/>! core/realm-queue #(save chat-id chat)))))
:data-store.transport/save
(fn [{:keys [chat-id chat]}]
(async/go (async/>! core/realm-queue #(save chat-id chat)))))
(re-frame/reg-fx
:data-store.transport/delete
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete chat-id)))))
:data-store.transport/delete
(fn [chat-id]
(async/go (async/>! core/realm-queue #(data-store/delete chat-id)))))

View File

@ -13,12 +13,12 @@
(defn valid-length? [identity]
(let [length (count identity)]
(and
(hex-string? identity)
(or
(and (= 128 length) (not (string/includes? identity "0x")))
(and (= 130 length) (string/starts-with? identity "0x"))
(and (= 132 length) (string/starts-with? identity "0x04"))
(ethereum/address? identity)))))
(hex-string? identity)
(or
(and (= 128 length) (not (string/includes? identity "0x")))
(and (= 130 length) (string/starts-with? identity "0x"))
(and (= 132 length) (string/starts-with? identity "0x04"))
(ethereum/address? identity)))))
(spec/def :global/not-empty-string (spec/and string? not-empty))
(spec/def :global/public-key (spec/and :global/not-empty-string valid-length?))

View File

@ -50,8 +50,8 @@
(reset! !error-handler-set? true)
(let [orig-handler (some-> js/ErrorUtils .-getGlobalHandler (.call))]
(js/ErrorUtils.setGlobalHandler
(fn [e isFatal]
(handle-error e isFatal)
(if js/goog.DEBUG
(some-> orig-handler (.call nil e isFatal))
(utils/show-popup "Error" (.-message e))))))))
(fn [e isFatal]
(handle-error e isFatal)
(if js/goog.DEBUG
(some-> orig-handler (.call nil e isFatal))
(utils/show-popup "Error" (.-message e))))))))

View File

@ -39,10 +39,10 @@
(defn transfer [web3 contract from address value params cb]
(ethereum/send-transaction web3
(merge (ethereum/call-params contract "transfer(address,uint256)" (ethereum/normalized-address address) (ethereum/int->hex value))
{:from from}
params)
#(cb %1 (ethereum/hex->boolean %2))))
(merge (ethereum/call-params contract "transfer(address,uint256)" (ethereum/normalized-address address) (ethereum/int->hex value))
{:from from}
params)
#(cb %1 (ethereum/hex->boolean %2))))
(defn transfer-from [web3 contract from-address to-address value cb]
(ethereum/call web3

View File

@ -22,388 +22,388 @@
(def all
{:mainnet
(resolve-icons :mainnet
[{:symbol :EOS
:name "EOS"
:address "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0"
:decimals 18}
{:symbol :OMG
:name "OmiseGo"
:address "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
:decimals 18}
{:symbol :PPT
:name "Populous"
:address "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a"
:decimals 18}
{:symbol :REP
:name "Augur"
:address "0xe94327d07fc17907b4db788e5adf2ed424addff6"
:decimals 18}
{:symbol :POWR
:name "PowerLedger"
:address "0x595832f8fc6bf59c85c527fec3740a1b7a361269"
:decimals 18}
{:symbol :PAY
:name "TenXPay"
:address "0xB97048628DB6B661D4C2aA833e95Dbe1A905B280"
:decimals 18}
{:symbol :VERI
:name "Veros"
:address "0xedbaf3c5100302dcdda53269322f3730b1f0416d"
:decimals 18}
{:symbol :GNT
:name "Golem Network Token"
:address "0xa74476443119A942dE498590Fe1f2454d7D4aC0d"
:decimals 18}
{:symbol :SALT
:name "Salt"
:address "0x4156D3342D5c385a87D264F90653733592000581"
:decimals 8}
{:symbol :BNB
:name "BNB"
:address "0xB8c77482e45F1F44dE1745F52C74426C631bDD52"
:decimals 18}
{:symbol :BAT
:name "Basic Attention Token"
:address "0x0d8775f648430679a709e98d2b0cb6250d2887ef"
:decimals 18}
{:symbol :KNC
:name "Kyber Network Crystal"
:address "0xdd974d5c2e2928dea5f71b9825b8b646686bd200"
:decimals 18}
{:symbol :DGD
:name "DGD"
:address "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"
:decimals 9}
{:symbol :AE
:name "Aeternity"
:address "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d"
:decimals 18}
{:symbol :TRX
:name "Tronix"
:address "0xf230b790e05390fc8295f4d3f60332c93bed42e2"
:decimals 6}
{:symbol :ETHOS
:name "Ethos"
:address "0x5af2be193a6abca9c8817001f45744777db30756"
:decimals 8}
{:symbol :RDN
:name "Raiden Token"
:address "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6"
:decimals 18}
{:symbol :SNT
:name "Status Network Token"
:address "0x744d70fdbe2ba4cf95131626614a1763df805b9e"
:decimals 18}
{:symbol :SNGLS
:name "SingularDTV"
:address "0xaec2e87e0a235266d9c5adc9deb4b2e29b54d009"
:decimals 0}
{:symbol :GNO
:name "Gnosis Token"
:address "0x6810e776880c02933d47db1b9fc05908e5386b96"
:decimals 18}
{:symbol :ATMChain
:name "Attention Token of Media"
:address "0x9B11EFcAAA1890f6eE52C6bB7CF8153aC5d74139"
:decimals 8}
{:symbol :STORJ
:name "StorjToken"
:address "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac"
:decimals 8}
{:symbol :ADX
:name "AdEx"
:address "0x4470bb87d77b963a013db939be332f927f2b992e"
:decimals 4}
{:symbol :FUN
:name "FunFair"
:address "0x419d0d8bdd9af5e606ae2232ed285aff190e711b"
:decimals 8}
{:symbol :CVC
:name "Civic"
:address "0x41e5560054824ea6b0732e656e3ad64e20e94e45"
:decimals 8}
{:symbol :ICN
:name "ICONOMI"
:address "0x888666CA69E0f178DED6D75b5726Cee99A87D698"
:decimals 18}
{:symbol :WTC
:name "Walton Token"
:address "0xb7cb1c96db6b22b0d3d9536e0108d062bd488f74"
:decimals 18}
{:symbol :BTM
:name "Bytom"
:address "0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750"
:decimals 8}
{:symbol :ZRX
:name "0x Protocol Token"
:address "0xe41d2489571d322189246dafa5ebde1f4699f498"
:decimals 18}
{:symbol :BNT
:name "Bancor Network Token"
:address "0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c"
:decimals 18}
{:symbol :MTL
:name "Metal"
:address "0xF433089366899D83a9f26A773D59ec7eCF30355e"
:decimals 8}
{:symbol :PPP
:name "PayPie"
:address "0xc42209aCcC14029c1012fB5680D95fBd6036E2a0"
:decimals 18}
{:symbol :LINK
:name "ChainLink Token"
:address "0x514910771af9ca656af840dff83e8264ecf986ca"
:decimals 18}
{:symbol :KIN
:name "Kin"
:address "0x818fc6c2ec5986bc6e2cbf00939d90556ab12ce5"
:decimals 18}
{:symbol :ANT
:name "Aragon Network Token"
:address "0x960b236A07cf122663c4303350609A66A7B288C0"
:decimals 18}
{:symbol :MGO
:name "MobileGo Token"
:address "0x40395044Ac3c0C57051906dA938B54BD6557F212"
:decimals 8}
{:symbol :MCO
:name "Monaco"
:address "0xb63b606ac810a52cca15e44bb630fd42d8d1d83d"
:decimals 8}
{:symbol :LRC
:name "LoopringCoin"
:address "0xEF68e7C694F40c8202821eDF525dE3782458639f"
:decimals 18}
{:symbol :ZSC
:name "Zeus Shield Token"
:address "0x7A41e0517a5ecA4FdbC7FbebA4D4c47B9fF6DC63"
:decimals 18}
{:symbol :DATA
:name "Streamr DATAcoin"
:address "0x0cf0ee63788a0849fe5297f3407f701e122cc023"
:decimals 18}
{:symbol :RCN
:name "Ripio Credit Network Token"
:address "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6"
:decimals 9}
{:symbol :WINGS
:name "WINGS"
:address "0x667088b212ce3d06a1b553a7221E1fD19000d9aF"
:decimals 18}
{:symbol :EDG
:name "Edgeless"
:address "0x08711d3b02c8758f2fb3ab4e80228418a7f8e39c"
:decimals 0}
{:symbol :MLN
:name "Melon Token"
:address "0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1"
:decimals 18}
{:symbol :MDA
:name "Moeda Loyalty Points"
:address "0x51db5ad35c671a87207d88fc11d593ac0c8415bd"
:decimals 18}
{:symbol :PLR
:name "PILLAR"
:address "0xe3818504c1b32bf1557b16c238b2e01fd3149c17"
:decimals 18}
{:symbol :Centra
:name "Centra Token"
:address "0x96A65609a7B84E8842732DEB08f56C3E21aC6f8a"
:decimals 18}
{:symbol :QRL
:name "QRL"
:address "0x697beac28b09e122c4332d163985e8a73121b97f"
:decimals 8}
{:symbol :MOD
:name "Modum Token"
:address "0x957c30ab0426e0c93cd8241e2c60392d08c6ac8e"
:decimals 0}
{:symbol :TAAS
:name "Token-as-a-Service"
:address "0xe7775a6e9bcf904eb39da2b68c5efb4f9360e08c"
:decimals 6}
{:symbol :GRID
:name "GRID+ Token"
:address "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd"
:decimals 12}
{:symbol :SAN
:name "SANtiment network token"
:address "0x7c5a0ce9267ed19b22f8cae653f198e3e8daf098"
:decimals 18}
{:symbol :SNM
:name "SONM Token"
:address "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63"
:decimals 18}
{:symbol :REQ
:name "Request Token"
:address "0x8f8221afbb33998d8584a2b05749ba73c37a938a"
:decimals 18}
{:symbol :SUB
:name "Substratum"
:address "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a"
:decimals 2}
{:symbol :MANA
:name "Decentraland MANA"
:address "0x0f5d2fb29fb7d3cfee444a200298f468908cc942"
:decimals 18}
{:symbol :AST
:name "AirSwap Token"
:address "0x27054b13b1b798b345b591a4d22e6562d47ea75a"
:decimals 4}
{:symbol :R
:name "R Token"
:address "0x48f775efbe4f5ece6e0df2f7b5932df56823b990"
:decimals 0}
{:symbol :1ST
:name "FirstBlood Token"
:address "0xaf30d2a7e90d7dc361c8c4585e9bb7d2f6f15bc7"
:decimals 18}
{:symbol :CFI
:name "Cofoundit"
:address "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e"
:decimals 2}
{:symbol :ENG
:name "Enigma"
:address "0xf0ee6b27b759c9893ce4f094b49ad28fd15a23e4"
:decimals 8}
{:symbol :AMB
:name "Amber Token"
:address "0x4dc3643dbc642b72c158e7f3d2ff232df61cb6ce"
:decimals 18}
{:symbol :XPA
:name "XPlay Token"
:address "0x90528aeb3a2b736b780fd1b6c478bb7e1d643170"
:decimals 18}
{:symbol :OTN
:name "Open Trading Network"
:address "0x881ef48211982d01e2cb7092c915e647cd40d85c"
:decimals 18}
{:symbol :TRST
:name "Trustcoin"
:address "0xcb94be6f13a1182e4a4b6140cb7bf2025d28e41b"
:decimals 6}
{:symbol :TKN
:name "Monolith TKN"
:address "0xaaaf91d9b90df800df4f55c205fd6989c977e73a"
:decimals 8}
{:symbol :RHOC
:name "RHOC"
:address "0x168296bb09e24a88805cb9c33356536b980d3fc5"
:decimals 8}
{:symbol :TGT
:name "Target Coin"
:address "0xac3da587eac229c9896d919abc235ca4fd7f72c1"
:decimals 0}
{:symbol :EVX
:name "Everex"
:address "0xf3db5fa2c66b7af3eb0c0b782510816cbe4813b8"
:decimals 4}
{:symbol :ICOS
:name "ICOS"
:address "0x014b50466590340d41307cc54dcee990c8d58aa8"
:decimals 6}
{:symbol :DNT
:name "district0x Network Token"
:address "0x0abdace70d3790235af448c88547603b945604ea"
:decimals 18}
{:symbol :DCN
:name "Dentacoin"
:address "0x08d32b0da63e2C3bcF8019c9c5d849d7a9d791e6"
:decimals 0}
{:symbol :EDO
:name "Eidoo Token"
:address "0xced4e93198734ddaff8492d525bd258d49eb388e"
:decimals 18}
{:symbol :CSNO
:name "BitDice"
:address "0x29d75277ac7f0335b2165d0895e8725cbf658d73"
:decimals 8}
{:symbol :COB
:name "Cobinhood Token"
:address "0xb2f7eb1f2c37645be61d73953035360e768d81e6"
:decimals 18}
{:symbol :ENJ
:name "Enjin Coin"
:address "0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c"
:decimals 18}
{:symbol :AVT
:name "AVT"
:address "0x0d88ed6e74bbfd96b831231638b66c05571e824f"
:decimals 18}
{:symbol :TIME
:name "TIME"
:address "0x6531f133e6deebe7f2dce5a0441aa7ef330b4e53"
:decimals 18}
{:symbol :CND
:name "Cindicator Token"
:address "0xd4c435f5b09f855c3317c8524cb1f586e42795fa"
:decimals 18}
{:symbol :STX
:name "STOX"
:address "0x006BeA43Baa3f7A6f765F14f10A1a1b08334EF45"
:decimals 18}
{:symbol :XAUR
:name "Xaurum"
:address "0x4DF812F6064def1e5e029f1ca858777CC98D2D81"
:decimals 8}
{:symbol :VIB
:name "Vibe"
:address "0x2c974b2d0ba1716e644c1fc59982a89ddd2ff724"
:decimals 18}
{:symbol :PRG
:name "PRG"
:address "0x7728dFEF5aBd468669EB7f9b48A7f70a501eD29D"
:decimals 6}
{:symbol :DPY
:name "Delphy"
:address "0x6c2adc2073994fb2ccc5032cc2906fa221e9b391"
:decimals 18}
{:symbol :CDT
:name "CoinDash Token"
:address "0x2fe6ab85ebbf7776fee46d191ee4cea322cecf51"
:decimals 18}
{:symbol :TNT
:name "Tierion Network Token"
:address "0x08f5a9235b08173b7569f83645d2c7fb55e8ccd8"
:decimals 8}
{:symbol :DRT
:name "DomRaider Token"
:address "0x9af4f26941677c706cfecf6d3379ff01bb85d5ab"
:decimals 8}
{:symbol :ROL
:name "Dice"
:address "0x2e071D2966Aa7D8dECB1005885bA1977D6038A65"
:decimals 16}])
[{:symbol :EOS
:name "EOS"
:address "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0"
:decimals 18}
{:symbol :OMG
:name "OmiseGo"
:address "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
:decimals 18}
{:symbol :PPT
:name "Populous"
:address "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a"
:decimals 18}
{:symbol :REP
:name "Augur"
:address "0xe94327d07fc17907b4db788e5adf2ed424addff6"
:decimals 18}
{:symbol :POWR
:name "PowerLedger"
:address "0x595832f8fc6bf59c85c527fec3740a1b7a361269"
:decimals 18}
{:symbol :PAY
:name "TenXPay"
:address "0xB97048628DB6B661D4C2aA833e95Dbe1A905B280"
:decimals 18}
{:symbol :VERI
:name "Veros"
:address "0xedbaf3c5100302dcdda53269322f3730b1f0416d"
:decimals 18}
{:symbol :GNT
:name "Golem Network Token"
:address "0xa74476443119A942dE498590Fe1f2454d7D4aC0d"
:decimals 18}
{:symbol :SALT
:name "Salt"
:address "0x4156D3342D5c385a87D264F90653733592000581"
:decimals 8}
{:symbol :BNB
:name "BNB"
:address "0xB8c77482e45F1F44dE1745F52C74426C631bDD52"
:decimals 18}
{:symbol :BAT
:name "Basic Attention Token"
:address "0x0d8775f648430679a709e98d2b0cb6250d2887ef"
:decimals 18}
{:symbol :KNC
:name "Kyber Network Crystal"
:address "0xdd974d5c2e2928dea5f71b9825b8b646686bd200"
:decimals 18}
{:symbol :DGD
:name "DGD"
:address "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"
:decimals 9}
{:symbol :AE
:name "Aeternity"
:address "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d"
:decimals 18}
{:symbol :TRX
:name "Tronix"
:address "0xf230b790e05390fc8295f4d3f60332c93bed42e2"
:decimals 6}
{:symbol :ETHOS
:name "Ethos"
:address "0x5af2be193a6abca9c8817001f45744777db30756"
:decimals 8}
{:symbol :RDN
:name "Raiden Token"
:address "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6"
:decimals 18}
{:symbol :SNT
:name "Status Network Token"
:address "0x744d70fdbe2ba4cf95131626614a1763df805b9e"
:decimals 18}
{:symbol :SNGLS
:name "SingularDTV"
:address "0xaec2e87e0a235266d9c5adc9deb4b2e29b54d009"
:decimals 0}
{:symbol :GNO
:name "Gnosis Token"
:address "0x6810e776880c02933d47db1b9fc05908e5386b96"
:decimals 18}
{:symbol :ATMChain
:name "Attention Token of Media"
:address "0x9B11EFcAAA1890f6eE52C6bB7CF8153aC5d74139"
:decimals 8}
{:symbol :STORJ
:name "StorjToken"
:address "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac"
:decimals 8}
{:symbol :ADX
:name "AdEx"
:address "0x4470bb87d77b963a013db939be332f927f2b992e"
:decimals 4}
{:symbol :FUN
:name "FunFair"
:address "0x419d0d8bdd9af5e606ae2232ed285aff190e711b"
:decimals 8}
{:symbol :CVC
:name "Civic"
:address "0x41e5560054824ea6b0732e656e3ad64e20e94e45"
:decimals 8}
{:symbol :ICN
:name "ICONOMI"
:address "0x888666CA69E0f178DED6D75b5726Cee99A87D698"
:decimals 18}
{:symbol :WTC
:name "Walton Token"
:address "0xb7cb1c96db6b22b0d3d9536e0108d062bd488f74"
:decimals 18}
{:symbol :BTM
:name "Bytom"
:address "0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750"
:decimals 8}
{:symbol :ZRX
:name "0x Protocol Token"
:address "0xe41d2489571d322189246dafa5ebde1f4699f498"
:decimals 18}
{:symbol :BNT
:name "Bancor Network Token"
:address "0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c"
:decimals 18}
{:symbol :MTL
:name "Metal"
:address "0xF433089366899D83a9f26A773D59ec7eCF30355e"
:decimals 8}
{:symbol :PPP
:name "PayPie"
:address "0xc42209aCcC14029c1012fB5680D95fBd6036E2a0"
:decimals 18}
{:symbol :LINK
:name "ChainLink Token"
:address "0x514910771af9ca656af840dff83e8264ecf986ca"
:decimals 18}
{:symbol :KIN
:name "Kin"
:address "0x818fc6c2ec5986bc6e2cbf00939d90556ab12ce5"
:decimals 18}
{:symbol :ANT
:name "Aragon Network Token"
:address "0x960b236A07cf122663c4303350609A66A7B288C0"
:decimals 18}
{:symbol :MGO
:name "MobileGo Token"
:address "0x40395044Ac3c0C57051906dA938B54BD6557F212"
:decimals 8}
{:symbol :MCO
:name "Monaco"
:address "0xb63b606ac810a52cca15e44bb630fd42d8d1d83d"
:decimals 8}
{:symbol :LRC
:name "LoopringCoin"
:address "0xEF68e7C694F40c8202821eDF525dE3782458639f"
:decimals 18}
{:symbol :ZSC
:name "Zeus Shield Token"
:address "0x7A41e0517a5ecA4FdbC7FbebA4D4c47B9fF6DC63"
:decimals 18}
{:symbol :DATA
:name "Streamr DATAcoin"
:address "0x0cf0ee63788a0849fe5297f3407f701e122cc023"
:decimals 18}
{:symbol :RCN
:name "Ripio Credit Network Token"
:address "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6"
:decimals 9}
{:symbol :WINGS
:name "WINGS"
:address "0x667088b212ce3d06a1b553a7221E1fD19000d9aF"
:decimals 18}
{:symbol :EDG
:name "Edgeless"
:address "0x08711d3b02c8758f2fb3ab4e80228418a7f8e39c"
:decimals 0}
{:symbol :MLN
:name "Melon Token"
:address "0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1"
:decimals 18}
{:symbol :MDA
:name "Moeda Loyalty Points"
:address "0x51db5ad35c671a87207d88fc11d593ac0c8415bd"
:decimals 18}
{:symbol :PLR
:name "PILLAR"
:address "0xe3818504c1b32bf1557b16c238b2e01fd3149c17"
:decimals 18}
{:symbol :Centra
:name "Centra Token"
:address "0x96A65609a7B84E8842732DEB08f56C3E21aC6f8a"
:decimals 18}
{:symbol :QRL
:name "QRL"
:address "0x697beac28b09e122c4332d163985e8a73121b97f"
:decimals 8}
{:symbol :MOD
:name "Modum Token"
:address "0x957c30ab0426e0c93cd8241e2c60392d08c6ac8e"
:decimals 0}
{:symbol :TAAS
:name "Token-as-a-Service"
:address "0xe7775a6e9bcf904eb39da2b68c5efb4f9360e08c"
:decimals 6}
{:symbol :GRID
:name "GRID+ Token"
:address "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd"
:decimals 12}
{:symbol :SAN
:name "SANtiment network token"
:address "0x7c5a0ce9267ed19b22f8cae653f198e3e8daf098"
:decimals 18}
{:symbol :SNM
:name "SONM Token"
:address "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63"
:decimals 18}
{:symbol :REQ
:name "Request Token"
:address "0x8f8221afbb33998d8584a2b05749ba73c37a938a"
:decimals 18}
{:symbol :SUB
:name "Substratum"
:address "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a"
:decimals 2}
{:symbol :MANA
:name "Decentraland MANA"
:address "0x0f5d2fb29fb7d3cfee444a200298f468908cc942"
:decimals 18}
{:symbol :AST
:name "AirSwap Token"
:address "0x27054b13b1b798b345b591a4d22e6562d47ea75a"
:decimals 4}
{:symbol :R
:name "R Token"
:address "0x48f775efbe4f5ece6e0df2f7b5932df56823b990"
:decimals 0}
{:symbol :1ST
:name "FirstBlood Token"
:address "0xaf30d2a7e90d7dc361c8c4585e9bb7d2f6f15bc7"
:decimals 18}
{:symbol :CFI
:name "Cofoundit"
:address "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e"
:decimals 2}
{:symbol :ENG
:name "Enigma"
:address "0xf0ee6b27b759c9893ce4f094b49ad28fd15a23e4"
:decimals 8}
{:symbol :AMB
:name "Amber Token"
:address "0x4dc3643dbc642b72c158e7f3d2ff232df61cb6ce"
:decimals 18}
{:symbol :XPA
:name "XPlay Token"
:address "0x90528aeb3a2b736b780fd1b6c478bb7e1d643170"
:decimals 18}
{:symbol :OTN
:name "Open Trading Network"
:address "0x881ef48211982d01e2cb7092c915e647cd40d85c"
:decimals 18}
{:symbol :TRST
:name "Trustcoin"
:address "0xcb94be6f13a1182e4a4b6140cb7bf2025d28e41b"
:decimals 6}
{:symbol :TKN
:name "Monolith TKN"
:address "0xaaaf91d9b90df800df4f55c205fd6989c977e73a"
:decimals 8}
{:symbol :RHOC
:name "RHOC"
:address "0x168296bb09e24a88805cb9c33356536b980d3fc5"
:decimals 8}
{:symbol :TGT
:name "Target Coin"
:address "0xac3da587eac229c9896d919abc235ca4fd7f72c1"
:decimals 0}
{:symbol :EVX
:name "Everex"
:address "0xf3db5fa2c66b7af3eb0c0b782510816cbe4813b8"
:decimals 4}
{:symbol :ICOS
:name "ICOS"
:address "0x014b50466590340d41307cc54dcee990c8d58aa8"
:decimals 6}
{:symbol :DNT
:name "district0x Network Token"
:address "0x0abdace70d3790235af448c88547603b945604ea"
:decimals 18}
{:symbol :DCN
:name "Dentacoin"
:address "0x08d32b0da63e2C3bcF8019c9c5d849d7a9d791e6"
:decimals 0}
{:symbol :EDO
:name "Eidoo Token"
:address "0xced4e93198734ddaff8492d525bd258d49eb388e"
:decimals 18}
{:symbol :CSNO
:name "BitDice"
:address "0x29d75277ac7f0335b2165d0895e8725cbf658d73"
:decimals 8}
{:symbol :COB
:name "Cobinhood Token"
:address "0xb2f7eb1f2c37645be61d73953035360e768d81e6"
:decimals 18}
{:symbol :ENJ
:name "Enjin Coin"
:address "0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c"
:decimals 18}
{:symbol :AVT
:name "AVT"
:address "0x0d88ed6e74bbfd96b831231638b66c05571e824f"
:decimals 18}
{:symbol :TIME
:name "TIME"
:address "0x6531f133e6deebe7f2dce5a0441aa7ef330b4e53"
:decimals 18}
{:symbol :CND
:name "Cindicator Token"
:address "0xd4c435f5b09f855c3317c8524cb1f586e42795fa"
:decimals 18}
{:symbol :STX
:name "STOX"
:address "0x006BeA43Baa3f7A6f765F14f10A1a1b08334EF45"
:decimals 18}
{:symbol :XAUR
:name "Xaurum"
:address "0x4DF812F6064def1e5e029f1ca858777CC98D2D81"
:decimals 8}
{:symbol :VIB
:name "Vibe"
:address "0x2c974b2d0ba1716e644c1fc59982a89ddd2ff724"
:decimals 18}
{:symbol :PRG
:name "PRG"
:address "0x7728dFEF5aBd468669EB7f9b48A7f70a501eD29D"
:decimals 6}
{:symbol :DPY
:name "Delphy"
:address "0x6c2adc2073994fb2ccc5032cc2906fa221e9b391"
:decimals 18}
{:symbol :CDT
:name "CoinDash Token"
:address "0x2fe6ab85ebbf7776fee46d191ee4cea322cecf51"
:decimals 18}
{:symbol :TNT
:name "Tierion Network Token"
:address "0x08f5a9235b08173b7569f83645d2c7fb55e8ccd8"
:decimals 8}
{:symbol :DRT
:name "DomRaider Token"
:address "0x9af4f26941677c706cfecf6d3379ff01bb85d5ab"
:decimals 8}
{:symbol :ROL
:name "Dice"
:address "0x2e071D2966Aa7D8dECB1005885bA1977D6038A65"
:decimals 16}])
:testnet
(resolve-icons :testnet
[{:name "Status Test Token"
:symbol :STT
:decimals 18
:address "0xc55cf4b03948d7ebc8b9e8bad92643703811d162"}
{:name "Aragon Test Token"
:symbol :ATT
:decimals 1
:address "0x00a8e52df8f4f1f4b67bded9ae6090b35489a973"}
{:name "Handy Test Token"
:symbol :HND
:decimals 18
:address "0x9e47fb3049f0d9c953f5428ce2e6c3a8321780bf"}
{:name "Lucky XS Test"
:symbol :LXS
:decimals 18
:address "0xf29d2dc0687d7d49f57d4a731ac8bfb6edc23473"}
{:name "Adi Test Token"
:symbol :ADI
:decimals 18
:address "0xd2a816110c1177478c7e644ae4853d8e80aaec35"}
{:name "Wagner Test Token"
:symbol :WGN
:decimals 18
:address "0x65c69bc258afa0906683f42e576b272a95c203dd"}
{:name "Modest Test Token"
:symbol :MDS
:decimals 18
:address "0x972b0570d9cd8b7c41aa8349f707ec7356daa825"}])})
[{:name "Status Test Token"
:symbol :STT
:decimals 18
:address "0xc55cf4b03948d7ebc8b9e8bad92643703811d162"}
{:name "Aragon Test Token"
:symbol :ATT
:decimals 1
:address "0x00a8e52df8f4f1f4b67bded9ae6090b35489a973"}
{:name "Handy Test Token"
:symbol :HND
:decimals 18
:address "0x9e47fb3049f0d9c953f5428ce2e6c3a8321780bf"}
{:name "Lucky XS Test"
:symbol :LXS
:decimals 18
:address "0xf29d2dc0687d7d49f57d4a731ac8bfb6edc23473"}
{:name "Adi Test Token"
:symbol :ADI
:decimals 18
:address "0xd2a816110c1177478c7e644ae4853d8e80aaec35"}
{:name "Wagner Test Token"
:symbol :WGN
:decimals 18
:address "0x65c69bc258afa0906683f42e576b272a95c203dd"}
{:name "Modest Test Token"
:symbol :MDS
:decimals 18
:address "0x972b0570d9cd8b7c41aa8349f707ec7356daa825"}])})
(defn tokens-for [chain]
(get all chain))

View File

@ -33,15 +33,14 @@
`(merge-fx* ~form ~cofx ~@(next forms))
`(merge-fx* {} ~cofx ~@forms))))
(comment (defn fn1 [{:keys [db]} ]
(comment (defn fn1 [{:keys [db]}]
{:db (assoc db :a 0)
:a "1"})
(defn fn2 [ a {:keys [db]}]
{:db (update db :a + a)
})
(defn fn2 [a {:keys [db]}]
{:db (update db :a + a)})
(defn fn3 [ a {:keys [db u]}]
(defn fn3 [a {:keys [db u]}]
{:db (update db :a + u)})
(let [a 1

View File

@ -30,8 +30,8 @@
count)
{:keys [token]} (first (filter (fn [{:keys [count]}]
(or
(= count sent-messages-count)
(= count sent-messages-after-ts-count)))
(= count sent-messages-count)
(= count sent-messages-after-ts-count)))
survey-triggers))]
(when token
(.showSurveyWithToken instabug token)))))

View File

@ -31,9 +31,9 @@
(def webview-js (slurp "resources/js/webview.js"))
(def jquery (str
" if (typeof jQuery2 == 'undefined') {"
(slurp "resources/js/vendors/jquery-3.1.1.min.js")
"}"))
" if (typeof jQuery2 == 'undefined') {"
(slurp "resources/js/vendors/jquery-3.1.1.min.js")
"}"))
(def web3 (str "; if (typeof Web3 == 'undefined') {"
(slurp "node_modules/web3/dist/web3.min.js")
"}"))

View File

@ -9,17 +9,17 @@
(defn- encryption-key-fetch [{:keys [resolve reject]}]
(-> (.getGenericPassword rn/keychain)
(.then
(fn [res]
(if (not res)
(when reject
(reject))
(let [encryption-key (.parse js/JSON (.-password res))]
(log/debug "Found existing encryption key!")
(re-frame/dispatch [:got-encryption-key {:encryption-key encryption-key
:callback resolve}])))))
(fn [res]
(if (not res)
(when reject
(reject))
(let [encryption-key (.parse js/JSON (.-password res))]
(log/debug "Found existing encryption key!")
(re-frame/dispatch [:got-encryption-key {:encryption-key encryption-key
:callback resolve}])))))
(.catch
(fn [err]
(log/debug err)))))
(fn [err]
(log/debug err)))))
(defn encryption-key-reset []
(log/debug "Resetting key...")
@ -32,17 +32,17 @@
(log/debug "No key exists, creating...")
(-> (rn/secure-random key-bytes)
(.then
(fn [encryption-key]
(-> (.setGenericPassword
rn/keychain
username
(.stringify js/JSON (.from js/Array encryption-key)))
(.then
(fn [res]
(encryption-key-fetch {:resolve callback})))
(.catch
(fn [err]
(log/debug err))))))
(.catch
(fn [err]
(log/debug err)))))}))
(fn [encryption-key]
(-> (.setGenericPassword
rn/keychain
username
(.stringify js/JSON (.from js/Array encryption-key)))
(.then
(fn [res]
(encryption-key-fetch {:resolve callback})))
(.catch
(fn [err]
(log/debug err))))))
(.catch
(fn [err]
(log/debug err)))))}))

View File

@ -63,8 +63,8 @@
(recur (conj accumulator event))
accumulator))]
(async/go
(doseq [batch (partition-all max-batch-size events)]
(async/<! (callback batch)))))))
(doseq [batch (partition-all max-batch-size events)]
(async/<! (callback batch)))))))
(defn track
"Track or accumulate an event"
@ -114,15 +114,15 @@
;; when event contains two or more elements we are trying
;; to match by first two elements of :trigger
;; {:trigger [:event-name :one-parameter]}
(>= cnt 2)
(concat (get-in triggers [event-name first-arg event-tag]))
(>= cnt 2)
(concat (get-in triggers [event-name first-arg event-tag]))
;; also if event contains more than one parameter (more than
;; two elements) we are trying to match it with equal :trigger
;; {:trigger [:e-name :p1 :p2 :p3]}
;; will match only with [:e-name :p1 :p2 :p3] event
(> cnt 2)
(concat (get-in triggers (conj event event-tag))))]
(> cnt 2)
(concat (get-in triggers (conj event event-tag))))]
(->> triggers
(filter (fn [{:keys [filter-fn]}]

View File

@ -143,7 +143,6 @@
:trigger [:navigate-to :wallet-transaction-sent]
:properties {:target :wallet-transaction-sent}}
;;Profile
{:label "Tap"
:trigger [:my-profile/start-editing-profile]

View File

@ -8,18 +8,18 @@
[name max-len]
(let [names (str/split name " ")]
(first
(reduce (fn [[name done] next-name]
(if done
name
(let [new-name (str/join " " [name next-name])]
(if (too-long? new-name max-len)
(let [new-name' (str name " " (first next-name) ".")]
(if (too-long? new-name' max-len)
[name true]
[new-name' true]))
[new-name]))))
[(first names)]
(rest names)))))
(reduce (fn [[name done] next-name]
(if done
name
(let [new-name (str/join " " [name next-name])]
(if (too-long? new-name max-len)
(let [new-name' (str name " " (first next-name) ".")]
(if (too-long? new-name' max-len)
[name true]
[new-name' true]))
[new-name]))))
[(first names)]
(rest names)))))
(defn shortened-name [name max-len]
(if (> (count name) max-len)

View File

@ -28,18 +28,18 @@
(defn request-permissions []
(-> (.requestPermissions (.-default rn/react-native-fcm))
(.then
(fn [_]
(log/debug "notifications-granted")
(dispatch [:request-notifications-granted {}]))
(fn [_]
(log/debug "notifications-denied")
(dispatch [:request-notifications-denied {}])))))
(fn [_]
(log/debug "notifications-granted")
(dispatch [:request-notifications-granted {}]))
(fn [_]
(log/debug "notifications-denied")
(dispatch [:request-notifications-denied {}])))))
(defn get-fcm-token []
(-> (.getFCMToken (object/get rn/react-native-fcm "default"))
(.then (fn [x]
(log/debug "get-fcm-token: " x)
(dispatch [:update-fcm-token x])))))
(-> (.getFCMToken (object/get rn/react-native-fcm "default"))
(.then (fn [x]
(log/debug "get-fcm-token: " x)
(dispatch [:update-fcm-token x])))))
(defn on-refresh-fcm-token []
(.on (.-default rn/react-native-fcm)

View File

@ -2,7 +2,6 @@
(:require [status-im.utils.signing-phrase.dictionaries.en :as en]
[clojure.string :as string]))
; In order to reduce phishing threat for Status.im users we want to have them
; recognize 3 predefined words when they sign transactions or make other sensitive operations.
;
@ -25,4 +24,3 @@
(defn generate []
(string/join " " (pick-words en/dictionary)))

View File

@ -10,6 +10,6 @@
(map (fn [file-name]
(try
(clojure.core/slurp
(string/join "/" ["resources/js/bots" (name bot-name) file-name]))
(string/join "/" ["resources/js/bots" (name bot-name) file-name]))
(catch Exception _ ""))))
(apply str)))

View File

@ -67,35 +67,35 @@
(defn subscribe! []
(when config/rn-bridge-threshold-warnings-enabled?
(let [emitter (js-dependencies/EventEmmiter.)
events (.stream snoopy emitter)]
(threshold-warnings
{:filter-fn (constantly true)
:label "all messages"
:threshold-message "too many calls to bridge, something suspicious is happening"
:tick? false
:print-events? false
:threshold 400
:events events})
(let [emitter (js-dependencies/EventEmmiter.)
events (.stream snoopy emitter)]
(threshold-warnings
{:filter-fn (constantly true)
:label "all messages"
:threshold-message "too many calls to bridge, something suspicious is happening"
:tick? false
:print-events? false
:threshold 400
:events events})
(threshold-warnings
{:filter-fn timer-filter
:label "timer"
:threshold-message "too many setTimeout/setInterval calls"
:tick? false
:print-events? false
:threshold 70
:events events})
(threshold-warnings
{:filter-fn timer-filter
:label "timer"
:threshold-message "too many setTimeout/setInterval calls"
:tick? false
:print-events? false
:threshold 70
:events events})
(threshold-warnings
{:filter-fn ui-manager-filter
:label "timer"
:threshold-message (str "too many calls to UIManager, most likely during navigation. "
"Please consider preloading of screens or lazy loading of some components")
:tick? false
:print-events? false
(threshold-warnings
{:filter-fn ui-manager-filter
:label "timer"
:threshold-message (str "too many calls to UIManager, most likely during navigation. "
"Please consider preloading of screens or lazy loading of some components")
:tick? false
:print-events? false
;; todo(rasom): revisit this number when/if
;; https://github.com/status-im/status-react/pull/2849 will be merged
:threshold 200
:events events}))))
:threshold 200
:events events}))))

View File

@ -42,8 +42,8 @@
:height 20}"
[style-name style]
(wrap-first-time
`(def ~style-name
~(body style))))
`(def ~style-name
~(body style))))
(defmacro defnstyle
"Defines style function.
@ -63,6 +63,6 @@
:height 5}"
[style-name params style]
(wrap-first-time
`(defn ~style-name
[~@params]
~(body style))))
`(defn ~style-name
[~@params]
~(body style))))

View File

@ -54,4 +54,4 @@
(defn get-transactions [network account on-success on-error]
(http/get (get-transaction-url network account)
#(on-success (format-transactions-response % account))
on-error))
on-error))

View File

@ -4,18 +4,18 @@
(defn show-popup
([title content]
(show-popup title content nil))
(show-popup title content nil))
([title content on-dismiss]
(.alert (.-Alert rn-dependencies/react-native)
title
content
(clj->js
(vector (merge {:text "OK"
:style "cancel"
:accessibility-label :cancel-button}
(when on-dismiss {:onPress on-dismiss}))))
(when on-dismiss
(clj->js {:cancelable false})))))
(.alert (.-Alert rn-dependencies/react-native)
title
content
(clj->js
(vector (merge {:text "OK"
:style "cancel"
:accessibility-label :cancel-button}
(when on-dismiss {:onPress on-dismiss}))))
(when on-dismiss
(clj->js {:cancelable false})))))
(defn show-confirmation
([title content on-accept]

View File

@ -63,9 +63,9 @@
(into {}))
{:display-name (name '~n)
:reagent-render
(fn ~params
(let [~@vars-bindings]
~body))})))))))
(fn ~params
(let [~@vars-bindings]
~body))})))))))
(defn check-view [all {:keys [view views component hide? parent]}]
(let [parent (or parent :root)
@ -107,8 +107,8 @@
(fn [[_ children]]
(not (nil? children)))
(map (fn [child]
[child (get view->children child)])
(reduce clojure.set/union children)))))
[child (get view->children child)])
(reduce clojure.set/union children)))))
(defn -generate-component
[{:keys [components view->children] :as config} view-sym component-name]
@ -132,144 +132,143 @@
~(assoc (get components child) :current-view view-sym)])
children)
~@(map (fn [[component-name children]]
`[status-im.ui.components.react/navigation-wrapper
{:component [status-im.ui.components.react/with-empty-preview
~(-generate-component config view-sym component-name)]
:views ~(conj
(reduce
clojure.set/union
(map (fn [child]
(-get-all-views config child))
children))
component-name)
:hide? true
:current-view ~view-sym}])
grandchildren)]))
`[status-im.ui.components.react/navigation-wrapper
{:component [status-im.ui.components.react/with-empty-preview
~(-generate-component config view-sym component-name)]
:views ~(conj
(reduce
clojure.set/union
(map (fn [child]
(-get-all-views config child))
children))
component-name)
:hide? true
:current-view ~view-sym}])
grandchildren)]))
(defn -compile-views [n views]
(let [view-sym (gensym "view-id")]
`(defview ~n []
(letsubs [~view-sym [:get :view-id]]
~(let [tree (-build-tree views)]
(-generate-component tree view-sym :root))))))
~(let [tree (-build-tree views)]
(-generate-component tree view-sym :root))))))
(defmacro compile-views
[n views]
(-compile-views n views))
(comment
(-compile-views
'root-view
'[{:views #{:home :wallet :my-profile}
:component main-tabs}
(-compile-views
'root-view
'[{:views #{:home :wallet :my-profile}
:component main-tabs}
{:view :chat
:hide? (not android?)
:component chat}
{:view :chat
:hide? (not android?)
:component chat}
{:view :wallet-send-transaction
:parent :wallet
:component send-transaction}
{:view :wallet-send-transaction
:parent :wallet
:component send-transaction}
{:view :wallet-request-transaction
:parent :wallet
:component request-transaction}
{:view :wallet-request-transaction
:parent :wallet
:component request-transaction}
{:view :choose-recipient
:parent :wallet-send-transaction
:component choose-recipient}
{:view :choose-recipient
:parent :wallet-send-transaction
:component choose-recipient}
{:view :wallet-transaction-sent
:parent :wallet-send-transaction
:component transaction-sent}
{:view :wallet-transaction-sent
:parent :wallet-send-transaction
:component transaction-sent}
{:views #{:transactions-history :unsigned-transactions}
:parent :wallet
:component wallet-transactions/transactions}
{:views #{:transactions-history :unsigned-transactions}
:parent :wallet
:component wallet-transactions/transactions}
{:view :edit-my-profile
:parent :profile
:component edit-my-profile}])
{:view :edit-my-profile
:parent :profile
:component edit-my-profile}])
(status-im.utils.views/defview
root-view
[]
(status-im.utils.views/letsubs
[view-id76826 [:get :view-id]]
[status-im.ui.components.react/view
{:flex 1}
[status-im.ui.components.react/navigation-wrapper
{:views #{:home :wallet :my-profile},
:component main-tabs,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:chat},
:component chat,
:hide? (not android?),
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:hide? true,
:component [status-im.ui.components.react/with-empty-preview
[status-im.ui.components.react/view
{:flex (if
(clojure.core/contains?
#{:wallet-request-transaction
:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent
:transactions-history
:unsigned-transactions}
view-id76826)
1
0)}
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-send-transaction},
:component send-transaction,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-request-transaction},
:component request-transaction,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:transactions-history :unsigned-transactions},
:component wallet-transactions/transactions,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:hide? true,
:component [status-im.ui.components.react/with-empty-preview
[status-im.ui.components.react/view
{:flex (if
(clojure.core/contains?
#{:choose-recipient
:wallet-transaction-sent}
view-id76826)
1
0)}
[status-im.ui.components.react/navigation-wrapper
{:views #{:choose-recipient},
:component choose-recipient,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-transaction-sent},
:component transaction-sent,
:hide? nil,
:current-view view-id76826}]]],
:current-view view-id76826,
:views #{:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent}}]]],
:current-view view-id76826,
:views #{:wallet-request-transaction
:wallet
:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent
:transactions-history
:unsigned-transactions}}]])))
(status-im.utils.views/defview
root-view
[]
(status-im.utils.views/letsubs
[view-id76826 [:get :view-id]]
[status-im.ui.components.react/view
{:flex 1}
[status-im.ui.components.react/navigation-wrapper
{:views #{:home :wallet :my-profile},
:component main-tabs,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:chat},
:component chat,
:hide? (not android?),
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:hide? true,
:component [status-im.ui.components.react/with-empty-preview
[status-im.ui.components.react/view
{:flex (if
(clojure.core/contains?
#{:wallet-request-transaction
:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent
:transactions-history
:unsigned-transactions}
view-id76826)
1
0)}
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-send-transaction},
:component send-transaction,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-request-transaction},
:component request-transaction,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:transactions-history :unsigned-transactions},
:component wallet-transactions/transactions,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:hide? true,
:component [status-im.ui.components.react/with-empty-preview
[status-im.ui.components.react/view
{:flex (if
(clojure.core/contains?
#{:choose-recipient
:wallet-transaction-sent}
view-id76826)
1
0)}
[status-im.ui.components.react/navigation-wrapper
{:views #{:choose-recipient},
:component choose-recipient,
:hide? nil,
:current-view view-id76826}]
[status-im.ui.components.react/navigation-wrapper
{:views #{:wallet-transaction-sent},
:component transaction-sent,
:hide? nil,
:current-view view-id76826}]]],
:current-view view-id76826,
:views #{:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent}}]]],
:current-view view-id76826,
:views #{:wallet-request-transaction
:wallet
:wallet-send-transaction
:choose-recipient
:wallet-transaction-sent
:transactions-history
:unsigned-transactions}}]])))

View File

@ -5,10 +5,10 @@
(defn make-web3 []
(dependencies/Web3.
#js {:sendAsync (fn [payload callback]
(status/call-web3
(.stringify js/JSON payload)
(fn [response]
(if (= "" response)
(log/warn :web3-response-error)
(callback nil (.parse js/JSON response))))))}))
#js {:sendAsync (fn [payload callback]
(status/call-web3
(.stringify js/JSON payload)
(fn [response]
(if (= "" response)
(log/warn :web3-response-error)
(callback nil (.parse js/JSON response))))))}))