Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter actions instead of whole trace #144

Open
dev-dantealighieri opened this issue Feb 3, 2024 · 1 comment
Open

filter actions instead of whole trace #144

dev-dantealighieri opened this issue Feb 3, 2024 · 1 comment

Comments

@dev-dantealighieri
Copy link

dev-dantealighieri commented Feb 3, 2024

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
Copy link
Member

igorls commented Feb 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants