Java Code Examples for org.web3j.protocol.core.methods.request.EthFilter#addSingleTopic()
The following examples show how to use
org.web3j.protocol.core.methods.request.EthFilter#addSingleTopic() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ENS.java From etherscan-explorer with GNU General Public License v3.0 | 6 votes |
public Observable<NewOwnerEventResponse> newOwnerEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { final Event event = new Event("NewOwner", Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}, new TypeReference<Bytes32>() {}), Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {})); EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(event)); return web3j.ethLogObservable(filter).map(new Func1<Log, NewOwnerEventResponse>() { @Override public NewOwnerEventResponse call(Log log) { EventValues eventValues = extractEventParameters(event, log); NewOwnerEventResponse typedResponse = new NewOwnerEventResponse(); typedResponse.node = (byte[]) eventValues.getIndexedValues().get(0).getValue(); typedResponse.label = (byte[]) eventValues.getIndexedValues().get(1).getValue(); typedResponse.owner = (String) eventValues.getNonIndexedValues().get(0).getValue(); return typedResponse; } }); }
Example 2
Source File: PublicResolver.java From etherscan-explorer with GNU General Public License v3.0 | 6 votes |
public Observable<ABIChangedEventResponse> aBIChangedEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { final Event event = new Event("ABIChanged", Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}, new TypeReference<Uint256>() {}), Arrays.<TypeReference<?>>asList()); EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(event)); return web3j.ethLogObservable(filter).map(new Func1<Log, ABIChangedEventResponse>() { @Override public ABIChangedEventResponse call(Log log) { EventValues eventValues = extractEventParameters(event, log); ABIChangedEventResponse typedResponse = new ABIChangedEventResponse(); typedResponse.node = (byte[]) eventValues.getIndexedValues().get(0).getValue(); typedResponse.contentType = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); return typedResponse; } }); }
Example 3
Source File: EventFilterIT.java From web3j with Apache License 2.0 | 5 votes |
private List<EthLog.LogResult> createFilterForEvent( String encodedEventSignature, String contractAddress) throws Exception { EthFilter ethFilter = new EthFilter( DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, contractAddress); ethFilter.addSingleTopic(encodedEventSignature); EthLog ethLog = web3j.ethGetLogs(ethFilter).send(); return ethLog.getLogs(); }
Example 4
Source File: EventFilterIT.java From etherscan-explorer with GNU General Public License v3.0 | 5 votes |
private List<EthLog.LogResult> createFilterForEvent( String encodedEventSignature, String contractAddress) throws Exception { EthFilter ethFilter = new EthFilter( DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, contractAddress ); ethFilter.addSingleTopic(encodedEventSignature); EthLog ethLog = web3j.ethGetLogs(ethFilter).send(); return ethLog.getLogs(); }
Example 5
Source File: SimpleAuction.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<HighestBidIncreasedEventResponse> highestBidIncreasedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(HIGHESTBIDINCREASED_EVENT)); return highestBidIncreasedEventFlowable(filter); }
Example 6
Source File: EventEmitter.java From eventeum with Apache License 2.0 | 4 votes |
public Flowable<DummyEventEventResponse> dummyEventEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(DUMMYEVENT_EVENT)); return dummyEventEventFlowable(filter); }
Example 7
Source File: ENS.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<NewOwnerEventResponse> newOwnerEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(NEWOWNER_EVENT)); return newOwnerEventFlowable(filter); }
Example 8
Source File: Purchase.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<ItemReceivedEventResponse> itemReceivedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(ITEMRECEIVED_EVENT)); return itemReceivedEventFlowable(filter); }
Example 9
Source File: PublicResolver.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<NameChangedEventResponse> nameChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(NAMECHANGED_EVENT)); return nameChangedEventFlowable(filter); }
Example 10
Source File: PublicResolver.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<PubkeyChangedEventResponse> pubkeyChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(PUBKEYCHANGED_EVENT)); return pubkeyChangedEventFlowable(filter); }
Example 11
Source File: PublicResolver.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<TextChangedEventResponse> textChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(TEXTCHANGED_EVENT)); return textChangedEventFlowable(filter); }
Example 12
Source File: Fibonacci.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<NotifyEventResponse> notifyEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(NOTIFY_EVENT)); return notifyEventFlowable(filter); }
Example 13
Source File: ERC20.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); return transferEventFlowable(filter); }
Example 14
Source File: ERC721.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); return transferEventFlowable(filter); }
Example 15
Source File: PublicResolver.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<ABIChangedEventResponse> aBIChangedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(ABICHANGED_EVENT)); return aBIChangedEventFlowable(filter); }
Example 16
Source File: Fibonacci.java From etherscan-explorer with GNU General Public License v3.0 | 4 votes |
public Observable<NotifyEventResponse> notifyEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(NOTIFY_EVENT)); return notifyEventObservable(filter); }
Example 17
Source File: ENS.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<NewResolverEventResponse> newResolverEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(NEWRESOLVER_EVENT)); return newResolverEventFlowable(filter); }
Example 18
Source File: HumanStandardToken.java From etherscan-explorer with GNU General Public License v3.0 | 4 votes |
public Observable<TransferEventResponse> transferEventObservable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); return transferEventObservable(filter); }
Example 19
Source File: HumanStandardToken.java From web3j-quorum with Apache License 2.0 | 4 votes |
public Flowable<ApprovalEventResponse> approvalEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(APPROVAL_EVENT)); return approvalEventFlowable(filter); }
Example 20
Source File: Purchase.java From web3j with Apache License 2.0 | 4 votes |
public Flowable<AbortedEventResponse> abortedEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); filter.addSingleTopic(EventEncoder.encode(ABORTED_EVENT)); return abortedEventFlowable(filter); }