org.bcos.web3j.protocol.Service Maven / Gradle / Ivy
package org.bcos.web3j.protocol;
import java.util.concurrent.CompletableFuture;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.bcos.web3j.protocol.core.Request;
import org.bcos.web3j.protocol.core.Response;
import org.bcos.web3j.utils.Async;
/**
* Base service implementation.
*/
public abstract class Service implements Web3jService {
protected final ObjectMapper objectMapper;
public Service(boolean includeRawResponses) {
objectMapper = ObjectMapperFactory.getObjectMapper(includeRawResponses);
}
@Override
public CompletableFuture sendAsync(
Request jsonRpc20Request, Class responseType) {
return Async.run(() -> send(jsonRpc20Request, responseType));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy