@walletconnect/react-native-compat 2.17.2-canary-ca-6 → 2.17.2-canary-ca-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -36
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -78,42 +78,7 @@ if (typeof global?.Application === "undefined") {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// iOS uses Yttrium, Android uses RNWalletConnectModule
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export async function checkRoute(params) {
|
|
84
|
-
if (!yttrium) {
|
|
85
|
-
throw new Error("RN Yttrium is not correctly linked");
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const result = await yttrium?.checkRoute(params);
|
|
89
|
-
return parseResult(result);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export async function checkStatus(params) {
|
|
93
|
-
if (!yttrium) {
|
|
94
|
-
throw new Error("RN Yttrium is not correctly linked");
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const result = await yttrium?.checkStatus(params);
|
|
98
|
-
return parseResult(result);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function parseResult(result) {
|
|
102
|
-
if (typeof result === "undefined") return;
|
|
103
|
-
|
|
104
|
-
// iOS returns parsed JSON object, while Android returns stringified
|
|
105
|
-
if (typeof result === "string") {
|
|
106
|
-
try {
|
|
107
|
-
return JSON.parse(result);
|
|
108
|
-
} catch (e) {}
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
global.yttrium = {
|
|
114
|
-
checkRoute,
|
|
115
|
-
checkStatus,
|
|
116
|
-
};
|
|
81
|
+
global.yttrium = NativeModules.Yttrium || NativeModules.RNWalletConnectModule;
|
|
117
82
|
|
|
118
83
|
// eslint-disable-next-line no-console
|
|
119
84
|
console.log("RN yttrium", global.yttrium);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walletconnect/react-native-compat",
|
|
3
3
|
"description": "Shims for WalletConnect Protocol in React Native Projects",
|
|
4
|
-
"version": "2.17.2-canary-ca-
|
|
4
|
+
"version": "2.17.2-canary-ca-7",
|
|
5
5
|
"author": "WalletConnect, Inc. <walletconnect.com>",
|
|
6
6
|
"homepage": "https://github.com/walletconnect/walletconnect-monorepo/",
|
|
7
7
|
"license": "Apache-2.0",
|