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

@yieldapp/crypto-address-detector

v1.0.13

Published

Detect and determine cryptocurrency by address (React native compatible).

Downloads

6

Readme

Crypto Address Detector

A lightweight cryptocurrency detector library that is compatible with react native. This module also validates Ethereum addressess against EIP-55

Table of contents

Getting Started

Installation

This module uses node.js, and can be installed through npm or yarn:

NPM:

npm install --save @yieldapp/crypto-address-detector

Yarn:

yarn add @yieldapp/crypto-address-detector

Usage

Example

import CryptoDetector from 'crypto_address_detector'

let addr = 'bc1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf'
let res = await CryptoDetector.detect(addr)
console.log(addr, 'result = ',  res)
// bc1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf result =  [ 'btc' ]

// An invalid address...should return null
addr = 'c1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf'
res = await CryptoDetector.detect(addr)
console.log(addr, 'result = ',  res)
// c1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf result =  null

addr = '3PHictxPg9gCLbSuwnvDhPtm9xkAM32Xs4'
res = await CryptoDetector.detect(addr)
console.log(addr, 'result = ',  res)
// 3PHictxPg9gCLbSuwnvDhPtm9xkAM32Xs4 result =  [ 'btc' ]

// an invalid ethereum like address
addr = '0x3PHictxPg9gCLbSuwnvDhPtm9xkAM32Xs4'
res = await CryptoDetector.detect(addr)
console.log(addr, 'result = ',  res)
// 0x3PHictxPg9gCLbSuwnvDhPtm9xkAM32Xs4 result =  null

// a valid ethereum compatible address
addr = '0xea674fdde714fd979de3edf0f56aa9716b898ec8'
res = await CryptoDetector.detect(addr)
console.log(addr, 'result = ',  res)
// 0xea674fdde714fd979de3edf0f56aa9716b898ec8 result =  [ 'eth', 'bsc/bnb', 'polygon', 'avalanche/c' ]