cita-sdk-js 监听事件 问题

我的solidity合约事件如下:

image
image.png686x772 31.2 KB

我用 nervosj 代码监听 ContractInstantiation 事件代码如下:

Event event = new Event("ContractInstantiation",
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}),
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        final AppFilter filter = new AppFilter(DefaultBlockParameterName.EARLIEST,
                DefaultBlockParameterName.LATEST, contractAddress);
        org.nervos.appchain.protocol.core.methods.response.AppFilter responseFilter
                = service.appNewFilter(filter).send();
        String filterId = responseFilter.getFilterId().toString();

        System.out.println("Filter Id for new filter: " + filterId);
        System.out.println("\nget history logs by \"getFilterLogs\"");
        List<ContractInstantiationEventResponse> list = getFilterLogs(event, filter);
        for (ContractInstantiationEventResponse response : list) {
            System.out.println("indexedValue: " + response.indexedValue
                    + " nonIndexedValue: " + response.nonIndexedValue);
        }
        List<ContractInstantiationEventResponse> responses = getFilterChanges(event, filterId);
        for (ContractInstantiationEventResponse response : responses) {
            System.out.println("indexedValue: " + response.indexedValue
                    + " nonIndexedValue: " + response.nonIndexedValue);
        }

问题:代码中 new Event(name,indexedParameters,nonIndexedParameters) 的indexedParameters、nonIndexedParameters是指什么啊,对应我的ContractInstantiation事件该传入怎样的indexedParameters、nonIndexedParameters呢?

https://solidity.readthedocs.io/en/v0.4.24/contracts.html#events

Up to three parameters can receive the attribute indexed which will cause the respective arguments to be searched for: It is possible to filter for specific values of indexed arguments in the user interface.

同问,有没有直接点的例子做说明?

@ChenYu, 我们有更详细的关于 Event 的用法吗?

这里用的好像是 Java 的 SDK

@DuanYangyang 请屈臣氏同学帮忙看看

可以参考这个例子