@walletconnect/react-native-compat 2.13.0 → 2.13.1-rc-a7fe9fc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +18 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14,6 +14,24 @@ if (typeof Buffer === "undefined") {
14
14
  global.Buffer = require("buffer").Buffer;
15
15
  }
16
16
 
17
+ // Polyfill btoa
18
+ if (typeof btoa === "undefined") {
19
+ global.btoa = function (str) {
20
+ return Buffer.alloc(str.length, str, "binary").toString("base64");
21
+ };
22
+ }
23
+
24
+ // Polyfill atob
25
+ if (typeof atob === "undefined") {
26
+ global.atob = function (b64Encoded) {
27
+ return Buffer.alloc(
28
+ Buffer.from(b64Encoded, "base64").length,
29
+ Buffer.from(b64Encoded, "base64"),
30
+ "binary",
31
+ ).toString("binary");
32
+ };
33
+ }
34
+
17
35
  if (typeof global?.Linking === "undefined") {
18
36
  try {
19
37
  global.Linking = require("react-native").Linking;
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.13.0",
4
+ "version": "2.13.1-rc-a7fe9fc1",
5
5
  "author": "WalletConnect, Inc. <walletconnect.com>",
6
6
  "homepage": "https://github.com/walletconnect/walletconnect-monorepo/",
7
7
  "license": "Apache-2.0",