 
 (re-frame/reg-fx
  ::accept-transaction-with-changed-gas
- (fn [{:keys [masked-password id on-completed gas gas-price]}]
+ (fn [{:keys [masked-password id on-completed gas gas-price default-gas-price]}]
    ;; unmasking the password as late as possible to avoid being exposed from app-db
-   (status/approve-sign-request-with-args id
-                                          (security/unmask masked-password)
-                                          (money/to-fixed gas)
-                                          (money/to-fixed gas-price)
-                                          on-completed)))
+   (if gas
+     (status/approve-sign-request-with-args id
+                                            (security/unmask masked-password)
+                                            (money/to-fixed gas)
+                                            (money/to-fixed (or gas-price default-gas-price))
+                                            on-completed)
+     (status/approve-sign-request id
+                                  (security/unmask masked-password)
+                                  on-completed))))
 
 (defn- send-ethers [{:keys [web3 from to value gas gas-price]}]
   (.sendTransaction (.-eth web3)

                            :masked-password password
                            :on-completed    on-transactions-modal-completed}})))

(handlers/register-handler-fx
 :wallet/sign-transaction-modal
 (fn [{db :db} _]
   ;;TODO(goranjovic) - unify send-transaction and unsigned-transaction
   (let [{:keys [id password] :as send-transaction}   (get-in db [:wallet :send-transaction])
         {:keys [gas gas-price]} [:wallet.send/unsigned-transaction]]
     {:db                                   (assoc-in db [:wallet :send-transaction :in-progress?] true)
      ::accept-transaction-with-changed-gas {:id              id
                                             :masked-password password
                                             :gas             (or gas (:gas send-transaction))
                                             :gas-price       (or gas-price (:gas-price send-transaction))
                                             :on-completed    on-transactions-modal-completed}})))

(defn discard-transaction
  [{:keys [db]}]

                        {:value    (ethereum/estimate-gas (-> db :wallet :send-transaction :symbol))
                         :invalid? false})}))

(handlers/register-handler-fx
 :close-transaction-sent-screen
 (fn [{:keys [db]} [_ chat-id]]
