Skip to content

Commit

Permalink
Revert "🤝 [19834] Add dapp connection flow with a basic design (#20204)…
Browse files Browse the repository at this point in the history
…" (#20323)

This reverts commit 6ea39b5.
  • Loading branch information
shivekkhurana authored Jun 4, 2024
1 parent 6ea39b5 commit 00d288f
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 311 deletions.
9 changes: 1 addition & 8 deletions src/react_native/wallet_connect.cljs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(ns react-native.wallet-connect
(:require
["@walletconnect/core" :refer [Core]]
["@walletconnect/utils" :refer
[buildApprovedNamespaces getSdkError parseUri]]
["@walletconnect/utils" :refer [buildApprovedNamespaces getSdkError]]
["@walletconnect/web3wallet" :refer [Web3Wallet]]))

(defn- wallet-connect-core
Expand All @@ -25,9 +24,3 @@
(defn get-sdk-error
[error-key]
(getSdkError error-key))

(defn parse-uri
[uri]
(-> uri
parseUri
(js->clj :keywordize-keys true)))
2 changes: 1 addition & 1 deletion src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
(goog-define ALCHEMY_OPTIMISM_MAINNET_TOKEN "")
(goog-define ALCHEMY_OPTIMISM_GOERLI_TOKEN "")
(goog-define ALCHEMY_OPTIMISM_SEPOLIA_TOKEN "")
(goog-define WALLET_CONNECT_PROJECT_ID "87815d72a81d739d2a7ce15c2cfdefb3")
(goog-define WALLET_CONNECT_PROJECT_ID "")

(def mainnet-rpc-url (str "https://eth-archival.rpc.grove.city/v1/" POKT_TOKEN))
(def goerli-rpc-url (str "https://goerli-archival.gateway.pokt.network/v1/lb/" POKT_TOKEN))
Expand Down
41 changes: 20 additions & 21 deletions src/status_im/contexts/shell/qr_reader/view.cljs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
(ns status-im.contexts.shell.qr-reader.view
(:require [clojure.string :as string]
[react-native.core :as rn]
[react-native.hooks :as hooks]
[status-im.common.router :as router]
[status-im.common.scan-qr-code.view :as scan-qr-code]
[status-im.common.validation.general :as validators]
[status-im.contexts.communities.events]
[status-im.contexts.wallet.common.validation :as wallet-validation]
[status-im.contexts.wallet.wallet-connect.utils :as wc-utils]
[utils.debounce :as debounce]
[utils.ethereum.eip.eip681 :as eip681]
[utils.i18n :as i18n]
[utils.url :as url]))
(:require
[clojure.string :as string]
[react-native.core :as rn]
[react-native.hooks :as hooks]
[status-im.common.router :as router]
[status-im.common.scan-qr-code.view :as scan-qr-code]
[status-im.common.validation.general :as validators]
[status-im.contexts.communities.events]
[status-im.contexts.wallet.common.validation :as wallet-validation]
[utils.debounce :as debounce]
[utils.ethereum.eip.eip681 :as eip681]
[utils.i18n :as i18n]
[utils.url :as url]))

(def invalid-qr-toast
{:type :negative
Expand Down Expand Up @@ -42,6 +42,10 @@
[_]
false)

(defn wallet-connect-code?
[scanned-text]
(string/starts-with? scanned-text "wc:"))

(defn url?
[scanned-text]
(url/url? scanned-text))
Expand All @@ -64,12 +68,6 @@
[:toasts/upsert invalid-qr-toast]
300))

(defn- handle-wallet-connect
[scanned-text]
(debounce/debounce-and-dispatch
[:wallet-connect/on-scan-connection scanned-text]
300))

(defn on-qr-code-scanned
[scanned-text]
(cond
Expand Down Expand Up @@ -102,8 +100,9 @@
;; TODO: https://github.com/status-im/status-mobile/issues/18744
nil

(wc-utils/valid-uri? scanned-text)
(handle-wallet-connect scanned-text)
(wallet-connect-code? scanned-text)
;; WalletConnect is not working yet, this flow should be updated once WalletConnect is ready
nil

(url? scanned-text)
(debounce/debounce-and-dispatch [:browser.ui/open-url scanned-text] 300)
Expand Down
13 changes: 6 additions & 7 deletions src/status_im/contexts/wallet/common/scan_account/view.cljs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
(ns status-im.contexts.wallet.common.scan-account.view
(:require
[clojure.string :as string]
[status-im.common.scan-qr-code.view :as scan-qr-code]
[status-im.constants :as constants]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
(:require [clojure.string :as string]
[status-im.common.scan-qr-code.view :as scan-qr-code]
[status-im.constants :as constants]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(def ^:private supported-networks #{:eth :arb1 :oeth})

Expand Down
4 changes: 1 addition & 3 deletions src/status_im/contexts/wallet/wallet_connect/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
:wallet-connect/on-session-proposal
(fn [{:keys [db]} [proposal]]
(log/info "Received Wallet Connect session proposal: " {:id (:id proposal)})
{:db (assoc db :wallet-connect/current-proposal proposal)
:fx [[:dispatch
[:open-modal :screen/wallet.wallet-connect-session-proposal]]]}))
{:db (assoc db :wallet-connect/current-proposal proposal)}))

(rf/reg-event-fx
:wallet-connect/on-session-request
Expand Down

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions src/status_im/contexts/wallet/wallet_connect/utils.cljs

This file was deleted.

5 changes: 0 additions & 5 deletions src/status_im/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
[status-im.contexts.wallet.send.send-amount.view :as wallet-send-input-amount]
[status-im.contexts.wallet.send.transaction-confirmation.view :as wallet-transaction-confirmation]
[status-im.contexts.wallet.send.transaction-progress.view :as wallet-transaction-progress]
[status-im.contexts.wallet.wallet-connect.session-proposal.view :as wallet-connect-session-proposal]
[status-im.contexts.wallet.wallet-connect.sign-message.view :as wallet-connect-sign-message]
[status-im.navigation.options :as options]
[status-im.navigation.transitions :as transitions]))
Expand Down Expand Up @@ -390,10 +389,6 @@
:options {:insets {:top? true}}
:component wallet-connected-dapps/view}

{:name :screen/wallet.wallet-connect-session-proposal
:options {:sheet? true}
:component wallet-connect-session-proposal/view}

{:name :screen/wallet.edit-account
:component wallet-edit-account/view}

Expand Down
12 changes: 0 additions & 12 deletions src/status_im/subs/wallet/wallet_connect.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,3 @@
{:customization-color customization-color
:name name
:emoji emoji})))

(rf/reg-sub
:wallet-connect/session-proposer
:<- [:wallet-connect/current-proposal]
(fn [proposal]
(-> proposal :params :proposer)))

(rf/reg-sub
:wallet-connect/session-proposer-name
:<- [:wallet-connect/session-proposer]
(fn [proposer]
(-> proposer :metadata :name)))
Loading

0 comments on commit 00d288f

Please sign in to comment.