npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rvnaddrjs

v1.0.0

Published

Ravencoin general purpose address translation.

Downloads

28

Readme

RvnAddr.js: Ravencoin general purpose address translation for Node.js and web browsers.

JavaScript Style Guide

JavaScript Style Guide

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](https://cdn.rawgit.com/raven-community/rvnaddrjs/master/dist/rvnaddrjs-{{ version }}.min.js).

Usage

In Node.js

var rvnaddr = require('rvnaddrjs');

Browser

Script Tag

You may include a script tag in your HTML and the rvnaddr module will be defined globally on subsequent scripts.

<html>
  <head>
    ...
    <script src="https://cdn.rawgit.com/raven-community/rvnaddrjs/master/dist/rvnaddrjs-{{ version }}.min.js"></script>
  </head>
  ...
</html>

Code Examples

Supported formats, networks and address types.

var Format = rvnaddr.Format; // Legacy, Rvn2addr.
var Network = rvnaddr.Network; // Mainnet or Testnet.
var Type = rvnaddr.Type; // P2PKH or P2SH.

Test for address format.

var isLegacyAddress = rvnaddr.isLegacyAddress;
var isRvn2Address = rvnaddr.isRvn2Address;

isLegacyAddress('1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR')
isLegacyAddress('qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk')
isRvn2Address('qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk')
isRvn2Address('CScMwvXjdooDnGevHgfHjGWFi9cjk75Aaj')

Test for address network.

var isMainnetAddress = rvnaddr.isMainnetAddress;
var isTestnetAddress = rvnaddr.isTestnetAddress;

isMainnetAddress('1P238gziZdeS5Wj9nqLhQHSBK2Lz6zPSke')
isMainnetAddress('mnbGP2FeRsbgdQCzDT35zPWDcYSKm4wrcg')
isTestnetAddress('qqdcsl6c879esyxyacmz7g6vtzwjjwtznsggspc457')
isTestnetAddress('CeUvhjLnSgcxyedaUafcyo4Cw9ZPwGq9JJ')

Test for address type.

var isP2PKHAddress = rvnaddr.isP2PKHAddress;
var isP2SHAddress = rvnaddr.isP2SHAddress;

isP2PKHAddress('1Mdob5JY1yuwoj6y76Vf3AQpoqUH5Aft8z')
isP2PKHAddress('2NFGG7yRBizUANU48b4dASrnNftqsNwzSM1')
isP2SHAddress('H92i9XpREZiBscxGu6Vx3M8jNGBKqscBBB')
isP2SHAddress('CeUvhjLnSgcxyedaUafcyo4Cw9ZPwGq9JJ')

Detect address format.

var detectAddressFormat = rvnaddr.detectAddressFormat;

detectAddressFormat('qqdcsl6c879esyxyacmz7g6vtzwjjwtznsggspc457') // Format.Rvn2addr

Detect address network.

var detectAddressNetwork = rvnaddr.detectAddressNetwork;

detectAddressNetwork('1P238gziZdeS5Wj9nqLhQHSBK2Lz6zPSke') // Network.Mainnet
detectAddressNetwork('qqdcsl6c879esyxyacmz7g6vtzwjjwtznsggspc457') // Network.Testnet

Detect address type.

var detectAddressType = rvnaddr.detectAddressType;

detectAddressType('1P238gziZdeS5Wj9nqLhQHSBK2Lz6zPSke') // Type.P2PKH
detectAddressType('3NKpWcnyZtEKttoQECAFTnmkxMkzgbT4WX') // Type.P2SH

Translate address from any address format into a specific format.

var toLegacyAddress = rvnaddr.toLegacyAddress;
var toRvn2Address = rvnaddr.toRvn2Address;

toLegacyAddress('qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk') // 1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR
toRvn2Address('1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR') // ravh5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk

Documentation

Generate and Browse Locally

$ npm run docs

Online

Browse automatically generated jsdocs online.