1.0.4 • Published 3 years ago

@asoltys/blech32 v1.0.4

Weekly downloads
7
License
MIT
Repository
github
Last release
3 years ago

Blech32.js

build status

A Elements extended BIP173 compatible Blech32 encoding/decoding library.

Example

Check out tests that also demonstrate how to serialize a pubkey and a witness program for generating a confidential address.

Installation

Install dependencies:

$ npm install

Build (with Emscripten installed via emsdk):

$ source path/to/emsdk_env.sh
$ emcc src/blech32.c -o src/blech32.js -O3 -s WASM=0 -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "getValue", "setValue", "allocate", "intArrayFromString", "ALLOC_NORMAL"]' -s EXPORT_ALL=1 -s LINKABLE=1 -s NO_EXIT_RUNTIME=1

Build (with Docker)

$ git submodule update --init
$ docker build -t blech32-js .
$ npm run compile

Bundle

$ browserify lib/index.js --standalone blech32 > bundle.js

Test

$ npm run test

Credits