From da812459a859e399c39114b600c0d30fb18503aa Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Thu, 5 May 2022 12:47:00 -0300 Subject: [PATCH] Identicon rings client side rendering proof of concept --- ios/Podfile.lock | 14 ++++++++++---- package.json | 2 ++ src/status_im/ethereum/json_rpc.cljs | 3 ++- src/status_im/visual_identity/core.cljs | 13 +++++++++++++ yarn.lock | 19 +++++++++++++++++++ 5 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 src/status_im/visual_identity/core.cljs diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 335c077046..da499cd2df 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -235,8 +235,8 @@ PODS: - React - react-native-slider (3.0.0): - React - - react-native-splash-screen (3.2.0): - - React + - react-native-splash-screen (3.3.0): + - React-Core - react-native-status (1.0.0): - React - react-native-status-keycard (2.5.37): @@ -304,6 +304,8 @@ PODS: - React-Core (= 0.63.4) - React-cxxreact (= 0.63.4) - React-jsi (= 0.63.4) + - ReactNativeART (1.2.0): + - React - ReactNativeAudioToolkit (2.0.3): - React - ReactNativeNavigation (7.13.0): @@ -452,6 +454,7 @@ DEPENDENCIES: - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) + - "ReactNativeART (from `../node_modules/@react-native-community/art`)" - "ReactNativeAudioToolkit (from `../node_modules/@react-native-community/audio-toolkit`)" - ReactNativeNavigation (from `../node_modules/react-native-navigation`) - "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)" @@ -583,6 +586,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/Vibration" ReactCommon: :path: "../node_modules/react-native/ReactCommon" + ReactNativeART: + :path: "../node_modules/@react-native-community/art" ReactNativeAudioToolkit: :path: "../node_modules/@react-native-community/audio-toolkit" ReactNativeNavigation: @@ -644,7 +649,7 @@ SPEC CHECKSUMS: FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e Folly: b73c3869541e86821df3c387eb0af5f65addfab4 - glog: 61334f8bdb4deea07543d4fbac3fb5948e78a7a5 + glog: 502275bc0747df92346edbab1f40dacde2ec86d4 Keycard: 07f1b4d4fadcf1218084cb3e1bb3a8bac3870c5a libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b @@ -673,7 +678,7 @@ SPEC CHECKSUMS: react-native-safe-area-context: 60f654e00b6cc416573f6d5dbfce3839958eb57a react-native-shake: de052eaa3eadc4a326b8ddd7ac80c06e8d84528c react-native-slider: 12bd76d3d568c9c5500825db54123d44b48e4ad4 - react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865 + react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457 react-native-status: 45dbf1302ce3c258b459dfab137cd1c2c68c295d react-native-status-keycard: 961d01ca190889ddf220206822fd752f8f4f3f7a react-native-webview: 28a8636d97ee641f2ee8f20492d7a6c269c1d703 @@ -687,6 +692,7 @@ SPEC CHECKSUMS: React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b + ReactNativeART: 78edc68dd4a1e675338cd0cd113319cf3a65f2ab ReactNativeAudioToolkit: de9610f323e855ac6574be8c99621f3d57c5df06 ReactNativeNavigation: 4c4ca87edc0da4ee818158a62cb6188088454e5c RNCAsyncStorage: d059c3ee71738c39834a627476322a5a8cd5bf36 diff --git a/package.json b/package.json index 7473d3f681..58d1cea7f6 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "app:android": "react-native run-android" }, "dependencies": { + "@react-native-community/art": "^1.2.0", "@react-native-community/async-storage": "^1.11.0", "@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6", "@react-native-community/blur": "^3.6.0", @@ -60,6 +61,7 @@ "react-native-navigation": "^7.13.0", "react-native-notifications": "^4.1.3", "react-native-permissions": "^2.1.5", + "react-native-pie-chart": "^2.0.2", "react-native-randombytes": "^3.6.1", "react-native-reanimated": "^2.1.0", "react-native-redash": "^16.0.11", diff --git a/src/status_im/ethereum/json_rpc.cljs b/src/status_im/ethereum/json_rpc.cljs index 2058de94a4..d9c020df9d 100644 --- a/src/status_im/ethereum/json_rpc.cljs +++ b/src/status_im/ethereum/json_rpc.cljs @@ -241,7 +241,8 @@ "mailservers_getChatRequestRanges" {} "mailservers_deleteChatRequestRange" {} "appmetrics_saveAppMetrics" {} - "appmetrics_getAppMetrics" {}}) + "appmetrics_getAppMetrics" {} + "visualidentity_colorHashOf" {}}) (defn on-error-retry [call-method {:keys [method number-of-retries delay on-error] :as arg}] diff --git a/src/status_im/visual_identity/core.cljs b/src/status_im/visual_identity/core.cljs new file mode 100644 index 0000000000..438a4c34b0 --- /dev/null +++ b/src/status_im/visual_identity/core.cljs @@ -0,0 +1,13 @@ +(ns status-im.visual-identity.core + (:require [taoensso.timbre :as log] + [status-im.ethereum.json-rpc :as json-rpc])) + +(defn color-hash + [public-key on-success] + (json-rpc/call + {:method "visualidentity_colorHashOf" + :params [public-key] + :on-success #(on-success %) + :on-error (fn [err] + (log/error {:error err}) + (log/warn "The logged events will be rejected"))})) diff --git a/yarn.lock b/yarn.lock index b2c8bcd91d..7079783029 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1236,6 +1236,15 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" +"@react-native-community/art@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@react-native-community/art/-/art-1.2.0.tgz#386d95393f6042d9006f9d4bc6063fb898794460" + integrity sha512-a+ZcRGl/BzLa89yi33Mbn5SHavsEXqKUMdbfLf3U8MDLElndPqUetoJyGkv63+BcPO49UMWiQRP1YUz6/zfJ+A== + dependencies: + art "^0.10.3" + invariant "^2.2.4" + prop-types "^15.7.2" + "@react-native-community/async-storage@^1.11.0": version "1.11.0" resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.11.0.tgz#bf81b8813080846f150c67f531987c429b442166" @@ -2073,6 +2082,11 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +art@^0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/art/-/art-0.10.3.tgz#b01d84a968ccce6208df55a733838c96caeeaea2" + integrity sha512-HXwbdofRTiJT6qZX/FnchtldzJjS3vkLJxQilc3Xj+ma2MXjY4UAyQ0ls1XZYVnDvVIBiFZbC6QsvtW86TD6tQ== + asap@~2.0.3, asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -7447,6 +7461,11 @@ react-native-permissions@^2.1.5: resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-2.1.5.tgz#6cfc4f1ab1590f4952299b7cdc9698525ad540e0" integrity sha512-b9KO/4UEV9qddl+kcSybmdk8nlAifclSDBR2rSvc5KZM06vIaJWJNIzK2ZwPXqDQ5yD3CJLuKTRj7Fz+jM9qyQ== +react-native-pie-chart@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/react-native-pie-chart/-/react-native-pie-chart-2.0.2.tgz#c88c2fbe49d9253064e520c5493efb94ca4f864a" + integrity sha512-pMsbR35r4it5i3Ck/tL7pWvYKy9VO7EZfQNhR+Nfvo3qQHJ1ZHdpO8QYS4/HZcHG5kbAG8x+679jpvR9nubsFw== + react-native-randombytes@^3.5.1, react-native-randombytes@^3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/react-native-randombytes/-/react-native-randombytes-3.6.1.tgz#cac578093b5ca38e3e085becffdc6cbcf6f0d654"