forked from cerc-io/laconic-wallet
Use library to have secure random source in react native environment (#5)
* Add library to provide secure random source to ethers * Add semicolon * Keep imports together * Add comment for react-native-get-random-values --------- Co-authored-by: Adw8 <adwait@deepstacksoft.com>
This commit is contained in:
parent
3d40de966d
commit
6f476a3ac1
@ -14,6 +14,7 @@
|
|||||||
"ethers": "5",
|
"ethers": "5",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-native": "0.73.3",
|
"react-native": "0.73.3",
|
||||||
|
"react-native-get-random-values": "^1.10.0",
|
||||||
"react-native-keychain": "^8.1.2"
|
"react-native-keychain": "^8.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
3
utils.ts
3
utils.ts
@ -1,3 +1,6 @@
|
|||||||
|
/* Importing this library provides react native with a secure random source.
|
||||||
|
For more information, "visit https://docs.ethers.org/v5/cookbook/react-native/#cookbook-reactnative-security" */
|
||||||
|
import 'react-native-get-random-values';
|
||||||
import '@ethersproject/shims';
|
import '@ethersproject/shims';
|
||||||
|
|
||||||
import { Wallet, utils } from 'ethers';
|
import { Wallet, utils } from 'ethers';
|
||||||
|
12
yarn.lock
12
yarn.lock
@ -3725,6 +3725,11 @@ expect@^29.7.0:
|
|||||||
jest-message-util "^29.7.0"
|
jest-message-util "^29.7.0"
|
||||||
jest-util "^29.7.0"
|
jest-util "^29.7.0"
|
||||||
|
|
||||||
|
fast-base64-decode@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418"
|
||||||
|
integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==
|
||||||
|
|
||||||
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
|
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
|
||||||
version "3.1.3"
|
version "3.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
||||||
@ -5919,6 +5924,13 @@ react-is@^17.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
|
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
|
||||||
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
|
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
|
||||||
|
|
||||||
|
react-native-get-random-values@^1.10.0:
|
||||||
|
version "1.10.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.10.0.tgz#c2c5f12a4ef8b1175145347b4a4b9f9a40d9ffc8"
|
||||||
|
integrity sha512-gZ1zbXhbb8+Jy9qYTV8c4Nf45/VB4g1jmXuavY5rPfUn7x3ok9Vl3FTl0dnE92Z4FFtfbUNNwtSfcmomdtWg+A==
|
||||||
|
dependencies:
|
||||||
|
fast-base64-decode "^1.0.0"
|
||||||
|
|
||||||
react-native-keychain@^8.1.2:
|
react-native-keychain@^8.1.2:
|
||||||
version "8.1.2"
|
version "8.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-8.1.2.tgz#34291ae472878e5124d081211af5ede7d810e64f"
|
resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-8.1.2.tgz#34291ae472878e5124d081211af5ede7d810e64f"
|
||||||
|
Loading…
Reference in New Issue
Block a user