1

I have a types.Transaction object.

How can I encode this to receive the raw transaction hex?

Something like this:

0xf305d719000000000000000000000000a6331220bfb0b1ad6ff6bea2b983fa15375dd1f1000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000001dcd65000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000b63d434fafc6240e928928f27cdfcec90eba69d60000000000000000000000000000000000000000000000000000000061f4d7e8

1 Answer 1

1

You can use Transaction.MarshalBinary to obtain the rlp encoded raw transaction and then use common.Bytes2Hex to create the hex string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.