Skip to content

Commit 2a6ebf7

Browse files
committed
refactor: updated patch to remove duplicated shim and podfile.lock
1 parent 790f87c commit 2a6ebf7

File tree

1 file changed

+1
-126
lines changed

1 file changed

+1
-126
lines changed

enable-walletconnect.patch

+1-126
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,3 @@
1-
-diff --git a/shim.js b/shim.js
2-
-index 73c130d..deae975 100644
3-
---- a/shim.js
4-
-+++ b/shim.js
5-
-@@ -26,3 +26,20 @@ if (typeof localStorage !== 'undefined') {
6-
- // If using the crypto shim, uncomment the following line to ensure
7-
- // crypto is loaded first, so it can populate global.crypto
8-
- require('crypto')
9-
-+
10-
-+const { TextEncoder, TextDecoder } = require('text-encoding');
11-
-+
12-
-+global.TextDecoder = TextDecoder;
13-
-+global.TextEncoder = TextEncoder;
14-
-+
15-
-+if (typeof btoa === 'undefined') {
16-
-+ global.btoa = function (str) {
17-
-+ return Buffer.from(str, 'binary').toString('base64');
18-
-+ };
19-
-+}
20-
-+
21-
-+if (typeof atob === 'undefined') {
22-
-+ global.atob = function (b64Encoded) {
23-
-+ return Buffer.from(b64Encoded, 'base64').toString('binary');
24-
-+ };
25-
-+}
26-
-diff --git a/src/sagas/walletConnect.js b/src/sagas/walletConnect.js
27-
-index 755753a..55e9c5f 100644
28-
---- a/src/sagas/walletConnect.js
29-
-+++ b/src/sagas/walletConnect.js
30-
-@@ -45,6 +45,7 @@
31-
- * loaded.
32-
- */
33-
-
34-
-+import '@walletconnect/react-native-compat';
35-
- import {
36-
- call,
37-
- fork,
38-
-@@ -62,6 +63,8 @@ import {
39-
- } from 'redux-saga/effects';
40-
- import { eventChannel } from 'redux-saga';
41-
- import { get, values } from 'lodash';
42-
-+import { Core } from '@walletconnect/core';
43-
-+import { Web3Wallet } from '@walletconnect/web3wallet';
44-
- import {
45-
- TriggerTypes,
46-
- TriggerResponseTypes,
47-
-@@ -100,12 +103,6 @@ const AVAILABLE_METHODS = {
48-
- };
49-
- const AVAILABLE_EVENTS = [];
50-
-
51-
--// We're mocking it here because we don't want to add the walletconnect
52-
--// libraries in our production build. If you really want to add it, just run the
53-
--// src/walletconnect.sh script
54-
--const Core = class {};
55-
--const Web3Wallet = class {};
56-
--
57-
- /**
58-
- * Those are the only ones we are currently using, extracted from
59-
- * https://docs.walletconnect.com/2.0/specs/clients/sign/error-codes
60-
-@@ -118,13 +115,10 @@ const ERROR_CODES = {
61-
- INVALID_PAYLOAD: 5003,
62-
- };
63-
-
64-
--function isWalletConnectEnabled() {
65-
-- return false;
66-
-- /*
67-
-+function* isWalletConnectEnabled() {
68-
- const walletConnectEnabled = yield call(checkForFeatureFlag, WALLET_CONNECT_FEATURE_TOGGLE);
69-
-
70-
- return walletConnectEnabled;
71-
-- */
72-
- }
73-
-
74-
- function* init() {
75-
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
76-
index 676a0a0..28ffa36 100644
77-
--- a/ios/Podfile.lock
78-
+++ b/ios/Podfile.lock
79-
@@ -389,6 +389,13 @@ PODS:
80-
- React-jsinspector (0.72.5)
81-
- React-logger (0.72.5):
82-
- glog
83-
+ - react-native-compat (2.12.2):
84-
+ - RCT-Folly (= 2021.07.22.00)
85-
+ - React-Core
86-
+ - react-native-get-random-values (1.11.0):
87-
+ - React-Core
88-
+ - react-native-netinfo (11.3.1):
89-
+ - React-Core
90-
- react-native-pager-view (5.4.25):
91-
- React-Core
92-
- react-native-randombytes (3.6.1):
93-
@@ -612,6 +619,9 @@ DEPENDENCIES:
94-
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
95-
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
96-
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
97-
+ - "react-native-compat (from `../node_modules/@walletconnect/react-native-compat`)"
98-
+ - react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
99-
+ - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
100-
- react-native-pager-view (from `../node_modules/react-native-pager-view`)
101-
- react-native-randombytes (from `../node_modules/react-native-randombytes`)
102-
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
103-
@@ -717,6 +727,12 @@ EXTERNAL SOURCES:
104-
:path: "../node_modules/react-native/ReactCommon/jsinspector"
105-
React-logger:
106-
:path: "../node_modules/react-native/ReactCommon/logger"
107-
+ react-native-compat:
108-
+ :path: "../node_modules/@walletconnect/react-native-compat"
109-
+ react-native-get-random-values:
110-
+ :path: "../node_modules/react-native-get-random-values"
111-
+ react-native-netinfo:
112-
+ :path: "../node_modules/@react-native-community/netinfo"
113-
react-native-pager-view:
114-
:path: "../node_modules/react-native-pager-view"
115-
react-native-randombytes:
116-
@@ -830,6 +846,9 @@ SPEC CHECKSUMS:
117-
React-jsiexecutor: ff70a72027dea5cc7d71cfcc6fad7f599f63987a
118-
React-jsinspector: aef73cbd43b70675f572214d10fa438c89bf11ba
119-
React-logger: 2e4aee3e11b3ec4fa6cfd8004610bbb3b8d6cca4
120-
+ react-native-compat: ea766c4bcad72b3cb36765a97a846c9551b5b802
121-
+ react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06
122-
+ react-native-netinfo: bdb108d340cdb41875c9ced535977cac6d2ff321
123-
react-native-pager-view: da490aa1f902c9a5aeecf0909cc975ad0e92e53e
124-
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
125-
react-native-safe-area-context: 68b07eabfb0d14547d36f6929c0e98d818064f02
1261
diff --git a/shim.js b/shim.js
1272
index 73c130d..deae975 100644
1283
--- a/shim.js
@@ -149,7 +24,7 @@ index 73c130d..deae975 100644
14924
+ };
15025
+}
15126
diff --git a/src/sagas/walletConnect.js b/src/sagas/walletConnect.js
152-
index 0a07c9b..bb36df3 100644
27+
index 160cb11..07ccb34 100644
15328
--- a/src/sagas/walletConnect.js
15429
+++ b/src/sagas/walletConnect.js
15530
@@ -45,6 +45,7 @@

0 commit comments

Comments
 (0)