I am trying to return transaction receipt in a JSON from my flask API (python). in JS this is absolutely easy but I can't get the receipt or the transaction hash to pass.

All I get is Object of type HexBytes is not JSON serializable I have tried everything, even str()method.

Am I missing something ?

my code :

tx_receiptComp = w3.eth.waitForTransactionReceipt(TX)
return jsonify({"payload" :tx_receiptComp})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.