argvil19 / bitcoin-transaction-size-calculator

A simple tool for calculating the weight and size of a bitcoin transaction with specific properties

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bitcoin Transaction Size / Fee Calculator

Based on jlopp's project.

What is this tool?

This tool makes it simple for anyone to determine the size and weight of a bitcoin transaction.

Who needs this tool?

Bitcoin wallet developers may find this tool helpful when writing transaction construction logic.

Bitcoin users may find this tool helpful if they are trying to construct a transaction manually and need to determine an appropriate transaction fee.

Usage

const BtcEstimator = require('btc-tx-size-fee-estimator')
const estimator = new BtcEstimator()

const opts = {
    input_count: 0,
    input_script: 'P2PKH',
    input_m: 0,
    input_n: 0,
    p2pkh_output_count: 0,
    p2sh_output_count: 0,
    p2sh_p2wpkh_output_count: 0,
    p2sh_p2wsh_output_count: 0,
    p2wpkh_output_count: 0,
    p2wsh_output_count: 0,
    p2tr_output_count: 0
}
btcEstimator.calcTxSize(opts)

btcEstimator.estimateFee(vbyte, satVb)
btcEstimator.formatFeeRange(fee, multiplier) // format: lowerRangeLimit - upperRangeLimit

License

The Bitcoin Transaction Size Calculator is released under the terms of the MIT license. See COPYING for more

information or see http://opensource.org/licenses/MIT.

About

A simple tool for calculating the weight and size of a bitcoin transaction with specific properties

License:MIT License


Languages

Language:JavaScript 100.0%