get https://example.com
Xlayer API - Polling method for a filter, which returns an array of logs which occurred since last poll.
Parameters
- QUANTITY - the filter id.
params: ["0x0700000000000000bf0b1f4b27e765fb"];
Returns
Array - Array of log objects, or an empty array if nothing has changed since last poll.
- For filters created with eth_newBlockFilter the return are block hashes (DATA, 32 Bytes), e.g. ["0x3454645634534..."].
- For filters created with eth_newPendingTransactionFilter the return are transaction hashes (DATA, 32 Bytes), e.g. ["0x6345343454645..."].
- For filters created with eth_newFilter logs are objects with following params:
- removed: TAG - true when the log was removed, due to a chain reorganization. false if its a valid log.
- logIndex: QUANTITY - integer of the log index position in the block. null when its pending log.
- transactionIndex: QUANTITY - integer of the transactions index position log was created from. null when its pending log.
- transactionHash: DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log.
- blockHash: DATA, 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.
- blockNumber: QUANTITY - the block number where this log was in. null when its pending. null when its pending log.
- address: DATA, 20 Bytes - address from which this log originated.
- data: DATA - contains one or more 32 Bytes non-indexed arguments of the log.
- topics: Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments.
- In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier.
Example
Request
curl https://xlayer-mainnet.unifra.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0x0700000000000000bf0b1f4b27e765fb"],"id":0}'
URL: https://xlayer-mainnet.unifra.io/v1/your-api-key
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"eth_getFilterChanges",
"params":["0x0700000000000000bf0b1f4b27e765fb"],
"id":0
}
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": [
{
"address": "0x2ef3723bb09c311d035334b11614efadbd0d7a24",
"topics": [
"0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"
],
"data": "0x00000000000000000000000000000000000000000014e2d0289430ca83a5a87c00000000000000000000000000000000000000000000002da4d39afc5502abde",
"blockNumber": "0x226f00c",
"transactionHash": "0xb8022d8e6a222d533724c5578f79d178f9336947163f5588c39f0d47a202398a",
"transactionIndex": "0xd",
"blockHash": "0xf77c0bf19dc0e8d15f123782cc970358c18da8273c7fef3487c98a46e31de294",
"logIndex": "0xe",
"removed": false
},
{
"address": "0x2ef3723bb09c311d035334b11614efadbd0d7a24",
"topics": [
"0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",
"0x000000000000000000000000881fb2f98c13d521009464e7d1cbf16e1b394e8e",
"0x0000000000000000000000007e3d9de93fcdf6e57881bcbbb577956c78d13db7"
],
"data": "0x0000000000000000000000000000000000000000000001a668f8babce18900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003991a81dc730771",
"blockNumber": "0x226f00c",
"transactionHash": "0xb8022d8e6a222d533724c5578f79d178f9336947163f5588c39f0d47a202398a",
"transactionIndex": "0xd",
"blockHash": "0xf77c0bf19dc0e8d15f123782cc970358c18da8273c7fef3487c98a46e31de294",
"logIndex": "0xf",
"removed": false
},
{
"address": "0x2ef3723bb09c311d035334b11614efadbd0d7a24",
"topics": [
"0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",
"0x000000000000000000000000881fb2f98c13d521009464e7d1cbf16e1b394e8e",
"0x0000000000000000000000007e3d9de93fcdf6e57881bcbbb577956c78d13db7"
],
"data": "0x0000000000000000000000000000000000000000000000163b6b6824e37300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000307ea940d60691",
"blockNumber": "0x226f00c",
"transactionHash": "0xb8022d8e6a222d533724c5578f79d178f9336947163f5588c39f0d47a202398a",
"transactionIndex": "0xd",
"blockHash": "0xf77c0bf19dc0e8d15f123782cc970358c18da8273c7fef3487c98a46e31de294",
"logIndex": "0x1a",
"removed": false
}
]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": [
"0x16dbc05abfee35e1b7fd796970963e3482f16f4f7b83fb99e4324fe146e5fd54",
"0xd4ffe0ed71943aca5673c0b6e15e08306d2e02052a803809337626332e307e89",
"0x0f8b07d61b63fd804b48f21b3adfca18bd6f52f1a3de60f54799087d35819940",
"0x92e251204400ed18d2e10bc3d8e5d2efb592c58c61e2f9180b191a3f6a6722cb",
"0xa294b5db625d33718156f65827fe9accb367e53cb8973ee5ad01a0c1b678e45a",
"0xf835e3ccb433a8a3b3a3fb5048a5a4c871bb7b123f79e4602d888b36c2a45cdf",
"0x4a9c51cca86f77190152619e213519d9eb180b591ca0c55f07a3ef5ee46e75a7",
"0x6fa0d8cd7b296638bcea987bc3622bd9c621e2457043ba80375bba31ab85ed8e",
"0xae8e9c76d03743950f92afa5483a1bcb2a1625c7e0a95feea8bb84a013c316e5",
"0x0e43ad970b79414a78ff22186a5ad0e7659c3f1d28f013251af0235c94b021dd",
"0x6d07a64f0ce7b04d5df74d2ef766ee4e9c92dfe3eaca77226f142c5d4bf478c3",
"0x2700b112137a340d9e3499bfce49cf0d1b3471e6ed3a49eb6d7a6c928e63dd74"
]
}