eosrio / hyperion-history-api

Scalable Full History API Solution for Antelope (former EOSIO) based blockchains
https://hyperion.docs.eosrio.io
Other
125 stars 72 forks source link

filter actions instead of whole trace #144

Closed dev-dantealighieri closed 4 months ago

dev-dantealighieri commented 7 months ago

i want to get only the actions created by the creator of the transaction but history api returns whole transaction to me,

im using the following code snippet to get the transaction

const transaction = await this.indexerRequest(
      EOS_INDEXER_API.V2.GET_TRANSACTION,
      {
        params: {
          id: transactionHash,
        },
        method: GET_METHOD,
      },
    );

example transaction

for example in here, i want to only filter the following actions, not traces, which are

image

how to filter correctly? i tried to use creator_action_ordinal but thats not what i was looking for

ps: problem is v2 api, v1 seems working correctly but their json scheme also different

below is another example, where v1 returns all user actions under trx with creator_action_ordinal equals to 0, while v2 returns them mixed, with non zero creator_action_ordinal's example transaction

i need a solid solution for v2 api to get a way to filter only actions created by user like its done in v1, not whole trace

another question, is there any problem for using v1 api? is it still supported by community, and do you continue to maintain it?

thanks, Dante

igorls commented 7 months ago

For this situation maybe you are looking for an actor filter like: /v2/history/get_actions?act.authorization.actor=eosio

V1 is a backport of the old history api provided in nodeos, we do not plan to support it for longer and its not optimized enough, v2 has more flexibility and its focused on the data that is indexed