shh_newFilter,当客户端收到与过滤器选项匹配的whisper消息时,创建过滤器来通知。
参数
Object - 过滤器操作:
to: DATA, 60 Bytes - (可选)接收者的身份。如果客户端拥有该身份的私钥,它将尝试解密任何传入的消息。
topics: Array of DATA - 传入消息的主题应与之匹配的DATA主题数组。你可以使用以下组合:
[A, B] = A && B
[A, [B, C]] = A && (B || C)
[null, A, B] = ANYTHING && A && B null works as a wildcard
params: [{ "topics": ['0x12341234bf4b564f'], "to": "0x04f96a5e25610293e42a73908e93ccc8c4d4dc0edcfa9fa872f50cb214e08ebf61a03e245533f97284d442460f2998cd41858798ddfd4d661997d3940272b717b1" }]
返回
- QUANTITY - 新创建的过滤器.
例子
// Request
curl -X POST --data '{"jsonrpc":"2.0","method":"shh_newFilter","params":[{"topics": ['0x12341234bf4b564f'],"to": "0x2341234bf4b2341234bf4b564f..."}],"id":73}'
// Result
{
"id":1,
"jsonrpc":"2.0",
"result": "0x7" // 7
}