cosmjs
cosmjs copied to clipboard
A way to limit number of transactions that are returned from searchTx func
Is there any way to limit number of transactions that are returned from searchTx function?
I saw SearchTxFilter with minHeight and maxHeight, but I'm not sure how to use them?
Or is there any other way to get transactions for an address with limit option?
Thank you
if i put minHeight as currentBlockHeight - 100, that means that the search will be in the last 100 blocks? Am i right?
if i put minHeight as currentBlockHeight - 100, that means that the search will be in the last 100 blocks? Am i right?
exactly!
The search is implemented via txSearchAll from the Tendermint client, which loops througth the result pages until everything was read. So unfotunatly there is no nice way the pagination is exposed to the user of txSearch. Using the heights to define a search range is workaround that will do the job, but far from ideal. Some serious redesign of StargateClient.txsQuery and StargateClient.searchTx would be needed.