keycard onboarding v1

Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2019-05-29 22:20:29 +03:00
parent b9d4e61fdf
commit ab2248f9f8
No known key found for this signature in database
GPG Key ID: 43D1DAF5AD39C927
17 changed files with 979 additions and 234 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -916,11 +916,6 @@
(fn [cofx [_ supported?]]
(hardwallet/set-nfc-support cofx supported?)))
(handlers/register-handler-fx
:hardwallet.callback/check-nfc-enabled-success
(fn [cofx [_ enabled?]]
(hardwallet/set-nfc-enabled cofx enabled?)))
(handlers/register-handler-fx
:hardwallet.callback/on-card-connected
(fn [cofx [_ data]]
@ -952,14 +947,14 @@
(hardwallet/on-install-applet-and-init-card-error cofx error)))
(handlers/register-handler-fx
:hardwallet.callback/on-pairing-success
:hardwallet.callback/on-pair-success
(fn [cofx [_ pairing]]
(hardwallet/on-pairing-success cofx pairing)))
(hardwallet/on-pair-success cofx pairing)))
(handlers/register-handler-fx
:hardwallet.callback/on-pairing-error
:hardwallet.callback/on-pair-error
(fn [cofx [_ error]]
(hardwallet/on-pairing-error cofx error)))
(hardwallet/on-pair-error cofx error)))
(handlers/register-handler-fx
:hardwallet.callback/on-generate-mnemonic-success
@ -1154,11 +1149,6 @@
(fn [{:keys [db]} _]
{:db (assoc-in db [:hardwallet :setup-step] :recovery-phrase)}))
(handlers/register-handler-fx
:hardwallet/load-preparing-screen
(fn [cofx _]
(hardwallet/load-preparing-screen cofx)))
(handlers/register-handler-fx
:hardwallet/connection-error
(fn [_ _]
@ -1173,21 +1163,6 @@
{:db (assoc-in db [:hardwallet :setup-step] :begin)}
(navigation/navigate-to-cofx :hardwallet-setup nil))))
(handlers/register-handler-fx
:hardwallet.ui/secret-keys-next-button-pressed
(fn [_ _]
{:ui/show-confirmation {:title (i18n/label :t/secret-keys-confirmation-title)
:content (i18n/label :t/secret-keys-confirmation-text)
:confirm-button-text (i18n/label :t/secret-keys-confirmation-confirm)
:cancel-button-text (i18n/label :t/secret-keys-confirmation-cancel)
:on-accept #(re-frame/dispatch [:hardwallet.ui/secret-keys-dialog-confirm-pressed])
:on-cancel #()}}))
(handlers/register-handler-fx
:hardwallet.ui/secret-keys-dialog-confirm-pressed
(fn [cofx _]
(hardwallet/load-pairing-screen cofx)))
(handlers/register-handler-fx
:hardwallet/load-pairing-screen
(fn [cofx _]

View File

@ -82,8 +82,8 @@
(when password
(.. (keycard)
(pair password)
(then #(re-frame/dispatch [:hardwallet.callback/on-pairing-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-pairing-error (error-object->map %)])))))
(then #(re-frame/dispatch [:hardwallet.callback/on-pair-success %]))
(catch #(re-frame/dispatch [:hardwallet.callback/on-pair-error (error-object->map %)])))))
(defn generate-mnemonic
[{:keys [pairing words]}]

View File

@ -18,10 +18,16 @@
[status-im.utils.types :as types]
[status-im.wallet.core :as wallet]
[taoensso.timbre :as log]
status-im.hardwallet.fx))
status-im.hardwallet.fx
[status-im.ui.components.react :as react]))
(def default-pin "000000")
(defn- vector->string [v]
"Converts numbers stored in vector into string,
e.g. [1 2 3 4 5 6] -> \"123456\""
(apply str v))
(defn- find-account-by-keycard-instance-uid
[db keycard-instance-uid]
(when keycard-instance-uid
@ -150,6 +156,186 @@
:cancel-button-text ""
:confirm-button-text :t/okay}}))
(fx/defn dispatch-event
[_ event]
{:dispatch [event]})
(fx/defn load-preparing-screen
{:events [:hardwallet/load-preparing-screen]}
[{:keys [db] :as cofx}]
(let [card-connected? (get-in db [:hardwallet :card-connected?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :preparing)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/load-preparing-screen))}
(when card-connected?
(navigation/navigate-to-cofx :keycard-onboarding-preparing nil))
(if card-connected?
(dispatch-event :hardwallet/start-installation)
(navigation/navigate-to-cofx :keycard-onboarding-connection-lost nil)))))
(fx/defn load-pin-screen
[{:keys [db] :as cofx}]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :pin)
(assoc-in [:hardwallet :pin] {:enter-step :original
:original []
:confirmation []}))}
(navigation/navigate-to-cofx :keycard-onboarding-pin nil)))
(fx/defn load-pair-screen
[{:keys [db] :as cofx}]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :pair))}
(navigation/navigate-to-cofx :keycard-onboarding-pair nil)))
(fx/defn load-pairing-screen
{:events [:hardwallet/load-pairing-screen
:keycard.onboarding.puk-code.ui/confirm-pressed]}
[{:keys [db] :as cofx}]
(let [card-connected? (get-in db [:hardwallet :card-connected?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :pairing)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/load-pairing-screen))}
(when card-connected?
(navigation/navigate-to-cofx :keycard-onboarding-pairing nil))
(if card-connected?
(dispatch-event :hardwallet/pair)
(navigation/navigate-to-cofx :keycard-onboarding-connection-lost nil)))))
(fx/defn puk-code-next-pressed
{:events [:keycard.onboarding.puk-code.ui/next-pressed]}
[_]
{:ui/show-confirmation {:title (i18n/label :t/secret-keys-confirmation-title)
:content (i18n/label :t/secret-keys-confirmation-text)
:confirm-button-text (i18n/label :t/yes)
:cancel-button-text (i18n/label :t/cancel)
:on-accept #(re-frame/dispatch [:keycard.onboarding.puk-code.ui/confirm-pressed])
:on-cancel #()}})
(fx/defn cancel-setup-pressed
{:events [:keycard.onboarding.ui/cancel-pressed]}
[_]
{:ui/show-confirmation {:title (i18n/label :t/keycard-cancel-setup-title)
:content (i18n/label :t/keycard-cancel-setup-text)
:confirm-button-text (i18n/label :t/yes)
:cancel-button-text (i18n/label :t/no)
:on-accept #(re-frame/dispatch [:keycard.onboarding.ui/cancel-confirm-pressed])
:on-cancel #()}})
(fx/defn cancel-setup-confirm-pressed
{:events [:keycard.onboarding.ui/cancel-confirm-pressed]}
[cofx]
(fx/merge cofx
{}
(navigation/navigate-to-cofx :keycard-onboarding-intro nil)))
(fx/defn load-finishing-screen
{:events [:keycard.onboarding.recovery-phrase-confirm-word2.ui/next-pressed
:hardwallet/load-finishing-screen]}
[{:keys [db] :as cofx}]
(let [card-connected? (get-in db [:hardwallet :card-connected?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :loading-keys)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/load-finishing-screen))}
(when card-connected?
(navigation/navigate-to-cofx :keycard-onboarding-finishing nil))
(if card-connected?
(dispatch-event :hardwallet/generate-and-load-key)
(navigation/navigate-to-cofx :keycard-onboarding-connection-lost nil)))))
(fx/defn recovery-phrase-learn-more-pressed
{:events [:keycard.onboarding.recovery-phrase.ui/learn-more-pressed]}
[_]
(.openURL (react/linking) "https://keycard.status.im"))
(fx/defn recovery-phrase-cancel-pressed
{:events [:keycard.onboarding.recovery-phrase.ui/cancel-pressed]}
[_])
(fx/defn recovery-phrase-next-pressed
{:events [:keycard.onboarding.recovery-phrase.ui/next-pressed]}
[_]
{:ui/show-confirmation {:title (i18n/label :t/keycard-recovery-phrase-confirmation-title)
:content (i18n/label :t/keycard-recovery-phrase-confirmation-text)
:confirm-button-text (i18n/label :t/yes)
:cancel-button-text (i18n/label :t/cancel)
:on-accept #(re-frame/dispatch [:keycard.onboarding.recovery-phrase.ui/confirm-pressed])
:on-cancel #()}})
(fx/defn recovery-phrase-start-confirmation [{:keys [db]}]
(let [mnemonic (get-in db [:hardwallet :secrets :mnemonic])
[word1 word2] (shuffle (map-indexed vector (clojure.string/split mnemonic #" ")))
word1 (zipmap [:idx :word] word1)
word2 (zipmap [:idx :word] word2)]
{:db (-> db
(assoc-in [:hardwallet :setup-step] :recovery-phrase-confirm-word1)
(assoc-in [:hardwallet :recovery-phrase :step] :word1)
(assoc-in [:hardwallet :recovery-phrase :confirm-error] nil)
(assoc-in [:hardwallet :recovery-phrase :input-word] nil)
(assoc-in [:hardwallet :recovery-phrase :word1] word1)
(assoc-in [:hardwallet :recovery-phrase :word2] word2))}))
(fx/defn recovery-phrase-confirm-pressed
{:events [:keycard.onboarding.recovery-phrase.ui/confirm-pressed]}
[cofx]
(fx/merge cofx
(recovery-phrase-start-confirmation)
(navigation/navigate-to-cofx :keycard-onboarding-recovery-phrase-confirm-word1 nil)))
(fx/defn recovery-phrase-next-word
[{:keys [db]}]
{:db (-> db
(assoc-in [:hardwallet :recovery-phrase :step] :word2)
(assoc-in [:hardwallet :recovery-phrase :confirm-error] nil)
(assoc-in [:hardwallet :recovery-phrase :input-word] nil)
(assoc-in [:hardwallet :setup-step] :recovery-phrase-confirm-word2))})
(fx/defn recovery-phrase-confirm-word-back-pressed
{:events [:keycard.onboarding.recovery-phrase-confirm-word.ui/back-pressed]}
[{:keys [db] :as cofx}]
(if (= (:view-id db) :keycard-onboarding-recovery-phrase-confirm-word1)
(navigation/navigate-to-cofx cofx :keycard-onboarding-recovery-phrase nil)
(navigation/navigate-to-cofx cofx :keycard-onboarding-recovery-phrase-confirm-word1 nil)))
(fx/defn recovery-phrase-confirm-word-next-pressed
{:events [:keycard.onboarding.recovery-phrase-confirm-word.ui/next-pressed
:keycard.onboarding.recovery-phrase-confirm-word.ui/input-submitted]}
[{:keys [db] :as cofx}]
(let [step (get-in db [:hardwallet :recovery-phrase :step])
input-word (get-in db [:hardwallet :recovery-phrase :input-word])
{:keys [word]} (get-in db [:hardwallet :recovery-phrase step])]
(if (= word input-word)
(if (= (:view-id db) :keycard-onboarding-recovery-phrase-confirm-word1)
(fx/merge cofx
(recovery-phrase-next-word)
(navigation/navigate-to-cofx :keycard-onboarding-recovery-phrase-confirm-word2 nil))
(let [pin (or (get-in db [:hardwallet :secrets :pin])
(vector->string (get-in db [:hardwallet :pin :current])))]
(if (empty? pin)
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :pin] {:enter-step :current
:on-verified :hardwallet/generate-and-load-key
:current []}))}
(navigation/navigate-to-cofx :keycard-onboarding-pin nil))
(load-finishing-screen cofx))))
{:db (assoc-in db [:hardwallet :recovery-phrase :confirm-error] (i18n/label :t/wrong-word))})))
(fx/defn recovery-phrase-confirm-word-input-changed
{:events [:keycard.onboarding.recovery-phrase-confirm-word.ui/input-changed]}
[{:keys [db]} input]
{:db (assoc-in db [:hardwallet :recovery-phrase :input-word] input)})
(fx/defn pair-code-input-changed
{:events [:keycard.onboarding.pair.ui/input-changed]}
[{:keys [db]} input]
{:db (assoc-in db [:hardwallet :secrets :password] input)})
(fx/defn check-card-state
[{:keys [db] :as cofx}]
(let [app-info (get-in db [:hardwallet :application-info])
@ -164,12 +350,10 @@
(fx/merge cofx
{:db db'}
(set-setup-step card-state)
(if (or (contains? #{:init :pre-init} card-state)
(and (= :account card-state)
(= :import flow)))
(navigation/navigate-to-cofx :hardwallet-setup nil)
(when-not (= :not-paired card-state)
(navigation/navigate-to-cofx :hardwallet-authentication-method nil)))
(when (= card-state :pre-init)
(load-pin-screen))
(when (= card-state :not-paired)
(load-pair-screen))
(when (= card-state :blank)
(show-no-keycard-applet-alert))
(when (and (= card-state :account)
@ -329,10 +513,6 @@
[{:keys [db]}]
{:db (assoc-in db [:hardwallet :on-card-connected] nil)})
(fx/defn dispatch-event
[_ event]
{:dispatch [event]})
(fx/defn show-wrong-keycard-alert
[_ card-connected?]
(when card-connected?
@ -366,8 +546,6 @@
(login-with-keycard true))
(when-not connect-screen?
(clear-on-card-read))
(when setup-starting?
(check-card-state))
(if (zero? puk-retry-counter)
{:utils/show-popup {:title (i18n/label :t/error)
:content (i18n/label :t/keycard-blocked)}}
@ -400,10 +578,6 @@
[{:keys [db]} supported?]
{:db (assoc-in db [:hardwallet :nfc-supported?] supported?)})
(fx/defn set-nfc-enabled
[{:keys [db]} enabled?]
{:db (assoc-in db [:hardwallet :nfc-enabled?] enabled?)})
(fx/defn status-hardwallet-option-pressed [{:keys [db] :as cofx}]
(fx/merge cofx
{:hardwallet/check-nfc-enabled nil
@ -415,6 +589,43 @@
(assoc-in [:hardwallet :pin :on-verified] nil))}
(navigation/navigate-to-cofx :hardwallet-connect nil)))
(fx/defn keycard-option-pressed
{:events [:onboarding.ui/keycard-option-pressed]}
[cofx]
(fx/merge cofx
{:hardwallet/check-nfc-enabled nil
:hardwallet/register-card-events nil}
(navigation/navigate-to-cofx :keycard-onboarding-intro nil)))
(fx/defn begin-setup-pressed
{:events [:keycard.onboarding.intro.ui/begin-setup-pressed]}
[{:keys [db] :as cofx}]
(let [nfc-enabled? (get-in db [:hardwallet :nfc-enabled?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :begin)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/get-application-info)
(assoc-in [:hardwallet :on-card-read] :hardwallet/check-card-state)
(assoc-in [:hardwallet :pin :on-verified] nil))}
(if nfc-enabled?
(navigation/navigate-to-cofx :keycard-onboarding-start nil)
(navigation/navigate-to-cofx :keycard-onboarding-nfc-on nil)))))
(fx/defn open-nfc-settings-pressed
{:events [:keycard.onboarding.nfc-on/open-nfc-settings-pressed]}
[_]
{:hardwallet/open-nfc-settings nil})
(fx/defn on-check-nfc-enabled-success
{:events [:hardwallet.callback/check-nfc-enabled-success]}
[{:keys [db] :as cofx} nfc-enabled?]
(fx/merge cofx
{:db (assoc-in db [:hardwallet :nfc-enabled?] nfc-enabled?)}
(when (and nfc-enabled?
(= (:view-id db)
:keycard-onboarding-nfc-on))
(navigation/navigate-to-cofx :keycard-onboarding-start nil))))
(fx/defn success-button-pressed [cofx]
(navigation/navigate-to-cofx cofx :home nil))
@ -464,11 +675,6 @@
:on-verified :hardwallet/unpair})}
(navigate-to-enter-pin-screen))))
(defn- vector->string [v]
"Converts numbers stored in vector into string,
e.g. [1 2 3 4 5 6] -> \"123456\""
(apply str v))
(fx/defn unpair
[{:keys [db]}]
(let [pin (vector->string (get-in db [:hardwallet :pin :current]))
@ -608,17 +814,6 @@
{:dispatch [on-card-connected]}
(navigation/navigate-to-cofx cofx :hardwallet-connect nil))))
(fx/defn load-pairing-screen
[{:keys [db] :as cofx}]
(let [card-connected? (get-in db [:hardwallet :card-connected?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :pairing)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/load-pairing-screen))}
(if card-connected?
(dispatch-event :hardwallet/pair)
(navigation/navigate-to-cofx :hardwallet-connect nil)))))
(fx/defn pair* [_ password]
{:hardwallet/pair {:password password}})
@ -630,38 +825,30 @@
{:db (assoc-in db [:hardwallet :on-card-connected] :hardwallet/pair)}
(if card-connected?
(pair* password)
(navigation/navigate-to-cofx :hardwallet-connect nil)))))
(navigation/navigate-to-cofx :keycard-onboarding-connection-lost nil)))))
(fx/defn pair-code-next-button-pressed
{:events [:keycard.onboarding.pair.ui/input-submitted
:keycard.onboarding.pair.ui/next-pressed]}
[{:keys [db] :as cofx}]
(let [pairing (get-in db [:hardwallet :secrets :pairing])
paired-on (get-in db [:hardwallet :secrets :paired-on] (utils.datetime/timestamp))]
(if pairing
{:db (-> db
(assoc-in [:hardwallet :setup-step] :import-account)
(assoc-in [:hardwallet :secrets :paired-on] paired-on))}
(pair cofx))))
(fx/merge cofx
(if pairing
{:db (-> db
(assoc-in [:hardwallet :setup-step] :import-account)
(assoc-in [:hardwallet :secrets :paired-on] paired-on))}
(pair))
(navigation/navigate-to-cofx :keycard-onboarding-pairing nil))))
(fx/defn return-back-from-nfc-settings [{:keys [db]}]
(when (contains? #{:hardwallet-connect
:hardwallet-connect-sign
:hardwallet-connect-settings} (:view-id db))
(when (= (:view-id db)
:keycard-onboarding-nfc-on)
{:hardwallet/check-nfc-enabled nil}))
(defn- proceed-to-pin-confirmation [fx]
(assoc-in fx [:db :hardwallet :pin :enter-step] :confirmation))
(fx/defn load-preparing-screen
[{:keys [db] :as cofx}]
(let [card-connected? (get-in db [:hardwallet :card-connected?])]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :preparing)
(assoc-in [:hardwallet :on-card-connected] :hardwallet/load-preparing-screen))}
(if card-connected?
(dispatch-event :hardwallet/start-installation)
(navigation/navigate-to-cofx :hardwallet-connect nil)))))
(fx/defn change-pin
[{:keys [db] :as cofx}]
(let [pairing (get-pairing db)
@ -1086,10 +1273,7 @@
(fx/defn on-card-connected
[{:keys [db] :as cofx} _]
(log/debug "[hardwallet] card connected")
(let [pin-enter-step (get-in db [:hardwallet :pin :enter-step])
setup-running? (boolean (get-in db [:hardwallet :setup-step]))
login? (= :login pin-enter-step)
instance-uid (get-in db [:hardwallet :application-info :instance-uid])
(let [instance-uid (get-in db [:hardwallet :application-info :instance-uid])
accounts-screen? (= :accounts (:view-id db))
auto-login? (and accounts-screen? instance-uid)
should-read-instance-uid? (nil? instance-uid)
@ -1109,9 +1293,7 @@
(clear-on-card-connected))
(when (and on-card-read
(nil? on-card-connected))
(get-application-info pairing on-card-read))
(when setup-running?
(navigation/navigate-to-cofx :hardwallet-setup nil)))))
(get-application-info pairing on-card-read)))))
(fx/defn on-card-disconnected
[{:keys [db] :as cofx} _]
@ -1151,13 +1333,16 @@
(navigation/navigate-to-cofx :hardwallet-authentication-method nil))))))
(fx/defn on-install-applet-and-init-card-success
[{:keys [db]} secrets]
[{:keys [db] :as cofx} secrets]
(let [secrets' (js->clj secrets :keywordize-keys true)]
{:hardwallet/get-application-info nil
:db (-> db
(assoc-in [:hardwallet :on-card-connected] nil)
(assoc-in [:hardwallet :setup-step] :secret-keys)
(assoc-in [:hardwallet :secrets] secrets'))}))
(fx/merge cofx
{:hardwallet/get-application-info nil
:db (-> db
(assoc-in [:hardwallet :card-state] :init)
(assoc-in [:hardwallet :on-card-connected] nil)
(assoc-in [:hardwallet :setup-step] :secret-keys)
(assoc-in [:hardwallet :secrets] secrets'))}
(navigation/navigate-to-cofx :keycard-onboarding-puk-code nil))))
(def on-init-card-success on-install-applet-and-init-card-success)
@ -1186,13 +1371,14 @@
(assoc-in [:accounts/accounts address] account'))
:data-store/base-tx [(accounts-store/save-account-tx account')]}))
(fx/defn on-pairing-success
(fx/defn on-pair-success
[{:keys [db] :as cofx} pairing]
(let [setup-step (get-in db [:hardwallet :setup-step])
flow (get-in db [:hardwallet :flow])
instance-uid (get-in db [:hardwallet :application-info :instance-uid])
account (find-account-by-keycard-instance-uid db instance-uid)
paired-on (utils.datetime/timestamp)
next-step (if (= setup-step :enter-pair-code)
next-step (if (= setup-step :pair)
:begin
:card-ready)]
(fx/merge cofx
@ -1204,12 +1390,12 @@
(assoc-in [:hardwallet :secrets :paired-on] paired-on))}
(when account
(set-account-pairing account pairing paired-on))
(when (= next-step :begin)
(check-card-state)))))
(when (= flow :create)
(generate-mnemonic)))))
(fx/defn on-pairing-error
(fx/defn on-pair-error
[{:keys [db] :as cofx} {:keys [error code]}]
(log/debug "[hardwallet] pairing error: " error)
(log/debug "[hardwallet] pair error: " error)
(let [setup-step (get-in db [:hardwallet :setup-step])]
(fx/merge cofx
{:db (-> db
@ -1221,11 +1407,13 @@
(process-error code error)))))
(fx/defn on-generate-mnemonic-success
[{:keys [db]} mnemonic]
{:db (-> db
(assoc-in [:hardwallet :setup-step] :recovery-phrase)
(assoc-in [:hardwallet :on-card-connected] nil)
(assoc-in [:hardwallet :secrets :mnemonic] mnemonic))})
[{:keys [db] :as cofx} mnemonic]
(fx/merge cofx
{:db (-> db
(assoc-in [:hardwallet :setup-step] :recovery-phrase)
(assoc-in [:hardwallet :on-card-connected] nil)
(assoc-in [:hardwallet :secrets :mnemonic] mnemonic))}
(navigation/navigate-to-cofx :keycard-onboarding-recovery-phrase nil)))
(fx/defn on-generate-mnemonic-error
[{:keys [db] :as cofx} {:keys [error code]}]
@ -1236,19 +1424,6 @@
(assoc-in [:hardwallet :setup-error] error))}
(process-error code error)))
(fx/defn recovery-phrase-start-confirmation [{:keys [db]}]
(let [mnemonic (get-in db [:hardwallet :secrets :mnemonic])
[word1 word2] (shuffle (map-indexed vector (clojure.string/split mnemonic #" ")))
word1 (zipmap [:idx :word] word1)
word2 (zipmap [:idx :word] word2)]
{:db (-> db
(assoc-in [:hardwallet :setup-step] :recovery-phrase-confirm-word1)
(assoc-in [:hardwallet :recovery-phrase :step] :word1)
(assoc-in [:hardwallet :recovery-phrase :confirm-error] nil)
(assoc-in [:hardwallet :recovery-phrase :input-word] nil)
(assoc-in [:hardwallet :recovery-phrase :word1] word1)
(assoc-in [:hardwallet :recovery-phrase :word2] word2))}))
(defn- show-recover-confirmation []
{:ui/show-confirmation {:title (i18n/label :t/are-you-sure?)
:content (i18n/label :t/are-you-sure-description)
@ -1257,13 +1432,6 @@
:on-accept #(re-frame/dispatch [:hardwallet.ui/recovery-phrase-confirm-pressed])
:on-cancel #(re-frame/dispatch [:hardwallet.ui/recovery-phrase-cancel-pressed])}})
(defn- recovery-phrase-next-word [db]
{:db (-> db
(assoc-in [:hardwallet :recovery-phrase :step] :word2)
(assoc-in [:hardwallet :recovery-phrase :confirm-error] nil)
(assoc-in [:hardwallet :recovery-phrase :input-word] nil)
(assoc-in [:hardwallet :setup-step] :recovery-phrase-confirm-word2))})
(fx/defn recovery-phrase-confirm-word
[{:keys [db]}]
(let [step (get-in db [:hardwallet :recovery-phrase :step])
@ -1324,7 +1492,8 @@
(fx/merge cofx
{:hardwallet/generate-and-load-key {:mnemonic mnemonic
:pairing pairing
:pin pin'}})))
:pin pin'}}
(navigation/navigate-to-cofx :keycard-onboarding-finishing nil))))
(fx/defn create-keycard-account
[{:keys [db] :as cofx}]
@ -1349,7 +1518,7 @@
encryption-public-key
{:seed-backed-up? true
:login? true})
(navigation/navigate-to-cofx :hardwallet-success nil))))
(navigation/navigate-to-cofx :keycard-welcome nil))))
(fx/defn on-generate-and-load-key-success
[{:keys [db random-guid-generator] :as cofx} data]

View File

@ -229,7 +229,7 @@
(defn finishing-hardwallet-setup? [cofx]
(= (get-in cofx [:db :view-id])
:hardwallet-success))
:keycard-welcome))
(fx/defn initialize-account [{:keys [db] :as cofx} address]
(let [stored-pns (:push-notifications/stored db)]

View File

@ -12,6 +12,10 @@
:hardwallet-card (js-require/js-require "./resources/images/ui/hardwallet-card.png")
:secret-keys (js-require/js-require "./resources/images/ui/secret-keys.png")
:keycard-lock (js-require/js-require "./resources/images/ui/keycard-lock.png")
:keycard (js-require/js-require "./resources/images/ui/keycard.png")
:keycard-phone (js-require/js-require "./resources/images/ui/keycard-phone.png")
:keycard-connection (js-require/js-require "./resources/images/ui/keycard-connection.png")
:keycard-nfc-on (js-require/js-require "./resources/images/ui/keycard-nfc-on.png")
:hold-card-animation (js-require/js-require "./resources/images/ui/hold-card-animation.gif")
:warning-sign (js-require/js-require "./resources/images/ui/warning-sign.png")
:phone-nfc-on (js-require/js-require "./resources/images/ui/phone-nfc-on.png")

View File

@ -40,7 +40,7 @@
[react/view styles/authentication-methods
[authentication-method-row {:title (i18n/label :t/keycard)
:icon :main-icons/keycard
:on-press #(re-frame/dispatch [:hardwallet.ui/status-hardwallet-option-pressed])}]
:on-press #(re-frame/dispatch [:onboarding.ui/keycard-option-pressed])}]
[authentication-method-row {:title (i18n/label :t/password)
:icon :main-icons/password
:on-press #(re-frame/dispatch [:hardwallet.ui/password-option-pressed])}]]]])

View File

@ -56,7 +56,11 @@
(re-frame/reg-sub
:hardwallet-mnemonic
(fn [db]
(get-in db [:hardwallet :secrets :mnemonic])))
(map-indexed vector
(partition 3
(map-indexed vector (clojure.string/split
(get-in db [:hardwallet :secrets :mnemonic])
#" "))))))
(re-frame/reg-sub
:hardwallet-application-info

View File

@ -0,0 +1,7 @@
(ns status-im.ui.screens.keycard.onboarding.styles
(:require [status-im.ui.components.colors :as colors]))
(def container
{:flex 1
:justify-content :space-between
:background-color colors/white})

View File

@ -0,0 +1,515 @@
(ns status-im.ui.screens.keycard.onboarding.views
(:require-macros [status-im.utils.views :refer [defview letsubs]])
(:require [status-im.ui.components.react :as react]
[status-im.ui.screens.keycard.onboarding.styles :as styles]
[status-im.ui.components.toolbar.view :as toolbar]
[status-im.ui.components.colors :as colors]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]
[status-im.react-native.resources :as resources]
[status-im.ui.components.common.common :as components.common]
[status-im.ui.components.styles :as components.styles]
[status-im.ui.components.text-input.view :as text-input]
[status-im.ui.components.tooltip.views :as tooltip]))
(defn intro []
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
toolbar/default-nav-back
nil]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header}}
(i18n/label :t/keycard-onboarding-intro-header)]]
[react/view {:margin-top 16
:width 311}
[react/text {:style {:font-size 15
:line-height 22
:color colors/gray
:text-align :center}}
(i18n/label :t/keycard-onboarding-intro-text)]]
[react/view {:margin-top 33}
[react/touchable-highlight {:on-press #(.openURL (react/linking) "https://keycard.status.im")}
[react/view {:flex-direction :row
:align-items :center
:justify-content :center}
[react/text {:style {:text-align :center
:color colors/blue}}
(i18n/label :t/learn-more-about-keycard)]
[vector-icons/icon :tiny-icons/tiny-external {:color colors/blue
:container-style {:margin-left 5}}]]]]]
[react/view
[react/view {:align-items :center
:justify-content :center}
[react/image {:source (resources/get-image :keycard)
:style {:width 144
:height 114}}]]]
[react/view {:margin-bottom 50}
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:keycard.onboarding.intro.ui/begin-setup-pressed])}
[react/view {:background-color colors/gray-background
:align-items :center
:justify-content :center
:flex-direction :row
:width 133
:height 44
:border-radius 10}
[react/text {:style {:color colors/blue}}
(i18n/label :t/begin-set-up)]]]]]])
(defn start []
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
toolbar/default-nav-back
nil]
[react/scroll-view
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/keycard-onboarding-start-header)]]
[react/view {:margin-top 16
:width 311}
[react/text {:style {:font-size 15
:line-height 22
:color colors/gray
:text-align :center}}
(i18n/label :t/keycard-onboarding-start-text)]]
[react/view {:margin-top 20
:width "80%"}
(for [[number header text] [["1"
(i18n/label :t/keycard-onboarding-start-step1)
(i18n/label :t/keycard-onboarding-start-step1-text)]
["2"
(i18n/label :t/keycard-onboarding-start-step2)
(i18n/label :t/keycard-onboarding-start-step2-text)]
["3"
(i18n/label :t/keycard-onboarding-start-step3)
(i18n/label :t/keycard-onboarding-start-step3-text)]]]
^{:key number} [react/view {:flex-direction :row
:margin-top 15}
[react/view {:border-width 1
:border-radius 20
:border-color colors/gray-light
:align-items :center
:justify-content :center
:width 40
:height 40}
[react/text {:style {:typography :title}}
number]]
[react/view {:align-items :flex-start
:justify-content :flex-start
:margin-left 11}
[react/view
[react/text {:style {:typography :main-medium}}
header]]
[react/view
[react/text {:style {:color colors/gray
:padding-right 35}}
text]]]])]]
[react/view {:margin-bottom 12
:align-items :center
:justify-content :center}
[react/image {:source (resources/get-image :keycard-phone)
:resize-mode :center
:style {:width 160
:height 170}}]]]]])
(defview puk-code []
(letsubs [secrets [:hardwallet-secrets]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
[toolbar/nav-text
{:handler #(re-frame/dispatch [:keycard.onboarding.ui/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
"Step 2 of 3"]]
[react/scroll-view {:content-container-style {:flex-grow 1
:justify-content :space-between}}
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/keycard-onboarding-puk-code-header)]]
[react/view {:margin-top 32
:width "85%"}
[react/view {:justify-content :center
:flex-direction :row}
[react/view {:width "100%"
:margin-horizontal 16
:height 108
:align-items :center
:justify-content :space-between
:flex-direction :column
:background-color colors/gray-lighter
:border-radius 8}
[react/view {:justify-content :center
:flex 1
:margin-top 10}
[react/text {:style {:color colors/gray
:text-align :center}}
(i18n/label :t/puk-code)]]
[react/view {:justify-content :flex-start
:flex 1}
[react/text {:style {:typography :header
:text-align :center
:color colors/blue}}
(:puk secrets)]]]]
[react/view {:margin-top 16}
[react/text {:style {:color colors/gray}}
(i18n/label :t/puk-code-explanation)]]
[react/view {:justify-content :center
:margin-top 32
:flex-direction :row}
[react/view {:width "100%"
:margin-horizontal 16
:height 108
:align-items :center
:justify-content :space-between
:flex-direction :column
:background-color colors/gray-lighter
:border-radius 8}
[react/view {:justify-content :center
:flex 1
:margin-top 10}
[react/text {:style {:color colors/gray
:text-align :center}}
(i18n/label :t/pair-code)]]
[react/view {:justify-content :flex-start
:flex 1}
[react/text {:style {:typography :header
:text-align :center
:color colors/blue}}
(:password secrets)]]]]
[react/view {:margin-top 16}
[react/text {:style {:color colors/gray}}
(i18n/label :t/pair-code-explanation)]]]]
[react/view {:flex-direction :row
:justify-content :space-between
:align-items :center
:width "100%"
:height 86}
[react/view components.styles/flex]
[react/view {:margin-right 20}
[components.common/bottom-button
{:on-press #(re-frame/dispatch [:keycard.onboarding.puk-code.ui/next-pressed])
:forward? true}]]]]]]))
(defn- loading [title-label]
[react/view styles/container
[toolbar/toolbar {:transparent? true
:style {:margin-top 32}}
nil nil]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/activity-indicator {:animating true
:size :large}]]
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label title-label)]]
[react/view {:margin-top 16
:width 311}
[react/text {:style {:font-size 15
:line-height 22
:color colors/gray
:text-align :center}}
(i18n/label :t/this-will-take-few-seconds)]]]
[react/view {:flex 1
:align-items :center
:justify-content :center}
[react/image {:source (resources/get-image :keycard-phone)
:resize-mode :center
:style {:width 160
:height 170}}]
[react/view {:margin-top 10}
[react/text {:style {:text-align :center
:color colors/gray
:font-size 15
:line-height 22}}
(i18n/label :t/hold-card)]]]]])
(defn preparing []
(loading :t/keycard-onboarding-preparing-header))
(defn pairing []
(loading :t/keycard-onboarding-pairing-header))
(defn finishing []
(loading :t/keycard-onboarding-finishing-header))
(defn connection-lost []
[react/view {:flex 1
:justify-content :center
:align-items :center
:background-color "rgba(4, 4, 15, 0.4)"}
[react/view {:background-color colors/white
:height 478
:width "85%"
:border-radius 16
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:margin-top 32}
[react/text {:style {:typography :title-bold
:text-align :center}}
(i18n/label :t/connection-with-the-card-lost)]
[react/view {:margin-top 16}
[react/text {:style {:color colors/gray
:text-align :center}}
(i18n/label :t/connection-with-the-card-lost-text)]]]
[react/view {:margin-top 16}
[react/image {:source (resources/get-image :keycard-connection)
:resize-mode :center
:style {:width 200
:height 200}}]]
[react/view {:margin-bottom 43}
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:keycard.onboarding.connection-lost.ui/cancel-setup-pressed])}
[react/text {:style {:color colors/red
:text-align :center}}
(i18n/label :t/cancel-keycard-setup)]]]]])
(defn nfc-on []
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
toolbar/default-nav-back
nil]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header}}
(i18n/label :t/turn-nfc-on)]]]
[react/view
[react/view {:align-items :center
:justify-content :center}
[react/image {:source (resources/get-image :keycard-nfc-on)
:style {:width 170
:height 170}}]]]
[react/view
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:keycard.onboarding.nfc-on/open-nfc-settings-pressed])}
[react/text {:style {:font-size 15
:line-height 22
:color colors/blue
:text-align :center
:margin-bottom 30}}
(i18n/label :t/open-nfc-settings)]]]]])
(def pin status-im.ui.screens.hardwallet.pin.views/create-pin)
(defview recovery-phrase []
(letsubs [mnemonic [:hardwallet-mnemonic]]
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
[toolbar/nav-text
{:handler #(re-frame/dispatch [:keycard.onboarding.ui/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
"Step 3 of 3"]]
[react/scroll-view {:content-container-style {:flex-grow 1
:justify-content :space-between}}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/keycard-onboarding-recovery-phrase-header)]]
[react/view {:margin-top 16
:width "85%"
:flex-direction :column
:align-items :center}
[react/text {:style {:text-align :center
:color colors/gray}}
(i18n/label :t/keycard-onboarding-recovery-phrase-text)]
[react/view
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:keycard.onboarding.recovery-phrase.ui/learn-more-pressed])}
[react/text {:style {:color colors/blue}}
(i18n/label :t/learn-more)]]]]]
[react/view
[react/view
(for [[i row] mnemonic]
^{:key (str "row" i)}
[react/view {:flex-direction :row
:margin-top 12}
(for [[i word] row]
^{:key (str "word" i)}
[react/view {:flex-direction :row
:background-color colors/gray-lighter
:padding-horizontal 14
:padding-vertical 7
:border-radius 48
:margin-left 12}
[react/text {:style {:color colors/gray}}
(str (inc i) ". ")]
[react/text
word]])])]
[react/view {:margin-top 24}
[react/text {:style {:text-align :center}}
(i18n/label :t/keycard-onboarding-recovery-phrase-description)]]]
[react/view {:flex-direction :row
:justify-content :space-between
:align-items :center
:width "100%"
:height 86}
[react/view components.styles/flex]
[react/view {:margin-right 20}
[components.common/bottom-button
{:on-press #(re-frame/dispatch [:keycard.onboarding.recovery-phrase.ui/next-pressed])
:label (i18n/label :t/confirm)
:forward? true}]]]]]))
(defview recovery-phrase-confirm-word []
(letsubs [word [:hardwallet-recovery-phrase-word]
input-word [:hardwallet-recovery-phrase-input-word]
error [:hardwallet-recovery-phrase-confirm-error]]
(let [{:keys [word idx]} word]
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
[toolbar/nav-text
{:handler #(re-frame/dispatch [:keycard.onboarding.ui/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
"Step 3 of 3"]]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/keycard-recovery-phrase-confirm-header)]]
[react/view {:margin-top 16
:align-items :center}
[react/text {:style {:typography :header
:color colors/gray
:text-align :center}}
(i18n/label :t/word-n {:number (inc idx)})]]]
[react/view
[text-input/text-input-with-label
{:on-change-text #(re-frame/dispatch [:keycard.onboarding.recovery-phrase-confirm-word.ui/input-changed %])
:auto-focus true
:on-submit-editing #(re-frame/dispatch [:keycard.onboarding.recovery-phrase-confirm-word.ui/input-submitted])
:placeholder nil
:container {:background-color :white}
:style {:background-color :white
:height 24
:typography :header}}]
[react/view {:margin-top 5
:width 250}
[tooltip/tooltip error]]]
[react/view {:flex-direction :row
:justify-content :space-between
:align-items :center
:width "100%"
:height 86}
[react/view {:margin-left 20}
[components.common/bottom-button
{:on-press #(re-frame/dispatch [:keycard.onboarding.recovery-phrase-confirm-word.ui/back-pressed])
:back? true
:label (i18n/label :t/back)}]]
[react/view {:margin-right 20}
[components.common/bottom-button
{:on-press #(re-frame/dispatch [:keycard.onboarding.recovery-phrase-confirm-word.ui/next-pressed])
:label (i18n/label :t/next)
:disabled? (empty? input-word)
:forward? true}]]]]])))
(defview pair []
(letsubs [pair-code [:hardwallet-pair-code]
error [:hardwallet-setup-error]
width [:dimensions/window-width]
ref (atom nil)]
[react/view styles/container
[toolbar/toolbar
{:transparent? true
:style {:margin-top 32}}
[toolbar/nav-text
{:handler #(re-frame/dispatch [:keycard.onboarding.ui/cancel-pressed])
:style {:padding-left 21}}
(i18n/label :t/cancel)]
[react/text {:style {:color colors/gray}}
"Step 3 of 3"]]
[react/view {:flex 1
:flex-direction :column
:justify-content :space-between
:align-items :center}
[react/view {:flex-direction :column
:align-items :center}
[react/view {:margin-top 16}
[react/text {:style {:typography :header
:text-align :center}}
(i18n/label :t/enter-pair-code)]]
[react/view {:margin-top 16
:width "85%"
:align-items :center}
[react/text {:style {:color colors/gray
:text-align :center}}
(i18n/label :t/enter-pair-code-description)]]]
[react/view
[text-input/text-input-with-label
{:on-change-text #(re-frame/dispatch [:keycard.onboarding.pair.ui/input-changed %])
:auto-focus true
:on-submit-editing #(re-frame/dispatch [:keycard.onboarding.pair.ui/input-submitted])
:error error
:placeholder nil
:container {:background-color :white}
:style {:background-color :white
:height 24
:typography :header}}]]
[react/view {:flex-direction :row
:justify-content :space-between
:align-items :center
:width "100%"
:height 86}
[react/view]
[react/view {:margin-right 20}
[components.common/bottom-button
{:on-press #(re-frame/dispatch [:keycard.onboarding.pair.ui/next-pressed])
:label (i18n/label :t/pair-card)
:disabled? (empty? pair-code)
:forward? true}]]]]]))

View File

@ -12,7 +12,20 @@
:hardwallet-connect
:enter-pin-login
:hardwallet-setup
:hardwallet-success})
:hardwallet-success
:keycard-onboarding-intro
:keycard-onboarding-start
:keycard-onboarding-puk-code
:keycard-onboarding-preparing
:keycard-onboarding-pairing
:keycard-onboarding-finishing
:keycard-onboarding-connection-lost
:keycard-onboarding-pin
:keycard-onboarding-pair
:keycard-onboarding-nfc-on
:keycard-onboarding-recovery-phrase
:keycard-onboarding-recovery-phrase-confirm-word1
:keycard-onboarding-recovery-phrase-confirm-word2})
(defn login-stack [view-id]
{:name :login-stack
@ -37,6 +50,20 @@
(defn intro-stack []
(-> (login-stack :intro)
(update :screens conj :intro)
(update :screens conj
:intro
:keycard-onboarding-intro
:keycard-onboarding-start
:keycard-onboarding-puk-code
:keycard-onboarding-preparing
:keycard-onboarding-pairing
:keycard-onboarding-finishing
:keycard-onboarding-connection-lost
:keycard-onboarding-pin
:keycard-onboarding-pair
:keycard-onboarding-nfc-on
:keycard-onboarding-recovery-phrase
:keycard-onboarding-recovery-phrase-confirm-word1
:keycard-onboarding-recovery-phrase-confirm-word2)
(assoc :name :intro-stack)
(assoc :config {:initialRouteName :intro})))

View File

@ -21,4 +21,5 @@
:selection-modal-screen
:wallet-transactions-filter
:profile-qr-viewer
:welcome])
:welcome
:keycard-welcome])

View File

@ -29,6 +29,7 @@
[status-im.ui.screens.hardwallet.settings.views :as hardwallet.settings]
[status-im.ui.screens.hardwallet.setup.views :as hardwallet.setup]
[status-im.ui.screens.hardwallet.success.views :as hardwallet.success]
[status-im.ui.screens.keycard.onboarding.views :as keycard.onboarding]
[status-im.ui.screens.help-center.views :as help-center]
[status-im.ui.screens.home.views :as home]
[status-im.ui.screens.intro.views :as intro]
@ -64,98 +65,112 @@
[status-im.ui.screens.wallet.account.views :as wallet.account]))
(def all-screens
{:login login/login
:progress progress/progress
:create-account accounts.create/create-account
:recover recover/recover
:accounts accounts/accounts
:intro intro/intro
:hardwallet-authentication-method hardwallet.authentication/hardwallet-authentication-method
:hardwallet-connect hardwallet.connect/hardwallet-connect
:hardwallet-connect-settings hardwallet.connect/hardwallet-connect
:hardwallet-connect-sign hardwallet.connect/hardwallet-connect
:hardwallet-connect-modal [:modal hardwallet.connect/hardwallet-connect]
:enter-pin-login hardwallet.pin/enter-pin
:enter-pin-settings hardwallet.pin/enter-pin
:enter-pin-sign hardwallet.pin/enter-pin
:enter-pin-modal [:modal hardwallet.pin/enter-pin]
:hardwallet-setup hardwallet.setup/hardwallet-setup
:hardwallet-success hardwallet.success/hardwallet-success
:home home/home-wrapper
:chat chat/chat
:profile profile.contact/profile
:new add-new/add-new
:new-chat new-chat/new-chat
:qr-scanner qr-scanner/qr-scanner
:profile-qr-viewer [:modal profile.user/qr-viewer]
:take-picture extensions.module/take-picture-view
:extension-screen-holder extensions.module/screen-holder-view
:new-group group/new-group
:add-participants-toggle-list group/add-participants-toggle-list
:contact-toggle-list group/contact-toggle-list
:group-chat-profile profile.group-chat/group-chat-profile
:new-public-chat new-public-chat/new-public-chat
:open-dapp open-dapp/open-dapp
:browser browser/browser
:stickers stickers/packs
:stickers-pack stickers/pack
:stickers-pack-modal [:modal stickers/pack-modal]
:tribute-learn-more [:modal tr-to-talk/learn-more]
:chat-modal [:modal chat/chat-modal]
:show-extension-modal [:modal extensions.module/show-extension-modal-view]
:wallet wallet.accounts/accounts-overview
:wallet-account wallet.account/account
:collectibles-list collectibles/collectibles-list
:contact-code wallet.components/contact-code
:wallet-send-transaction send/send-transaction
:recent-recipients wallet.components/recent-recipients
:recipient-qr-code wallet.components/recipient-qr-code
:wallet-send-assets wallet.components/send-assets
:wallet-request-transaction request/request-transaction
:wallet-send-transaction-request request/send-transaction-request
:wallet-request-assets wallet.components/request-assets
:unsigned-transactions wallet-transactions/transactions
:transactions-history wallet-transactions/transactions
:wallet-transaction-details wallet-transactions/transaction-details
:wallet-settings-hook wallet-settings/settings-hook
:selection-modal-screen [:modal extensions.module/selection-modal-screen-view]
:wallet-settings-assets wallet-settings/manage-assets
:wallet-add-custom-token custom-tokens/add-custom-token
:wallet-custom-token-details custom-tokens/custom-token-details
:wallet-transactions-filter [:modal wallet-transactions/filter-history]
:my-profile profile.user/my-profile
:my-profile-ext-settings profile.user/extensions-settings
:contacts-list contacts-list/contacts-list
:ens-main ens/main
:ens-register ens/register
:ens-terms ens/terms
:ens-name-details ens/name-details
:blocked-users-list contacts-list/blocked-users-list
:profile-photo-capture photo-capture/profile-photo-capture
:about-app about-app/about-app
:bootnodes-settings bootnodes-settings/bootnodes-settings
:installations pairing/installations
:edit-bootnode edit-bootnode/edit-bootnode
:offline-messaging-settings offline-messaging-settings/offline-messaging-settings
:edit-mailserver edit-mailserver/edit-mailserver
:help-center help-center/help-center
:dapps-permissions dapps-permissions/dapps-permissions
:manage-dapps-permissions dapps-permissions/manage
:extensions-settings extensions.module/extensions-settings-view
:edit-extension extensions.module/edit-extension-view
:show-extension extensions.module/show-extension-view
:network-settings network/network-settings-view
:network-details network/network-details-view
:edit-network network/edit-network-view
:log-level-settings log-level-settings/log-level-settings
:fleet-settings fleet-settings/fleet-settings
:currency-settings currency-settings/currency-settings
:backup-seed profile.seed/backup-seed
:tribute-to-talk tr-to-talk/tribute-to-talk
:reset-card hardwallet.settings/reset-card
:keycard-settings hardwallet.settings/keycard-settings
:mobile-network-settings mobile-network-settings/mobile-network-settings
:welcome [:modal home/welcome]})
{:login login/login
:progress progress/progress
:create-account accounts.create/create-account
:recover recover/recover
:accounts accounts/accounts
:intro intro/intro
:hardwallet-authentication-method hardwallet.authentication/hardwallet-authentication-method
:hardwallet-connect hardwallet.connect/hardwallet-connect
:hardwallet-connect-settings hardwallet.connect/hardwallet-connect
:hardwallet-connect-sign hardwallet.connect/hardwallet-connect
:hardwallet-connect-modal [:modal hardwallet.connect/hardwallet-connect]
:enter-pin-login hardwallet.pin/enter-pin
:enter-pin-settings hardwallet.pin/enter-pin
:enter-pin-sign hardwallet.pin/enter-pin
:enter-pin-modal [:modal hardwallet.pin/enter-pin]
:hardwallet-setup hardwallet.setup/hardwallet-setup
:hardwallet-success hardwallet.success/hardwallet-success
:keycard-onboarding-intro keycard.onboarding/intro
:keycard-onboarding-start keycard.onboarding/start
:keycard-onboarding-puk-code keycard.onboarding/puk-code
:keycard-onboarding-preparing keycard.onboarding/preparing
:keycard-onboarding-pairing keycard.onboarding/pairing
:keycard-onboarding-finishing keycard.onboarding/finishing
:keycard-onboarding-connection-lost keycard.onboarding/connection-lost
:keycard-onboarding-pin keycard.onboarding/pin
:keycard-onboarding-pair keycard.onboarding/pair
:keycard-onboarding-nfc-on keycard.onboarding/nfc-on
:keycard-onboarding-recovery-phrase keycard.onboarding/recovery-phrase
:keycard-onboarding-recovery-phrase-confirm-word1 keycard.onboarding/recovery-phrase-confirm-word
:keycard-onboarding-recovery-phrase-confirm-word2 keycard.onboarding/recovery-phrase-confirm-word
:home home/home-wrapper
:chat chat/chat
:profile profile.contact/profile
:new add-new/add-new
:new-chat new-chat/new-chat
:qr-scanner qr-scanner/qr-scanner
:profile-qr-viewer [:modal profile.user/qr-viewer]
:take-picture extensions.module/take-picture-view
:extension-screen-holder extensions.module/screen-holder-view
:new-group group/new-group
:add-participants-toggle-list group/add-participants-toggle-list
:contact-toggle-list group/contact-toggle-list
:group-chat-profile profile.group-chat/group-chat-profile
:new-public-chat new-public-chat/new-public-chat
:open-dapp open-dapp/open-dapp
:browser browser/browser
:stickers stickers/packs
:stickers-pack stickers/pack
:stickers-pack-modal [:modal stickers/pack-modal]
:tribute-learn-more [:modal tr-to-talk/learn-more]
:chat-modal [:modal chat/chat-modal]
:show-extension-modal [:modal extensions.module/show-extension-modal-view]
:wallet wallet.accounts/accounts-overview
:wallet-account wallet.account/account
:collectibles-list collectibles/collectibles-list
:contact-code wallet.components/contact-code
:wallet-send-transaction send/send-transaction
:recent-recipients wallet.components/recent-recipients
:recipient-qr-code wallet.components/recipient-qr-code
:wallet-send-assets wallet.components/send-assets
:wallet-request-transaction request/request-transaction
:wallet-send-transaction-request request/send-transaction-request
:wallet-request-assets wallet.components/request-assets
:unsigned-transactions wallet-transactions/transactions
:transactions-history wallet-transactions/transactions
:wallet-transaction-details wallet-transactions/transaction-details
:wallet-settings-hook wallet-settings/settings-hook
:selection-modal-screen [:modal extensions.module/selection-modal-screen-view]
:wallet-settings-assets wallet-settings/manage-assets
:wallet-add-custom-token custom-tokens/add-custom-token
:wallet-custom-token-details custom-tokens/custom-token-details
:wallet-transactions-filter [:modal wallet-transactions/filter-history]
:my-profile profile.user/my-profile
:my-profile-ext-settings profile.user/extensions-settings
:contacts-list contacts-list/contacts-list
:ens-main ens/main
:ens-register ens/register
:ens-terms ens/terms
:ens-name-details ens/name-details
:blocked-users-list contacts-list/blocked-users-list
:profile-photo-capture photo-capture/profile-photo-capture
:about-app about-app/about-app
:bootnodes-settings bootnodes-settings/bootnodes-settings
:installations pairing/installations
:edit-bootnode edit-bootnode/edit-bootnode
:offline-messaging-settings offline-messaging-settings/offline-messaging-settings
:edit-mailserver edit-mailserver/edit-mailserver
:help-center help-center/help-center
:dapps-permissions dapps-permissions/dapps-permissions
:manage-dapps-permissions dapps-permissions/manage
:extensions-settings extensions.module/extensions-settings-view
:edit-extension extensions.module/edit-extension-view
:show-extension extensions.module/show-extension-view
:network-settings network/network-settings-view
:network-details network/network-details-view
:edit-network network/edit-network-view
:log-level-settings log-level-settings/log-level-settings
:fleet-settings fleet-settings/fleet-settings
:currency-settings currency-settings/currency-settings
:backup-seed profile.seed/backup-seed
:tribute-to-talk tr-to-talk/tribute-to-talk
:reset-card hardwallet.settings/reset-card
:keycard-settings hardwallet.settings/keycard-settings
:mobile-network-settings mobile-network-settings/mobile-network-settings
:welcome [:modal home/welcome]
:keycard-welcome [:modal home/welcome]})
(defn get-screen [screen]
(get all-screens screen #(throw (str "Screen " screen " is not defined."))))

View File

@ -816,6 +816,7 @@
"link-card": "Link the card and use it to confirm your identity on the platform.",
"hold-card": "Hold card to the back\n of your phone",
"turn-nfc-on": "Turn NFC on to continue",
"open-nfc-settings": "Open NFC settings",
"go-to-settings": "Go to Settings...",
"card-is-empty": "Card is empty",
"card-is-blank": "This card is blank",
@ -835,11 +836,11 @@
"puk-code": "PUK code",
"puk-code-explanation": "If you forget your PIN or enter it incorrectly 3 times, you'll need this code to unlock your card.",
"pair-code": "Pair code",
"pair-code-explanation": "Pairs card to a different device with the same Status account on it",
"secret-keys-confirmation-title": "Did you write them down?",
"secret-keys-confirmation-text": "Record these now because you won't see this screen again",
"pair-code-explanation": "Pairs card to a different device with the same Status account on it.",
"secret-keys-confirmation-confirm": "GOT IT",
"secret-keys-confirmation-cancel": "SEE IT AGAIN",
"secret-keys-confirmation-title": "Written the codes down?",
"secret-keys-confirmation-text": "You will need them to continue to use your Keycard in case you ever loose your phone.",
"completing-card-setup": "Completing card setup",
"generating-mnemonic": "Generating mnemonic phrase",
"next-step-generating-mnemonic": "Next step is generating mnemonic phrase for your card",
@ -886,13 +887,14 @@
"reset-card": "Reset card",
"reset-card-description": "This operation will reset card to initial state. It will erase all card data including private keys. Operation is not reversible.",
"unpair-card": "Unpair card",
"pair-card": "Pair card",
"card-unpaired": "Card has been unpaired from current device",
"card-reseted": "Card has been reseted",
"unpair-card-confirmation": "This operation will unpair card from current device. Requires PIN authorization. Do you want to proceed?",
"pair-card": "Pair to this device",
"pair-card-question": "Card is ready to pair",
"enter-pair-code": "Enter pair code",
"enter-pair-code-description": "SECURITY NOTE: Use only the code you wrote down during card setup.",
"enter-pair-code": "Enter your pairing code",
"enter-pair-code-description": "Pairing code was displayed to you during the Keycard setup",
"no-pairing-slots-available": "This card is already paired to 5 devices and cannot pair to this one. Please use one of the paired devices, log in with this card and free up pairing slots on the card",
"keycard-has-account-on-it": "This card has already an account on it. If you wish to change it, login first and reset your card. If you want to import keycard account, please use \"Add existing account\"",
"card-already-linked": "Card is already linked to another account",
@ -1152,5 +1154,31 @@
"set-currency" : "Set currency",
"view-signing" : "View signing phrase",
"history" : "History",
"no-collectibles" : "No collectibles available"
"no-collectibles" : "No collectibles available",
"keycard-onboarding-intro-header": "Store your key on Keycard",
"keycard-onboarding-intro-text": "A secure, contactless, open source Hardwallet. Android only.",
"learn-more-about-keycard": "Learn more about Keycard",
"keycard-onboarding-start-header": "Hold card to the back\n of your phone to start",
"keycard-onboarding-start-text": "And maintain card to phone contact\n during the setup. The setup will take around 4 minutes",
"keycard-onboarding-start-step1": "Create a passcode",
"keycard-onboarding-start-step1-text": "Around 1 minute. Create a 6-digit code to encrypt your key",
"keycard-onboarding-start-step2": "Write down PUK and the pairing code",
"keycard-onboarding-start-step2-text": "Around 1 minute. You are going to need a piece of paper and a pencil for that",
"keycard-onboarding-start-step3": "Back up the recovery phrase",
"keycard-onboarding-start-step3-text": "Around 1 minute. Also a piece of paper and a pencil are necessary",
"keycard-onboarding-puk-code-header": "Write codes down\n and store them securely",
"keycard-onboarding-preparing-header": "Preparing the card...",
"keycard-onboarding-pairing-header": "Pairing the card...",
"keycard-onboarding-finishing-header": "Finishing up",
"connection-with-the-card-lost": "Connection with the card\n has been lost",
"connection-with-the-card-lost-text": "To resume the setup hold the card to\n the back of your phone and maintain\n card to phone contact",
"cancel-keycard-setup": "Cancel Keycard setup",
"keycard-onboarding-recovery-phrase-header": "Backup “Seed” phrase",
"keycard-onboarding-recovery-phrase-text": "For your eyes only. This is the magical seed used to generate your key.",
"keycard-onboarding-recovery-phrase-description": "With this Seed phrase you can always get your key back. Write the Seed phrase down. Keep it safe, offline, and separate from this device.",
"keycard-recovery-phrase-confirmation-title": "Written the Seed phrase down?",
"keycard-recovery-phrase-confirmation-text": "You cannot do this later. Without the Seed phrase you will not be able to access your key or any assets associated with it if you loose your device.",
"keycard-recovery-phrase-confirm-header": "Confirm “Seed” phrase",
"keycard-cancel-setup-title": "Dangerous operation",
"keycard-cancel-setup-text": "This will cancel keycard setup. It's highly recommended to finish the setup in order to use keycard. Do you really want to cancel?"
}