npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

bitcoincore-node

v1.0.0

Published

A comprehensive Node.js package for interacting with Bitcoin Core via RPC. Create, sign, and broadcast Bitcoin transactions, manage wallets, and access blockchain data through an easy-to-use API interface. Perfect for developers building cryptocurrency ap

Readme

bitcoincore-node

A comprehensive Node.js package for interacting with Bitcoin Core via RPC. Easily create, sign, and broadcast Bitcoin transactions, manage wallets, and access blockchain data through a simple and easy-to-use API interface. Perfect for developers building cryptocurrency applications, wallets, or integrating Bitcoin functionality into their services.

Features

  • Create Bitcoin transactions: Create, sign, and broadcast transactions directly from your Node.js application.
  • Wallet management: Manage Bitcoin wallets, import/export private keys, and perform backup and encryption operations.
  • Blockchain data: Access various blockchain data including block hashes, block headers, and transaction details.
  • Bitcoin Core RPC: Interact with Bitcoin Core via JSON-RPC, supporting a wide range of commands.

Installation

To install the package, use npm:

npm install bitcoincore-node

Usage

To use the package, require the module and create a new instance of the BitcoinCore class.

Follow official Bitcoin Core documentation for more details on available commands.

Import Library

const BitcoinCore = require('bitcoincore-node');

ES6

import { BitcoinCore } from 'bitcoincore-node';

Example

// Create a new instance of BitcoinCore
const client = new BitcoinCore({
    network: 'test'
    host: '127.0.0.1',
    port: 18332,
    username: 'rpcusername',
    password: 'rpcpassword',
});

All RPC methods are available as promises in camelCase

BlockchainRPC

const blockHash = await client.BlockchainRPC.getBestBlockhash();

ControlRPC

const info = await client.ControlRPC.getMemoryInfo();

GeneratingRPC

const info = await client.GeneratingRPC.generateBlock(...);

MiningRPC

const info = await client.MiningRPC.getBlockTemplate();

NetworkRPC

const info = await client.NetworkRPC.getNetworkInfo();

RawTransactionRPC

const info = await client.RawTransactionRPC.getRawTransaction(...);

UtilRPC

const info = await client.UtilRPC.getIndexInfo(...);

WalletRPC

const info = await client.WalletRPC.getBalance(...);

Sample

Run bitcoin core

Download and install bitcoincore in your machine

Follow official Bitcoin Core documentation for more details instruction.

Create wallet

return await client.WalletRPC.createWallet('your_wallet_name');

Get wallet information

return await client.WalletRPC.getWalletInfo({
    wallet: 'your_wallet_name',
});

Wallet balance

return await client.WalletRPC.getBalance({
    wallet: 'your_wallet_name',
});

Create address

return await client.WalletRPC.getNewAddress({
    wallet: 'your_wallet_name',
});

Respose

tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh

Get address info

return await client.WalletRPC.getAddressInfo(
    'tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh'
);

Take payment

Send test bitcoin to the address. You can send test bitcoin using various testnet faucet for free. Then you can check your wallet balance to confirm that the payment has been received.

Monitor payment

return await client.WalletRPC.getReceivedByAddress(
    {
        wallet: 'your_wallet_name',
    },
    'tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh'
);

License

This package is released under the MIT License.

Author

Md Shafkat Hussain Tanvir