Getting the gas used via receipt/tx in ETH (BNB) ? #2481
-
Hi, Can anyone help, I am getting an issue with trying to get the total price of a TX, the TX doesn't sent any ETH/BNB - it only uses gas. I checked on BscSCan and the total amount being shown is 0.00012974 BNB ($0.07) I tried this but its not come back with the correct value, I think I am using it wrong. I did notice somebody said to use effectiveGasPrice - but that is for ethereum and I don't think it exists on BSC - actually its not there so I used gasPrice from the TX
Actually outputs: total ether spent on gas for transaction: 0.05843443 and this is not what is on BscScan. Could anybody tell me what I am doing wrong ? Probably something silly of course, something I haven't taken into consideration Thanks in advance For clarity sake, I am getting the tx and receipt using this
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I figured it out, don't know why but I thought i tried this. Anyway this is the solution
|
Beta Was this translation helpful? Give feedback.
I figured it out, don't know why but I thought i tried this. Anyway this is the solution