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

Filtering by contract does not work on /v3/accounts/<account>/activities #1992

Open
asyncmind0 opened this issue Oct 23, 2024 · 1 comment
Open
Assignees

Comments

@asyncmind0
Copy link

asyncmind0 commented Oct 23, 2024

Filtering by contract does not work on /v3/accounts//activities

seems like filter by contracts is broken 🤔

curl -X 'GET' \
  'https://mainnet.aeternity.io/mdw/v3/accounts/ak_psy8tRXPzGxh6975H7K6XQcMFVsdrxJMt7YkzMY8oUTevutzw/activities?owned_only=true&type=transactions&limit=10' \
  -H 'accept: application/json'
curl -X 'GET' \
  'https://mainnet.aeternity.io/mdw/v3/accounts/ak_psy8tRXPzGxh6975H7K6XQcMFVsdrxJMt7YkzMY8oUTevutzw/activities?owned_only=true&type=contract&limit=10' \
  -H 'accept: application/json'
@sborrazas sborrazas self-assigned this Oct 23, 2024
@sborrazas
Copy link
Contributor

@asyncmind0 filtering activities by type=contract will return internal contract call/create activities, not transactions. Activities type filter filters type of activities, not type of transactions. If you want transaction activities for the account you can use type=transaction, but that's going to return all transactions related to the account, not filtered by contractcall/spendtx/etc.

What you can do is use the /transactions endpoint that's specifically for transactions and has a whole bunch of filters. For example, to get all the transactions where caller_id is ak_psy8tRXPzGxh6975H7K6XQcMFVsdrxJMt7YkzMY8oUTevutzw you can do:
https://mainnet.aeternity.io/mdw/v3/transactions?caller_id=ak_psy8tRXPzGxh6975H7K6XQcMFVsdrxJMt7YkzMY8oUTevutzw&type=contract_call
or if you want contract create transactions that have a caller_id too you can simply do too:
https://mainnet.aeternity.io/mdw/v3/transactions?caller_id=ak_psy8tRXPzGxh6975H7K6XQcMFVsdrxJMt7YkzMY8oUTevutzw

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