Before I submit the transaction to the network I want to convert the 'transaction' in XDR format so that I can save it to database for future reference. I am using Stellar JS library. How to do it?

1 Answer 1


Given transaction is a Transaction object then this will give you base64 encoded XDR:

  • Thanks for quick reply. works. Another quick question, is the transaction hash and operation id generated before the transaction is submitted to the network or after? Feb 27, 2018 at 13:03
  • Transaction hash can be generated before submitting to the network using hash() method. Operation ID (Horizon) can be generated once transaction is in the ledger. Feb 27, 2018 at 14:30

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.