Insight v0.0.8-beta
A new version of Insight is released, focusing on bringing decoded data to the API and bug fixes to the indexing logic.
Added
Decoding for events and transactions in the API
Implemented functionality to decode event logs (supporting both indexed and non-indexed parameters) and transaction inputs whenever a query is made with. partial ABI.
For example, let's say we want to query all allocated withdrawal function calls on the TheCompact
contract (0x00000000000018DF021Ff2467dF97ff846E09f48
).
The partial ABI of the function is ((bytes,uint256,uint256,uint256,uint256,address))
, however the Insight API allows for named arguments, so we can use allocatedWithdrawal((bytes allocatorSignature,uint256 nonce,uint256 expires,uint256 id,uint256 amount,address recipient) _withdrawal)
We can do the following query to insight
curl 'https://1.insight.thirdweb.com/v1/:clientID/transactions/0x00000000000018DF021Ff2467dF97ff846E09f48/allocatedWithdrawal((bytes,uint256 nonce,uint256 expires,uint256 id,uint256 amount,address recipient) _withdrawal)'
and receive a response
{
"meta": {
"chain_id": 1,
"address": "0x00000000000018DF021Ff2467dF97ff846E09f48",
"signature": "0x27c777a9",
"page": 0,
"limit": 5,
"total_items": 1,
"total_pages": 0
},
"data": [
{
"chain_id": 1,
"hash": "0x8cd2145f99f11885c4136330ad1bb77555504f58bede20fc1f32f1ba12adcb53",
"nonce": 832,
"block_hash": "0xe6053a9f4e9ee63b37f174ece3938a46e1dd782dfefc55316e770134bfc59d60",
"block_number": 21131927,
"block_timestamp": 1730936111,
"transaction_index": 117,
"from_address": "0x0734d56da60852a03e2aafae8a36ffd8c12b32f1",
"to_address": "0x00000000000018df021ff2467df97ff846e09f48",
"value": 0,
"gas": 67401,
"gas_price": 15172764689,
"data": "0x27c777a9000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000007b00000000000000000000000000000000000000000000000000000000672c0c60302aafae8a36ffd8c12b32f1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000734d56da60852a03e2aafae8a36ffd8c12b32f10000000000000000000000000000000000000000000000000000000000000000",
"function_selector": "0x27c777a9",
"max_fee_per_gas": 28932060124,
"max_priority_fee_per_gas": 187296056,
"transaction_type": 2,
"r": 56974697277111379906610442563886472860956697825679089697101225017574199230150,
"s": 41080792507018916056596496103695262958288003493025956403880548103799170703734,
"v": 1,
"access_list_json": "[]",
"contract_address": null,
"gas_used": null,
"cumulative_gas_used": null,
"effective_gas_price": null,
"blob_gas_used": null,
"blob_gas_price": null,
"logs_bloom": null,
"status": null,
"decodedData": {
"name": "allocatedWithdrawal",
"signature": "allocatedWithdrawal((bytes,uint256,uint256,uint256,uint256,address))",
"inputs": {
"_withdrawal": {
"allocatorSignature": "",
"nonce": 123,
"expires": 1730940000,
"id": 21786436819914608908212656341824591317420268878283544900672692017070052737024,
"amount": 1000000000000000,
"recipient": "0x0734d56da60852a03e2aafae8a36ffd8c12b32f1"
}
}
}
}
]
}
The interesting part is the decodedData
property, which contains the decoded function input arguments
"decodedData": {
"name": "allocatedWithdrawal",
"signature": "allocatedWithdrawal((bytes,uint256,uint256,uint256,uint256,address))",
"inputs": {
"_withdrawal": {
"allocatorSignature": "",
"nonce": 123,
"expires": 1730940000,
"id": 21786436819914608908212656341824591317420268878283544900672692017070052737024,
"amount": 1000000000000000,
"recipient": "0x0734d56da60852a03e2aafae8a36ffd8c12b32f1"
}
}
}
Bug fixes
- Poller gap filling uses configured poll range - Introduced a limit on polling missing blocks, based on `blocksPerPoll` configuration instead of the whole missing range.
- Fixed signature calculation for partial ABI - Fixed a bug where various uint types in the partial ABI resulted in an incorrect signature
- Fixed nullpointer exception when checking if polling limit is reached
- Clickhouse delete performance - Updated to use lightweight deletes instead when handling reorgs, to reduce load on the DB
Learn more about Insight and how to use it.
Insight is open source.