you_getLogs

描述:返回指定过滤器中的所有日志,如获取合约事件的日志。

parameter

Object - 过滤器对象,参考 you_newFilter 调用的参数

"params": [
        {
            "fromBlock": "0x1",
            "address": "0xcF9F5007AA1A9ae7b8092DBE3E12B3B97fD5b18D",
            "topics": [
                "0xa3c155334a3d6a20244e2ffa767f9d0f580b2aa45c8c109a32994c2ca6b1ae56",
                "0x00000000000000000000000059677fd68ec54e43ad4319d915f81748b5a6ff8b",
                "0x00000000000000000000000059677fd68ec54e43ad4319d915f81748b5a6ff8b"
            ]
        }
    ]

return

请参阅 you_getFilterChanges

example

Request:

curl -X POST \
  http://127.0.0.1:8283 \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "you_getLogs",
    "params": [
        {
            "fromBlock": "0x1",
            "address": "0xdE92c35b541B1D0208707D96C577831eac9C6ca9", // 合约地址
            "topics": []
        }
    ]
}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "address": "0xdE92c35b541B1D0208707D96C577831eac9C6ca9",
            "topics": [
                "0x3e238cd42ac2d6f8cb4448b4a931fd3bbd6f1088c845eec9c9daef375f6c908c"
            ],
            "data": "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003",
            "blockNumber": "0x15bb9d",
            "transactionHash": "0x2e0b68384cff7687ed949d10be9115c1d15a81b585811f5f32ee0a161a2c4cfc",
            "transactionIndex": "0x2",
            "blockHash": "0xb487d0e1107f07aaeadc0b86e8461d09b18fa3177e63dfab9fe0f1268d6732ae",
            "logIndex": "0x0",
            "removed": false
        }
    ]
}