litecoin-core

simple litecoin rpc client

Usage no npm install needed!

<script type="module">
  import litecoinCore from 'https://cdn.skypack.dev/litecoin-core';
</script>

README

Litecoin-Core

Installation

Install the package via yarn:

yarn add litecoin-core

or via npm:

Install the package via npm:

npm install litecoin-core --save

Usage

Client(...args)

Arguments

  1. [host=localhost] (string): The host to connect to.
  2. [port=[network]] (string): The RPC server port.
  3. [network=mainnet] (string): The network
  4. [username] (string): The RPC server user name.
  5. [password] (string): The RPC server user password.
  6. [timeout=30000] (number): How long until the request times out (ms).

Examples

Using network mode

The network will automatically determine the port to connect to, just like the litecoind and litecoin-cli commands.

const Client = require('litecoin-core');
const client = new Client({ network: 'regtest' });
Setting a custom port
const client = new Client({ port: 32777 });