some polishing

This commit is contained in:
Brian Sztamfater
2023-12-04 20:48:21 -03:00
parent 710829d248
commit 372bf83da5
5 changed files with 12 additions and 14 deletions
+6 -6
View File
@@ -126,7 +126,7 @@
(rf/defn clean-scanned-address
{:events [:wallet/clean-scanned-address]}
[{:keys [db]}]
{:db (dissoc db :wallet/scanned-address :wallet/send-address)})
{:db (update-in db [:wallet :ui :send] dissoc :to-address)})
(rf/reg-event-fx :wallet/create-derived-addresses
(fn [{:keys [db]} [password {:keys [path]} on-success]]
@@ -354,6 +354,7 @@
(rf/reg-event-fx :wallet/select-send-address
(fn [{:keys [db]} [address]]
(println address "dsadass")
{:db (assoc-in db [:wallet :ui :send :to-address] address)}))
(rf/reg-event-fx :wallet/get-address-details-success
@@ -388,8 +389,8 @@
(rf/reg-event-fx :wallet/get-suggested-routes
(fn [{:keys [db]}]
(let [wallet-address (get-in db [:wallet :current-viewing-account-address])
tokens (get-in db [:wallet :accounts])
account (get-in db [:wallet :accounts wallet-address])
;tokens (get-in db [:wallet :accounts])
;account (get-in db [:wallet :accounts wallet-address])
token (get-in db [:wallet :ui :send :token])
to-address (get-in db [:wallet :ui :send :to-address])
token-decimal 18
@@ -410,7 +411,7 @@
network-preferences
gas-rates
{}]]
(println token "fdsfsdfsfdfs")
(prn "=====" request-params)
{:json-rpc/call [{:method "wallet_getSuggestedRoutes"
:params request-params
:on-success (fn [suggested-routes]
@@ -429,7 +430,7 @@
to-address (get-in db [:wallet :ui :send :to-address])
best (first (:Best suggested-routes))
from (:From best)
to (:To best)
;to (:To best)
token (get-in db [:wallet :ui :send :token])
token-id (:symbol token)
from-asset token-id
@@ -462,7 +463,6 @@
:Data "0x"}}]
sha3-pwd (native-module/sha3 (str (security/safe-unmask-data password)))
request-params [multi-transaction-command transaction-bridge sha3-pwd]]
(prn from "++++BESTSTT")
(prn "=====" request-params)
{:json-rpc/call [{:method "wallet_createMultiTransaction"
:params request-params
@@ -48,7 +48,7 @@
[input-value input-focused?]
(fn []
(let [scanned-address (rf/sub [:wallet/scanned-address])
send-address (rf/sub [:wallet/send-address])
send-address (get-in (rf/sub [:wallet]) [:ui :send :to-address])
valid-ens-or-address? (rf/sub [:wallet/valid-ens-or-address?])]
[quo/address-input
{:on-focus (fn []
@@ -7,10 +7,10 @@
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.common.standard-authentication.core :as standard-auth]
[status-im2.contexts.wallet.send.transaction-confirmation.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[status-im2.common.standard-authentication.core :as standard-auth]))
[utils.re-frame :as rf]))
(defn- transaction-title
[]
@@ -145,8 +145,7 @@
(defn- f-view-internal
[_]
(let [reset-slider? (reagent/atom false)
margin-top (safe-area/get-top)
(let [margin-top (safe-area/get-top)
biometric-auth? false
on-close #(rf/dispatch [:navigate-back-within-stack :wallet-select-asset])
status-account-props {:customization-color :purple
-1
View File
@@ -156,7 +156,6 @@
(reg-root-key-sub :wallet/scanned-address :wallet/scanned-address)
(reg-root-key-sub :wallet/local-suggestions :wallet/local-suggestions)
(reg-root-key-sub :wallet/valid-ens-or-address? :wallet/valid-ens-or-address?)
(reg-root-key-sub :wallet/send-address :wallet/send-address)
;;debug
(when js/goog.DEBUG
+2 -2
View File
@@ -47,8 +47,8 @@
:<- [:wallet/accounts]
:<- [:wallet/balances]
:<- [:wallet/tokens-loading?]
(fn [[accounts balances tokens-loading?]]
(mapv (fn [{:keys [color address type] :as account}]
(fn [[accounts balances _]]
(mapv (fn [{:keys [color address] :as account}]
(assoc account
:customization-color color
:type (if (= type :watch) :watch-only :empty)