Skip to content

Commit

Permalink
chore: add wallet connect library
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Sztamfater <[email protected]>
  • Loading branch information
briansztamfater committed Apr 29, 2024
1 parent b65ac2a commit 2d95457
Show file tree
Hide file tree
Showing 6 changed files with 1,580 additions and 8 deletions.
14 changes: 14 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,16 @@ PODS:
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- react-native-compat (2.12.2):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
- react-native-config (1.5.0):
- react-native-config/App (= 1.5.0)
- react-native-config/App (1.5.0):
- React-Core
- react-native-get-random-values (1.11.0):
- React-Core
- react-native-hole-view (3.0.0-alpha4):
- React-Core
- react-native-image-resizer (1.2.3):
Expand Down Expand Up @@ -1180,7 +1186,9 @@ DEPENDENCIES:
- react-native-blob-util (from `../node_modules/react-native-blob-util`)
- "react-native-blur (from `../node_modules/@react-native-community/blur`)"
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- "react-native-compat (from `../node_modules/@walletconnect/react-native-compat`)"
- react-native-config (from `../node_modules/react-native-config`)
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- react-native-hole-view (from `../node_modules/react-native-hole-view`)
- react-native-image-resizer (from `../node_modules/react-native-image-resizer`)
- react-native-lottie-splash-screen (from `../node_modules/react-native-lottie-splash-screen`)
Expand Down Expand Up @@ -1312,8 +1320,12 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/blur"
react-native-cameraroll:
:path: "../node_modules/@react-native-camera-roll/camera-roll"
react-native-compat:
:path: "../node_modules/@walletconnect/react-native-compat"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-get-random-values:
:path: "../node_modules/react-native-get-random-values"
react-native-hole-view:
:path: "../node_modules/react-native-hole-view"
react-native-image-resizer:
Expand Down Expand Up @@ -1463,7 +1475,9 @@ SPEC CHECKSUMS:
react-native-blob-util: 600972b1782380a5a7d5db61a3817ea32349dae9
react-native-blur: 799045500f56146afc46245148080e7b7623cb75
react-native-cameraroll: af8eec1e585d053ff485d98ec837f9a8a11b5745
react-native-compat: 84e00e8dcff9251278c0d48f2bce81f4502e3925
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
react-native-hole-view: 6935448993bac79f2b5a4ad7e9741094cf810679
react-native-image-resizer: 2f1577efa3bc762597681f530c8e8d05ce0ceeb3
react-native-lottie-splash-screen: 4e1b1fd9d6633f9cd2106d6877eb5ba0147f3e2b
Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"preinstall": "scripts/check-nix-shell.sh && make status-go-library"
},
"dependencies": {
"@ethersproject/shims": "^5.7.0",
"@json-rpc-tools/utils": "^1.7.6",
"@react-native-async-storage/async-storage": "1.19.3",
"@react-native-camera-roll/camera-roll": "7.5.2",
"@react-native-clipboard/clipboard": "1.13.2",
Expand All @@ -18,11 +20,15 @@
"@react-native-community/netinfo": "^4.4.0",
"@react-native-community/push-notification-ios": "^1.4.1",
"@react-native-community/slider": "^3.0.0",
"@walletconnect/react-native-compat": "^2.12.2",
"@walletconnect/web3wallet": "^1.11.2",
"base-64": "^1.0.0",
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#refs/tags/v4.0.2-status",
"chance": "^1.1.0",
"emojilib": "^2.4.0",
"eth-phishing-detect": "^1.2.0",
"ethers": "5.7.2",
"fast-text-encoding": "^1.0.6",
"form-data": "^4.0.0",
"functional-red-black-tree": "^1.0.1",
"i18n-js": "^3.3.0",
Expand All @@ -41,6 +47,7 @@
"react-native-fast-image": "^8.5.11",
"react-native-fs": "^2.14.1",
"react-native-gesture-handler": "2.14.1",
"react-native-get-random-values": "^1.11.0",
"react-native-gifted-charts": "^1.3.2",
"react-native-hole-view": "^3.0.0-alpha4",
"react-native-image-crop-picker": "0.40.0",
Expand Down
3 changes: 2 additions & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_GOERLI_TOKEN #shadow/env "ALCHEMY_OPTIMISM_GOERLI_TOKEN"
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"}
status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"
status-im.config/WALLET_CONNECT_PROJECT_ID #shadow/env "WALLET_CONNECT_PROJECT_ID"}
:compiler-options
{;; needed because we override require and it
;; messes with source-map which reports callstack
Expand Down
1 change: 1 addition & 0 deletions src/status_im/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +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 "")

(def mainnet-rpc-url (str "https://eth-archival.gateway.pokt.network/v1/lb/" POKT_TOKEN))
(def goerli-rpc-url (str "https://goerli-archival.gateway.pokt.network/v1/lb/" POKT_TOKEN))
Expand Down
24 changes: 24 additions & 0 deletions src/status_im/contexts/wallet/wallet_connect/utils.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(ns status-im.contexts.wallet.wallet-connect.utils
(:require ["@walletconnect/core" :refer [Core]]
["@walletconnect/web3wallet" :refer [Web3Wallet]]
[status-im.config :as config]))

(defonce ^:private wallet-connect-metadata
#js
{:name "Status"
:description
"Status is a secure messaging app, crypto wallet, and Web3 browser built with state of the art technology."
:url "https://status.app"
:icons
["https://res.cloudinary.com/dhgck7ebz/image/upload/f_auto,c_limit,w_1080,q_auto/Brand/Logo%20Section/Mark/Mark_01"]})

(defn- wallet-connect-core
[]
(Core. #js {:projectId config/WALLET_CONNECT_PROJECT_ID}))

(defn init
[]
(let [core (wallet-connect-core)]
(Web3Wallet.init
(clj->js {:core core
:metadata wallet-connect-metadata}))))

0 comments on commit 2d95457

Please sign in to comment.