React Native
You can import Pools SDK into your React Native dapp to enable your users to easily connect to the Pools Wallet
Install the SDK
Use rn-nodeify to install the SDK. In your project directory, install rn-nodeify:
yarn add --dev rn-nodeifyor
npm i --dev rn-nodeifyInstall the rn-nodeify libraries:
yarn add react-native-crypto
yarn add react-native-randombytes
yarn add crypto
yarn add process
yarn add stream
yarn add eventsIn your project's package.json file, insert the rn-nodeify command into the postinstall script:
package.json
"scripts": {
...,
"postinstall": "rn-nodeify --install 'crypto,process,stream,events' --hack"
}rn-nodeify creates a shim.js file in your project root directory. Import it in the root file of your application:
Install react-native-background-timer:
Install Pools SDK:
Run the postinstall script after everything is installed:
Finally, install the necessary pods that come with the libraries:
Use the SDK
Import, instantiate, and use the SDK by adding something similar to the following to your project script:
You can configure the SDK using any options and call any provider API methods. Always call eth_requestAccounts using ethereum.request(args) first, since it prompts the installation or connection popup to appear.
You can use EthersJS with your React Native app:
Last updated