cmdruid / tapscript

A humble library for working with Tapscript and Bitcoin Transactions.
https://www.npmjs.com/package/@cmdcode/tapscript
Creative Commons Zero v1.0 Universal
188 stars 49 forks source link

How to calculate fee with tx size? #1

Closed mgpai22 closed 1 year ago

mgpai22 commented 1 year ago

How to get the byte count or vSize of a transaction in order to accurately calculate an adequate fee?

cmdruid commented 1 year ago

Hello. I just updated the library to version 1.2.8. There is now a Tx.getTxSize(txdata) method which will return an object with all the various sizes (base size, vsize, weight, etc.)

Let me know if that works for you!

mgpai22 commented 1 year ago

Awesome! Thank you for the swift update