Author

Topic: How to get fee from incoming transaction? (Read 172 times)

HCP
legendary
Activity: 2086
Merit: 4361
October 18, 2020, 03:23:11 PM
#7
How to get fee from incoming transaction because incoming object hasn`t this parameter?
If you're wanting to calculate the fee programmatically, you need to add up the value of all the inputs, and then subtract the value of all the outputs. The amont leftover is what the total fee was.

To calculate the fee rate, you then need to divide this amount by the "size" of the transaction in bytes to get the sats/byte value. Note that if it is a SegWit transaction, then you will need to calculate the "virtual size" (aka "vsize") to get sats/vbyte. Refer: https://bitcoin.stackexchange.com/questions/87275/how-to-calculate-segwit-transaction-fee-in-bytes
legendary
Activity: 3696
Merit: 2219
💲🏎️💨🚓
October 17, 2020, 09:19:07 PM
#6
Is the OP asking about an additional fee to then pass the payment along to the next wallet address?  There's provision to use part of the amount sent to cover TX fees, so it shouldn't be an issue on sending funds you receive.
legendary
Activity: 2492
Merit: 1232
October 17, 2020, 09:32:13 AM
#5
It's quite hard to understand an incomplete question of what you've meant for OP. Please explain further more details.
I read this twice and I think OP's transaction didn't arrive at his wallet, IMO.

Once a sender sent Bitcoin (I assume it is Bitcoin) there's no way to get the fee once it is transacted and broadcast to the blockchain network and waiting to be confirmed, if there is a congestion of the network which is a cause of delayed transaction, you can add the fee for a faster transaction but this depend on what wallet you've used. That's why most comment above says, please be specific of your question to have the right answer.

Meanwhile, you can follow what o_e_l_e_o said above to check your transaction status.
legendary
Activity: 2268
Merit: 18711
October 17, 2020, 08:31:57 AM
#4
I think what OP is asking is how to see the fee of an incoming transaction, so as to get a rough idea of how long it will take to confirm. The answer to that question depends on the client or wallet software you are using, so if you can answer that question then we can give more detailed instructions.

Alternatively, if you know how to find the transaction hash or transaction ID of the incoming transaction, you can paste it in to a block explorer such as https://blockchair.com and look at the field "Fee per vbyte".
legendary
Activity: 1526
Merit: 1359
October 17, 2020, 06:53:09 AM
#3
How to get fee from incoming transaction because incoming object hasn`t this parameter?

Short answer: You can't.

Long answer: Explain your use case in a little more detail. Why would you want to do that? Maybe we can offer you an alternative solution.
legendary
Activity: 2170
Merit: 1789
October 17, 2020, 04:27:18 AM
#2
AFAIK on the protocol level, there is no way to do that (maybe you can explicitly ask your sender to send some additional money for you). You'd probably need to set up an exchange to do that or run a mining rig to get paid from transaction fees. But as an individual receiver, I'm afraid you can't. Why would you charge someone anyway?
newbie
Activity: 1
Merit: 0
October 17, 2020, 04:04:38 AM
#1
Hi!

How to get fee from incoming transaction because incoming object hasn`t this parameter?
Jump to: