react-native-patchql
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

react-native-cardano

Getting started

$ npm install react-native-cardano --save

Installing Rust

$ curl https://sh.rustup.rs -sSf | sh

Follow instructions. Restart Terminal application after installation (PATH should be updated)

Install Rust targets and tools for iOS

  1. Install build targets: $ rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios
  2. Install cargo-lipo for building: $ cargo install cargo-lipo

Install Rust targets for Android

$ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

Android NDK should be installed for Android. Check that local.properties file in android folder has ndk.dir property and it's path is correct.

Mostly automatic installation

$ react-native link react-native-cardano

Manual installation

iOS

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

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import io.crossroad.rnardano.CardanoPackage; to the imports at the top of the file
  • Add new CardanoPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-cardano'
    project(':react-native-cardano').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-cardano/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-cardano')
    

Usage

import { Wallet, HdWallet, RandomAddressChecker, PasswordProtect } from 'react-native-cardano';

Wallet
  .checkAddress(
    "DdzFFzCqrhtCUjHyzgvgigwA5soBgDxpc8WfnG1RGhrsRrWMV8uKdpgVfCXGgNuXhdN4qxPMvRUtbUnWhPzxSdxJrWzPqACZeh6scCH5"
  )
  .then(isValid => console.log(isValid)); // Should print "true"

You can check all exported functions there.

Package Sidebar

Install

npm i react-native-patchql

Weekly Downloads

3

Version

0.0.3

License

AGPL-3.0

Unpacked Size

14.7 MB

Total Files

323

Last publish

Collaborators

  • pietgeursen