Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed May 17, 2024
1 parent 6b1cda9 commit e8faea0
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions src/status_im/contexts/wallet/add_account/create_account/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -82,41 +82,40 @@
"hidden" :false}]}]


#_(do
#_(native-module.core/get-random-mnemonic #(def --a %))
(comment
(native-module.core/get-random-mnemonic #(def --mnemonic %))
--mnemonic

#_(native-module.core/create-account-from-mnemonic
{:MnemonicPhrase --a
:paths ["m/44'/60'/0'/0/0"]}
(fn [x]
(def --b x)))
(native-module.core/create-account-from-mnemonic
{:MnemonicPhrase --mnemonic
:paths ["m/44'/60'/0'/0/0"]}
(fn [x]
(def --account x)))
--account

#_(status-im.common.json-rpc.events/call
{:method "accounts_importMnemonic"
:params [(native-module.core/sha3 "Hola1234.,")
(:mnemonic --b)]
:on-success (fn [x] (js/alert x))
:on-error #(log/error "failed to import Mnemonic " %)})
(status-im.common.json-rpc.events/call
{:method "accounts_importMnemonic"
:params [(native-module.core/sha3 "Hola1234.,")
(:mnemonic --account)]
:on-success (fn [x] (js/alert "success!" (prn-str x)))
:on-error #(js/alert (str "ERROR\nFailed to import Mnemonic\n\n" (prn-str %)))})


#_(let [kp-data (assoc
(status-im.contexts.wallet.add-account.create-account.utils/prepare-new-keypair
{:new-keypair
--b
:new-account
{:account-name "Acc 1"
:account-color :turquoise
:emoji (status-im.common.emoji-picker.utils/random-emoji)}})
:name
"My kp 2")]
(status-im.common.json-rpc.events/call
{:method "accounts_addKeypair"
:params [(native-module.core/sha3 "Hola1234.,")
kp-data]
:on-success [:wallet/add-account-success (string/lower-case (:address --b))]
:on-error #(log/info "___________________ KP ERROR\n\n " %)}))
(let [kp-data (assoc
(status-im.contexts.wallet.add-account.create-account.utils/prepare-new-keypair
{:new-keypair --account
:new-account {:account-name "Acc 1"
:account-color :turquoise
:emoji (status-im.common.emoji-picker.utils/random-emoji)}})
:name "My new Keypair 2")]

)
(status-im.common.json-rpc.events/call
{:method "accounts_addKeypair"
:params [(native-module.core/sha3 "Hola1234.,")
kp-data]
:on-success [:wallet/add-account-success (clojure.string/lower-case (:address --account))]
:on-error #(js/alert (str "___________________ KP ERROR\n\n " (prn-str %)))}))
)

["0x759e6bc12c2ff1afff2a65ac74b9bc0d92a641d4d6ef4bae1713d4a365eda3de"
{"key-uid" "0xef578a90bc6cfb827712864a8314e1ad60fbf566de5cb861ccc8f4eec4060f53",
Expand Down

0 comments on commit e8faea0

Please sign in to comment.