Get Account Ledger + assetId

Hello team!

I am trying to retrieve all the dividends of my assets with the following call: getAccountLedger

It does not return the assetId that generates the event.

If I look up the eventHash if it is linked to the assetId, but I would need an extra call for each entry.

Is there a more optimal way to handle this?

Thank you very much!

Hi, did you try to set the includeHoldingInfo flag to true?

1 Like

Thank you for your quick response!

Yes, I have also tried it but it does not return the assetId to which it is linked.

1 Like

ok, so you want the asset for which the dividend is payed. Right, includeHoldingInfo won't return that. Unfortunately I cannot think of another option except to do the extra call for each entry.

1 Like

I imagined it... thanks for your answer! :hearts:

What function should I call to return the data I need?

you correctly notice that the eventHash is the fullHash of the transaction which created the event. Having that, call the API getTransaction. Also set the chain to the ledger event chain. And from the attachment object of the response, get the asset field.

1 Like

Its working, thanks!!!!


Thanks @petko.petkov ! BTW, it would be very appreciated if the platform offers such an API in any future release.