How can I retrieve:
- transaction amount
- source Account
from envelope_xdr using the python sdk?
Stellar Stack Exchange is a question and answer site for developers and users of Stellar and the Stellar Distributed Exchange. It only takes a minute to sign up.Sign up to join this community
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
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!