RvnAddr.js: Ravencoin general purpose address translation for Node.js and web browsers.
Plug & Play JavaScript library for all Ravencoin address format translation needs. Easy-to-use, thoroughly tested, and feature complete.
Installation
Using NPM
$ npm install --save rvnaddrjs
Using Bower
$ bower install --save rvnaddrjs
Manually
You may also download the distribution file manually and place it within your third-party scripts directory: dist/rvnaddrjs-{{ version }}.min.js.
Usage
In Node.js
var rvnaddr = ;
Browser
Script Tag
You may include a script tag in your HTML and the rvnaddr
module will be defined globally on subsequent scripts.
... ...
Code Examples
Supported formats, networks and address types.
var Format = rvnaddrFormat; // Legacy, Rvn2addr.var Network = rvnaddrNetwork; // Mainnet or Testnet.var Type = rvnaddrType; // P2PKH or P2SH.
Test for address format.
var isLegacyAddress = rvnaddrisLegacyAddress;var isRvn2Address = rvnaddrisRvn2Address;
Test for address network.
var isMainnetAddress = rvnaddrisMainnetAddress;var isTestnetAddress = rvnaddrisTestnetAddress;
Test for address type.
var isP2PKHAddress = rvnaddrisP2PKHAddress;var isP2SHAddress = rvnaddrisP2SHAddress;
Detect address format.
var detectAddressFormat = rvnaddrdetectAddressFormat; // Format.Rvn2addr
Detect address network.
var detectAddressNetwork = rvnaddrdetectAddressNetwork; // Network.Mainnet // Network.Testnet
Detect address type.
var detectAddressType = rvnaddrdetectAddressType; // Type.P2PKH // Type.P2SH
Translate address from any address format into a specific format.
var toLegacyAddress = rvnaddrtoLegacyAddress;var toRvn2Address = rvnaddrtoRvn2Address; // 1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR // ravh5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk
Documentation
Generate and Browse Locally
$ npm run docs
Online
Browse automatically generated jsdocs online.