fix
Helius
2022-08-05 9b18757c8e9716fb2797f732eeca25b1ad7e89e7
fix
1 files modified
11 ■■■■■ changed files
src/main/java/cc/mrbird/febs/dapp/chain/ChainService.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/chain/ChainService.java
@@ -6,6 +6,7 @@
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;
@@ -23,6 +24,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
 * @author
@@ -82,7 +84,14 @@
    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) {