Wallet - Refresh tokens and prices (#18456)
This commit adds - RPC call for start wallet which will signal the client to refresh data (tokens, prices, ...etc) every 10 minutes - Refreshes tokens and prices every 10 minutes on receiving the "wallet-tick-reload" signal --------- Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
cb586c8676
commit
4fe62553ca
|
@ -89,4 +89,5 @@
|
||||||
"wallet-get-collectibles-details-done" {:fx [[:dispatch
|
"wallet-get-collectibles-details-done" {:fx [[:dispatch
|
||||||
[:wallet/get-collectible-details-done
|
[:wallet/get-collectible-details-done
|
||||||
event]]]}
|
event]]]}
|
||||||
|
"wallet-tick-reload" {:fx [[:dispatch [:wallet/reload]]]}
|
||||||
(log/debug ::unknown-wallet-event :type type :event event)))
|
(log/debug ::unknown-wallet-event :type type :event event)))
|
||||||
|
|
|
@ -327,9 +327,23 @@
|
||||||
{:fx [[:dispatch [:hide-bottom-sheet]]
|
{:fx [[:dispatch [:hide-bottom-sheet]]
|
||||||
[:dispatch [:browser.ui/open-url (str explorer-link "/" address)]]]}))
|
[:dispatch [:browser.ui/open-url (str explorer-link "/" address)]]]}))
|
||||||
|
|
||||||
|
(rf/reg-event-fx :wallet/reload
|
||||||
|
(fn [_]
|
||||||
|
{:fx [[:dispatch-n [[:wallet/get-wallet-token]]]]}))
|
||||||
|
|
||||||
|
(rf/reg-event-fx :wallet/start-wallet
|
||||||
|
(fn [_]
|
||||||
|
{:fx [[:json-rpc/call
|
||||||
|
[{:method "wallet_startWallet"
|
||||||
|
:on-error #(log/info "failed to start wallet"
|
||||||
|
{:error %
|
||||||
|
:event :wallet/start-wallet})}]]]}))
|
||||||
|
|
||||||
(rf/reg-event-fx :wallet/initialize
|
(rf/reg-event-fx :wallet/initialize
|
||||||
(fn []
|
(fn []
|
||||||
{:fx [[:dispatch-n [[:wallet/get-ethereum-chains] [:wallet/get-accounts]]]]}))
|
{:fx [[:dispatch [:wallet/start-wallet]]
|
||||||
|
[:dispatch [:wallet/get-ethereum-chains]]
|
||||||
|
[:dispatch [:wallet/get-accounts]]]}))
|
||||||
|
|
||||||
(rf/reg-event-fx :wallet/share-account
|
(rf/reg-event-fx :wallet/share-account
|
||||||
(fn [_ [{:keys [content title]}]]
|
(fn [_ [{:keys [content title]}]]
|
||||||
|
|
Loading…
Reference in New Issue