Ended up paying 45c on a binance smart chain transaction thru web3.py

Cryptocurrency News and Public Mining Pools

Ended up paying 45c on a binance smart chain transaction thru web3.py

i'm new to web3 development with web3 python and was trying out the following script:

from web3 import Web3 key = "thisismyprivatekey" address = "0x8Aaca3e2a858c2d5c3ABA66a343A6F6DEA5017e9" w3 = Web3(Web3.HTTPProvider("https://bsc-dataseed1.binance.org:443")) nonce = w3.eth.getTransactionCount(address) tx = { "nonce" : nonce, "to" : recipient, "value" : w3.toWei(amount,'ether'), "gas" : 21000, "gasPrice": 50 } signed_tx = w3.eth.account.sign_transaction(tx,key) sent_tx = w3.eth.sendRawTransaction(signed_tx.rawTransaction) return w3.toHex(sent_tx) 

I've attempted to use a lower gas price, but it ends up with an error. every time i use my wallet (Metamask/Okex) I always pay less than 5c in transaction fees.

what went wrong?

submitted by /u/masterofdead4
[link] [comments]