3

When querying the Horizon API for operations related to an account, some are unexpectedly missing.

The documentation says that the endpoint I'm using represents all operations in valid transactions affecting a particular account. But I'm noticing that some operation objects are omitted from the paged responses. Particularly, when multiple operations are contained within the same transaction.

For example, using Stellar Expert, I see that this transaction has two operations:

  • 90616517091172353 - Change Trust
  • 90616517091172354 - Manage Offer

When I query the API directly for them using the account operations endpoint and check each page of responses (by passing the cursor in the next link), neither of the operations I'm looking for are contained in the overall list. When I query the transaction endpoint directly, they are returned as I expect.

Trying with another transaction that only contains one operation (90614571470974977) seems to return the operation in the response as expected.

I'm baffled by this, can anyone explain why the first two objects would not be included in the account endpoint response?

2

Stellar expert is blocked by my adblocker, so I used Horizon to check the envelope XDR of your transaction. It decodes to these two operations.

The operations do not specify a source account, so they are modifying the source account of the transaction. Namely GCXRMMINCZYBOJ3UT7CLHJOVZEEIEWU5YXBOP4ZCTESSVQ4SGJN27G3T.

The account operations endpoint you linked to is for a different account (GCD6FZCAJTDGU6QBES3AKQZGLWCELNGMRCNRR23WF3TUKFTDX75HXL3Y).

The account operations endpoint for the correct account holds the PTS change trust operation you are looking for.

If I recall correctly, the Manage Offer operation doesn't appear because manage offer by itself does not affect an account, unless it is matched.

  • This makes sense now after your explanation. I was looking at the effects on an account and trying to associate them to a corresponding operation via the operation id. But since the operations acted on a different account, of course they're not going to be in the API response for the one I'm concerned with. Thank you! – Nick DiZazzo Nov 22 '18 at 3:47
  • @Synesso Which ad-blocker plugin/browser do you use? StellarExpert contains no ads, it shouldn't be blocked. – Orbit Lens Nov 22 '18 at 11:50
  • Privacy Badger detects 4 potential trackers. Two of which are blocked, including a call to horizon. Any reason why there's a query param c on the horizon call? – Synesso Nov 22 '18 at 22:30

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.