Home

Awesome

react-native-substrate-sign

npm version

This React Native library packages practical crypto functions written in Rust for Substrate, Polkadot and Ethereum. Originally used for Parity Signer.

Getting started

yarn add react-native-substrate-sign
cd ios && pod install && cd ..

Usage

All the functions could be find in the index.d.ts file. They are wrapped with async behaviors, since we need access to Rust runtime, be sure to use await or then to access the result.

import SubstrateSign from 'react-native-substrate-sign';

async function getRandomPhrase(){
  const newRandomPhrase = SubstrateSign.randomPhrase(12);
}

Build and Develop

Requirements

* It's recommended to install Android Studio and use that to install the necessary build tools and SDKs for the Android version you want to test on. It's also the best way to test in the emulator.

Setup

./scripts/init.sh

Develop

After update the rust code, you need to change the following files for updating the interface to native android and ios code.

Test

yarn test

Build

./scripts/build.sh