use of org.bcos.web3j.abi.datatypes.Event in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method getAbiNotExistEvents.
public static List<AbiNotExistEventResponse> getAbiNotExistEvents(TransactionReceipt transactionReceipt) {
final Event event = new Event("AbiNotExist", Arrays.<TypeReference<?>>asList(), Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}, new TypeReference<Utf8String>() {
}));
List<EventValues> valueList = extractEventParameters(event, transactionReceipt);
ArrayList<AbiNotExistEventResponse> responses = new ArrayList<AbiNotExistEventResponse>(valueList.size());
for (EventValues eventValues : valueList) {
AbiNotExistEventResponse typedResponse = new AbiNotExistEventResponse();
typedResponse.cns_name = (Utf8String) eventValues.getNonIndexedValues().get(0);
typedResponse.contractname = (Utf8String) eventValues.getNonIndexedValues().get(1);
typedResponse.version = (Utf8String) eventValues.getNonIndexedValues().get(2);
responses.add(typedResponse);
}
return responses;
}
use of org.bcos.web3j.abi.datatypes.Event in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method updateAbiEventObservable.
public Observable<UpdateAbiEventResponse> updateAbiEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final Event event = new Event("UpdateAbi", 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, UpdateAbiEventResponse>() {
@Override
public UpdateAbiEventResponse call(Log log) {
EventValues eventValues = extractEventParameters(event, log);
UpdateAbiEventResponse typedResponse = new UpdateAbiEventResponse();
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.abi.datatypes.Event in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method getUpdateAbiEvents.
public static List<UpdateAbiEventResponse> getUpdateAbiEvents(TransactionReceipt transactionReceipt) {
final Event event = new Event("UpdateAbi", 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>() {
}));
List<EventValues> valueList = extractEventParameters(event, transactionReceipt);
ArrayList<UpdateAbiEventResponse> responses = new ArrayList<UpdateAbiEventResponse>(valueList.size());
for (EventValues eventValues : valueList) {
UpdateAbiEventResponse typedResponse = new UpdateAbiEventResponse();
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);
responses.add(typedResponse);
}
return responses;
}
use of org.bcos.web3j.abi.datatypes.Event in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method getAddOldAbiEvents.
public static List<AddOldAbiEventResponse> getAddOldAbiEvents(TransactionReceipt transactionReceipt) {
final Event event = new Event("AddOldAbi", 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>() {
}));
List<EventValues> valueList = extractEventParameters(event, transactionReceipt);
ArrayList<AddOldAbiEventResponse> responses = new ArrayList<AddOldAbiEventResponse>(valueList.size());
for (EventValues eventValues : valueList) {
AddOldAbiEventResponse typedResponse = new AddOldAbiEventResponse();
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);
responses.add(typedResponse);
}
return responses;
}
use of org.bcos.web3j.abi.datatypes.Event in project web3sdk by FISCO-BCOS.
the class ContractAbiMgr method getAddAbiEvents.
public static List<AddAbiEventResponse> getAddAbiEvents(TransactionReceipt transactionReceipt) {
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>() {
}));
List<EventValues> valueList = extractEventParameters(event, transactionReceipt);
ArrayList<AddAbiEventResponse> responses = new ArrayList<AddAbiEventResponse>(valueList.size());
for (EventValues eventValues : valueList) {
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);
responses.add(typedResponse);
}
return responses;
}
Aggregations