Skip to content

Commit

Permalink
chore(wallet)_: Refactor collectible balance utility method
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Javid <[email protected]>
  • Loading branch information
smohamedjavid committed Jan 2, 2025
1 parent baf3b8c commit 6505118
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/status_im/contexts/wallet/collectible/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
(:require [status-im.config :as config]
[status-im.constants :as constants]
[status-im.contexts.wallet.common.utils.networks :as network-utils]
[taoensso.timbre :as log]))
[taoensso.timbre :as log]
[utils.number :as utils.number]))

(defn collectible-balance
([{:keys [ownership]} address]
(let [balance (some #(when (= address (:address %))
(js/parseInt (:balance %)))
ownership)]
(if (js/Number.isNaN balance) 0 balance))))
(->> ownership
(some #(when (= address (:address %))
(:balance %)))
utils.number/parse-int)))

(def supported-collectible-types
#{"image/jpeg"
Expand Down

0 comments on commit 6505118

Please sign in to comment.