For some applications (e.g. the explorer or token airdrops), it is helpful to have an endpoint that returns txs/UTXOs with a given token ID.
We add these HTTP endpoints:
- /token-id/:token_id/confirmed-txs
- /token-id/:token_id/history
- /token-id/:token_id/unconfirmed-txs
- /token-id/:token_id/utxos
Since have a generic implementation that allows us to easily group txs, this now becomes really easy, we simply add TokenIdGroup, implement Group on it and use the generic group writer + mempool to index txs by token ID.
The only tricky part is getting the auxillary data for the group, which can come from 3 different sources (for BlockConnected: from ProcessedTokenTxBatch, for BlockDisconnected: from the DB, for mempool inserts/removals: from the mempool).