New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jskitty/bitcoin-rpc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jskitty/bitcoin-rpc

A simple, efficient, zero-dep Bitcoin RPC interface.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bitcoin-rpc - npm

A simple, efficient, zero-dep Bitcoin RPC interface.

Why?

Most other Bitcoin RPC libraries either:

  • Have unnecessary dependencies.
  • Don't follow proper standards (silent RPC errors, strange Promise handling, etc).
  • Have hardcoded RPC commands, meaning the lib must be upgraded every time the RPC daemon changes, seriously?

How?

const RPCClient = require('@jskitty/bitcoin-rpc');

// Create a new RPC class for a Bitcoind RPC daemon
//                           user    pass    host         port
const btcRPC = new RPCClient('user', 'pass', '127.0.0.1', 8332);

// EXAMPLE: Fetch the latest block count
btcRPC.call('getblockcount').then(nBlocks => {
    console.log('There\'s ' + nBlocks + ' blocks in the blockchain, nice!');
});

// EXAMPLE: Fetch a raw block based on it's block hash
btcRPC.call('getblock', '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f').then(cBlock => {
    console.log(cBlock);
});

// EXAMPLE: Asynchronously fetch the latest block count
async function getBlockCount() {
    const nBlocks = await btcRPC.call('getblockcount');
    console.log('There\'s ' + nBlocks + ' blocks in the blockchain, nice!');
}

FAQs

Package last updated on 24 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc