use of org.bcos.web3j.protocol.core.methods.response.Log in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method addAbiEventObservable.
public Observable<AddAbiEventResponse> addAbiEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("AddAbi", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<Address>() {
}, new TypeReference<Uint256>() {
}, new TypeReference<Uint256>() {
}));
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(event));
return web3j.ethLogObservable(filter).map(new Func1<Log, AddAbiEventResponse>() {
@Override
public AddAbiEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
AddAbiEventResponse typedResponse = new AddAbiEventResponse();
typedResponse.cns_name = (Utf8String) eventValues.getNonIndexedValues().get(0);
typedResponse.contractname = (Utf8String) eventValues.getNonIndexedValues().get(1);
typedResponse.version = (Utf8String) eventValues.getNonIndexedValues().get(2);
typedResponse.abi = (Utf8String) eventValues.getNonIndexedValues().get(3);
typedResponse.addr = (Address) eventValues.getNonIndexedValues().get(4);
typedResponse.blocknumber = (Uint256) eventValues.getNonIndexedValues().get(5);
typedResponse.timestamp = (Uint256) eventValues.getNonIndexedValues().get(6);
return typedResponse;
}
});
}
use of org.bcos.web3j.protocol.core.methods.response.Log in project web3sdk by FISCO-BCOS.
the class FileInfoManager method notifyEventObservable.
public Observable<NotifyEventResponse> notifyEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("Notify", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {
}, new TypeReference<Utf8String>() {
}));
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(event));
return web3j.ethLogObservable(filter).map(new Func1<Log, NotifyEventResponse>() {
@Override
public NotifyEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
NotifyEventResponse typedResponse = new NotifyEventResponse();
typedResponse._errno = (Uint256) eventValues.getNonIndexedValues().get(0);
typedResponse._info = (Utf8String) eventValues.getNonIndexedValues().get(1);
return typedResponse;
}
});
}
use of org.bcos.web3j.protocol.core.methods.response.Log in project web3sdk by FISCO-BCOS.
the class FileServerManager method notifyEventObservable.
public Observable<NotifyEventResponse> notifyEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("Notify", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {
}, new TypeReference<Utf8String>() {
}));
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(event));
return web3j.ethLogObservable(filter).map(new Func1<Log, NotifyEventResponse>() {
@Override
public NotifyEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
NotifyEventResponse typedResponse = new NotifyEventResponse();
typedResponse._errno = (Uint256) eventValues.getNonIndexedValues().get(0);
typedResponse._info = (Utf8String) eventValues.getNonIndexedValues().get(1);
return typedResponse;
}
});
}
use of org.bcos.web3j.protocol.core.methods.response.Log in project web3sdk by FISCO-BCOS.
the class NodeAction method logMessageEventObservable.
public Observable<LogMessageEventResponse> logMessageEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("LogMessage", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
}, new TypeReference<Uint256>() {
}, new TypeReference<Utf8String>() {
}));
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(event));
return web3j.ethLogObservable(filter).map(new Func1<Log, LogMessageEventResponse>() {
@Override
public LogMessageEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
LogMessageEventResponse typedResponse = new LogMessageEventResponse();
typedResponse.addr = (Address) eventValues.getNonIndexedValues().get(0);
typedResponse.code = (Uint256) eventValues.getNonIndexedValues().get(1);
typedResponse.msg = (Utf8String) eventValues.getNonIndexedValues().get(2);
return typedResponse;
}
});
}
use of org.bcos.web3j.protocol.core.methods.response.Log in project web3sdk by FISCO-BCOS.
the class NodeAction method logMessageEventObservable.
public Observable<LogMessageEventResponse> logMessageEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("LogMessage", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {
}, new TypeReference<Uint256>() {
}, new TypeReference<Utf8String>() {
}));
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(event));
return web3j.ethLogObservable(filter).map(new Func1<Log, LogMessageEventResponse>() {
@Override
public LogMessageEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
LogMessageEventResponse typedResponse = new LogMessageEventResponse();
typedResponse.addr = (Address) eventValues.getNonIndexedValues().get(0);
typedResponse.code = (Uint256) eventValues.getNonIndexedValues().get(1);
typedResponse.msg = (Utf8String) eventValues.getNonIndexedValues().get(2);
return typedResponse;
}
});
}
Aggregations