# electroneumjs

> Electroneum RPC made easy. Explore the blockchain, send transactions and much more.

Latest version **1.0.2** (published 2018-02-07) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install electroneumjs
pnpm add electroneumjs
yarn add electroneumjs
bun add electroneumjs
```

## 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.2 |
| Published | 2018-02-07 |
| First published | 2018-02-06 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 37.4 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Pavlo Kochylo |
| Maintainers | syncroit |
| Keywords | cryptocurrency, rpc, http |

## Links

- npm: https://www.npmjs.com/package/electroneumjs
- Repository: https://github.com/SyncroIT/electroneum-rpc-js
- Homepage: https://github.com/SyncroIT/electroneum-rpc-js#readme
- Issues: https://github.com/SyncroIT/electroneum-rpc-js/issues
- npm.io page: https://npm.io/package/electroneumjs

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.17.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-02-07
- 1.0.0 — 2018-02-06

## README

## Electroneum RPC 

Electroneum RPC is a JavaScript library that adapts the Electroneum JSON RPC methods to JS.

#### Installation

```
npm install electroneumjs 
```

#### Usage
```javascript
const EtnRpc = require('electroneumjs');
var rpc = new EtnRpc();
rpc.getBlockCount().then(function(response) {
    console.log(response.data);
}); 
```

#### Options
```javascript
new EtnRpc({
    protocol: 'http',
    ip: '127.0.0.1',
    port: 26968,
    id: '0',
    jsonrpc: '2.0'
});
```


#### Method parameters
```javascript
const rpc = new EtnRpc();

// on_getblockhash method
rpc.getBlockHash([50]);

// submitblock method
rpc.submitBlock('blob_of_mined_block');
```

#### Methods 
| JavaScript Method      | RPC Method                 | 
| :--------------------: | :------------------------: |
| getBlockCount          | getblockcount              |
| getBlockHash           | on_get_block_hash          |
| getBlockTemplate       | get_block_template         |
| submitBlock            | submit_block               |
| getLastBlockHeader     | get_last_block_header      |
| getBlockHeaderByHash   | get_block_header_by_hash   |
| getBlockHeaderByHeight | get_block_header_by_height |
| getBlockHeadersRange   | get_block_headers_range    |
| getBlock               | get_block                  |
| getConnections         | get_connections            |
| getInfo                | get_info                   |
| hardForkInfo           | hard_fork_info             |
| setBans                | set_bans                   |
| getBans                | get_bans                   |
| flushTxPool            | flush_txpool               |
| getOutputHistogram     | get_output_histogram       |
| getVersion             | get_version                |
| getCoinbaseTxSum       | get_coinbase_tx_sum        |
| getFeeEstimate         | get_fee_estimate           |
| getAlternateChains     | get_alternate_chains       |
| relayTx                | relay_tx                   |
| syncInfo               | sync_info                  |
| getTxpoolBacklog       | get_txpool_backlog         |


#### How to run Electroneumd?

- Download the Electroneum project from their repository from here: https://github.com/electroneum/electroneum
- Install *CMake* if you have not did it.
- Inside the Electroneum project folder run `make` from command line
- Run `cd build/release/bin` and then open `electroneumd` by typing `./electroneumd`

**It will take some time to synchronize the blockchain with the network**


#### TODO
- Integrate **electroneum-wallet-rpc** methods

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