Client-side Bitcoin JavaScript library for node.js and browsers with comprehensive Bitcoin protocol support
Overall
score
99%
Build a Bitcoin transaction analyzer that calculates important transaction metrics including weight and virtual size. The analyzer should parse transaction data and provide detailed size calculations that are essential for fee estimation.
The analyzer should be able to:
The analyzer must calculate and return the following metrics:
For each transaction analyzed, provide:
@generates
/**
* Analyzes a Bitcoin transaction and returns size metrics
*
* @param {string} txHex - The transaction in hexadecimal format
* @returns {object} Analysis results containing:
* - weight: Transaction weight in weight units
* - virtualSize: Virtual size in bytes (vsize)
* - size: Actual serialized size in bytes
* - inputs: Number of inputs
* - outputs: Number of outputs
* - hasWitness: Whether transaction contains witness data
*/
function analyzeTransaction(txHex) {
// Implementation here
}
module.exports = {
analyzeTransaction
};Provides Bitcoin transaction parsing and manipulation capabilities.
Install with Tessl CLI
npx tessl i tessl/npm-bitcoinjs-libdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10