
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@devgrid/bitcoin-core
Advanced tools
A strongly-typed Bitcoin Core RPC client for Node.js with full TypeScript support.
npm install @devgrid/bitcoin-core
# or
yarn add @devgrid/bitcoin-core
import { BitcoinCore } from '@devgrid/bitcoin-core';
const client = new BitcoinCore({
host: 'localhost',
port: 8332,
username: 'your-username',
password: 'your-password',
ssl: true
});
// Get blockchain info
const info = await client.getBlockchainInfo();
console.log(info);
// Get transaction by ID
const tx = await client.getTransaction('txid');
console.log(tx);
interface BitcoinConfig {
host: string;
port: number;
username: string;
password: string;
ssl?: boolean;
timeout?: number;
headers?: Record<string, string>;
}
getBlockchainInfo(): Get blockchain infogetBlock(hash: string): Get block by hashgetBlockHash(height: number): Get block hash by heightgetBlockCount(): Get current block countgetTransaction(txid: string): Get transaction detailssendTransaction(hex: string): Send raw transactiondecodeTransaction(hex: string): Decode raw transactiongetBalance(): Get wallet balancelistUnspent(): List unspent transactionssendToAddress(address: string, amount: number): Send to addresstry {
await client.getTransaction('invalid-txid');
} catch (error) {
if (error.code === RPCErrorCode.INVALID_PARAMS) {
console.error('Invalid transaction ID');
}
}
const batch = client.batch();
batch.getBlockCount();
batch.getBlockchainInfo();
const [count, info] = await batch.execute();
const client = new BitcoinCore({
// ... other config
headers: {
'User-Agent': 'MyApp/1.0.0'
}
});
const client = new BitcoinCore({
// ... other config
ssl: true,
sslOptions: {
ca: fs.readFileSync('ca.pem'),
cert: fs.readFileSync('cert.pem'),
key: fs.readFileSync('key.pem')
}
});
const client = new BitcoinCore({
// ... other config
timeout: 30000 // 30 seconds
});
| Code | Description |
|---|---|
| -32600 | Invalid Request |
| -32601 | Method not found |
| -32602 | Invalid params |
| -32603 | Internal error |
| -32700 | Parse error |
Contributions are welcome! Please read our contributing guidelines first.
npm test
# or
yarn test
MIT
Built with TypeScript and Node.js.
FAQs
Bitcoin Core API client for Node.js
We found that @devgrid/bitcoin-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.