Indexer block query asset destruction

Looking at blocks: using algod, asset destruction has no “apar” section. using indexer, how can one determine this is destruction?

For example 455266410 in block: https://algoexplorerapi.io/idx2/v2/blocks/17826484

{“asset-config-transaction”:{“asset-id”:455266410,“params”:{“creator”:“GC5ICHM3HWCZR6AJETA3RXQVCFLKZU6LQCFQH2I42ACSJ7UHEAO4R63TIM”,“decimals”:0,“default-frozen”:false,“total”:0}},“close-rewards”:0,“closing-amount”:0,“confirmed-round”:17826484,“fee”:1000,“first-valid”:17826478,“genesis-hash”:“wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=”,“genesis-id”:“mainnet-v1.0”,“id”:“AIVMXYU6HR27QHIIOIDQZBP7Y5DL4ERBAR5GRFTQRDGPHQVKIB6A”,“intra-round-offset”:16,“last-valid”:17827478,“receiver-rewards”:0,“round-time”:1638647723,“sender”:“GC5ICHM3HWCZR6AJETA3RXQVCFLKZU6LQCFQH2I42ACSJ7UHEAO4R63TIM”,“sender-rewards”:0,“signature”:{“sig”:“PyTzeXp/kqE63kHhT+HJ+AQklpKVzavLsFQjYTQVx2gbpG6ov8k3ulr8yIeCLeTdtMss2BfH9aO7rxssxYmeBw==”},“tx-type”:“acfg”}

I suggest the “params” section is removed or if that’s useful a “deleted”:“true” is added somewhere.
Regarding “params”, it seems that in modifications, totals is always 0, so not sure how this can be useful. I believe it should only include what has changed for asset modifications, and should be absent in destruction.

Please clarify. Thanks.

P.S. Also, any reason why indexer does not report metadata hash on creation?

1 Like

Good question. Should probably be added to the next version of algod.

By definition if apar is empty/not present, it means this is asset destruction.

What do you mean by:

why indexer does not report metadata hash on creation?

In all Algorand transactions, if a field is empty, it’s omitted.

1 Like

Thank Fabrice, I am not sure you understood my question. Yes algod is fine, apar missing = destruction.
My question is regarding the indexer, when you get the “blocks” from it. In that case “params” is not missing and I am not sure how you can understand if this is modification or destruction. When getting the block from indexer and not algod, there is nothing I can see that tells you if it’s destruction.

That’s a very good point!
Can you open an issue in github.com/algorand/indexer
And you can link to this forum post too.

1 Like

Thank you: Getting blocks from the indexer (and not algod), not possible to determine asset destruction · Issue #804 · algorand/indexer · GitHub

1 Like