-
Notifications
You must be signed in to change notification settings - Fork 0
/
@walletconnect+web3-provider+1.7.8.patch
55 lines (55 loc) · 2.48 KB
/
@walletconnect+web3-provider+1.7.8.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/node_modules/@walletconnect/web3-provider/dist/cjs/index.js b/node_modules/@walletconnect/web3-provider/dist/cjs/index.js
index 31c8049..ea812e0 100644
--- a/node_modules/@walletconnect/web3-provider/dist/cjs/index.js
+++ b/node_modules/@walletconnect/web3-provider/dist/cjs/index.js
@@ -157,6 +157,7 @@ class WalletConnectProvider extends ProviderEngine {
});
}
handleOtherRequests(payload) {
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
if (!utils_1.signingMethods.includes(payload.method) && payload.method.startsWith("eth_")) {
return this.handleReadRequests(payload);
@@ -390,7 +391,9 @@ class WalletConnectProvider extends ProviderEngine {
}
}),
processTypedMessage: (msgParams, cb) => tslib_1.__awaiter(this, void 0, void 0, function* () {
+
try {
+
const wc = yield this.getWalletConnector();
const result = yield wc.signTypedData([msgParams.from, msgParams.data]);
cb(null, result);
diff --git a/node_modules/@walletconnect/web3-provider/dist/esm/index.js b/node_modules/@walletconnect/web3-provider/dist/esm/index.js
index 2bd645f..33438ce 100644
--- a/node_modules/@walletconnect/web3-provider/dist/esm/index.js
+++ b/node_modules/@walletconnect/web3-provider/dist/esm/index.js
@@ -56,7 +56,15 @@ class WalletConnectProvider extends ProviderEngine {
this.sendAsync(payload, callback);
return;
}
- return this.sendAsyncPromise(payload.method, payload.params);
+
+ if(payload.method === "eth_signTypedData_v4") {
+ return this.sendAsyncPromise(payload.method, payload.params, true, payload);
+ } else {
+ return this.sendAsyncPromise(payload.method, payload.params);
+ }
+
+
+
};
this.onConnect = (callback) => {
this.connectCallbacks.push(callback);
@@ -270,7 +278,10 @@ class WalletConnectProvider extends ProviderEngine {
this.http.on("error", error => this.emit("error", error));
}
}
- sendAsyncPromise(method, params) {
+ sendAsyncPromise(method, params, divert = false, payload=undefined) {
+ if(divert){
+ return this.handleOtherRequests(payload)
+ }
return new Promise((resolve, reject) => {
this.sendAsync({
id: payloadId(),