New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bitcoin-minimal

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-minimal

Parse raw bitcoin block and transaction buffers with minimal overhead

latest
Source
npmnpm
Version
1.1.7
Version published
Maintainers
0
Created
Source

bitcoin-minimal

NPM Package

Parse raw bitcoin block and transaction buffers with minimal overhead

Note

You must use node.js v12+

Install

npm i bitcoin-minimal

Documentation

Basic use

const { Block, Transaction, Header } = require('bitcoin-minimal')

const block = Block.fromBuffer(yourBlockBuffer)
block.getHash()
block.getTransactions()
block.getHeight()
await block.getTransactionsAsync(({ header, transactions, finished }), => {
    for (const [txIndex, transaction, txPos, txLength] of transactions) {
        console.log(`tx ${transaction.getTxid()}`)
    }
})

const header = Header.fromBuffer(yourHeaderBuffer)
header.getHash()

const transaction = Transaction.fromBuffer(yourTransactionBuffer)
transaction.getTxid()
transaction.getCoinbaseHeight()

Tests

npm run test

Keywords

bitcoin

FAQs

Package last updated on 21 Dec 2024

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