
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@shafkat/bitcoincore
Advanced tools
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
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.
To install the package, use npm:
npm install @shafkat/bitcoincore
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.
const BitcoinCore = require('@shafkat/bitcoincore');
import { BitcoinCore } from '@shafkat/bitcoincore';
// Create a new instance of BitcoinCore
const client = new BitcoinCore({
network: 'test'
host: '127.0.0.1',
port: 18332,
username: 'rpcusername',
password: 'rpcpassword',
});
const blockHash = await client.BlockchainRPC.getBestBlockhash();
const info = await client.ControlRPC.getMemoryInfo();
const info = await client.GeneratingRPC.generateBlock(...);
const info = await client.MiningRPC.getBlockTemplate();
const info = await client.NetworkRPC.getNetworkInfo();
const info = await client.RawTransactionRPC.getRawTransaction(...);
const info = await client.UtilRPC.getIndexInfo(...);
const info = await client.WalletRPC.getBalance(...);
Download and install bitcoincore in your machine
Follow official Bitcoin Core documentation for more details instruction.
return await client.WalletRPC.createWallet('your_wallet_name');
return await client.WalletRPC.getWalletInfo({
wallet: 'your_wallet_name',
});
return await client.WalletRPC.getBalance({
wallet: 'your_wallet_name',
});
return await client.WalletRPC.getNewAddress({
wallet: 'your_wallet_name',
});
tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh
return await client.WalletRPC.getAddressInfo(
'tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh'
);
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.
return await client.WalletRPC.getReceivedByAddress(
{
wallet: 'your_wallet_name',
},
'tb1q30lhx0e00xql5gmwn59yvu3umf7s03p8tp4gdh'
);
This package is released under the MIT License.
FAQs
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
The npm package @shafkat/bitcoincore receives a total of 0 weekly downloads. As such, @shafkat/bitcoincore popularity was classified as not popular.
We found that @shafkat/bitcoincore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.