# @machado-rev/htmlcoind-rpc

> HTMLCOIN Client Library to connect to HTMLCOIN Core via RPC

Latest version **0.0.8** (published 2020-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @machado-rev/htmlcoind-rpc
pnpm add @machado-rev/htmlcoind-rpc
yarn add @machado-rev/htmlcoind-rpc
bun add @machado-rev/htmlcoind-rpc
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2020-08-24 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 25 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leandro Machado |
| Maintainers | machado-rev |
| Keywords | htmlcoin, rpc |

## Links

- npm: https://www.npmjs.com/package/@machado-rev/htmlcoind-rpc
- Repository: https://github.com/machado-rev/htmlcoind-rpc
- Issues: https://github.com/machado-rev/htmlcoind-rpc/issues
- npm.io page: https://npm.io/package/@machado-rev/htmlcoind-rpc

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2020-08-24

## README

htmlcoind-rpc.js
===============

A client library to connect to HTMLCOIN Core RPC in JavaScript.

## Get Started

htmlcoind-rpc.js runs on [node](http://nodejs.org/), and can be installed via [npm](https://npmjs.org/):

```bash
npm install htmlcoind-rpc
```

## Examples

```javascript
var run = function() {
  var htmlcoincore = require('htmlcoincore');
  var RpcClient = require('htmlcoind-rpc');

  var config = {
    protocol: 'http',
    user: 'user',
    pass: 'pass',
    host: '127.0.0.1',
    port: '18332',
  };

  var rpc = new RpcClient(config);

  var txids = [];

  function showNewTransactions() {
    rpc.getRawMemPool(function (err, ret) {
      if (err) {
        console.error(err);
        return setTimeout(showNewTransactions, 10000);
      }

      function batchCall() {
        ret.result.forEach(function (txid) {
          if (txids.indexOf(txid) === -1) {
            rpc.getRawTransaction(txid);
          }
        });
      }

      rpc.batch(batchCall, function(err, rawtxs) {
        if (err) {
          console.error(err);
          return setTimeout(showNewTransactions, 10000);
        }

        rawtxs.map(function (rawtx) {
          var tx = new htmlcoincore.Transaction(rawtx.result);
          console.log('\n\n\n' + tx.id + ':', tx.toObject());
        });

        txids = ret.result;
        setTimeout(showNewTransactions, 2500);
      });
    });
  }

  showNewTransactions();
};
```

## License

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