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

phore-rpc

v1.0.0

Published

For interacting with the Phore RPC API

Downloads

7

Readme

Installation

Using npm:

npm install phore-rpc --save

In Node.js:

const phorerpc = require('phore-rpc');

phorerpc.estimateFee(numberofblocks).then(console.log) // input a number (e.g. 5) of blocks within which the transaction needs to be included - returns an estimate of the fee per kilobyte for the transaction

phorerpc.estimatePriority(numberofblocks).then(console.log) //input a number (e.g. 5) of blocks the transaction may wait before being included as a free high-priority transaction - returns an estimate of the priority that a transaction needs

phorerpc.getBestBlockHash().then(console.log) // no parameter - returns a hash from the tip of the best block chain

phorerpc.getBlock(blockhash).then(function(d){
	console.log(d) // input the hash of a block - returns block details
})

phorerpc.getBlockHash(index).then(console.log) // input a number that represents the block height index of the block to get back its hash - an index of 0 returns the genesis block, which has a hash of '2b1a0f66712aad59ad283662d5b919415a25921ce89511d73019107e380485bf'

phorerpc.getBlockChainInfo().then(console.log) // no parameter - returns an object with network info such as blocks, headers, bestblockhash

phorerpc.getBlockCount().then(console.log) // no parameter - returns current blocks height (i.e. # of blocks)

phorerpc.getBlockHeader(blockhash).then(console.log) // input a block hash - returns just the header info for that block

phorerpc.getChainTips().then(console.log) // no parameter - returns an array of blocks with their height, hash, branchlen and status

phorerpc.getConnectionCount().then(console.log) // no parameter - returns the number of connections to other nodes

phorerpc.getDifficulty().then(console.log) // no parameter - returns a difficulty score as multiple of the minimum difficulty

phorerpc.getInfo().then(console.log) // no parameter - returns information about the node and the network

phorerpc.getMemPoolInfo().then(console.log) // no parameter - returns information about the current state of the mempool

phorerpc.getMiningInfo().then(console.log) // no parameter - returns info about the network

phorerpc.getNetworkHashPs().then(console.log) // no parameter - returns the estimated current or historical network hashes per second based on the last n blocks

phorerpc.getRawMemPool().then(console.log) // no parameter - returns an array of info about what is in the Mem Pool or an empty array if nothing is in the Mem Pool

phorerpc.getRawTransaction(txId).then(console.log) // input a txId (transaction id) - returns details of that transaction

phorerpc.getTxOut(txId).then(console.log) // input a txId (transaction id) - returns the value of any unspent UTXO's

phorerpc.getTxOutsetInfo().then(console.log) // no parameter - returns statistics about the unspent transaction output (UTXO) set

phorerpc.ping().then(console.log) // no parameter - returns null

phorerpc.submitBlock(blockhex).then(console.log) // input the new block in a serialized hex format and this submits it to the network and returns result


phorerpc.masterNodeList().then(console.log) // no parameter - returns a list of master nodes

phorerpc.sendRawTransaction(txHex).then(console.log) // input the txHex obtained from creating a transaction using bitcoinjs-phore - broadcasts the transaction to the network and returns result