Transactions
Note: With GraphQL API 1.0 migration by default Blockchain API provides blocks, transactions and messages data only for the past 7 days. For use cases where earlier data is needed make sure to use the archive: true
flag in blockchain
query filters.
Get transaction info by hash
Result:
Get transaction by inbound message hash
Result:
Calculate account fees for transaction
You need to sum up these values to get the total fee the account paid for the transaction
Paginate blockchain transactions
Paginate workchain transactions within masterchain seqNo range, sorted by blockchain logical time.
Look at this sample. See the parameters documentation below.
Result:
Filter parameters
You can filter by
master_seq_no_range
: BlockchainMasterSeqNoFilter - Everscale is sharded blockchain, you need paginate within masterchain seqNo range, where your workchain blocks were commited.workchain
: Int - optional, if you want to filter by workchain. If ommited, queries all workchains data.max_balance_delta
: Stringmin_balance_delta
: Stringallow_latest_inconsistent_data
: Boolean - false by default. If you need to have less latency over consistency, you can get the latest data in realtime, but may miss some data. If you need reliable reads, then specify as false.
Pagination parameters
Use cursor
, {first
, after
} or {last
, before
} filters for pagination.
We followed GraphQL best practices and implemented Relay Cursor Connections Specification for pagination for all list types. You can read more here https://relay.dev/graphql/connections.htm
How to paginate by time range
If you do not know the seq_no
of masterchain blocks to create a range you can first obtain it by the time range, and then implement pagination the same way as described above.
To get the seq_no
range by time rage do this query:
In the result you will get the required seq_no range.
Attention! Specifying timestamp range does not mean that there will be no blocks outside this range in the result set: this happens because some thread blocks that were generated outside this time range were committed to masterchain block generated within this time range. But anyway, this pagination allows us to get all blocks in a handy manner, these time deltas are very small and not significant and can be ignored.
Use startCursor
and hasPreviousPage
== true condition to paginate backwards like this:
Result:
Get the number of transactions in a specified shard over a period of time.
Here we specify the only shard of "-1" workchain and time from 18.43 till 19.43. You can do the same for any shard of "0" workchain.
Result:
Last updated