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

react-native-chainz

v1.0.0

Published

React Native wrapper for the CryptoID Blockchain Explorers API. Uses Fetch so it drops in neatly into any React Native App. In addition to Phore (PHR), it works for any Altcoin for which Chainz has a code. Sample commands include getting the balance of an

Downloads

5

Readme

React-Native-Chainz

A React Native wrapper for the CryptoID Blockchain Explorer API. Uses Fetch so it drops in neatly into any React Native App. In addition to Phore (PHR), it works for any Altcoin for which Chainz has a code.

Installation

Using npm:

npm install react-native-chainz --save

In React Native:


import * as phorechainz from 'react-native-chainz' // doesn't phorechainz sound a bit like Fortunes? I think it does...

phorechainz.getPhoreBalance(address).then(console.log) // returns the current balance for the provide Phore (PHR) address

phorechainz.getAltBalance(altcoin, address).then(console.log) // returns the current balance for the address provided for the specified Altcoin - using the Chainz code for the Altcoin. More info at https://chainz.cryptoid.info

phorechainz.getAddresses(altcoin).then(console.log) // returns a JSON object with the number of known and non-zero addresses (with funds) - for Phore use the code 'phr'

phorechainz.getCirculating(altcoin).then(console.log) // returns the number of circulating coins (minus reserve, Prime holdings...)

phorechainz.getBlockcount(altcoin).then(console.log) // returns the current block height as a plain text string

phorechainz.getDifficulty(altcoin).then(console.log) // returns the difficulty as a plain text string

phorechainz.getHashrate(altcoin).then(console.log) // returns the hashrate in GH/s (when supported, blockchain.info API compatible)

phorechainz.getNethashps(altcoin).then(console.log) // returns the hashrate in H/s (when supported)

phorechainz.getNetmhashps(altcoin).then(console.log) // returns the hashrate in MH/s (when supported)

phorechainz.getRich(altcoin).then(console.log) // returns the rich list top 1000 (JSON format)

phorechainz.getTotalcoins(altcoin).then(console.log) // returns the outstanding number of coinsr

phorechainz.getAddressFirstSeen(altcoin, address).then(console.log) // returns the date and time of the block in which the address was first seen, or a string begining with "ERROR:" otherwise.

phorechainz.getReceivedByAddress(altcoin, address).then(console.log) // returns the amount received by the address (sum of vout). For incorrect addresses or addresses never seen on the network, the returned amount is zero. Can be delayed by up to 1 hour.

phorechainz.getRichRank(altcoin, address).then(console.log) // returns the rich list rank for the address.

phorechainz.getLasttxs(altcoin).then(console.log) // returns the last ten transactions (with at least one confirmation), excluding coinbase and stake transactions

phorechainz.getTxinfo(altcoin, txHash).then(console.log) // returns summary information about a transaction (confirmations, fees, inputs & output addresses and amounts).