bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Option for Electrum and Esplora APIs to include floating `TxOut`s in updates for fee calculation

Open evanlinjin opened this issue 1 year ago • 6 comments

Describe the enhancement

BDK does not store the transaction fee in a separate field. It needs to be calculated from the difference between prev outputs and outputs created.

For transactions that are received from an external wallet, we would not have prev txout data by default. It'll be handy to have an option to get prev txouts for these transactions and have them inserted as floating txouts in the TxGraph.

Use case

Some wallets would want to be able to calculate fees for all transactions that it includes.

Additional context

evanlinjin avatar Jan 10 '24 05:01 evanlinjin

In esplora it should not be an option it just should be done. The information is already fetched it just isn't inserted. With electrum I guess you have to make it an option.

LLFourn avatar Jan 22 '24 01:01 LLFourn

That's a good point @LLFourn. Should be straightforward for Esplora then.

evanlinjin avatar Jan 22 '24 15:01 evanlinjin

I can take a look at this.

LagginTimes avatar Jan 22 '24 16:01 LagginTimes

possibly related #1419

ValuedMammal avatar May 01 '24 19:05 ValuedMammal

@LagginTimes will also implement this for Electrum.

evanlinjin avatar May 07 '24 04:05 evanlinjin

The electrum portion of this ticket has been addressed in #1403.

LagginTimes avatar May 07 '24 12:05 LagginTimes