From 01c5cf249809272ceca1e8edc7a06e0b8319584c Mon Sep 17 00:00:00 2001 From: Andrey Bocharnikov Date: Tue, 22 Oct 2024 19:15:47 +0700 Subject: [PATCH] fix: client should pass a list with "Symbol" and without "ChainID-" prefix to wallet_fetchMarketValues, wallet_fetchPrices (#21453) Signed-off-by: Brian Sztamfater --- src/status_im/constants.cljs | 1 + src/status_im/contexts/wallet/common/utils.cljs | 4 +--- src/status_im/contexts/wallet/tokens/events.cljs | 6 ++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 6d41398963..3aa0e4afdf 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -566,6 +566,7 @@ (def ^:const bridge-name-erc-1155-transfer "ERC1155Transfer") (def ^:const bridge-name-hop "Hop") (def ^:const bridge-name-paraswap "Paraswap") +(def ^:const bridge-name-celer "CBridge") (def ^:const bridge-assets #{"ETH" "USDT" "USDC" "DAI"}) diff --git a/src/status_im/contexts/wallet/common/utils.cljs b/src/status_im/contexts/wallet/common/utils.cljs index 779e1c4a6c..1b4de8759d 100644 --- a/src/status_im/contexts/wallet/common/utils.cljs +++ b/src/status_im/contexts/wallet/common/utils.cljs @@ -495,9 +495,7 @@ :TokenIDTo token-id-to :SlippagePercentage slippage-percentage)) - (not (or (= bridge-name constants/bridge-name-erc-721-transfer) - (= bridge-name constants/bridge-name-transfer) - (= bridge-name constants/bridge-name-hop))) + (= bridge-name constants/bridge-name-celer) (assoc :CbridgeTx (assoc tx-data :ChainID to-chain-id diff --git a/src/status_im/contexts/wallet/tokens/events.cljs b/src/status_im/contexts/wallet/tokens/events.cljs index 42bd1074f8..3a2c5692d6 100644 --- a/src/status_im/contexts/wallet/tokens/events.cljs +++ b/src/status_im/contexts/wallet/tokens/events.cljs @@ -50,8 +50,10 @@ data) symbols (->> tokens :by-symbol - keys - (remove utils.address/address?))] + vals + (map :symbol) + set + vec)] {:fx [[:effects.wallet.tokens/fetch-market-values {:symbols symbols :currency constants/profile-default-currency