Installation
Requirements
- Android minSdkVersion = 26
- iOS platform >= 13
- XCode > 14
Our wallets package uses the Expo Modules API, please configure it in your app:
Move into your /ios
folder and run the following command to install ios required pods:
Add shims for the crypto nodejs' libraries
React Native is based on JavaScriptCore (part of WebKit) and does not use Node.js or the common Web and DOM APIs. As such, there are many operations missing that a normal web environment or Node.js instance would provide. [1].
For this reason we need to add shims for some of the operations not available in closed out environments like React Native:
In your metro.config.js
(please, create one if you don’t have it) add the following to shim the nodejs modules needed:
We provide a package that imports all the necessary polyfills for you, please, import this package into your index.js
file. Make sure it is at the top of your imports.
Why are all these packages needed?
As explained in the intro of this doc, we need to shim some of the packages available in Node and web environments. Find below who’s using these packages:
WalletConnect
-
WalletConnect uses Node's
crypto
package when signing transactions. Since this package is not available in React Native we need an alternative implementation for it and its dependencies, the following packages accomplishes this:node-libs-browser
react-native-crypto
react-native-randombytes
react-native-get-random-values
-
Coinbase wallet connector package depends on
react-native-mmkv
andexpo-modules
. -
WalletConnect V2 connectors depend on
@react-native-async-storage/async-storage
.