bit icon indicating copy to clipboard operation
bit copied to clipboard

input and output for estimate_tx_fee() function

Open Freditansari opened this issue 4 years ago • 1 comments

How do I find the input and output for the estimate_tx_fee() function?

Freditansari avatar Jul 13 '21 14:07 Freditansari

@Freditansari Did you find any usefull answer? I need to estimate transaction fee before key.send() or key.create_transaction(). I have find this formula:

Get fee_rate from here:

https://bitcoinfees.earn.com/api/v1/fees/recommended 
=> {"fastestFee":102,"halfHourFee":102,"hourFee":88}

Then:

transaction_size_as_byte = (number_of_inputs * 180) + (number_of_output * 34)
transaction_fee = transaction_size_as_byte * fee_rate

And i don't know how to get number_of_inputs and number_of_output.

Let me know if you have any solution for it.

reza-khalafi avatar May 24 '23 22:05 reza-khalafi