Skip to content

Commit

Permalink
Merge branch 'develop' into jc/recent-transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Son89 committed May 14, 2024
2 parents 61c094d + d658fcf commit 2fca855
Show file tree
Hide file tree
Showing 21 changed files with 308 additions and 81 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ _install-hooks: ##@prepare Create prepare-commit-msg git hook symlink

# Remove directories and ignored files
clean: SHELL := /bin/sh
clean: _fix-node-perms _tmpdir-rm ##@prepare Remove all output folders
clean: _fix-node-perms _tmpdir-rm ios-clean android-clean ##@prepare Remove all output folders
git clean -dXf

# Remove directories, ignored and non-ignored files
Expand Down Expand Up @@ -196,6 +196,10 @@ xcode-clean: XCODE_HOME := $(HOME)/Library/Developer/Xcode
xcode-clean: ##@prepare Clean XCode derived data and archives
rm -fr $(XCODE_HOME)/DerivedData/StatusIm-* $(XCODE_HOME)/Archives/*/StatusIm*

ios-simulator-cache-clean: SHELL := /bin/sh
ios-simulator-cache-clean: ##@prepare Clean iOS Simulator Caches
rm -rf ~/Library/Developer/CoreSimulator/Cache

#----------------
# Release builds
#----------------
Expand Down Expand Up @@ -409,13 +413,17 @@ geth-connect: ##@other Connect to Geth on the device
build/bin/geth attach http://localhost:8545

ios-clean: SHELL := /bin/sh
ios-clean: ios-simulator-cache-clean
ios-clean: ##@prepare Clean iOS build artifacts
git clean -dxf -f target/ios

android-clean: export TARGET := gradle
android-clean: SHELL := /bin/sh
android-clean: ##@prepare Clean Gradle state
git clean -dxf -f ./android/app/build; \
[[ -d android/.gradle ]] && cd android && ./gradlew clean
rm -rf android/.gradle \
rm -rf android/build \
rm -rf ~/.gradle


android-ports: export TARGET := android-sdk
android-ports: ##@other Add proxies to Android Device/Simulator
Expand Down
12 changes: 6 additions & 6 deletions nix/deps/clojure/deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,11 @@
},

{
"path": "org/clojure/tools.logging/1.1.0/tools.logging-1.1.0",
"path": "org/clojure/tools.logging/1.2.4/tools.logging-1.2.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "84cb5d00caa9df2ee504d46f6107f4708271f619",
"sha256": "0x2zzivn38z179lxkw9wbi9n9qwsf466lrd9y27khdz7wbxhscb5"
"sha1": "3a85764aa30c434a5b0375a2ee72924aa040fa66",
"sha256": "0a8riw23pfkiiyz98ccmljpbw1z13mxl73pdgyz80j93s0y0mzj6"
}
},

Expand Down Expand Up @@ -1008,11 +1008,11 @@
},

{
"path": "re-frame/re-frame/1.3.0/re-frame-1.3.0",
"path": "re-frame/re-frame/1.4.3/re-frame-1.4.3",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "b7135a76432b8141027ba1f4eb6bb15a36acfb7c",
"sha256": "16wi01z0j4wn04kldwzxvj0pd9dianjyb000nv5611ikhxk1qrps"
"sha1": "74e132cc593ed2d72a5d4874954c58677a905f0e",
"sha256": "1xdmbjb0gv6dby98y1nx3brz9sdkfzxz9cjk8ajcr1f4zabcaapb"
}
},

Expand Down
4 changes: 2 additions & 2 deletions nix/deps/clojure/deps.list
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ org/clojure/test.check/1.1.1/test.check-1.1.1.jar
org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar
org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.jar
org/clojure/tools.logging/1.2.4/tools.logging-1.2.4.jar
org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar
org/clojure/tools.reader/1.3.7/tools.reader-1.3.7.jar
org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
Expand All @@ -110,7 +110,7 @@ prismatic/schema/1.1.7/schema-1.1.7.jar
reagent/reagent/1.2.0/reagent-1.2.0.jar
re-com/re-com/2.8.0/re-com-2.8.0.jar
refactor-nrepl/refactor-nrepl/3.9.1/refactor-nrepl-3.9.1.jar
re-frame/re-frame/1.3.0/re-frame-1.3.0.jar
re-frame/re-frame/1.4.3/re-frame-1.4.3.jar
re-frisk-remote/re-frisk-remote/1.6.0/re-frisk-remote-1.6.0.jar
re-frisk/sente/1.15.0/sente-1.15.0.jar
ring-cors/ring-cors/0.1.8/ring-cors-0.1.8.jar
Expand Down
2 changes: 1 addition & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{:source-paths ["src" "test/cljs"]

:dependencies [[reagent "1.2.0"]
[re-frame "1.3.0"]
[re-frame "1.4.3"]
[binaryage/oops "0.7.2"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[com.taoensso/timbre "6.3.1"]
Expand Down
1 change: 1 addition & 0 deletions src/mocks/js_dependencies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
"react-native-transparent-video" react-native-transparent-video
"react-native-orientation-locker" react-native-orientation-locker
"react-native-gifted-charts" react-native-gifted-charts
"@walletconnect/react-native-compat" #js {}
"../resources/data/emojis/en.json" (js/JSON.parse
(slurp
"./resources/data/emojis/en.json"))
Expand Down
6 changes: 6 additions & 0 deletions src/status_im/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@
(def regx-starts-with-uuid #"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
(def regx-full-or-partial-address #"^0x[a-fA-F0-9]{1,40}$")

;; Wallet Connect
(def ^:const optimism-crosschain-id "eip155:10")
(def ^:const wallet-connect-supported-methods ["eth_sendTransaction" "personal_sign"])
(def ^:const wallet-connect-supported-events ["accountsChanged" "chainChanged"])
(def ^:const wallet-connect-session-proposal-event "session_proposal")

(def ^:const dapp-permission-contact-code "contact-code")
(def ^:const dapp-permission-web3 "web3")
(def ^:const dapp-permission-qr-code "qr-code")
Expand Down
3 changes: 3 additions & 0 deletions src/status_im/contexts/profile/login/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[status-im.constants :as constants]
status-im.contexts.profile.login.effects
[status-im.contexts.profile.rpc :as profile.rpc]
[status-im.feature-flags :as ff]
[taoensso.timbre :as log]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
Expand Down Expand Up @@ -104,6 +105,8 @@
[:chat.ui/request-link-preview-whitelist]
[:visibility-status-updates/fetch]
[:switcher-cards/fetch]
(when (ff/enabled? ::ff/wallet.wallet-connect)
[:dispatch [:wallet-connect/init]])
(when-not (:universal-links/handling db)
[:effects.chat/open-last-chat key-uid])
(when notifications-enabled?
Expand Down
14 changes: 10 additions & 4 deletions src/status_im/contexts/wallet/collectible/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
[rn/view {:style style/header}
[quo/text
{:weight :semi-bold
:size :heading-1} collectible-name]
:size :heading-1}
collectible-name]
[rn/view {:style style/collection-container}
[rn/view {:style style/collection-avatar-container}
[quo/collection-avatar {:image collection-image-url}]]
Expand All @@ -28,15 +29,19 @@
collection-name]]])

(defn cta-buttons
[{:keys [chain-id token-id contract-address watch-only?]}]
[{:keys [chain-id token-id contract-address collectible watch-only?]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style style/buttons-container}
(when-not watch-only?
[quo/button
{:container-style style/send-button
:type :outline
:size 40
:icon-left :i/send}
:icon-left :i/send
:on-press #(rf/dispatch
[:wallet/set-collectible-to-send
{:collectible collectible
:current-screen :screen/wallet.collectible}])}
(i18n/label :t/send)])
[quo/button
{:container-style style/opensea-button
Expand Down Expand Up @@ -134,7 +139,8 @@
{:chain-id chain-id
:token-id token-id
:contract-address contract-address
:watch-only? (:watch-only? collectible-owner)}]
:watch-only? false ;(:watch-only? collectible-owner)
:collectible collectible}]
[quo/tabs
{:size 32
:style style/tabs
Expand Down
17 changes: 11 additions & 6 deletions src/status_im/contexts/wallet/common/token_value/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
:right-icon :i/external})

(defn- action-send
[token-data]
[send-params]
{:icon :i/send
:accessibility-label :send
:label (i18n/label :t/send)
:on-press (fn []
(rf/dispatch [:hide-bottom-sheet])
(rf/dispatch [:wallet/clean-send-data])
(rf/dispatch [:wallet/send-select-token
{:token token-data
:start-flow? true}]))})
(rf/dispatch [:wallet/set-token-to-send send-params]))})

(defn- action-receive
[]
Expand Down Expand Up @@ -59,14 +57,21 @@

(defn token-value-drawer
[token watch-only?]
(let [token-data (first (rf/sub [:wallet/current-viewing-account-tokens-filtered (:token token)]))]
(let [token-symbol (:token token)
token-data (first (rf/sub [:wallet/current-viewing-account-tokens-filtered token-symbol]))
selected-account? (rf/sub [:wallet/current-viewing-account-address])
send-params (if selected-account?
{:token token-data
:start-flow? true}
{:token-symbol token-symbol
:start-flow? true})]
[quo/action-drawer
[(cond->> [(when (ff/enabled? ::ff/wallet.assets-modal-manage-tokens)
(action-manage-tokens watch-only?))
(when (ff/enabled? ::ff/wallet.assets-modal-hide)
(action-hide))]
(not watch-only?) (concat [(action-buy)
(action-send token-data)
(action-send send-params)
(action-receive)
(action-bridge token-data)]))]]))

Expand Down
7 changes: 7 additions & 0 deletions src/status_im/contexts/wallet/common/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,10 @@
(str (get-in collectible [:id :contract-id :address])
":"
(get-in collectible [:id :token-id]))))

(defn get-token-from-account
[db token-symbol address]
(let [address-tokens (-> db :wallet :accounts (get address) :tokens)]
(some #(when (= token-symbol (:symbol %))
%)
address-tokens)))
7 changes: 2 additions & 5 deletions src/status_im/contexts/wallet/home/tabs/assets/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.contexts.wallet.common.token-value.view :as token-value]
[status-im.contexts.wallet.home.tabs.assets.style :as style]
[utils.re-frame :as rf]))

(defn- token-value
[item & _rest]
[quo/token-value item])

(defn view
[]
(let [tokens-loading? (rf/sub [:wallet/tokens-loading?])
Expand All @@ -19,6 +16,6 @@
:parent-height 560
:animated? false}]
[rn/flat-list
{:render-fn token-value
{:render-fn token-value/view
:data tokens
:content-container-style style/list-container}])))

0 comments on commit 2fca855

Please sign in to comment.