| | |
| | | }); |
| | | } |
| | | |
| | | public Flowable<TransferEventResponse> transferEventFlowable(Web3j web3j, EthFilter filter) { |
| | | return web3j.ethLogFlowable(filter).map(new Function<Log, TransferEventResponse>() { |
| | | @Override |
| | | public TransferEventResponse apply(Log log) { |
| | | EventValuesWithLog eventValues = extractEventParametersWithLog(TRANSFER_EVENT, log); |
| | | TransferEventResponse typedResponse = new TransferEventResponse(); |
| | | if(eventValues!=null){ |
| | | typedResponse.log = log; |
| | | typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue(); |
| | | typedResponse.to = (String) eventValues.getIndexedValues().get(1).getValue(); |
| | | typedResponse.tokens = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); |
| | | } |
| | | |
| | | return typedResponse; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public Flowable<TransferEventResponse> transferEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { |
| | | EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); |
| | | filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); |