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

detect-cryptocoin

v0.0.8

Published

Detects which cryptcoin is the given cryptocoin address (starts with some coins listed in CoinWarz.com that have working block explorers)

Downloads

11

Readme

node-detect-cryptocoin

Detects which cryptcoin is the given cryptocoin address (starts with some coins listed in CoinWarz.com that have working block explorers)

This isn't by any means accurate, it's a quick & dirty check, you have to resolve any conflicts by yourself.

The addresses are checked using

Contains Util code from bitcoinjs-server

Usage

var dcc = require('detect-cryptocoin');

var detected = dcc([
    '1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu',
    'LW2kXiquqDu3GfpfBX2xNTSgjVmBPu6g3z',
    'PNKZEkDf9eBSNebu2CcxHaGuma6wHuZEBh',
    'ARKZ7uVE1YS19HC8jSq5xZGkr6YAzugWBv'
    ], ['BTC','LTC','PPC','XPM']);
    // You may narrow the function results by passing only the allowed list as the second parameter.

console.log(detected);
/**
 * yields:
 * {
 *   'BTC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
 *   'LTC:  ['LW2kXiquqDu3GfpfBX2xNTSgjVmBPu6g3z'],
 *   'PPC': ['PNKZEkDf9eBSNebu2CcxHaGuma6wHuZEBh'],
 *   'XPM': ['ARKZ7uVE1YS19HC8jSq5xZGkr6YAzugWBv']
 * }
 */

// add more coins using:

detected.coins.HKK = {
    name: 'HongKongKoin',
    starts: ['h']
};

// you may do an easy and fast check, using, [COIN SYMBOL].cryptocoinexplorer.com/q/checkaddress/[ADDRESS] for example

// If there's a conflict, you must check with your coin daemon if these addresses exists there, or using an API.
// They are valid, but they match multiple coins.
// Check the 'conflicts' member for conflicts:

{
    'LTC:  ['LW2kXiquqDu3GfpfBX2xNTSgjVmBPu6g3z'],
    'PPC': ['PNKZEkDf9eBSNebu2CcxHaGuma6wHuZEBh'],
    'XPM': ['ARKZ7uVE1YS19HC8jSq5xZGkr6YAzugWBv'],
    'conflicts': {
        'BTC': {
            'TRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'DVC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'FRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu']
        },
        'TRC': {
            'BTC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'DVC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'FRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu']
        },
        'FRC': {
            'BTC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'DVC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'TRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu']
        },
        'DVC': {
            'FRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'BTC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu'],
            'TRC': ['1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu']
        }
    },
    'invalids': []
}

// If there are any invalids, they will go in 'invalids' member array

There's also a helper function, dcc.valid, it checks using Base58Check using Node.js Buffers (instead of Bignum/Bigint). It's not as performant, but it works in Windows.

Do you like it? Wanna support the development?

npm star detect-cryptocoin

BTC: 1PskTzQjmzqB2boz67AXsv4C5YNWN4xmhu

LTC: LW2kXiquqDu3GfpfBX2xNTSgjVmBPu6g3z

PPC: PNKZEkDf9eBSNebu2CcxHaGuma6wHuZEBh

XPM: ARKZ7uVE1YS19HC8jSq5xZGkr6YAzugWBv