| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.reactivex.Flowable; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.OkHttpClient; |
| | | import org.springframework.data.repository.query.ParameterOutOfBoundsException; |
| | | import org.web3j.crypto.Credentials; |
| | | import org.web3j.protocol.Web3j; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * @author |
| | |
| | | |
| | | private static EthUsdtContract contract(String privateKey, String contractAddress, String url) { |
| | | Credentials credentials = Credentials.create(privateKey); |
| | | return EthUsdtContract.load(contractAddress, Web3j.build(new HttpService(url)), credentials, new StaticGasProvider(BigInteger.valueOf(4500000L), BigInteger.valueOf(200000L))); |
| | | return EthUsdtContract.load(contractAddress, |
| | | Web3j.build(new HttpService(url, new OkHttpClient().newBuilder() |
| | | .connectTimeout(100, TimeUnit.SECONDS) |
| | | .writeTimeout(100, TimeUnit.SECONDS) |
| | | .readTimeout(100, TimeUnit.SECONDS) |
| | | .build())), |
| | | credentials, |
| | | new StaticGasProvider(BigInteger.valueOf(4500000L), BigInteger.valueOf(200000L))); |
| | | } |
| | | |
| | | private static EthFilter getFilter(BigInteger startBlock, String contractAddress) { |