cosmos / gaia

Cosmos Hub
https://hub.cosmos.network
Apache License 2.0
475 stars 693 forks source link

[Question]: Why is Transaction API Not Working with cosmos-sdk v0.50 (gaiad >= v19.x) #3347

Closed mayank-daga closed 1 month ago

mayank-daga commented 1 month ago

Is there an existing issue for this?

What happened?

A bug happened!

Gaia Version

v19.1.0

How to reproduce?

Hi, I am using to get particular event transactions but it is giving me following response:

{ "code": 13, "message": "query cannot be empty", "details": [] }

API: http:///cosmos/tx/v1beta1/txs?events=message.sender='cosmos1w5jleaknx4qhh8exw86eea0ckpeqzuu68kca3l'&page=1&limit=10

It was working with earlier versions

MSalopek commented 1 month ago

Use /txs?query= instead of /txs?events=

https://cosmos-api.polkachu.com/cosmos/tx/v1beta1/txs?query=message.sender=%27cosmos1w5jleaknx4qhh8exw86eea0ckpeqzuu68kca3l%27&page=1&limit=10
-<URL>/cosmos/tx/v1beta1/txs?query=message.sender=...
+<URL>/cosmos/tx/v1beta1/txs?events=message.sender=...

Example: https://cosmos-api.polkachu.com/cosmos/tx/v1beta1/txs?query=message.sender=%27cosmos1w5jleaknx4qhh8exw86eea0ckpeqzuu68kca3l%27&page=1&limit=10

RPC docs: https://docs.cosmos.network/api#tag/Service/operation/GetTxsEvent

Relevant section:

Array of strings events is the list of transaction event type. Deprecated: post v0.47.x use query instead, which should contain a valid events query.

string query defines the transaction event query that is proxied to Tendermint's TxSearch RPC method. The query must be valid.

mayank-daga commented 1 month ago

@MSalopek that for the help issue is resolved