Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Understanding the Behavior of TON API Endpoints and the "count" Parameter

I am using the TON API to fetch transaction data, and I have noticed some discrepancies when using the /getTransactions, /lookupBlock, and /getBlockTransactions methods.

The /getTransactions method returns a transaction with a specific utime, but when I look up the block using /lookupBlock and then fetch the transactions using /getBlockTransactions, I can't find any transaction with the same logical time.

Is this expected behavior, or am I missing something?

Additionally, I would like to know the purpose of the "count" parameter in the /getBlockTransactions method, as it seems to have no effect on the results.

This question was imported from Telegram Chat: https://t.me/tondev_eng/1371

Posted one year ago
Votes Newest


The discrepancies you are experiencing with the TON API endpoints could be due to querying the incorrect workchain. The address UQCzwxqIw1pt41DND9pgGfAOhJKtQQEgjVcpn0rHxv-4b8Ob resides in the basechain (workchain=0), but you are looking for transactions in the masterchain (workchain=-1).

To find the correct transaction, follow these steps:

  1. Query the /getBlockTransactions endpoint with the correct workchain (workchain=0) and shard (-9223372036854775808) values:

This query should return the required transaction.

  1. If you still cannot find the transaction, retrieve all shards for the block you found using the /shards endpoint:

Then, for the block you found and for each shard, get the transactions list. You should find your transaction in the block with the following parameters: workchain=0, shard=-9223372036854775808, and seqno=21407484.

By querying the correct workchain and shard, you should be able to locate the transaction with the same logical time as initially given to the /getTransactions method.

Posted one year ago
Edited one year ago