Git Product home page Git Product logo

react-native-web3c's Introduction

react-native-web3c

react-native-web3c is a shim for web3c.js to make using web3c in react-native quick and easy.

Usage

When including web3c.js in a react-native project, make sure to install and link the native randombytes, which is needed for the underlying crypto modules used by web3c.js.

yarn add react-native-web3c
yarn add react-native-randombytes
react-native link react-native-randombytes

After installing, you can use web3c.js in your react-native app like you would any other library.

If you find the Metro Bundler running out of memory, increase node's memory using the --max-old-space-size=8192 flag.

Persisting Key Manager Keys

When instantiating your web3c object, be sure to pass in the platform specific persistent storage you'd like to use. An in memory version of this interface is as follows:

class Storage {

  constructor() {
    this.db = new Map();
  }

  getItem(key) {
    return this.db.get(key);
  }

  setItem(key, val) {
    this.db.set(key, val);
  }

}

Then when instantiating your web3c object, pass it in as part of options.

let web3c = new Web3c('https://web3.oasiscloud.io:443', undefined, {
  storage: new Storage()
});

Build

To build a new version of react-native-web3c, run

git clone https://github.com/oasislabs/react-native-web3c.git
yarn install
yarn webpack

Webpack will output the new index.js as a new version of web3c.js to be used in react-native.

react-native-web3c's People

Contributors

armaniferrante avatar willscott avatar

Watchers

 avatar

Forkers

ganesham09

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.