From 8093e96849805d57d5c3ed9ce69211d7f341f117 Mon Sep 17 00:00:00 2001 From: balogunofafrica Date: Wed, 15 May 2024 17:04:02 +0100 Subject: [PATCH] rename tx-type for collectibles --- .../contexts/wallet/send/events.cljs | 22 ++++++++++--------- .../contexts/wallet/send/flow_config.cljs | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/status_im/contexts/wallet/send/events.cljs b/src/status_im/contexts/wallet/send/events.cljs index 859f86f167e9..156a055516e5 100644 --- a/src/status_im/contexts/wallet/send/events.cljs +++ b/src/status_im/contexts/wallet/send/events.cljs @@ -138,7 +138,7 @@ {:prefix prefix :testnet-enabled? testnet-enabled? :goerli-enabled? goerli-enabled?}) - collectible-tx? (contains? #{:collectible :collectible-multi} + collectible-tx? (contains? #{:collectible-erc-721 :collectible-erc-1155} (-> db :wallet :ui :send :tx-type)) collectible (when collectible-tx? (-> db :wallet :ui :send :collectible)) @@ -211,7 +211,9 @@ :collectible :token-display-name :amount - (when (contains? #{:collectible :collectible-multi} transaction-type) :tx-type))}))) + (when (contains? #{:collectible-erc-721 :collectible-erc-1155} + transaction-type) + :tx-type))}))) (rf/reg-event-fx :wallet/set-collectible-to-send @@ -220,8 +222,8 @@ collectible-data (:collectible-data collectible) contract-type (:contract-type collectible) tx-type (if (= contract-type constants/contract-type-erc-1155) - :collectible-multi - :collectible) + :collectible-erc-1155 + :collectible-erc-721) collectible-id (get-in collectible [:id :token-id]) one-collectible? (= (collectible.utils/collectible-balance collectible) 1) token-display-name (cond @@ -302,9 +304,9 @@ network-chain-ids)) from-locked-amount {} transaction-type-param (case transaction-type - :collectible constants/send-type-erc-721-transfer - :collectible-multi constants/send-type-erc-1155-transfer - :bridge constants/send-type-bridge + :collectible-erc-721 constants/send-type-erc-721-transfer + :collectible-erc-1155 constants/send-type-erc-1155-transfer + :bridge constants/send-type-bridge constants/send-type-transfer) balances-per-chain (when token (:balances-per-chain token)) token-available-networks-for-suggested-routes @@ -480,9 +482,9 @@ from-address (get-in db [:wallet :current-viewing-account-address]) transaction-type (get-in db [:wallet :ui :send :tx-type]) transaction-type-param (case transaction-type - :collectible constants/send-type-erc-721-transfer - :collectible-multi constants/send-type-erc-1155-transfer - :bridge constants/send-type-bridge + :collectible-erc-721 constants/send-type-erc-721-transfer + :collectible-erc-1155 constants/send-type-erc-1155-transfer + :bridge constants/send-type-bridge constants/send-type-transfer) token (get-in db [:wallet :ui :send :token]) collectible (get-in db [:wallet :ui :send :collectible]) diff --git a/src/status_im/contexts/wallet/send/flow_config.cljs b/src/status_im/contexts/wallet/send/flow_config.cljs index 956423e7a8c8..d10fae65a6ad 100644 --- a/src/status_im/contexts/wallet/send/flow_config.cljs +++ b/src/status_im/contexts/wallet/send/flow_config.cljs @@ -5,7 +5,8 @@ (let [collectible-stored (-> db :wallet :ui :send :collectible) tx-type (-> db :wallet :ui :send :tx-type)] (and (some? collectible-stored) - (contains? #{:collectible :collectible-multi} tx-type)))) + (contains? #{:collectible-erc-721 :collectible-erc-1155} + tx-type)))) (defn- token-selected? [db]