I think your error is not related to hex/binary conversions as this is mostly handled by web3.
You can easily view the hex version in python by using .hex()
h = '935479cfcb8d9b53861f4c6c5e8941ed2787710b289100235dcb6ca1182a2f24'
b = b"\x93Ty\xcf\xcb\x8d\x9bS\x86\x1fLl^\x89A\xed'\x87q\x0b(\x91\x00#]\xcbl\xa1\x18*/$"
print(b.hex())
>>> 935479cfcb8d9b53861f4c6c5e8941ed2787710b289100235dcb6ca1182a2f24
print(b.hex() == h)
>>> True
The actual error comes from poor formatting somewhere in your code.
Most likelyPossibly from ,'maxFeePerGas':277777,'maxPriorityFeePerGas':30000
as these are mainly for Ethereum and alwayscan fail if I include them on other chains.
You should include gas
and gasPrice
If you still have issue, change gas
to gasLimit
You also appear to be missing the chainId
from the transaction which will default to ETH
make sure to add that as well..
chain_id_binance = 56 # 0x38 in hex
tx = {
chainId: w3.utils.toHex(chain_id_binance),
...
}