# phore-rpc

> For interacting with the Phore RPC API

Latest version **1.0.0** (published 2018-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install phore-rpc
pnpm add phore-rpc
yarn add phore-rpc
bun add phore-rpc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-16 |
| First published | 2018-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Greg Marlin |
| Maintainers | marleymarl |
| Keywords | phore, json-rpc, rpc, api |

## Links

- npm: https://www.npmjs.com/package/phore-rpc
- Repository: https://github.com/phoreproject/phorejs
- Homepage: https://github.com/phoreproject/phorejs#readme
- Issues: https://github.com/phoreproject/phorejs/issues
- npm.io page: https://npm.io/package/phore-rpc

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.87.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-06-16

## README

# Installation

Using npm: 

``` bash
npm install phore-rpc --save

```

In Node.js:

``` javascript
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

```

---
_Source: https://npm.io/package/phore-rpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
