various cardano javascript using wasm bindings
Clone or download
NicolasDP Merge pull request #40 from input-output-hk/fix-issue-39
fix bug regarding `Wallet.fromSeed` where the seed length was not tested properly
Latest commit def5d9a Oct 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
js-example the entropy is decoded from hexadecimal in the js-example May 8, 2018
js fix the issue where we compare the SEED.length to undefined Oct 31, 2018
rust @ 13e342a update cardano-rust Oct 15, 2018
wallet-wasm Update Cargo.toml Oct 22, 2018
.babelrc [DDW-161] prepare js library setup Mar 6, 2018
.gitignore pin down rustc compiler and the dependency file too Jun 7, 2018
.gitmodules
.npmignore [DDW-130] fix .npmignore file Mar 12, 2018
.travis.yml initial Apr 24, 2018
LICENSE initial commit Mar 1, 2018
README.md Update README.md Jul 3, 2018
build Fail if toolchain is not installed Jun 12, 2018
package-lock.json seems like the hashes are now sha512 Jun 4, 2018
package.json add tests with known addresses Jun 4, 2018
rust-toolchain pin down rustc compiler and the dependency file too Jun 7, 2018
webpack.config.js [DDW-130] improve test setup Mar 12, 2018

README.md

cardano wasm binding for JavaScript

Installation

# install rustup
curl https://sh.rustup.rs -sSf | sh
# use nightly version
rustup install nightly-2018-06-05
rustup target add wasm32-unknown-unknown --toolchain nightly

Build the Library

To Compile the rust crypto to a Web Assembly (WASM) module and build JS library run the ./build script. (only necessary if you want to build locally)

Run the Example

There is a simple example application in js-example that can be run to test some of the features.

installation

within js-example/ folder

  1. npm install
  2. npm run install

Building

within js-example/ run npm run build

Running

open js-example/index.html in any browser

Use the Crypto Library

Install

You can either build the library locally on your machine to test the latest version with your project or install via NPM.

Install locally:

in the root of this repo: npm link in the root of your project: npm link rust-cardano-crypto

Install via NPM:

in the root of your project: npm install rust-cardano-crypto

Import the API in Your Code

// Import like this:
import CardanoCrypto from 'rust-cardano-crypto'
// Or access as global in browsers:
CardanoCrypto.PaperWallet.scramble(iv, password, input)

Notes

The rust code contains rwc/ a fork of rust-crypto without the dependencies that cannot be build easily in a wasm environment, and minus the algorithms that are not useful.