2020-09-08 01:12:15 -04:00
|
|
|
-----
|
|
|
|
|
|
|
|
Documentation: [html](https://docs.ethers.io/)
|
|
|
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
React Native (and ilk)
|
|
|
|
======================
|
|
|
|
|
|
|
|
Installing
|
|
|
|
----------
|
|
|
|
|
|
|
|
```
|
|
|
|
/home/ricmoo/my-react-project> npm install @ethersproject/shims --save
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
// Pull in the shims (BEFORE importing ethers)
|
|
|
|
import "@ethersproject/shims"
|
|
|
|
|
|
|
|
// Import the ethers library
|
|
|
|
import { ethers } from "ethers";
|
|
|
|
```
|
|
|
|
|
|
|
|
Security
|
|
|
|
--------
|
|
|
|
|
2020-11-22 23:07:13 -05:00
|
|
|
```
|
|
|
|
// Import the crypto getRandomValues shim (**BEFORE** the shims)
|
|
|
|
import "react-native-get-random-values"
|
|
|
|
|
|
|
|
// Import the the ethers shims (**BEFORE** ethers)
|
|
|
|
import "@ethersproject/shims"
|
|
|
|
|
|
|
|
// Import the ethers library
|
|
|
|
import { ethers } from "ethers";
|
|
|
|
```
|
|
|
|
|