2

How can I retrieve:

  • transaction amount
  • memo
  • source Account

from envelope_xdr using the python sdk?

1

I'll admit, I am not the most familiar with the Python Stellar Base, however I have heard great things about it!

Gave it a quick look and saw that it does have methods for parsing XDR. Take the Asset class for example. Here you can see we have a from_xdr_object method that takes in XDR and outputs an Asset.

I believe this is the type of functionality you are looking for.

Here is some rough Python Code (just skimmed repo to get something to work and threw this together as POC:

import stellar_base.transaction_envelope as TxEnv
import stellar_base.transaction as Tx

xdr_object = TxEnv.TransactionEnvelope.from_xdr(INSERT_XDR_HERE).to_xdr_object()

tx_object = Tx.Transaction.from_xdr_object(xdr_object)

source_account = tx_object.source

TLDR: functionality is all there!

Your Answer

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

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