Socket
Socket
Sign inDemoInstall

bitcoin-json-rpc

Package Overview
Dependencies
8
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bitcoin-json-rpc

Bitcoin JSON RPC with type validation


Version published
Weekly downloads
230
increased by52.32%
Maintainers
2
Install size
6.80 MB
Created
Weekly downloads
 

Readme

Source

bitcoin-json-rpc

Bitcoin JSON RPC for TypeScript with Response Type Enforcement

Installing

npm install bitcoin-json-rpc

Example usage

import BitcoinJsonRpc from 'bitcoin-json-rpc';

const rpc = new BitcoinJsonRpc('http://localhost:8332');

const balance = await rpc.getBalance();
console.log(balance);

Non-standard methods

Methods not exposed by Bitcoin Core, such as omni_getwalletaddressbalances or Liquid's getbalance are prefixed i.e. getLiquidBalanceForAsset.

Motivation

There are plenty of Bitcoin forks, including Omni, Zcash, and Blockstream Liquid. These forks often introduce breaking changes to the JSON RPC responses that are not reflected in their documentation.

This library provides TypeScript types for RPC commands and validates the responses using io-ts. If the response does not match the schema, an error is thrown.

Author

Andreas Brekken

License

MIT

FAQs

Last updated on 27 Sep 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc