-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove old wallet signals and move signals to status-im ns #18285
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
(ns status-im.contexts.wallet.signals | ||
(:require [utils.re-frame :as rf])) | ||
(:require | ||
[oops.core :as oops] | ||
[taoensso.timbre :as log] | ||
[utils.re-frame :as rf])) | ||
|
||
(rf/reg-event-fx | ||
:wallet/pending-transaction-status-changed-received | ||
|
@@ -8,3 +11,36 @@ | |
tx-hash (:hash details)] | ||
{:db (update-in db [:wallet :transactions tx-hash] assoc :status :confirmed :blocks 1)}))) | ||
|
||
(rf/reg-event-fx | ||
:wallet/signal-received | ||
(fn [_ [event-js]] | ||
(let [event-type (oops/oget event-js "type") | ||
blockNumber (oops/oget event-js "blockNumber") | ||
accounts (oops/oget event-js "accounts")] | ||
(log/debug "[wallet-subs] New wallet event" | ||
{:type event-type | ||
:block-number blockNumber | ||
:accounts accounts}) | ||
(case event-type | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"pending-transaction-status-changed" {:fx | ||
[[:dispatch | ||
[:wallet/pending-transaction-status-changed-received | ||
(js->clj event-js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have transformations namespace, so it should be used |
||
:keywordize-keys | ||
true)]]]} | ||
"wallet-owned-collectibles-filtering-done" {:fx [[:dispatch | ||
[:wallet/owned-collectibles-filtering-done | ||
(js->clj event-js | ||
:keywordize-keys | ||
true)]]]} | ||
"wallet-get-collectibles-details-done" {:fx [[:dispatch | ||
[:wallet/get-collectible-details-done | ||
(js->clj event-js | ||
:keywordize-keys | ||
true)]]]} | ||
"wallet-tick-reload" {:fx [[:dispatch [:wallet/reload]]]} | ||
(log/debug ::unknown-wallet-event | ||
:type type | ||
:event (js->clj event-js | ||
:keywordize-keys | ||
true)))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I just put this in a regular effects file? not sure if we have a common approach for this but seemed nice to me to somewhat separate it out 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate ns is good as the signals for the wallet will grow over time. 👍