Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
984bc74b6d | ||
|
|
17cd163f25 | ||
|
|
f3c967f26b | ||
|
|
9f78eaa91d | ||
|
|
778b06abb2 | ||
|
|
68d7eddb4d | ||
|
|
c7165cf078 | ||
|
|
50dcf9d9b9 | ||
|
|
372bf83da5 | ||
|
|
710829d248 | ||
|
|
23fae29f9d | ||
|
|
daf3e52281 | ||
|
|
3338a4b1a1 | ||
|
|
9ead91c383 | ||
|
|
fb84885af0 | ||
|
|
4aac04e931 | ||
|
|
90166e8762 | ||
|
|
d68fdb18f4 | ||
|
|
e46f4d9081 | ||
|
|
dd2fd3410b | ||
|
|
085e2df34c | ||
|
|
51bfd3567c | ||
|
|
fb6d907cc5 | ||
|
|
a88c5b7bf7 |
@@ -4,7 +4,7 @@
|
||||
|
||||
(defn container
|
||||
[networks? theme]
|
||||
{:width 335
|
||||
{:width "100%"
|
||||
:height (if networks? 90 56)
|
||||
:border-radius 16
|
||||
:border-width 1
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
:align-items :flex-end}}
|
||||
[rn/image
|
||||
{:style style/token
|
||||
:source (resources/get-token token)}]
|
||||
:source (resources/get-token (keyword (string/lower-case token)))}]
|
||||
[rn/text-input
|
||||
(cond-> {:auto-focus true
|
||||
:ref #(reset! input-ref %)
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
(rf/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:currency
|
||||
currency
|
||||
"USD"
|
||||
{})
|
||||
(prices/update-prices)))
|
||||
|
||||
@@ -172,8 +172,7 @@
|
||||
:use-mailservers? true
|
||||
:recovered recovered}
|
||||
config/default-multiaccount)
|
||||
;; The address from which we derive any chat
|
||||
;; account/encryption keys
|
||||
;; The address from which we derive any chat account/encryption keys
|
||||
eip1581-address
|
||||
(assoc :eip1581-address eip1581-address)
|
||||
save-mnemonic?
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
transactions-management-enabled?
|
||||
wakuv2-flag
|
||||
current-fleet
|
||||
webview-debug]}]
|
||||
webview-debug
|
||||
test-networks-enabled?]}]
|
||||
(keep
|
||||
identity
|
||||
[{:size :small
|
||||
@@ -95,6 +96,15 @@
|
||||
[:profile.settings/change-webview-debug (not webview-debug)])
|
||||
:accessory :switch
|
||||
:active webview-debug}
|
||||
{:size :small
|
||||
:title "Test Networks Enabled"
|
||||
:accessibility-label :test-networks-enabled
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch
|
||||
[:profile.settings/change-test-networks-enabled (not test-networks-enabled?)])
|
||||
:accessory :switch
|
||||
:active test-networks-enabled?}
|
||||
{:size :small
|
||||
:title (i18n/label :t/waku-bloom-filter-mode)
|
||||
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
||||
@@ -117,7 +127,8 @@
|
||||
|
||||
(views/defview advanced-settings
|
||||
[]
|
||||
(views/letsubs [{:keys [webview-debug]} [:profile/profile]
|
||||
(views/letsubs [{:keys [webview-debug
|
||||
test-networks-enabled?]} [:profile/profile]
|
||||
network-name [:network-name]
|
||||
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
||||
wakuv2-flag [:waku/v2-flag]
|
||||
@@ -133,6 +144,7 @@
|
||||
:dev-mode? false
|
||||
:wakuv2-flag wakuv2-flag
|
||||
:waku-bloom-filter-mode waku-bloom-filter-mode
|
||||
:webview-debug webview-debug})
|
||||
:webview-debug webview-debug
|
||||
:test-networks-enabled? test-networks-enabled?})
|
||||
:key-fn (fn [_ i] (str i))
|
||||
:render-fn render-item}]))
|
||||
|
||||
@@ -246,8 +246,8 @@
|
||||
assets (get visible-tokens chain)
|
||||
tokens (->> (vals all-tokens)
|
||||
(remove #(or (:hidden? %)
|
||||
;;if not scan-all-tokens? remove not
|
||||
;;visible tokens
|
||||
;;if not scan-all-tokens? remove
|
||||
;;not visible tokens
|
||||
(and (not scan-all-tokens?)
|
||||
(not (get assets (:symbol %))))))
|
||||
(reduce (fn [acc {:keys [address symbol]}]
|
||||
@@ -1075,7 +1075,7 @@
|
||||
(re-frame/reg-fx
|
||||
;;TODO: this could be replaced by a single API call on status-go side
|
||||
:wallet-legacy/initialize-wallet
|
||||
(fn [[network-id network callback]]
|
||||
(fn [[network-id callback]]
|
||||
(-> (js/Promise.all
|
||||
(clj->js
|
||||
[(js/Promise.
|
||||
@@ -1083,24 +1083,6 @@
|
||||
(json-rpc/call {:method "accounts_getAccounts"
|
||||
:on-success resolve-fn
|
||||
:on-error reject})))
|
||||
(js/Promise.
|
||||
(fn [resolve-fn _]
|
||||
(json-rpc/call
|
||||
{:method "wallet_addEthereumChain"
|
||||
:params
|
||||
[{:isTest false
|
||||
:tokenOverrides []
|
||||
:rpcUrl (get-in network [:config :UpstreamConfig :URL])
|
||||
:chainColor "green"
|
||||
:chainName (:name network)
|
||||
:nativeCurrencyDecimals 10
|
||||
:shortName "erc20"
|
||||
:layer 1
|
||||
:chainId (int network-id)
|
||||
:enabled false
|
||||
:fallbackURL (get-in network [:config :UpstreamConfig :URL])}]
|
||||
:on-success resolve-fn
|
||||
:on-error (fn [_] (resolve-fn nil))})))
|
||||
(js/Promise.
|
||||
(fn [resolve-fn _]
|
||||
(json-rpc/call {:method "wallet_getTokens"
|
||||
|
||||
@@ -14,8 +14,11 @@
|
||||
(defn authorize
|
||||
[{:keys [on-enter-password biometric-auth? on-auth-success on-auth-fail on-close
|
||||
auth-button-label theme blur? auth-button-icon-left]}]
|
||||
(println auth-button-label "dasasdasdadsdas")
|
||||
(biometric/get-supported-type
|
||||
(fn [biometric-type]
|
||||
(println biometric-type "biometric-type")
|
||||
|
||||
(if (and biometric-auth? biometric-type)
|
||||
(biometric/authenticate
|
||||
{:reason (i18n/label :t/biometric-auth-confirm-message)
|
||||
@@ -30,8 +33,10 @@
|
||||
:shell? blur?
|
||||
:content (fn []
|
||||
[enter-password/view
|
||||
{:on-enter-password on-enter-password}])}]))})
|
||||
{:button-label auth-button-label
|
||||
:on-enter-password on-enter-password}])}]))})
|
||||
(do
|
||||
(println "222222")
|
||||
(reset-password)
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:on-close on-close
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
(def default-multiaccount
|
||||
{:preview-privacy? blank-preview?
|
||||
:wallet-legacy/visible-tokens {:mainnet #{:SNT}}
|
||||
:wallet-legacy/visible-tokens {:mainnet #{:SNT :ETH :DAI}}
|
||||
:currency :usd
|
||||
:appearance 0
|
||||
:profile-pictures-show-to 2
|
||||
|
||||
@@ -242,6 +242,7 @@
|
||||
|
||||
(defn- internal-discover-view
|
||||
[params]
|
||||
(rf/dispatch [:fetch-contract-communities])
|
||||
[:f> f-view-internal params])
|
||||
|
||||
(def view (quo.theme/with-theme internal-discover-view))
|
||||
|
||||
@@ -119,7 +119,6 @@
|
||||
(cond-> {:wallet-legacy/initialize-transactions-management-enabled nil
|
||||
:wallet-legacy/initialize-wallet
|
||||
[network-id
|
||||
current-network-config
|
||||
(fn [accounts tokens custom-tokens favourites]
|
||||
(re-frame/dispatch [:wallet-legacy/initialize-wallet
|
||||
accounts tokens custom-tokens favourites]))]
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
:on-success #(log/debug "sent contact update")}]}))
|
||||
|
||||
(rf/defn profile-update
|
||||
{:events [:profile.settings/profile-update]}
|
||||
[{:keys [db] :as cofx}
|
||||
setting setting-value
|
||||
{:keys [dont-sync? on-success] :or {on-success #()}}]
|
||||
@@ -56,6 +57,10 @@
|
||||
{:profile.settings/webview-debug-changed value}
|
||||
(profile-update :webview-debug (boolean value) {})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/change-test-networks-enabled
|
||||
(fn [_ [value]]
|
||||
{:fx [[:dispatch [:profile.settings/profile-update :test-networks-enabled? (boolean value) {}]]]}))
|
||||
|
||||
(rf/defn change-preview-privacy-flag
|
||||
{:events [:profile.settings/change-preview-privacy]}
|
||||
[{:keys [db] :as cofx} private?]
|
||||
|
||||
@@ -36,12 +36,15 @@
|
||||
(map #(calculate-raw-balance (:raw-balance %) decimals))
|
||||
(reduce +)))
|
||||
|
||||
(defn calculate-balance-for-token
|
||||
[token]
|
||||
(* (total-token-value-in-all-chains token)
|
||||
(-> token :market-values-per-currency :usd :price)))
|
||||
|
||||
(defn calculate-balance
|
||||
[tokens-in-account]
|
||||
(->> tokens-in-account
|
||||
(map (fn [token]
|
||||
(* (total-token-value-in-all-chains token)
|
||||
(-> token :market-values-per-currency :usd :price))))
|
||||
(map #(calculate-balance-for-token %))
|
||||
(reduce +)))
|
||||
|
||||
(defn network-list
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
[status-im2.common.data-store.wallet :as data-store]
|
||||
[status-im2.contexts.wallet.temp :as temp]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.datetime :as datetime]
|
||||
[utils.ethereum.chain :as chain]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.money :as money]
|
||||
[utils.number]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.security.core :as security]
|
||||
@@ -29,21 +31,12 @@
|
||||
|
||||
(rf/reg-event-fx :wallet/navigate-to-account
|
||||
(fn [{:keys [db]} [address]]
|
||||
{:db (assoc-in db [:wallet :current-viewing-account-address] address)
|
||||
:fx [[:dispatch [:navigate-to :wallet-accounts address]]]}))
|
||||
(let [new-account? (get-in db [:wallet :new-account?])]
|
||||
(cond-> {:db (assoc-in db [:wallet :current-viewing-account-address] address)
|
||||
:fx [[:dispatch [:navigate-to :wallet-accounts address]]]}
|
||||
|
||||
(rf/reg-event-fx :wallet/navigate-to-new-account
|
||||
(fn [{:keys [db]} [address]]
|
||||
{:db (assoc-in db [:wallet :current-viewing-account-address] address)
|
||||
:fx [[:dispatch [:hide-bottom-sheet]]
|
||||
[:dispatch-later
|
||||
[{:dispatch [:navigate-back]
|
||||
:ms 100}
|
||||
{:dispatch [:navigate-back]
|
||||
:ms 100}
|
||||
{:dispatch [:navigate-to :wallet-accounts address]
|
||||
:ms 300}]]
|
||||
[:dispatch [:wallet/show-account-created-toast address]]]}))
|
||||
new-account?
|
||||
(update :fx conj [:dispatch [:wallet/show-account-created-toast address]])))))
|
||||
|
||||
(rf/reg-event-fx :wallet/close-account-page
|
||||
(fn [{:keys [db]}]
|
||||
@@ -134,7 +127,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]]
|
||||
@@ -362,7 +355,7 @@
|
||||
|
||||
(rf/reg-event-fx :wallet/select-send-address
|
||||
(fn [{:keys [db]} [address]]
|
||||
{:db (assoc db :wallet/send-address address)}))
|
||||
{:db (assoc-in db [:wallet :ui :send :to-address] address)}))
|
||||
|
||||
(rf/reg-event-fx :wallet/get-address-details-success
|
||||
(fn [{:keys [db]} [{:keys [hasActivity]}]]
|
||||
@@ -384,3 +377,127 @@
|
||||
:on-error #(log/info "failed to get address details"
|
||||
{:error %
|
||||
:event :wallet/get-address-details})}]]]}))
|
||||
|
||||
(rf/reg-event-fx :wallet/send-select-token
|
||||
(fn [{:keys [db]} [token stack-id]]
|
||||
{:db (assoc-in db [:wallet :ui :send :token] token)
|
||||
:fx [[:navigate-to-within-stack [:wallet-send-input-amount stack-id]]]}))
|
||||
|
||||
(rf/reg-event-fx :wallet/send-select-amount
|
||||
(fn [{:keys [db]} [amount stack-id]]
|
||||
{:db (assoc-in db [:wallet :ui :send :amount] amount)
|
||||
:fx [[:navigate-to-within-stack [:wallet-transaction-confirmation stack-id]]]}))
|
||||
|
||||
(rf/reg-event-fx :wallet/suggested-routes-success
|
||||
(fn [{:keys [db]} [suggested-routes timestamp]]
|
||||
(when (= (get-in db [:wallet :ui :send :suggested-routes-call-timestamp]) timestamp)
|
||||
{:db (-> db
|
||||
(assoc-in [:wallet :ui :send :suggested-routes] suggested-routes)
|
||||
(assoc-in [:wallet :ui :send :route] (first (:Best suggested-routes)))
|
||||
(assoc-in [:wallet :ui :send :loading-suggested-routes?] false))})))
|
||||
|
||||
(rf/reg-event-fx :wallet/suggested-routes-error
|
||||
(fn [{:keys [db]} [_error]]
|
||||
{:db (-> db
|
||||
(update-in [:wallet :ui :send] dissoc :suggested-routes)
|
||||
(update-in [:wallet :ui :send] dissoc :route)
|
||||
(assoc-in [:wallet :ui :send :loading-suggested-routes?] false))}))
|
||||
|
||||
(rf/reg-event-fx :wallet/clean-suggested-routes
|
||||
(fn [{:keys [db]}]
|
||||
{:db (-> db
|
||||
(update-in [:wallet :ui :send] dissoc :suggested-routes)
|
||||
(update-in [:wallet :ui :send] dissoc :route)
|
||||
(update-in [:wallet :ui :send] dissoc :loading-suggested-routes?))}))
|
||||
|
||||
(rf/reg-event-fx :wallet/get-suggested-routes
|
||||
(fn [{:keys [db]} [amount]]
|
||||
(let [wallet-address (get-in db [:wallet :current-viewing-account-address])
|
||||
token (get-in db [:wallet :ui :send :token])
|
||||
to-address (get-in db [:wallet :ui :send :to-address])
|
||||
token-decimal 18
|
||||
token-id (:symbol token)
|
||||
value_ (js/parseFloat amount)
|
||||
network-preferences [1]
|
||||
gas-rates 0 ;low
|
||||
amount-in (money/mul (money/bignumber value_)
|
||||
(money/from-decimal token-decimal))
|
||||
from-address wallet-address
|
||||
request-params [0
|
||||
from-address
|
||||
to-address
|
||||
(money/to-hex amount-in)
|
||||
token-id
|
||||
[]
|
||||
[]
|
||||
network-preferences
|
||||
gas-rates
|
||||
{}]
|
||||
timestamp (datetime/timestamp)]
|
||||
(prn "=====" request-params)
|
||||
{:db (-> db
|
||||
(assoc-in [:wallet :ui :send :loading-suggested-routes?] true)
|
||||
(assoc-in [:wallet :ui :send :suggested-routes-call-timestamp]
|
||||
timestamp))
|
||||
:json-rpc/call [{:method "wallet_getSuggestedRoutes"
|
||||
:params request-params
|
||||
:on-success (fn [suggested-routes]
|
||||
(rf/dispatch [:wallet/suggested-routes-success suggested-routes
|
||||
timestamp]))
|
||||
:on-error (fn [error]
|
||||
(rf/dispatch [:wallet/suggested-routes-error error])
|
||||
(log/error "failed to get suggested routes"
|
||||
{:event :wallet/get-suggested-routes
|
||||
:error error
|
||||
:params request-params}))}]})))
|
||||
|
||||
(rf/reg-event-fx :wallet/send-transaction
|
||||
(fn [{:keys [db]} [password]]
|
||||
(let [route (get-in db [:wallet :ui :send :route])
|
||||
from-address (get-in db [:wallet :current-viewing-account-address])
|
||||
to-address (get-in db [:wallet :ui :send :to-address])
|
||||
from (:From route)
|
||||
token (get-in db [:wallet :ui :send :token])
|
||||
token-id (:symbol token)
|
||||
from-asset token-id
|
||||
to-asset token-id
|
||||
bridge-name (:BridgeName route)
|
||||
chain-id (:chainId from)
|
||||
multi-transaction-command {:fromAddress from-address
|
||||
:toAddress to-address
|
||||
:fromAsset from-asset
|
||||
:toAsset to-asset
|
||||
:fromAmount (:AmountOut route)
|
||||
:type 0}
|
||||
transaction-bridge
|
||||
[{:BridgeName bridge-name
|
||||
:ChainID chain-id
|
||||
:TransferTx {:From from-address
|
||||
:To to-address
|
||||
:Gas (money/to-hex (:GasAmount route))
|
||||
:GasPrice (money/to-hex (money/->wei :gwei
|
||||
(:gasPrice (:GasFees route))))
|
||||
:Value (:AmountOut route)
|
||||
:Nonce nil
|
||||
:MaxFeePerGas (money/to-hex
|
||||
(money/->wei :gwei
|
||||
(:maxFeePerGasMedium (:GasFees route))))
|
||||
:MaxPriorityFeePerGas (money/to-hex (money/->wei :gwei
|
||||
(:maxPriorityFeePerGas
|
||||
(:GasFees
|
||||
route))))
|
||||
:Input ""
|
||||
:Data "0x"}}]
|
||||
sha3-pwd (native-module/sha3 (str (security/safe-unmask-data password)))
|
||||
request-params [multi-transaction-command transaction-bridge sha3-pwd]]
|
||||
(prn "=====" request-params)
|
||||
{:json-rpc/call [{:method "wallet_createMultiTransaction"
|
||||
:params request-params
|
||||
:on-success (fn [response]
|
||||
(prn response "======+++++++++========++++++++")
|
||||
(rf/dispatch [:dismiss-modal :wallet-select-address]))
|
||||
:on-error (fn [error]
|
||||
(log/error "failed to send transaction"
|
||||
{:event :wallet/send-transaction
|
||||
:error error
|
||||
:params request-params}))}]})))
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.wallet.send.input-amount.style :as style]
|
||||
[utils.debounce :as debounce]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -47,71 +48,88 @@
|
||||
current))
|
||||
|
||||
(defn- f-view-internal
|
||||
[{:keys [token limit rate]}]
|
||||
(let [bottom (safe-area/get-bottom)
|
||||
{:keys [currency]} (rf/sub [:profile/profile])
|
||||
networks (rf/sub [:wallet/network-details])
|
||||
;; Temporary values
|
||||
token (or token :eth)
|
||||
conversion-rate (or rate 10)
|
||||
limit-crypto (or limit 2860000.32)
|
||||
limit-fiat (* limit-crypto conversion-rate)
|
||||
input-value (reagent/atom "")
|
||||
current-limit (reagent/atom {:amount limit-crypto
|
||||
:currency token})
|
||||
handle-swap (fn [crypto?]
|
||||
(let [num-value (parse-double @input-value)]
|
||||
(reset! current-limit (if crypto?
|
||||
{:amount limit-crypto
|
||||
:currency token}
|
||||
{:amount limit-fiat
|
||||
:currency currency}))
|
||||
(when (> num-value (:amount @current-limit))
|
||||
(reset! input-value ""))))
|
||||
handle-keyboard-press (fn [v]
|
||||
(let [current-value @input-value
|
||||
new-value (make-new-input current-value v)
|
||||
num-value (or (parse-double new-value) 0)]
|
||||
(when (<= num-value (:amount @current-limit))
|
||||
(reset! input-value new-value)
|
||||
(reagent/flush))))
|
||||
handle-delete (fn [_]
|
||||
(swap! input-value #(subs % 0 (dec (count %))))
|
||||
(reagent/flush))
|
||||
handle-on-change (fn [v]
|
||||
(when (valid-input? @input-value v)
|
||||
(let [num-value (or (parse-double v) 0)
|
||||
current-limit-amount (:amount @current-limit)]
|
||||
(if (> num-value current-limit-amount)
|
||||
(reset! input-value (str current-limit-amount))
|
||||
(reset! input-value v))
|
||||
(reagent/flush))))]
|
||||
[{:keys [rate]}]
|
||||
(let [bottom (safe-area/get-bottom)
|
||||
{:keys [currency]} (rf/sub [:profile/profile])
|
||||
networks (rf/sub [:wallet/network-details])
|
||||
wallet-send (get-in (rf/sub [:wallet]) [:ui :send])
|
||||
token (:token wallet-send)
|
||||
token-symbol (:symbol token)
|
||||
limit-crypto (:total-balance token)
|
||||
limit-fiat (:total-balance-fiat token)
|
||||
conversion-rate (or rate 10)
|
||||
input-value (reagent/atom "")
|
||||
current-limit (reagent/atom {:amount limit-crypto
|
||||
:currency token-symbol})
|
||||
loading-suggested-routes? (:loading-suggested-routes? wallet-send)
|
||||
handle-swap (fn [crypto?]
|
||||
(let [num-value (parse-double @input-value)]
|
||||
(reset! current-limit (if crypto?
|
||||
{:amount limit-crypto
|
||||
:currency token-symbol}
|
||||
{:amount limit-fiat
|
||||
:currency currency}))
|
||||
(when (> num-value (:amount @current-limit))
|
||||
(reset! input-value ""))))
|
||||
handle-keyboard-press (fn [v]
|
||||
(let [current-value @input-value
|
||||
new-value (make-new-input current-value v)
|
||||
num-value (or (parse-double new-value) 0)]
|
||||
(when (and (not loading-suggested-routes?)
|
||||
(<= num-value (:amount @current-limit)))
|
||||
(reset! input-value new-value)
|
||||
(reagent/flush))))
|
||||
handle-delete (fn [_]
|
||||
(when-not loading-suggested-routes?
|
||||
(swap! input-value #(subs % 0 (dec (count %))))
|
||||
(reagent/flush)))
|
||||
handle-on-change (fn [v]
|
||||
(when (valid-input? @input-value v)
|
||||
(let [num-value (or (parse-double v) 0)
|
||||
current-limit-amount (:amount @current-limit)]
|
||||
(if (> num-value current-limit-amount)
|
||||
(reset! input-value (str current-limit-amount))
|
||||
(reset! input-value v))
|
||||
(reagent/flush))))]
|
||||
(fn [{:keys [on-confirm]
|
||||
:or {on-confirm #(js/alert "Confirmed")}}]
|
||||
(let [limit-label (make-limit-label @current-limit)
|
||||
input-num-value (parse-double @input-value)
|
||||
confirm-disabled? (or
|
||||
(empty? @input-value)
|
||||
(<= input-num-value 0)
|
||||
(> input-num-value (:amount @current-limit)))]
|
||||
:or {on-confirm #(rf/dispatch [:wallet/send-select-amount @input-value
|
||||
:wallet-send-input-amount])}}]
|
||||
(let [limit-label (make-limit-label @current-limit)
|
||||
input-num-value (parse-double @input-value)
|
||||
route (get-in (rf/sub [:wallet]) [:ui :send :route])
|
||||
loading-suggested-routes? (get-in (rf/sub [:wallet]) [:ui :send :loading-suggested-routes?])
|
||||
confirm-disabled? (or
|
||||
(nil? route)
|
||||
(empty? @input-value)
|
||||
(<= input-num-value 0)
|
||||
(> input-num-value (:amount @current-limit)))]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(let [dismiss-keyboard-fn #(when (= % "active") (rn/dismiss-keyboard!))
|
||||
app-keyboard-listener (.addEventListener rn/app-state "change" dismiss-keyboard-fn)]
|
||||
#(.remove app-keyboard-listener))))
|
||||
(rn/use-effect (fn []
|
||||
(rf/dispatch [:wallet/clean-suggested-routes])
|
||||
(when-not (or
|
||||
(empty? @input-value)
|
||||
(<= input-num-value 0)
|
||||
(> input-num-value (:amount @current-limit)))
|
||||
(debounce/debounce-and-dispatch [:wallet/get-suggested-routes @input-value]
|
||||
100)))
|
||||
[@input-value])
|
||||
[rn/view
|
||||
{:style style/screen}
|
||||
[quo/page-nav
|
||||
{:background :blur
|
||||
:icon-name :i/arrow-left
|
||||
:on-press #(rf/dispatch [:navigate-back])
|
||||
:on-press #(rf/dispatch [:navigate-back-within-stack :wallet-send-input-amount])
|
||||
:right-side :account-switcher
|
||||
:account-switcher {:customization-color :yellow
|
||||
:emoji "🎮"
|
||||
:on-press #(js/alert "Switch account")}}]
|
||||
[quo/token-input
|
||||
{:container-style style/input-container
|
||||
:token token
|
||||
:token token-symbol
|
||||
:currency currency
|
||||
:networks networks
|
||||
:title (i18n/label :t/send-limit {:limit limit-label})
|
||||
@@ -122,7 +140,16 @@
|
||||
:on-change-text (fn [text]
|
||||
(handle-on-change text))}]
|
||||
;; Network routing content to be added
|
||||
[rn/scroll-view]
|
||||
[rn/scroll-view
|
||||
{:content-container-style {:flex-grow 1
|
||||
:align-items :center
|
||||
:justify-content :center}}
|
||||
(cond loading-suggested-routes?
|
||||
[quo/text "Loading routes"]
|
||||
(and (not loading-suggested-routes?) route)
|
||||
[quo/text "Route found"]
|
||||
(and (not loading-suggested-routes?) (nil? route))
|
||||
[quo/text "Route not found"])]
|
||||
[quo/bottom-actions
|
||||
{:actions :1-action
|
||||
:button-one-label (i18n/label :t/confirm)
|
||||
|
||||
@@ -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 []
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
(defn- asset-component
|
||||
[]
|
||||
(fn [token _ _ _]
|
||||
(let [on-press #(js/alert "Not implemented yet")
|
||||
(let [on-press
|
||||
#(if (= (:symbol token) "ETH")
|
||||
(rf/dispatch [:wallet/send-select-token token :wallet-select-asset])
|
||||
(js/alert "Only ETH transfers are allowed."))
|
||||
total-balance-formatted (.toFixed (:total-balance token) 2)
|
||||
balance-fiat-formatted (.toFixed (:total-balance-fiat token) 2)
|
||||
currency-symbol "$"]
|
||||
balance-fiat-formatted (.toFixed (:total-balance-fiat token) 2)
|
||||
currency-symbol "$"]
|
||||
[quo/token-network
|
||||
{:token (quo.resources/get-token (keyword (string/lower-case (:symbol token))))
|
||||
:label (:name token)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
(ns status-im2.contexts.wallet.send.transaction-confirmation.style
|
||||
(:require [quo.foundations.colors :as colors]))
|
||||
|
||||
(defn container
|
||||
[margin-top]
|
||||
{:position :absolute
|
||||
:top margin-top
|
||||
:right 0
|
||||
:left 0
|
||||
:bottom 0})
|
||||
|
||||
(def content-container
|
||||
{:padding-top 12
|
||||
:padding-horizontal 20
|
||||
:padding-bottom 32})
|
||||
|
||||
(def title-container
|
||||
{:margin-right 4})
|
||||
|
||||
(defn details-container
|
||||
[theme]
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:height 52
|
||||
:padding-horizontal 12
|
||||
:padding-top 7
|
||||
:padding-bottom 8
|
||||
:border-radius 16
|
||||
:border-width 1
|
||||
:border-color (colors/theme-colors colors/neutral-10 colors/neutral-90 theme)})
|
||||
|
||||
(def slide-button-container
|
||||
{:position :absolute
|
||||
:right 20
|
||||
:left 20
|
||||
:bottom 20})
|
||||
|
||||
(defn section-label
|
||||
[theme]
|
||||
{:margin-bottom 8
|
||||
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
||||
@@ -0,0 +1,202 @@
|
||||
(ns status-im2.contexts.wallet.send.transaction-confirmation.view
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[quo.foundations.resources :as quo.resources]
|
||||
[quo.theme :as quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[status-im.utils.utils :as utils]
|
||||
[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]))
|
||||
|
||||
(defn- transaction-title
|
||||
[token amount account to-address]
|
||||
[rn/view {:style style/content-container}
|
||||
[rn/view {:style {:flex-direction :row}}
|
||||
[quo/text
|
||||
{:size :heading-1
|
||||
:weight :semi-bold
|
||||
:style style/title-container
|
||||
:accessibility-label :send-label}
|
||||
(i18n/label :t/send)]
|
||||
[quo/summary-tag
|
||||
{:label (str amount " " (:symbol token))
|
||||
:type :token
|
||||
:image-source (quo.resources/get-token :eth)}]]
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:margin-top 4}}
|
||||
[quo/text
|
||||
{:size :heading-1
|
||||
:weight :semi-bold
|
||||
:style style/title-container
|
||||
:accessibility-label :send-label}
|
||||
(i18n/label :t/from)]
|
||||
[quo/summary-tag
|
||||
{:label (:name account)
|
||||
:type :account
|
||||
:emoji (:emoji account)
|
||||
:customization-color (:color account)}]]
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:margin-top 4}}
|
||||
[quo/text
|
||||
{:size :heading-1
|
||||
:weight :semi-bold
|
||||
:style style/title-container
|
||||
:accessibility-label :send-label}
|
||||
(i18n/label :t/to)]
|
||||
[quo/summary-tag
|
||||
{:type :address
|
||||
:label (utils/get-shortened-address to-address)}]]])
|
||||
|
||||
(defn- transaction-from
|
||||
[amount account-props theme]
|
||||
[rn/view
|
||||
{:style {:padding-horizontal 20
|
||||
:padding-bottom 16}}
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/section-label theme)
|
||||
:accessibility-label :summary-from-label}
|
||||
(i18n/label :t/from-capitalized)]
|
||||
[quo/summary-info
|
||||
{:type :status-account
|
||||
:networks? true
|
||||
:values {:ethereum amount
|
||||
:optimism 0
|
||||
:arbitrum 0}
|
||||
:account-props account-props}]])
|
||||
|
||||
(defn- transaction-to
|
||||
[amount user-props theme]
|
||||
[rn/view
|
||||
{:style {:padding-horizontal 20
|
||||
:padding-bottom 16}}
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/section-label theme)
|
||||
:accessibility-label :summary-from-label}
|
||||
(i18n/label :t/to-capitalized)]
|
||||
[quo/summary-info
|
||||
{:type :user
|
||||
:networks? true
|
||||
:values {:ethereum amount
|
||||
:optimism 0
|
||||
:arbitrum 0}
|
||||
:account-props user-props}]])
|
||||
|
||||
(defn- transaction-details
|
||||
[estimated-time-min max-fees-eth token amount to-address theme]
|
||||
[rn/view
|
||||
{:style {:padding-horizontal 20
|
||||
:padding-bottom 16}}
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :medium
|
||||
:style (style/section-label theme)
|
||||
:accessibility-label :summary-from-label}
|
||||
(i18n/label :t/details)]
|
||||
[rn/view
|
||||
{:style (style/details-container theme)}
|
||||
[quo/data-item
|
||||
{:container-style {:flex 1
|
||||
:height 36}
|
||||
:blur? false
|
||||
:description :default
|
||||
:icon-right? false
|
||||
:card? false
|
||||
:label :none
|
||||
:status :default
|
||||
:size :small
|
||||
:title (i18n/label :t/est-time)
|
||||
:subtitle (str estimated-time-min " min")}]
|
||||
[quo/data-item
|
||||
{:container-style {:flex 1
|
||||
:height 36}
|
||||
:blur? false
|
||||
:description :default
|
||||
:icon-right? false
|
||||
:card? false
|
||||
:label :none
|
||||
:status :default
|
||||
:size :small
|
||||
:title (i18n/label :t/max-fees)
|
||||
:subtitle (str "$" max-fees-eth)}]
|
||||
[quo/data-item
|
||||
{:container-style {:flex 1
|
||||
:height 36}
|
||||
:blur? false
|
||||
:description :default
|
||||
:icon-right? false
|
||||
:card? false
|
||||
:label :none
|
||||
:status :default
|
||||
:size :small
|
||||
:title (i18n/label :t/user-gets {:name (utils/get-shortened-address to-address)})
|
||||
:subtitle (str amount " " (:symbol token))}]]])
|
||||
|
||||
(defn- f-view-internal
|
||||
[_]
|
||||
(let [margin-top (safe-area/get-top)
|
||||
biometric-auth? false
|
||||
on-close #(rf/dispatch [:navigate-back-within-stack :wallet-select-asset])
|
||||
send-transaction-data (get-in (rf/sub [:wallet]) [:ui :send])
|
||||
token (:token send-transaction-data)
|
||||
amount (:amount send-transaction-data)
|
||||
route (:route send-transaction-data)
|
||||
estimated-time-min (:EstimatedTime route)
|
||||
max-fees-eth 5.28 ; calculate gas price in fiat
|
||||
to-address (:to-address send-transaction-data)
|
||||
account (rf/sub [:wallet/current-viewing-account])
|
||||
account-props {:customization-color (:color account)
|
||||
:size 32
|
||||
:emoji (:emoji account)
|
||||
:type :default
|
||||
:name (:name account)
|
||||
:address (utils/get-shortened-address (:address account))}
|
||||
user-props {:full-name "M L"
|
||||
:status-indicator? false
|
||||
:size :small
|
||||
:ring-background (resources/get-mock-image :ring)
|
||||
:customization-color :blue
|
||||
:name "Mark Libot"
|
||||
:address "0x0ah...78b"
|
||||
:status-account (merge account-props
|
||||
{:size 16
|
||||
:name "New house"
|
||||
:emoji "🍔"})}]
|
||||
(fn [{:keys [theme]}]
|
||||
[rn/view {:style {:flex 1}}
|
||||
[quo/gradient-cover {:customization-color (:color account)}]
|
||||
[rn/view {:style (style/container margin-top)}
|
||||
[quo/page-nav
|
||||
{:icon-name :i/arrow-left
|
||||
:on-press on-close
|
||||
:accessibility-label :top-bar
|
||||
:right-side [{:icon-name :i/advanced
|
||||
:on-press (fn callback [] nil)
|
||||
:accessibility-label "Advanced"}]}]
|
||||
[transaction-title token amount account to-address]
|
||||
[transaction-from amount account-props theme]
|
||||
[transaction-to amount user-props theme]
|
||||
[transaction-details estimated-time-min max-fees-eth token amount to-address theme]
|
||||
[rn/view {:style style/slide-button-container}
|
||||
[standard-auth/slide-button
|
||||
{:size :size-40
|
||||
:track-text (i18n/label :t/slide-to-send)
|
||||
:customization-color (:color account)
|
||||
:on-enter-password #(rf/dispatch [:wallet/send-transaction %])
|
||||
:biometric-auth? biometric-auth?
|
||||
:auth-button-label (i18n/label :t/confirm)}]]]])))
|
||||
|
||||
(defn view-internal
|
||||
[props]
|
||||
[:f> f-view-internal props])
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
@@ -0,0 +1,39 @@
|
||||
{:send-push-notifications? true
|
||||
:send-status-updates? true
|
||||
:key-uid "0x2a2d3b6722dcbcabaeae48adc0f4147bcb3d94b3cc9606da1a080b765ec5d9b1"
|
||||
:backup-enabled? true
|
||||
:address "0x88e052c915950060e6a51438a0524ca76b50d8f4"
|
||||
:preview-privacy? true
|
||||
:use-mailservers? true
|
||||
:signing-phrase "beef flax tram"
|
||||
:url-unfurling-mode 1
|
||||
:profile-pictures-visibility 2
|
||||
:messages-from-contacts-only false
|
||||
:eip1581-address "0x56b5eb0c8d257a249eb1d6f5838cc356bfa9cbe7"
|
||||
:name "Red Mediumslateblue Otter"
|
||||
:latest-derived-path 0
|
||||
:wallet-root-address "0xd00fc8f05dcf8f2676b066d9fb0e67db794eeb69"
|
||||
:last-backup 1700127251
|
||||
:networks/networks []
|
||||
:gifs/api-key ""
|
||||
:currency "usd"
|
||||
:gifs/favorite-gifs nil
|
||||
:default-sync-period 777600
|
||||
:photo-path ""
|
||||
:compressedKey "zQ3sha1FRZXLtZ5aG43vRhGbm1W16crtPMQ1CSbyyqSZXB7Bw"
|
||||
:current-user-status {:statusType 1 :clock 1700127405 :text ""}
|
||||
:dapps-address "0x5ffa75ce51c3a7ebe23bde37b5e3a0143dfbcee0"
|
||||
:display-name "A1234"
|
||||
:test-networks-enabled? true
|
||||
:gifs/recent-gifs nil
|
||||
:appearance 0
|
||||
:emojiHash ["🫒" "👨🏽🏫" "🥄" "👦🏽" "👭" "🚣♂️" "🧓🏽" "👩🏿" "👨🏽⚖️" "👵🏿" "🕴🏻" "😦" "🙅"
|
||||
"👩🏻🚀"]
|
||||
:link-preview-request-enabled true
|
||||
:profile-pictures-show-to 2
|
||||
:device-name ""
|
||||
:networks/current-network "mainnet_rpc"
|
||||
:mutual-contact-enabled? false
|
||||
:public-key
|
||||
"0x04bb2024ce5d72e45d4a4f8589ae657ef9745855006996115a23a1af88d536cf02c0524a585fce7bfa79d6a9669af735eda6205d6c7e5b3cdc2b8ff7b2fa1f0b56"
|
||||
:installation-id "38ff0c3e-58cf-41b3-bc01-48869af9776f"}
|
||||
@@ -0,0 +1,125 @@
|
||||
{:Best
|
||||
[
|
||||
{:From {:isTest true
|
||||
:tokenOverrides nil
|
||||
:rpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:chainColor "#939BA1"
|
||||
:chainName "Ethereum Mainnet"
|
||||
:nativeCurrencyName "Ether"
|
||||
:nativeCurrencyDecimals 18
|
||||
:blockExplorerUrl "https://goerli.etherscan.io/"
|
||||
:relatedChainId 1
|
||||
:shortName "goEth"
|
||||
:layer 1
|
||||
:chainId 5
|
||||
:originalFallbackURL "https://goerli.infura.io/v3/"
|
||||
:iconUrl "network/Network=Testnet"
|
||||
:originalRpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:enabled true
|
||||
:nativeCurrencySymbol "ETH"
|
||||
:fallbackURL "https://goerli.infura.io/v3/"}
|
||||
|
||||
:AmountInLocked false
|
||||
:AmountIn "0x16345785d8a0000"
|
||||
:MaxAmountIn "0x362680d85001805"
|
||||
:GasFees {:gasPrice "1.3e-08"
|
||||
:baseFee "1"
|
||||
:maxPriorityFeePerGas "2e-09"
|
||||
:maxFeePerGasLow "9e-09"
|
||||
:maxFeePerGasMedium "1"
|
||||
:maxFeePerGasHigh "2"
|
||||
:eip1559Enabled true}
|
||||
:BridgeName "Transfer"
|
||||
:AmountOut "0x16345785d8a0000" ;no bridge amount in === amount out, otherwise different
|
||||
:ApprovalContractAddress nil
|
||||
:ApprovalRequired false ; always fast - when using bridge
|
||||
:EstimatedTime 3 ; an enum - see status go
|
||||
:ApprovalGasFees "0"
|
||||
|
||||
:To {:isTest true
|
||||
:tokenOverrides nil
|
||||
:rpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:chainColor "#939BA1"
|
||||
:chainName "Ethereum Mainnet"
|
||||
:nativeCurrencyName "Ether"
|
||||
:nativeCurrencyDecimals 18
|
||||
:blockExplorerUrl "https://goerli.etherscan.io/"
|
||||
:relatedChainId 1
|
||||
:shortName "goEth"
|
||||
:layer 1
|
||||
:chainId 5
|
||||
:originalFallbackURL "https://goerli.infura.io/v3/"
|
||||
:iconUrl "network/Network=Testnet"
|
||||
:originalRpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:enabled true
|
||||
:nativeCurrencySymbol "ETH"
|
||||
:fallbackURL "https://goerli.infura.io/v3/"}
|
||||
|
||||
:BonderFees "0x0"
|
||||
:ApprovalAmountRequired nil
|
||||
:Cost "4.3119595404000002308e-10"
|
||||
:TokenFees "0"
|
||||
:GasAmount 23487}]
|
||||
|
||||
|
||||
|
||||
:Candidates
|
||||
[{:From {:isTest true
|
||||
:tokenOverrides nil
|
||||
:rpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:chainColor "#939BA1"
|
||||
:chainName "Ethereum Mainnet"
|
||||
:nativeCurrencyName "Ether"
|
||||
:nativeCurrencyDecimals 18
|
||||
:blockExplorerUrl "https://goerli.etherscan.io/"
|
||||
:relatedChainId 1
|
||||
:shortName "goEth"
|
||||
:layer 1
|
||||
:chainId 5
|
||||
:originalFallbackURL "https://goerli.infura.io/v3/"
|
||||
:iconUrl "network/Network=Testnet"
|
||||
:originalRpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:enabled true
|
||||
:nativeCurrencySymbol "ETH"
|
||||
:fallbackURL "https://goerli.infura.io/v3/"}
|
||||
:AmountInLocked false
|
||||
:AmountIn "0x16345785d8a0000"
|
||||
:MaxAmountIn "0x362680d85001805"
|
||||
:GasFees {:gasPrice "1.3e-08"
|
||||
:baseFee "1"
|
||||
:maxPriorityFeePerGas "2e-09"
|
||||
:maxFeePerGasLow "9e-09"
|
||||
:maxFeePerGasMedium "1"
|
||||
:maxFeePerGasHigh "2"
|
||||
:eip1559Enabled true}
|
||||
:BridgeName "Transfer"
|
||||
:AmountOut "0x16345785d8a0000"
|
||||
:ApprovalContractAddress nil
|
||||
:ApprovalRequired false
|
||||
:EstimatedTime 3
|
||||
:ApprovalGasFees "0"
|
||||
:To {:isTest true
|
||||
:tokenOverrides nil
|
||||
:rpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:chainColor "#939BA1"
|
||||
:chainName "Ethereum Mainnet"
|
||||
:nativeCurrencyName "Ether"
|
||||
:nativeCurrencyDecimals 18
|
||||
:blockExplorerUrl "https://goerli.etherscan.io/"
|
||||
:relatedChainId 1
|
||||
:shortName "goEth"
|
||||
:layer 1
|
||||
:chainId 5
|
||||
:originalFallbackURL "https://goerli.infura.io/v3/"
|
||||
:iconUrl "network/Network=Testnet"
|
||||
:originalRpcUrl "https://goerli-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9"
|
||||
:enabled true
|
||||
:nativeCurrencySymbol "ETH"
|
||||
:fallbackURL "https://goerli.infura.io/v3/"}
|
||||
:BonderFees "0x0"
|
||||
:ApprovalAmountRequired nil
|
||||
:Cost "4.3119595404000002308e-10" ; "USD" or local currency
|
||||
:TokenFees "0"
|
||||
:GasAmount 23487}]
|
||||
:TokenPrice 2039.88
|
||||
:NativeChainTokenPrice 2039.88}
|
||||
@@ -54,6 +54,7 @@
|
||||
[status-im2.contexts.wallet.send.input-amount.view :as wallet-send-input-amount]
|
||||
[status-im2.contexts.wallet.send.select-address.view :as wallet-select-address]
|
||||
[status-im2.contexts.wallet.send.select-asset.view :as wallet-select-asset]
|
||||
[status-im2.contexts.wallet.send.transaction-confirmation.view :as wallet-transaction-confirmation]
|
||||
[status-im2.navigation.options :as options]
|
||||
[status-im2.navigation.transitions :as transitions]))
|
||||
|
||||
@@ -311,6 +312,10 @@
|
||||
:options {:insets {:top? true}}
|
||||
:component wallet-select-asset/view}
|
||||
|
||||
{:name :wallet-transaction-confirmation
|
||||
:options {:insets {:bottom? true}}
|
||||
:component wallet-transaction-confirmation/view}
|
||||
|
||||
{:name :scan-address
|
||||
:options (merge
|
||||
options/dark-screen
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
:<- [:wallet/balances]
|
||||
:<- [:wallet/tokens-loading?]
|
||||
(fn [[accounts balances tokens-loading?]]
|
||||
(mapv (fn [{:keys [color address type] :as account}]
|
||||
(mapv (fn [{:keys [color address] :as account}]
|
||||
(assoc account
|
||||
:customization-color color
|
||||
:type (if (= type :watch) :watch-only :empty)
|
||||
@@ -75,7 +75,7 @@
|
||||
(assoc token
|
||||
:networks (utils/network-list token networks)
|
||||
:total-balance (utils/total-token-value-in-all-chains token)
|
||||
:total-balance-fiat (utils/calculate-balance token)))
|
||||
:total-balance-fiat (utils/calculate-balance-for-token token)))
|
||||
(:tokens account))
|
||||
|
||||
sorted-tokens
|
||||
@@ -86,5 +86,4 @@
|
||||
(string/starts-with? (string/lower-case (:symbol %))
|
||||
(string/lower-case query)))
|
||||
sorted-tokens)]
|
||||
(println filtered-tokens "3421342342432")
|
||||
filtered-tokens)))
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
;; E.g. for Ether, it's smallest part is wei or 10^(-18) of 1 ether
|
||||
;; for arbitrary ERC20 token the smallest part is 10^(-decimals) of 1 token
|
||||
;;
|
||||
;; Different tokens can have different number of allowed decimals, so it's neccessary to include the
|
||||
;; Different tokens can have different number of allowed decimals, so it's necessary to include the
|
||||
;; decimals parameter
|
||||
;; to get the amount scale right.
|
||||
|
||||
@@ -205,10 +205,14 @@
|
||||
(with-precision 2)
|
||||
str))
|
||||
|
||||
(defn add
|
||||
(defn- add*
|
||||
[bn1 n2]
|
||||
(.add ^js bn1 n2))
|
||||
|
||||
(def add
|
||||
"Add with defaults, this version is able to receive `nil` and takes them as 0."
|
||||
(fnil add* (bignumber 0) (bignumber 0)))
|
||||
|
||||
(defn mul
|
||||
[bn1 bn2]
|
||||
(.mul ^js bn1 bn2))
|
||||
|
||||
@@ -2398,5 +2398,9 @@
|
||||
"send-limit": "Max: {{limit}}",
|
||||
"searching-for-activity": "Searching for activity...",
|
||||
"this-address-has-no-activity": "This address has no activity",
|
||||
"this-address-has-activity": "This address has activity"
|
||||
"this-address-has-activity": "This address has activity",
|
||||
"details": "Details",
|
||||
"est-time": "Est. time",
|
||||
"user-gets": "{{name}} gets",
|
||||
"slide-to-send": "Slide to send"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user