4

I am currently trying to get the memo and amount of a transaction, but am confused over the differences between a transaction, an operation, and a payment.

From my understanding, a transaction contains multiple operations, one of which is a payment.

However, when querying with horizon.stellar.org, which of the following should I be using to get both memo and amount?

server.transactions().forAccount(accountId).call()... server.operations().forAccount(accountId).call()... server.payments().forAccount(accountId).call()...

1 Answer 1

2

The memo can be seen on the transaction. e.g.

    "memo_type": "text",
    "memo": "chp_290",

You can then decode the envelope_xdr value to drill down on the details of the operations within the transaction. Or you can make a subsequent call to the payments by transaction endpoint, where the asset and amount can be seen. e.g.

    "type": "payment",
    "asset_type": "credit_alphanum4",
    "asset_code": "TEST",
    "asset_issuer": "GDNFUWF2EO4OWXYLI4TDEH4DXUCN6PB24R6XQW4VATORK6WGMHGRXJVB",
    "amount": "1000000.0000000"

The payment endpoint is an alias for a filtered operations call, where only create_account and payment operations are included.

Your Answer

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

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