## Getting started

Usage no npm install needed!

<script type="module">
  import reactNativeElastosUnityWallet from '';


React Native Elastos Wallet Plugin

The React Native Elastos Unity Wallet repository provides all the necessary code to port the Elastos wallet functionnalities to React Native. Developers can use the Elastos Unity wallet module to implement the Elastos wallet functionalities into their existing app. Elastos Wallet is used to manage private and public keys and to make transactions on the Elastos network including DID sidechain.


You can install the react-native-unity-elastos-wallet package using npm or yarn:

## with npm
npm install react-native-elastos-unity-wallet --save
## with yarn
yarn add react-native-elastos-unity-wallet

Platform specific linking

Automatic linking


  • RN < 0.60
react-native link react-native-elastos-unity-wallet
  • RN > 0.60
cd ios
pod install


The only step required for Android is to insert the following lines inside the android block in android/app/build.gradle:

packagingOptions {
    pickFirst '**/'

Manual linking


  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-elastos-unity-wallet and add RNElastosMainchain.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNElastosMainchain.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)


  1. Open up android/app/src/main/java/[...]/
  • Add import org.elastos.mainchain.reactnative.RNElastosMainchainPackage; to the imports at the top of the file
  • Add new RNElastosMainchainPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-elastos-wallet-core'
    project(':react-native-elastos-wallet-core').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-elastos-wallet-core/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    implementation project(':react-native-elastos-wallet-core')
  3. Insert the following lines inside the android block in android/app/build.gradle:
    packagingOptions {
        pickFirst '**/'


import Wallet from 'react-native-elastos-unity-wallet';

// Generate a new mnemonic (defaults to English)
Wallet.generateMnemonic((err, mnemonic) => {

The complete documentation is available on: