@getpara/react-native-wallet 1.0.2-dev.9 → 1.1.0

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/dist/shim.js CHANGED
@@ -7,6 +7,7 @@ import { atob, btoa } from 'react-native-quick-base64';
7
7
  import { Buffer } from '@craftzdog/react-native-buffer';
8
8
  import process from 'process';
9
9
  import 'react-native-url-polyfill/auto';
10
+ import { TextEncoder, TextDecoder } from 'text-encoding';
10
11
  const setupProcessPolyfill = () => {
11
12
  if (typeof globalThis.process === 'undefined') {
12
13
  globalThis.process = process;
@@ -57,29 +58,8 @@ const setupCryptoPolyfills = () => {
57
58
  };
58
59
  };
59
60
  const setupTextEncodingPolyfills = () => {
60
- if (typeof globalThis.Buffer === 'undefined') {
61
- globalThis.Buffer = Buffer;
62
- }
63
- let TextEncoderPolyfill, TextDecoderPolyfill;
64
- const polyfillModule = require('fastestsmallesttextencoderdecoder/NodeJS/EncoderAndDecoderNodeJS.min.js');
65
- if (polyfillModule &&
66
- typeof polyfillModule.TextEncoder === 'function' &&
67
- typeof polyfillModule.TextDecoder === 'function') {
68
- TextEncoderPolyfill = polyfillModule.TextEncoder;
69
- TextDecoderPolyfill = polyfillModule.TextDecoder;
70
- }
71
- else if (polyfillModule &&
72
- polyfillModule.default &&
73
- typeof polyfillModule.default.TextEncoder === 'function' &&
74
- typeof polyfillModule.default.TextDecoder === 'function') {
75
- TextEncoderPolyfill = polyfillModule.default.TextEncoder;
76
- TextDecoderPolyfill = polyfillModule.default.TextDecoder;
77
- }
78
- else {
79
- throw new Error('fastestsmallesttextencoderdecoder did not export valid constructors.');
80
- }
81
- globalThis.TextEncoder = TextEncoderPolyfill;
82
- globalThis.TextDecoder = TextDecoderPolyfill;
61
+ globalThis.TextEncoder = TextEncoder;
62
+ globalThis.TextDecoder = TextDecoder;
83
63
  };
84
64
  setupProcessPolyfill();
85
65
  setupBufferPolyfill();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-native-wallet",
3
- "version": "1.0.2-dev.9",
3
+ "version": "1.1.0",
4
4
  "description": "Para Wallet for React Native",
5
5
  "homepage": "https://getpara.com",
6
6
  "author": "Para Team <hello@getpara.com> (https://getpara.com)",
@@ -22,13 +22,13 @@
22
22
  "compile-signer": "bash ./scripts/compileSigner.sh"
23
23
  },
24
24
  "dependencies": {
25
- "@getpara/core-sdk": "1.0.1",
26
- "@getpara/user-management-client": "1.0.1",
27
- "@getpara/web-sdk": "1.0.1",
25
+ "@getpara/core-sdk": "1.1.0",
26
+ "@getpara/user-management-client": "1.1.0",
27
+ "@getpara/web-sdk": "1.1.0",
28
28
  "@peculiar/webcrypto": "^1.5.0",
29
- "fastestsmallesttextencoderdecoder": "1.0.22",
30
29
  "node-forge": "1.3.1",
31
- "react-native-url-polyfill": "2.0.0"
30
+ "react-native-url-polyfill": "2.0.0",
31
+ "text-encoding": "0.7.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@craftzdog/react-native-buffer": "6.0.5",
@@ -58,5 +58,6 @@
58
58
  },
59
59
  "publishConfig": {
60
60
  "access": "public"
61
- }
61
+ },
62
+ "gitHead": "a9e81f5c4560664441b3a18b3f8fe05c5db927ec"
62
63
  }
package/src/shim.js CHANGED
@@ -7,6 +7,7 @@ import { atob, btoa } from 'react-native-quick-base64';
7
7
  import { Buffer } from '@craftzdog/react-native-buffer';
8
8
  import process from 'process';
9
9
  import 'react-native-url-polyfill/auto';
10
+ import { TextEncoder, TextDecoder } from 'text-encoding';
10
11
 
11
12
  const setupProcessPolyfill = () => {
12
13
  if (typeof globalThis.process === 'undefined') {
@@ -62,31 +63,8 @@ const setupCryptoPolyfills = () => {
62
63
  };
63
64
 
64
65
  const setupTextEncodingPolyfills = () => {
65
- if (typeof globalThis.Buffer === 'undefined') {
66
- globalThis.Buffer = Buffer;
67
- }
68
- let TextEncoderPolyfill, TextDecoderPolyfill;
69
- const polyfillModule = require('fastestsmallesttextencoderdecoder/NodeJS/EncoderAndDecoderNodeJS.min.js');
70
- if (
71
- polyfillModule &&
72
- typeof polyfillModule.TextEncoder === 'function' &&
73
- typeof polyfillModule.TextDecoder === 'function'
74
- ) {
75
- TextEncoderPolyfill = polyfillModule.TextEncoder;
76
- TextDecoderPolyfill = polyfillModule.TextDecoder;
77
- } else if (
78
- polyfillModule &&
79
- polyfillModule.default &&
80
- typeof polyfillModule.default.TextEncoder === 'function' &&
81
- typeof polyfillModule.default.TextDecoder === 'function'
82
- ) {
83
- TextEncoderPolyfill = polyfillModule.default.TextEncoder;
84
- TextDecoderPolyfill = polyfillModule.default.TextDecoder;
85
- } else {
86
- throw new Error('fastestsmallesttextencoderdecoder did not export valid constructors.');
87
- }
88
- globalThis.TextEncoder = TextEncoderPolyfill;
89
- globalThis.TextDecoder = TextDecoderPolyfill;
66
+ globalThis.TextEncoder = TextEncoder;
67
+ globalThis.TextDecoder = TextDecoder;
90
68
  };
91
69
 
92
70
  setupProcessPolyfill();