File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 601
601
{:paraswap swap-provider-paraswap})
602
602
603
603
(def ^:const token-for-fees-symbol " ETH" )
604
+
605
+ (def ^:const transaction-status-success " Success" )
606
+ (def ^:const transaction-status-pending " Pending" )
607
+ (def ^:const transaction-status-failed " Failed" )
Original file line number Diff line number Diff line change 1
1
(ns status-im.contexts.wallet.signals
2
2
(:require
3
3
[oops.core :as oops]
4
+ [status-im.constants :as constants]
4
5
[taoensso.timbre :as log]
5
6
[utils.re-frame :as rf]
6
7
[utils.transforms :as transforms]))
10
11
(fn [{:keys [db]} [{:keys [message]}]]
11
12
(let [details (transforms/json->clj message)
12
13
tx-hash (:hash details)
13
- status (case (:status details)
14
- " Success" :confirmed
15
- " Pending" :pending
16
- " Failed" :failed )
14
+ tx-status (:status details)
15
+ status (cond
16
+ (= tx-status constants/transaction-status-success)
17
+ :confirmed
18
+ (= tx-status constants/transaction-status-pending)
19
+ :pending
20
+ (= tx-status constants/transaction-status-failed)
21
+ :failed )
17
22
swap-approval-transaction-id (get-in db [:wallet :ui :swap :approval-transaction-id ])
18
23
swap-approval-transaction? (= swap-approval-transaction-id tx-hash)]
19
24
(cond-> {:db (update-in db [:wallet :transactions tx-hash] assoc :status status)}
You can’t perform that action at this time.
0 commit comments