Search in sources :

Example 1 with TransactionDecoder

use of org.fisco.bcos.web3j.tx.txdecode.TransactionDecoder in project web3sdk by FISCO-BCOS.

the class Contract method registerEventLogPushFilter.

public void registerEventLogPushFilter(String abi, String bin, String topic0, String fromBlock, String toBlock, List<String> otherTopics, EventLogPushWithDecodeCallback callback) {
    EventLogUserParams filter = new EventLogUserParams();
    filter.setFromBlock(fromBlock);
    filter.setToBlock(toBlock);
    List<String> addresses = new ArrayList<String>();
    addresses.add(getContractAddress());
    filter.setAddresses(addresses);
    List<Object> topics = new ArrayList<Object>();
    topics.add(topic0);
    if (otherTopics != null) {
        for (Object obj : otherTopics) {
            topics.add(obj);
        }
    }
    filter.setTopics(topics);
    TransactionDecoder decoder = new TransactionDecoder(abi, bin);
    this.registerEventLogPushFilter(decoder, filter, callback);
}
Also used : EventLogUserParams(org.fisco.bcos.channel.event.filter.EventLogUserParams) ArrayList(java.util.ArrayList) TransactionDecoder(org.fisco.bcos.web3j.tx.txdecode.TransactionDecoder)

Aggregations

ArrayList (java.util.ArrayList)1 EventLogUserParams (org.fisco.bcos.channel.event.filter.EventLogUserParams)1 TransactionDecoder (org.fisco.bcos.web3j.tx.txdecode.TransactionDecoder)1