sei-protocol/sei-js

[SEI-6102] [BUG] Unable to search transactions using events.

Closed this issue · 3 comments

Seid version
N/A

SeiJS package & version
3.1.1

Chain ID
atlantic-2

Describe the bug
(await getQueryClient("https://rest.atlantic-2.seinetwork.io/")).cosmos.tx.v1beta1.getTxsEvent is always doomed to fail due to the events not being encoded in a manner the endpoint expects.

To Reproduce

const queryClient = await getQueryClient("https://rest.atlantic-2.seinetwork.io/");
const searchResults = await queryClient.cosmos.tx.v1beta1.getTxsEvent({
	events: [
		"message.action='/cosmwasm.wasm.v1.MsgExecuteContract'"
	],
	orderBy: 1 // ORDER_BY_ASC
});
console.log({searchResults});

Throws an error with the response of the endpoint being:

rpc error: code = InvalidArgument desc = invalid event; event  should be of the format: {eventType}.{eventAttribute}={value}: invalid request

Expected behavior
The search to succeed.

Screenshots
If applicable, add screenshots to help explain your problem.

image

Additional context
There's no standard on how to decode arrays with querystrings. Some server-side frameworks accept myarray[]=val1&myarray[]=val2, while others do myarray=val1&myarray=val2. The version of axios which @osmonauts/lcd (As well as @cosmology/lcd) seemingly depends on serializes arrays as the former while the endpoint expects the latter.

From SyncLinear.com | SEI-6102

Hey @ARitz-Cracker! Thanks for making this ticket, I'll be looking into this

Hey @ARitz-Cracker, apologies for the late response. I wanted to follow up here - this fix requires an update to the @cosmology/lcd package as you've identified, and we're still working on it. Will post an update as soon as we can!

The latest version of proto has this most up to date @cosmology/lcd