mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-26 07:15:53 +00:00
[fix #8759] Сan't send funds from added account
- save added account in keystore properly so that it can be used - still needs a fix in status-go so that it works without having to relogin
This commit is contained in:
parent
b4b93aa3f7
commit
3597978131
@ -1881,11 +1881,11 @@
|
|||||||
:wallet.send/transaction
|
:wallet.send/transaction
|
||||||
:<- [::send-transaction]
|
:<- [::send-transaction]
|
||||||
:<- [:wallet]
|
:<- [:wallet]
|
||||||
:<- [:network-status]
|
:<- [:offline?]
|
||||||
:<- [:wallet/all-tokens]
|
:<- [:wallet/all-tokens]
|
||||||
:<- [:ethereum/chain-keyword]
|
:<- [:ethereum/chain-keyword]
|
||||||
(fn [[{:keys [amount symbol from to amount-error] :as transaction}
|
(fn [[{:keys [amount symbol from to amount-error] :as transaction}
|
||||||
wallet network-status all-tokens chain]]
|
wallet offline? all-tokens chain]]
|
||||||
(let [balance (get-in wallet [:accounts from :balance])
|
(let [balance (get-in wallet [:accounts from :balance])
|
||||||
token (tokens/asset-for all-tokens chain symbol)]
|
token (tokens/asset-for all-tokens chain symbol)]
|
||||||
(assoc (merge transaction
|
(assoc (merge transaction
|
||||||
@ -1896,7 +1896,7 @@
|
|||||||
:sign-enabled? (and to
|
:sign-enabled? (and to
|
||||||
(nil? amount-error)
|
(nil? amount-error)
|
||||||
(not (nil? amount))
|
(not (nil? amount))
|
||||||
(= :online network-status))))))
|
(not offline?))))))
|
||||||
|
|
||||||
;; NETWORK SETTINGS
|
;; NETWORK SETTINGS
|
||||||
|
|
||||||
|
@ -32,11 +32,20 @@
|
|||||||
(status/multiaccount-derive-addresses
|
(status/multiaccount-derive-addresses
|
||||||
id
|
id
|
||||||
[path]
|
[path]
|
||||||
#(re-frame/dispatch [:wallet.accounts/account-generated
|
(fn [result]
|
||||||
(merge
|
(status/multiaccount-store-derived
|
||||||
(get (types/json->clj %) (keyword path))
|
id
|
||||||
{:name (str "Account " path-num)
|
[path]
|
||||||
:color (rand-nth colors/account-colors)})])))))))))
|
password
|
||||||
|
(fn [result]
|
||||||
|
(let [{:keys [public-key address]}
|
||||||
|
(get (types/json->clj result) (keyword path))]
|
||||||
|
(re-frame/dispatch [:wallet.accounts/account-generated
|
||||||
|
{:name (str "Account " path-num)
|
||||||
|
:address address
|
||||||
|
:public-key public-key
|
||||||
|
:path path
|
||||||
|
:color (rand-nth colors/account-colors)}])))))))))))))
|
||||||
|
|
||||||
(fx/defn set-symbol-request
|
(fx/defn set-symbol-request
|
||||||
{:events [:wallet.accounts/share]}
|
{:events [:wallet.accounts/share]}
|
||||||
@ -61,13 +70,13 @@
|
|||||||
{:events [:wallet.accounts/save-generated-account]}
|
{:events [:wallet.accounts/save-generated-account]}
|
||||||
[{:keys [db] :as cofx}]
|
[{:keys [db] :as cofx}]
|
||||||
(let [{:keys [accounts latest-derived-path]} (:multiaccount db)
|
(let [{:keys [accounts latest-derived-path]} (:multiaccount db)
|
||||||
new-account (assoc (get-in db [:generate-account :account])
|
{:keys [account]} (:generate-account db)]
|
||||||
:path (str constants/path-root "/" latest-derived-path))]
|
|
||||||
(fx/merge cofx
|
(fx/merge cofx
|
||||||
{::json-rpc/call [{:method "accounts_saveAccounts"
|
{::json-rpc/call [{:method "accounts_saveAccounts"
|
||||||
:params [[new-account]]
|
:params [[account]]
|
||||||
:on-success #()}]}
|
:on-success #()}]
|
||||||
(multiaccounts.update/multiaccount-update {:accounts (conj accounts new-account)
|
:db (dissoc db :generate-account)}
|
||||||
|
(multiaccounts.update/multiaccount-update {:accounts (conj accounts account)
|
||||||
:latest-derived-path (inc latest-derived-path)} nil)
|
:latest-derived-path (inc latest-derived-path)} nil)
|
||||||
(wallet/update-balances nil)
|
(wallet/update-balances nil)
|
||||||
(navigation/navigate-to-cofx :wallet nil))))
|
(navigation/navigate-to-cofx :wallet nil))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user