| | |
| | | import io.reactivex.Flowable; |
| | | import io.reactivex.functions.Function; |
| | | import org.web3j.abi.EventEncoder; |
| | | import org.web3j.abi.EventValues; |
| | | import org.web3j.abi.FunctionReturnDecoder; |
| | | import org.web3j.abi.TypeReference; |
| | | import org.web3j.abi.datatypes.*; |
| | | import org.web3j.abi.datatypes.generated.Uint256; |
| | |
| | | typedResponse.coinTarget = (BigInteger) eventValues.getNonIndexedValues().get(4).getValue(); |
| | | typedResponse.usdtCoin = (BigInteger) eventValues.getNonIndexedValues().get(5).getValue(); |
| | | typedResponse.lastMineTime = (BigInteger) eventValues.getNonIndexedValues().get(6).getValue(); |
| | | typedResponse.blockHash = log.getTransactionHash(); |
| | | } |
| | | |
| | | return typedResponse; |
| | |
| | | |
| | | public Flowable<CoinRewardEventResponse> coinRewardEventFlowable(DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) { |
| | | EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress()); |
| | | filter.addSingleTopic(EventEncoder.encode(TRANSFER_EVENT)); |
| | | filter.addSingleTopic(EventEncoder.encode(COINREWARD_EVENT)); |
| | | return coinRewardEventFlowable(filter); |
| | | } |
| | | |
| | |
| | | public BigInteger coinTarget;//币本位多少币 |
| | | public BigInteger usdtCoin;//金本位换算后多少币 |
| | | public BigInteger lastMineTime;//上一次挖矿时间 |
| | | public String blockHash;//上一次挖矿时间 |
| | | } |
| | | } |