Andrey Shovkoplyas 26bbac83bc
[#8348] [Multi-Account] Account overview + individual wallet UI
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2019-06-18 17:44:56 +02:00

19 lines
904 B
Clojure

(ns status-im.wallet.utils
(:require [status-im.utils.money :as money]))
(defn format-amount [amount decimals]
(-> amount
(or (money/bignumber 0))
(money/token->unit decimals)
money/to-fixed))
;;NOTE(goranjovic) - we are internally using symbol ETH for native currencies of any ethereum network
;; some sidechains have different names for this native currency, which we handle with `symbol-display` override.
(defn display-symbol [{:keys [symbol-display symbol] :as token}]
(when token
(clojure.core/name (or symbol-display symbol))))
;;NOTE(goranjovic) - in addition to custom symbol display, some sidechain native currencies are listed under a different
;; ticker on exchange networks. We handle that with `symbol-exchange` override.
(defn exchange-symbol [{:keys [symbol-exchange symbol-display symbol]}]
(clojure.core/name (or symbol-exchange symbol-display symbol)))