-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into jc/collectible-transition
- Loading branch information
Showing
12 changed files
with
448 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 28 additions & 18 deletions
46
src/status_im/contexts/wallet/add_account/create_account/utils.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
(ns status-im.contexts.wallet.add-account.create-account.utils) | ||
(ns status-im.contexts.wallet.add-account.create-account.utils | ||
(:require [status-im.constants :as constants])) | ||
|
||
(defn prepare-new-keypair | ||
[{:keys [new-keypair address account-name account-color emoji derivation-path]}] | ||
(assoc new-keypair | ||
:name (:keypair-name new-keypair) | ||
:key-uid (:keyUid new-keypair) | ||
:type :seed | ||
:derived-from address | ||
:accounts [{:keypair-name (:keypair-name new-keypair) | ||
:key-uid (:keyUid new-keypair) | ||
:seed-phrase (:mnemonic new-keypair) | ||
:public-key (:publicKey new-keypair) | ||
:name account-name | ||
:type :seed | ||
:emoji emoji | ||
:colorID account-color | ||
:path derivation-path | ||
:address (:address new-keypair)}])) | ||
(defn first-derived-account | ||
[account-data] | ||
(-> account-data :derived first val)) | ||
|
||
(defn prepare-new-account | ||
[{keypair-name :keypair-name | ||
{:keys [keyUid address] :as account} :account-data | ||
{:keys [account-name color emoji]} :account-preferences}] | ||
(let [account-to-create (first-derived-account account) | ||
account-config {:address (:address account-to-create) | ||
:key-uid keyUid | ||
:wallet false | ||
:chat false | ||
:type :seed | ||
:path constants/path-default-wallet | ||
:public-key (:publicKey account-to-create) | ||
:name account-name | ||
:emoji emoji | ||
:colorID color | ||
:hidden false}] | ||
{:key-uid keyUid | ||
:name keypair-name | ||
:type :seed | ||
:derived-from address | ||
:last-used-derivation-index 0 | ||
:accounts [account-config]})) |
Oops, something went wrong.