Skip to content

Commit

Permalink
rename tx-type for collectibles
Browse files Browse the repository at this point in the history
  • Loading branch information
BalogunofAfrica committed May 15, 2024
1 parent af75432 commit 8093e96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
22 changes: 12 additions & 10 deletions src/status_im/contexts/wallet/send/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/send/flow_config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 8093e96

Please sign in to comment.