gen, Function super HexData, T> conv) {
+ return split(size, 0, gen, conv);
+ }
+
+ /**
+ * Returns an array of {@link HexData} were split by required {@code size}
+ * bytes and from {@code offset}.
+ *
+ * @param size a size in bytes to split by
+ * @param offset an offset in bytes to split from
+ * @return an array of split hex data
+ * @throws IllegalArgumentException if the summary length to split
+ * is not a multiple of given {@code size}
+ * @see #split(int)
+ */
+ public HexData[] split(int size, int offset) {
+ return split(size, offset, HexData[]::new, Function.identity());
+ }
+
+ /**
+ * Returns an array of {@link Hex32} by splitting the value bytes starting from {@code offset}.
+ *
+ * @param offset an offset in bytes to split from
+ * @return an array of split 32-bytes data
+ * @throws IllegalArgumentException if the summary length to split
+ * is not a multiple of given {@code size}
+ * @see #split32()
+ */
+ public Hex32[] split32(int offset) {
+ return split(Hex32.SIZE_BYTES, offset, Hex32[]::new, v -> Hex32.from(v.value));
+ }
+
+ /**
+ * Returns an array of the elements were split by required {@code size}
+ * bytes and from {@code offset}, using the provided {@code conv}
+ * function to convert {@link HexData} into required object type.
+ *
+ * {@code
+ * List coll = data.split(32, 0, String[]::new, data::toHex);
+ * }
+ *
+ * @param size a size in bytes to split by
+ * @param offset an offset in bytes to split from
+ * @param gen a function which produces a new array of the desired
+ * type and the provided length
+ * @param conv a converter from hex data into required object type
+ * @param the element type of the resulting array
+ * @return an array of split type instances
+ * @throws IllegalArgumentException if the summary length to split
+ * is not a multiple of given {@code size}
+ * @see #split(int, IntFunction, Function)
+ */
+ public T[] split(int size, int offset, IntFunction gen, Function super HexData, T> conv) {
+ Objects.requireNonNull(conv);
+
+ if (size < 0 || offset < 0)
+ throw new IllegalArgumentException("Negative extract arguments");
+
+ if (getSize() < offset)
+ throw new IllegalArgumentException("Insufficient size to extract");
+
+ if (size != 0 && (getSize() - offset) % size != 0)
+ throw new IllegalArgumentException("Length to split is not a multiple of " + size);
+
+ if (size == 0)
+ return gen.apply(0);
+
+ Stream stream = IntStream.range(0, (getSize() - offset) / size)
+ .map(i -> i * size + offset).mapToObj(j -> Arrays.copyOfRange(value, j, j + size));
+
+ return stream.map(HexData::new).map(conv::apply).toArray(gen);
+ }
+
+ public String toHex() {
+ char[] hex = new char[value.length * 2 + 2];
+
+ hex[0] = '0';
+ hex[1] = 'x';
+
+ for(int i = 0, j = 2; i < value.length; i++){
+ hex[j++] = HEX_DIGITS[(0xF0 & value[i]) >>> 4];
+ hex[j++] = HEX_DIGITS[0x0F & value[i]];
+ }
+
+ return new String(hex);
+ }
+
+ public HexQuantity asQuantity() {
+ return new HexQuantity(new BigInteger(1, value));
+ }
+
+ /**
+ * Try to extract an array of Hex32 packed into the value. The array is encoded with 32 bytes of offset
+ * value, 32 bytes of length and following items.
+ *
+ * @return array of values
+ * @throws IllegalArgumentException if invalid structure or length
+ */
+ public Hex32[] asEncodedArray() {
+ HexData[] parts = split(Hex32.SIZE_BYTES);
+ if (parts.length < 2) {
+ throw new IllegalArgumentException("Not an encoded array");
+ }
+ Hex32 _offset = Hex32.from(parts[0]);
+ int len = parts[1].asQuantity().getValue().intValue();
+ if (parts.length != 2 + len) {
+ throw new IllegalArgumentException("Invalid data length. " + parts.length + " != " + (2 + len));
+ }
+ Hex32[] result = new Hex32[len];
+ for (int i = 0; i < len; i++) {
+ result[i] = Hex32.from(parts[2 + i]);
+ }
+ return result;
+ }
+
+ /**
+ * Try to extract an array of <T> packed into the value. The array is encoded with 32 bytes of offset
+ * value, 32 bytes of length and following items.
+ *
+ * The conversion function must extract actual value (ex. an Address, or Number) from the Hex32 representation.
+ *
+ * @param converter conversion function to extract actual value
+ * @param target type
+ * @return array of values
+ * @throws IllegalArgumentException if invalid structure or length
+ */
+ @SuppressWarnings("unchecked")
+ public T[] asEncodedArray(Function converter) {
+ Hex32[] values = asEncodedArray();
+ return (T[]) Arrays.stream(values).map(converter).toArray();
+ }
+
+ public String toString() {
+ return toHex();
+ }
+
+ public byte[] getBytes() {
+ return value.clone();
+ }
+
+ public int getSize() {
+ return value.length;
+ }
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(value);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null) return false;
+ if (!(o instanceof HexData)) return false;
+
+ HexData hexData = (HexData) o;
+
+ return Arrays.equals(value, hexData.value);
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexDataComparator.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexDataComparator.java
new file mode 100644
index 000000000..c4379a87b
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexDataComparator.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2021 EmeraldPay Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.hex;
+
+import java.util.Comparator;
+
+public class HexDataComparator implements Comparator {
+
+ @Override
+ public int compare(HexData o1, HexData o2) {
+ if (o1.getSize() != o2.getSize()) {
+ throw new IllegalArgumentException("Cannot compare HexData with different lengths. " + o1.getSize() + " and " + o2.getSize());
+ }
+ byte[] val1 = o1.getBytes();
+ byte[] val2 = o2.getBytes();
+ for (int i = 0; i < val1.length; i++) {
+ if (val1[i] < val2[i]) {
+ return -1;
+ }
+ if (val1[i] > val2[i]) {
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexEncoding.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexEncoding.java
new file mode 100644
index 000000000..9b95e0db7
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexEncoding.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved.
+ * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.emeraldpay.dshackle.upstream.ethereum.hex;
+
+import java.math.BigInteger;
+
+/**
+ * Hex-encoded {@link String} for {@link BigInteger} instances.
+ */
+public interface HexEncoding {
+
+ /**
+ * The prefix used for non naked hex encoding format.
+ *
+ * @see #toHex(long)
+ * @see #toHex(BigInteger)
+ */
+ String HEX_PREFIX = "0x";
+
+ /**
+ * @param hex hex-encoded {@link String} with optional {@value #HEX_PREFIX}
+ * @return {@link BigInteger} instance
+ * @see #HEX_PREFIX
+ */
+ static BigInteger fromHex(String hex) {
+ return new BigInteger(
+ hex.startsWith(HEX_PREFIX) ?
+ hex.substring(HEX_PREFIX.length()) : hex, 16);
+ }
+
+ /**
+ * @param val a long value
+ * @return Hex-encoded {@link String} with {@value #HEX_PREFIX}
+ * and padded with zero to an even number of digits
+ * @see #HEX_PREFIX
+ */
+ static String toHex(long val) {
+ String str = toNakedHex(val);
+
+ return HEX_PREFIX.concat(str.length() % 2 == 0 ? "" : "0").concat(str);
+ }
+
+ /**
+ * @param num {@link BigInteger} instance
+ * @return Hex-encoded {@link String} with {@value #HEX_PREFIX}
+ * and padded with zero to an even number of digits
+ * @see #HEX_PREFIX
+ */
+ static String toHex(BigInteger num) {
+ String str = toNakedHex(num);
+
+ return HEX_PREFIX.concat(str.length() % 2 == 0 ? "" : "0").concat(str);
+ }
+
+ /**
+ * @param val a long value
+ * @return Naked hex-encoded {@link String} without {@value #HEX_PREFIX}
+ * @see #toHex(long)
+ */
+ static String toNakedHex(long val) {
+ return Long.toHexString(val);
+ }
+
+ /**
+ * @param num {@link BigInteger} instance
+ * @return Naked hex-encoded {@link String} without {@value #HEX_PREFIX}
+ * @see #toHex(BigInteger)
+ */
+ static String toNakedHex(BigInteger num) {
+ return num.toString(16);
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexQuantity.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexQuantity.java
new file mode 100644
index 000000000..8e725773b
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/hex/HexQuantity.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.hex;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.util.Objects;
+
+public class HexQuantity implements Serializable {
+
+ private final BigInteger value;
+
+ public HexQuantity(BigInteger value) {
+ if (value == null) {
+ throw new IllegalArgumentException("Can't create instance of null quantity");
+ }
+ this.value = value;
+ }
+
+ public static HexQuantity from(Long value) {
+ if (value == null) {
+ return null;
+ }
+ return new HexQuantity(BigInteger.valueOf(value));
+ }
+
+ public static HexQuantity from(BigInteger value) {
+ if (value == null) {
+ return null;
+ }
+ return new HexQuantity(value);
+ }
+
+ public static HexQuantity from(String value) {
+ if (value == null) {
+ return null;
+ }
+ int signum = 1;
+ if (value.startsWith("-")) {
+ signum = -1;
+ value = value.substring(1);
+ }
+ if (!value.startsWith("0x")) {
+ throw new IllegalArgumentException("Input must be formatted as a hex value");
+ }
+ value = value.substring(2);
+ if (value.length() == 0) {
+ return null;
+ }
+ try {
+ BigInteger num = new BigInteger(value, 16);
+ if (signum == -1) {
+ num = num.negate();
+ }
+ return new HexQuantity(num);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Invalid quantity value: " + value);
+ }
+ }
+
+ public String toHex() {
+ return (value.signum() == -1 ? "-" : "") + "0x" + value.abs().toString(16);
+ }
+
+ public String toString() {
+ return toHex();
+ }
+
+ public BigInteger getValue() {
+ return value;
+ }
+
+ public HexData asData() {
+ return new HexData(value.toByteArray());
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ HexQuantity that = (HexQuantity) o;
+ return value.equals(that.value);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(value);
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJson.java
index 1d35f9424..28be2b300 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJson.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJson.java
@@ -6,7 +6,7 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Bloom;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.Serializable;
import java.math.BigInteger;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJsonDeserializer.java
index 3eb50d24d..83a893e6c 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJsonDeserializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/BlockJsonDeserializer.java
@@ -24,7 +24,7 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Bloom;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.IOException;
import java.time.Instant;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonDeserializer.java
index 1482b04a1..a03418a84 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonDeserializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonDeserializer.java
@@ -24,8 +24,8 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei;
-import io.emeraldpay.etherjar.hex.HexData;
-import io.emeraldpay.etherjar.hex.HexEncoding;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexEncoding;
import java.math.BigInteger;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonSerializer.java
index 3c170397c..c971ad30f 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonSerializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/EtherJsonSerializer.java
@@ -18,7 +18,7 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.IOException;
import java.math.BigInteger;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/HexDataSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/HexDataSerializer.java
new file mode 100644
index 000000000..6643a2f07
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/HexDataSerializer.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
+
+import java.io.IOException;
+
+public class HexDataSerializer extends StdSerializer {
+
+ public HexDataSerializer() {
+ super(HexData.class);
+ }
+
+ @Override
+ public void serialize(HexData value, JsonGenerator gen, SerializerProvider provider) throws IOException {
+ if (value == null) {
+ gen.writeNull();
+ } else {
+ gen.writeString(value.toHex());
+ }
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/RequestJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/RequestJson.java
new file mode 100644
index 000000000..c6da64668
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/RequestJson.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved.
+ * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import java.util.List;
+
+public class RequestJson {
+
+ private String jsonrpc = "2.0";
+ private String method;
+ @JsonInclude(JsonInclude.Include.ALWAYS)
+ private List params;
+ @JsonInclude(JsonInclude.Include.ALWAYS)
+ private T id;
+
+ public RequestJson(String method, List params, T id) {
+ if (!(
+ Integer.class.isAssignableFrom(id.getClass())
+ || Long.class.isAssignableFrom(id.getClass())
+ || String.class.isAssignableFrom(id.getClass())
+ )) {
+ throw new IllegalArgumentException("ID must be String or Integer/Long");
+ }
+ this.method = method;
+ this.params = params;
+ this.id = id;
+ }
+
+ public String getJsonrpc() {
+ return jsonrpc;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+
+ public List getParams() {
+ return params;
+ }
+
+ public T getId() {
+ return id;
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJson.java
new file mode 100644
index 000000000..e8df64c3f
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJson.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved.
+ * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError;
+
+@JsonSerialize(using = ResponseJsonSerializer.class)
+public class ResponseJson {
+
+ private String jsonrpc = "2.0";
+ private ID id;
+ private DATA result;
+ private RpcResponseError error;
+
+ public String getJsonrpc() {
+ return jsonrpc;
+ }
+
+ public void setJsonrpc(String jsonrpc) {
+ this.jsonrpc = jsonrpc;
+ }
+
+ public ID getId() {
+ return id;
+ }
+
+ public void setId(ID id) {
+ if (!(
+ Integer.class.isAssignableFrom(id.getClass())
+ || Long.class.isAssignableFrom(id.getClass())
+ || String.class.isAssignableFrom(id.getClass())
+ )) {
+ throw new IllegalArgumentException("ID must be String or Integer/Long");
+ }
+ this.id = id;
+ }
+
+ public DATA getResult() {
+ return result;
+ }
+
+ public void setResult(DATA result) {
+ this.result = result;
+ }
+
+ public RpcResponseError getError() {
+ return error;
+ }
+
+ public void setError(RpcResponseError error) {
+ this.error = error;
+ }
+
+ @SuppressWarnings("unchecked")
+ public ResponseJson cast(Class clazz) {
+ if (result == null || clazz.isAssignableFrom(result.getClass())) {
+ return (ResponseJson) this;
+ }
+ throw new ClassCastException("Value of " + result.getClass() + " is not assignable to " + clazz);
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJsonSerializer.java
new file mode 100644
index 000000000..f63d74113
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/ResponseJsonSerializer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+import java.io.IOException;
+
+public class ResponseJsonSerializer extends JsonSerializer> {
+
+ @Override
+ public void serialize(ResponseJson value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+ gen.writeStartObject();
+ gen.writeStringField("jsonrpc", "2.0");
+ gen.writeObjectField("id", value.getId());
+ if (value.getError() != null) {
+ gen.writeObjectField("error", value.getError());
+ } else {
+ gen.writeObjectField("result", value.getResult());
+ }
+ gen.writeEndObject();
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJson.java
new file mode 100644
index 000000000..ed6b3ffaa
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJson.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+@JsonDeserialize(using = SyncingJsonDeserializer.class)
+@JsonSerialize(using = SyncingJsonSerializer.class)
+public class SyncingJson {
+
+ private boolean syncing;
+
+ private Long startingBlock;
+ private Long currentBlock;
+ private Long highestBlock;
+
+ public boolean isSyncing() {
+ return syncing;
+ }
+
+ public void setSyncing(boolean syncing) {
+ this.syncing = syncing;
+ }
+
+ public Long getStartingBlock() {
+ return startingBlock;
+ }
+
+ public void setStartingBlock(Long startingBlock) {
+ this.startingBlock = startingBlock;
+ }
+
+ public Long getCurrentBlock() {
+ return currentBlock;
+ }
+
+ public void setCurrentBlock(Long currentBlock) {
+ this.currentBlock = currentBlock;
+ }
+
+ public Long getHighestBlock() {
+ return highestBlock;
+ }
+
+ public void setHighestBlock(Long highestBlock) {
+ this.highestBlock = highestBlock;
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonDeserializer.java
new file mode 100644
index 000000000..f146f7808
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonDeserializer.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonNode;
+
+import java.io.IOException;
+
+public class SyncingJsonDeserializer extends EtherJsonDeserializer {
+
+ @Override
+ public SyncingJson deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ JsonNode node = jp.readValueAsTree();
+ SyncingJson resp = new SyncingJson();
+ if (node.isBoolean()) {
+ resp.setSyncing(node.asBoolean());
+ } else {
+ resp.setSyncing(true);
+ resp.setStartingBlock(getLong(node, "startingBlock"));
+ resp.setCurrentBlock(getLong(node, "currentBlock"));
+ resp.setHighestBlock(getLong(node, "highestBlock"));
+ }
+ return resp;
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonSerializer.java
new file mode 100644
index 000000000..09e3d7d63
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/SyncingJsonSerializer.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016-2019 Igor Artamonov, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.json;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+import java.io.IOException;
+
+public class SyncingJsonSerializer extends EtherJsonSerializer {
+
+ @Override
+ public void serialize(SyncingJson value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+ if (value == null) {
+ gen.writeNull();
+ } else if (value.isSyncing()) {
+ gen.writeStartObject();
+ writeField(gen, "startingBlock", value.getStartingBlock());
+ writeField(gen, "currentBlock", value.getCurrentBlock());
+ writeField(gen, "highestBlock", value.getHighestBlock());
+ gen.writeEndObject();
+ } else {
+ gen.writeBoolean(false);
+ }
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJson.java
index 9451dab14..3873d19c6 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJson.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJson.java
@@ -20,7 +20,7 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.Serializable;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJsonSerializer.java
index 3a9b87cf6..af197e0a4 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJsonSerializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionCallJsonSerializer.java
@@ -21,7 +21,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
-import io.emeraldpay.etherjar.hex.HexEncoding;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexEncoding;
import java.io.IOException;
import java.math.BigInteger;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJson.java
index 2505ce72f..43e1f5c3d 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJson.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJson.java
@@ -24,8 +24,8 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionRef;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionSignature;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei;
-import io.emeraldpay.etherjar.hex.Hex32;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.Serializable;
import java.util.ArrayList;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonDeserializer.java
index 7f3bc27b7..60e7f3b6a 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonDeserializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonDeserializer.java
@@ -24,7 +24,7 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address;
import io.emeraldpay.dshackle.upstream.ethereum.domain.ChainId;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionSignature;
-import io.emeraldpay.etherjar.hex.Hex32;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonSerializer.java
index 4f37ff731..0434f816b 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonSerializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionJsonSerializer.java
@@ -18,7 +18,7 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionSignature;
-import io.emeraldpay.etherjar.hex.Hex32;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32;
import java.io.IOException;
import java.util.List;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJson.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJson.java
index 365a7ebaa..93c1b0ed5 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJson.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJson.java
@@ -23,8 +23,8 @@
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId;
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionRef;
-import io.emeraldpay.etherjar.hex.Hex32;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.Serializable;
import java.util.List;
@@ -79,7 +79,6 @@ public class TransactionLogJson implements TransactionRef, Serializable {
*
* In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)),
* except you declared the event with the anonymous specifier.
- * @see io.emeraldpay.etherjar.domain.EventId
*/
private List topics;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonDeserializer.java
index b43ca9648..f07bd492c 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonDeserializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonDeserializer.java
@@ -21,7 +21,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
-import io.emeraldpay.etherjar.hex.Hex32;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonSerializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonSerializer.java
index d29b8a72e..2fd67c058 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonSerializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionLogJsonSerializer.java
@@ -17,7 +17,7 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.IOException;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionReceiptJsonDeserializer.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionReceiptJsonDeserializer.java
index 7ab3f1174..9b724d93e 100644
--- a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionReceiptJsonDeserializer.java
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/json/TransactionReceiptJsonDeserializer.java
@@ -22,7 +22,7 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import io.emeraldpay.dshackle.upstream.ethereum.domain.Bloom;
-import io.emeraldpay.etherjar.hex.HexData;
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData;
import java.io.IOException;
import java.util.ArrayList;
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcException.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcException.java
new file mode 100644
index 000000000..5f295ace4
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcException.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved.
+ * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.rpc;
+
+import java.util.Objects;
+
+/**
+ * @author Igor Artamonov
+ */
+public class RpcException extends RuntimeException {
+
+ private int code;
+ private String rpcMessage;
+ private Object details;
+
+ public RpcException(int code, String rpcMessage, Object details, Throwable cause) {
+ super("RPC Error " + code + ": " + rpcMessage, cause);
+ this.code = code;
+ this.rpcMessage = rpcMessage;
+ this.details = details;
+ }
+
+ public RpcException(int code, String rpcMessage, Object details) {
+ this(code, rpcMessage, details, null);
+ }
+
+ public RpcException(int code, String rpcMessage) {
+ this(code, rpcMessage, null);
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getRpcMessage() {
+ return rpcMessage;
+ }
+
+ public Object getDetails() {
+ return details;
+ }
+
+ public RpcResponseError getError() {
+ return new RpcResponseError(code, rpcMessage, details);
+ }
+
+ public String toString() {
+ return "RpcException(" + code + " " + rpcMessage
+ + (details == null ? "" : ", " + details.toString())
+ + ")";
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ RpcException that = (RpcException) o;
+ return code == that.code &&
+ Objects.equals(rpcMessage, that.rpcMessage) &&
+ Objects.equals(details, that.details);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(code, rpcMessage);
+ }
+}
diff --git a/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcResponseError.java b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcResponseError.java
new file mode 100644
index 000000000..d90ef8ada
--- /dev/null
+++ b/src/main/java/io/emeraldpay/dshackle/upstream/ethereum/rpc/RpcResponseError.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2020 EmeraldPay Inc, All Rights Reserved.
+ * Copyright (c) 2016-2017 Infinitape Inc, All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.emeraldpay.dshackle.upstream.ethereum.rpc;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * @author Igor Artamonov
+ */
+public class RpcResponseError {
+
+ public static int CODE_INVALID_JSON = -32700;
+ public static int CODE_INVALID_REQUEST = -32600;
+ public static int CODE_METHOD_NOT_EXIST = -32601;
+ public static int CODE_INVALID_METHOD_PARAMS = -32602;
+ public static int CODE_INTERNAL_ERROR = -32603;
+
+ public static int CODE_RESERVED_0 = -32000;
+ public static int CODE_RESERVED_99 = -32099;
+
+ public static int CODE_UPSTREAM_INVALID_RESPONSE = -32000;
+ public static int CODE_UPSTREAM_CONNECTION_ERROR = -32001;
+
+ /**
+ * -32700 - Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
+ * -32600 - The JSON sent is not a valid Request object.
+ * -32601 - The method does not exist / is not available.
+ * -32602 - Invalid method parameter(s).
+ * -32603 - Internal JSON-RPC error.
+ * -32000 to -32099 - Reserved for implementation-defined server-errors.
+ */
+ private int code;
+
+ /**
+ * A String providing a short description of the error.
+ * The message SHOULD be limited to a concise single sentence.
+ */
+ private String message;
+
+
+ /**
+ * A Primitive or Structured value that contains additional information about the error.
+ * This may be omitted.
+ * The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
+ */
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ private Object data;
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public RpcResponseError() {
+ }
+
+ public RpcResponseError(int code, String message) {
+ this.code = code;
+ this.message = message;
+ }
+
+ public RpcResponseError(int code, String message, Object data) {
+ this.code = code;
+ this.message = message;
+ this.data = data;
+ }
+
+ /**
+ * Convert it ot RpcException
+ *
+ * @return same error as exception
+ * @see RpcException
+ */
+ public RpcException asException() {
+ return new RpcException(code, message, data);
+ }
+
+ public String toString() {
+ return "RPC Response Error (code: " + code + "; message: " + message + ")";
+ }
+}
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt
index 0483ea7de..5b8e2dbea 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/HttpHandler.kt
@@ -20,8 +20,8 @@ import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.config.ProxyConfig
import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp
import io.emeraldpay.dshackle.rpc.NativeCall
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled
import org.reactivestreams.Publisher
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/ReadRpcJson.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/ReadRpcJson.kt
index fcc37e84f..b98af23bf 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/ReadRpcJson.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/ReadRpcJson.kt
@@ -20,10 +20,10 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.google.protobuf.ByteString
import io.emeraldpay.api.proto.BlockchainOuterClass
import io.emeraldpay.dshackle.Global
+import io.emeraldpay.dshackle.upstream.ethereum.json.RequestJson
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
-import io.emeraldpay.etherjar.rpc.json.RequestJson
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
import java.io.IOException
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt b/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt
index c152f2cb4..e83876e03 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/proxy/WebsocketHandler.kt
@@ -23,8 +23,8 @@ import io.emeraldpay.dshackle.config.ProxyConfig
import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp
import io.emeraldpay.dshackle.rpc.NativeCall
import io.emeraldpay.dshackle.rpc.NativeSubscribe
-import io.emeraldpay.etherjar.rpc.json.RequestJson
-import io.emeraldpay.etherjar.rpc.json.ResponseJson
+import io.emeraldpay.dshackle.upstream.ethereum.json.RequestJson
+import io.emeraldpay.dshackle.upstream.ethereum.json.ResponseJson
import io.netty.buffer.ByteBufInputStream
import org.reactivestreams.Publisher
import org.slf4j.LoggerFactory
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/quorum/MaximumValueQuorum.kt b/src/main/kotlin/io/emeraldpay/dshackle/quorum/MaximumValueQuorum.kt
index a4f22ba41..fb203b42c 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/quorum/MaximumValueQuorum.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/quorum/MaximumValueQuorum.kt
@@ -1,9 +1,9 @@
package io.emeraldpay.dshackle.quorum
import io.emeraldpay.dshackle.upstream.Upstream
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.hex.HexQuantity
class MaximumValueQuorum : CallQuorum, ValueAwareQuorum(String::class.java) {
private var max: Long? = null
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt
index 7f85edf2d..8092e3cce 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/quorum/QuorumRpcReader.kt
@@ -24,12 +24,12 @@ import io.emeraldpay.dshackle.reader.RpcReader
import io.emeraldpay.dshackle.reader.SpannedReader
import io.emeraldpay.dshackle.upstream.ApiSource
import io.emeraldpay.dshackle.upstream.Upstream
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcUpstreamException
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
import org.slf4j.LoggerFactory
import org.springframework.cloud.sleuth.Tracer
import reactor.core.publisher.Flux
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/quorum/ValueAwareQuorum.kt b/src/main/kotlin/io/emeraldpay/dshackle/quorum/ValueAwareQuorum.kt
index c99863832..be6147881 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/quorum/ValueAwareQuorum.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/quorum/ValueAwareQuorum.kt
@@ -18,11 +18,11 @@ package io.emeraldpay.dshackle.quorum
import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.upstream.Upstream
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
import org.slf4j.LoggerFactory
abstract class ValueAwareQuorum(
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/reader/RpcReaderFactory.kt b/src/main/kotlin/io/emeraldpay/dshackle/reader/RpcReaderFactory.kt
index 661ac40ac..4b9f1423c 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/reader/RpcReaderFactory.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/reader/RpcReaderFactory.kt
@@ -6,13 +6,13 @@ import io.emeraldpay.dshackle.reader.RpcReader.Result
import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.Upstream
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.rpcclient.stream.Chunk
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
import org.springframework.cloud.sleuth.Tracer
import reactor.core.publisher.Flux
import java.util.concurrent.atomic.AtomicInteger
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt
index bc5a36517..e05790c57 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/NativeCall.kt
@@ -41,13 +41,13 @@ import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.MultistreamHolder
import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.calls.DefaultEthereumMethods
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.stream.Chunk
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import io.micrometer.core.instrument.Metrics
import org.apache.commons.lang3.StringUtils
import org.reactivestreams.Publisher
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultSolanaMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultSolanaMethods.kt
index 53aff5a77..1cdc0e313 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultSolanaMethods.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/DefaultSolanaMethods.kt
@@ -4,7 +4,7 @@ import io.emeraldpay.dshackle.quorum.AlwaysQuorum
import io.emeraldpay.dshackle.quorum.BroadcastQuorum
import io.emeraldpay.dshackle.quorum.CallQuorum
import io.emeraldpay.dshackle.upstream.calls.CallMethods
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
class DefaultSolanaMethods : CallMethods {
companion object {
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/LocalCallRouter.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/LocalCallRouter.kt
index 74574fa9f..829f03ba7 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/LocalCallRouter.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/LocalCallRouter.kt
@@ -21,10 +21,10 @@ import io.emeraldpay.dshackle.reader.JsonRpcReader
import io.emeraldpay.dshackle.upstream.bitcoin.data.RpcUnspent
import io.emeraldpay.dshackle.upstream.bitcoin.data.SimpleUnspent
import io.emeraldpay.dshackle.upstream.calls.CallMethods
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import org.bitcoinj.core.Address
import org.slf4j.LoggerFactory
import reactor.core.publisher.Mono
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultBitcoinMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultBitcoinMethods.kt
index 29f2654aa..c366bef74 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultBitcoinMethods.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultBitcoinMethods.kt
@@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.quorum.AlwaysQuorum
import io.emeraldpay.dshackle.quorum.BroadcastQuorum
import io.emeraldpay.dshackle.quorum.CallQuorum
import io.emeraldpay.dshackle.quorum.NotNullQuorum
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import java.util.Collections
class DefaultBitcoinMethods : CallMethods {
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt
index 2883309c4..5cb1b67d0 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt
@@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.quorum.BroadcastQuorum
import io.emeraldpay.dshackle.quorum.CallQuorum
import io.emeraldpay.dshackle.quorum.MaximumValueQuorum
import io.emeraldpay.dshackle.quorum.NotNullQuorum
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
/**
* Default configuration for Ethereum based RPC. Defines optimal Quorum strategies for different methods, and provides
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultPolkadotMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultPolkadotMethods.kt
index cdb736669..0342b4ae8 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultPolkadotMethods.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultPolkadotMethods.kt
@@ -19,7 +19,7 @@ package io.emeraldpay.dshackle.upstream.calls
import io.emeraldpay.dshackle.quorum.AlwaysQuorum
import io.emeraldpay.dshackle.quorum.BroadcastQuorum
import io.emeraldpay.dshackle.quorum.CallQuorum
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
/**
* Default configuration for Ethereum based RPC. Defines optimal Quorum strategies for different methods, and provides
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultStarknetMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultStarknetMethods.kt
index 7e0c5f72e..876b3ac98 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultStarknetMethods.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultStarknetMethods.kt
@@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.quorum.BroadcastQuorum
import io.emeraldpay.dshackle.quorum.CallQuorum
import io.emeraldpay.dshackle.quorum.MaximumValueQuorum
import io.emeraldpay.dshackle.quorum.NotNullQuorum
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
/**
* Default configuration for Ethereum based RPC. Defines optimal Quorum strategies for different methods, and provides
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt
index 82326108c..64a181daa 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt
@@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.cache.Caches
import io.emeraldpay.dshackle.data.BlockId
import io.emeraldpay.dshackle.upstream.Head
import io.emeraldpay.dshackle.upstream.Selector
-import io.emeraldpay.etherjar.hex.HexQuantity
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
import org.bouncycastle.util.encoders.DecoderException
import org.slf4j.LoggerFactory
import reactor.core.publisher.Mono
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumArchiveBlockNumberReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumArchiveBlockNumberReader.kt
index 294887d30..4f172c487 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumArchiveBlockNumberReader.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumArchiveBlockNumberReader.kt
@@ -2,9 +2,9 @@ package io.emeraldpay.dshackle.upstream.ethereum
import io.emeraldpay.dshackle.Chain
import io.emeraldpay.dshackle.reader.JsonRpcReader
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.hex.HexQuantity
import reactor.core.publisher.Mono
private const val ARBITRUM_NITRO_BLOCK = "0x152DD47" // 22207815
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReader.kt
index 588662cd8..aac950d39 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReader.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumDirectReader.kt
@@ -21,16 +21,16 @@ import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
import io.emeraldpay.dshackle.upstream.ethereum.domain.Wei
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
import io.emeraldpay.dshackle.upstream.ethereum.json.BlockJson
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionJsonSnapshot
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionLogJson
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionReceiptJson
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionRefJson
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
-import io.emeraldpay.etherjar.hex.HexQuantity
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import org.apache.commons.collections4.Factory
import org.apache.commons.lang3.exception.ExceptionUtils
import org.slf4j.LoggerFactory
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt
index 0848c3fd3..eceda46b4 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscription.kt
@@ -5,10 +5,10 @@ import io.emeraldpay.dshackle.upstream.EgressSubscription
import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.ConnectLogs
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.ConnectNewHeads
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.PendingTxesSource
-import io.emeraldpay.etherjar.hex.Hex32
import org.slf4j.LoggerFactory
import reactor.core.publisher.Flux
import reactor.core.scheduler.Scheduler
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt
index 296cffa6b..a2b8a10b7 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt
@@ -22,11 +22,11 @@ import io.emeraldpay.dshackle.reader.JsonRpcReader
import io.emeraldpay.dshackle.upstream.Head
import io.emeraldpay.dshackle.upstream.LogsOracle
import io.emeraldpay.dshackle.upstream.calls.CallMethods
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.hex.HexQuantity
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import reactor.core.publisher.Mono
import reactor.kotlin.core.publisher.switchIfEmpty
import java.math.BigInteger
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt
index c0829e68d..fbb7c29a0 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidator.kt
@@ -27,11 +27,11 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability
import io.emeraldpay.dshackle.upstream.UpstreamValidator
import io.emeraldpay.dshackle.upstream.ValidateUpstreamSettingsResult
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.json.SyncingJson
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionCallJson
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.hex.HexData
-import io.emeraldpay.etherjar.rpc.json.SyncingJson
import org.slf4j.LoggerFactory
import org.springframework.scheduling.concurrent.CustomizableThreadFactory
import reactor.core.publisher.Mono
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImpl.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImpl.kt
index 9c595d194..ce763f4ad 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImpl.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImpl.kt
@@ -20,6 +20,7 @@ import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.config.AuthConfig
import io.emeraldpay.dshackle.upstream.ethereum.WsConnection.ConnectionState.CONNECTED
import io.emeraldpay.dshackle.upstream.ethereum.WsConnection.ConnectionState.DISCONNECTED
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
@@ -27,7 +28,6 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcWsMessage
import io.emeraldpay.dshackle.upstream.rpcclient.ResponseWSParser
import io.emeraldpay.dshackle.upstream.rpcclient.RpcMetrics
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import io.micrometer.core.instrument.Metrics
import io.netty.buffer.ByteBufInputStream
import io.netty.handler.codec.http.HttpHeaderNames
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogs.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogs.kt
index 3cb098654..609fd8f56 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogs.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogs.kt
@@ -19,9 +19,9 @@ import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.Selector
import io.emeraldpay.dshackle.upstream.SubscriptionConnect
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexDataComparator
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.LogMessage
-import io.emeraldpay.etherjar.hex.Hex32
-import io.emeraldpay.etherjar.hex.HexDataComparator
import reactor.core.publisher.Flux
import reactor.core.scheduler.Scheduler
import java.util.function.Function
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogs.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogs.kt
index cfd0b38ce..be33befa0 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogs.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogs.kt
@@ -22,9 +22,9 @@ import io.emeraldpay.dshackle.reader.Reader
import io.emeraldpay.dshackle.upstream.Multistream
import io.emeraldpay.dshackle.upstream.ethereum.EthereumCachingReader
import io.emeraldpay.dshackle.upstream.ethereum.EthereumDirectReader.Result
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionLogJson
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.LogMessage
-import io.emeraldpay.etherjar.hex.HexData
import org.slf4j.LoggerFactory
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceNewHeads.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceNewHeads.kt
index 263a04f7b..497269b1b 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceNewHeads.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceNewHeads.kt
@@ -17,8 +17,8 @@ package io.emeraldpay.dshackle.upstream.ethereum.subscribe
import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.upstream.Head
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.NewHeadMessage
-import io.emeraldpay.etherjar.hex.HexData
import reactor.core.publisher.Flux
/**
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessage.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessage.kt
index d9a4761c9..cf638be2e 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessage.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessage.kt
@@ -20,9 +20,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.hex.Hex32
-import io.emeraldpay.etherjar.hex.HexData
-import io.emeraldpay.etherjar.rpc.json.HexDataSerializer
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.json.HexDataSerializer
data class LogMessage(
@get:JsonSerialize(using = HexDataSerializer::class)
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessage.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessage.kt
index 8e94cf953..7b9900957 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessage.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessage.kt
@@ -22,8 +22,8 @@ import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.Bloom
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.hex.HexData
-import io.emeraldpay.etherjar.rpc.json.HexDataSerializer
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.json.HexDataSerializer
import java.math.BigInteger
import java.time.Instant
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NumberAsHexSerializer.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NumberAsHexSerializer.kt
index 679cb17ab..c87fcc3bd 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NumberAsHexSerializer.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NumberAsHexSerializer.kt
@@ -18,7 +18,7 @@ package io.emeraldpay.dshackle.upstream.ethereum.subscribe.json
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.JsonSerializer
import com.fasterxml.jackson.databind.SerializerProvider
-import io.emeraldpay.etherjar.hex.HexQuantity
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexQuantity
import java.math.BigInteger
/**
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/LocalReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/LocalReader.kt
index c91036430..b92251e72 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/LocalReader.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/generic/LocalReader.kt
@@ -2,10 +2,10 @@ package io.emeraldpay.dshackle.upstream.generic
import io.emeraldpay.dshackle.reader.JsonRpcReader
import io.emeraldpay.dshackle.upstream.calls.CallMethods
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import reactor.core.publisher.Mono
class LocalReader(private val methods: CallMethods) : JsonRpcReader {
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt
index 887c64374..a13bbbffc 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/grpc/BitcoinGrpcUpstream.kt
@@ -34,11 +34,11 @@ import io.emeraldpay.dshackle.upstream.Upstream
import io.emeraldpay.dshackle.upstream.UpstreamAvailability
import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinUpstream
import io.emeraldpay.dshackle.upstream.bitcoin.ExtractBlock
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.emeraldpay.dshackle.upstream.forkchoice.MostWorkForkChoice
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcGrpcClient
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
import org.reactivestreams.Publisher
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcError.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcError.kt
index 4e4fa5bd7..42a5886ff 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcError.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcError.kt
@@ -15,7 +15,7 @@
*/
package io.emeraldpay.dshackle.upstream.rpcclient
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
data class JsonRpcError(val code: Int, val message: String, val details: Any?) {
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcException.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcException.kt
index 8ce2dcaa9..8cd5c1e8c 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcException.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcException.kt
@@ -15,7 +15,7 @@
*/
package io.emeraldpay.dshackle.upstream.rpcclient
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
open class JsonRpcException(
val id: JsonRpcResponse.Id,
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt
index 50c510022..4f1defaa8 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClient.kt
@@ -22,9 +22,9 @@ import io.emeraldpay.api.proto.ReactorBlockchainGrpc
import io.emeraldpay.dshackle.Chain
import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.reader.JsonRpcReader
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import io.grpc.StatusRuntimeException
import org.apache.commons.lang3.time.StopWatch
import org.slf4j.LoggerFactory
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClient.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClient.kt
index e358c8b74..6478290a7 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClient.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClient.kt
@@ -17,13 +17,13 @@ package io.emeraldpay.dshackle.upstream.rpcclient
import io.emeraldpay.dshackle.config.AuthConfig
import io.emeraldpay.dshackle.reader.JsonRpcHttpReader
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.stream.AggregateResponse
import io.emeraldpay.dshackle.upstream.rpcclient.stream.JsonRpcStreamParser
import io.emeraldpay.dshackle.upstream.rpcclient.stream.Response
import io.emeraldpay.dshackle.upstream.rpcclient.stream.SingleResponse
import io.emeraldpay.dshackle.upstream.rpcclient.stream.StreamResponse
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import io.micrometer.core.instrument.Metrics
import io.netty.buffer.Unpooled
import io.netty.handler.codec.http.HttpHeaderNames
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcWsClient.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcWsClient.kt
index 5eba7fecb..7381afdb4 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcWsClient.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcWsClient.kt
@@ -17,7 +17,7 @@ package io.emeraldpay.dshackle.upstream.rpcclient
import io.emeraldpay.dshackle.reader.JsonRpcReader
import io.emeraldpay.dshackle.upstream.ethereum.WsConnectionPool
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import reactor.core.publisher.Mono
class JsonRpcWsClient(
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/ResponseParser.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/ResponseParser.kt
index 15ee04e75..7c8b99e98 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/ResponseParser.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/ResponseParser.kt
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.core.JsonParseException
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.JsonToken
import io.emeraldpay.dshackle.Global
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import org.slf4j.LoggerFactory
import java.io.IOException
diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/stream/JsonRpcStreamParser.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/stream/JsonRpcStreamParser.kt
index 68b612539..9e4673dff 100644
--- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/stream/JsonRpcStreamParser.kt
+++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/rpcclient/stream/JsonRpcStreamParser.kt
@@ -3,9 +3,9 @@ package io.emeraldpay.dshackle.upstream.rpcclient.stream
import com.fasterxml.jackson.core.JsonFactory
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.JsonToken
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.ResponseRpcParser
-import io.emeraldpay.etherjar.rpc.RpcResponseError
import org.slf4j.LoggerFactory
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy
index 6465daabf..fe132e93c 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/HttpHandlerSpec.groovy
@@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.config.ProxyConfig
import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp
import io.emeraldpay.dshackle.rpc.NativeCall
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import io.micrometer.core.instrument.Counter
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/ReadRpcJsonSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/ReadRpcJsonSpec.groovy
index 3cab7db4a..61f5312be 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/proxy/ReadRpcJsonSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/ReadRpcJsonSpec.groovy
@@ -18,7 +18,7 @@ package io.emeraldpay.dshackle.proxy
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import spock.lang.Specification
class ReadRpcJsonSpec extends Specification {
diff --git a/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy
index 7ff8c52b7..bec1d7872 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/proxy/WebsocketHandlerSpec.groovy
@@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.monitoring.accesslog.AccessHandlerHttp
import io.emeraldpay.dshackle.rpc.NativeCall
import io.emeraldpay.dshackle.rpc.NativeSubscribe
import io.emeraldpay.dshackle.upstream.Selector
-import io.emeraldpay.etherjar.rpc.json.RequestJson
+import io.emeraldpay.dshackle.upstream.ethereum.json.RequestJson
import io.micrometer.core.instrument.Counter
import reactor.core.publisher.Flux
import reactor.core.publisher.Sinks
diff --git a/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy
index ce71f16ee..77b53e91e 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/quorum/QuorumRpcReaderSpec.groovy
@@ -24,8 +24,8 @@ import io.emeraldpay.dshackle.upstream.Upstream
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import org.springframework.cloud.sleuth.Tracer
import reactor.core.publisher.Mono
import reactor.test.StepVerifier
diff --git a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy
index 3031e7970..ec33518ec 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/rpc/NativeCallSpec.groovy
@@ -40,8 +40,8 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcException
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.signature.ResponseSigner
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import org.springframework.cloud.sleuth.Tracer
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
diff --git a/src/test/groovy/io/emeraldpay/dshackle/test/ApiReaderMock.groovy b/src/test/groovy/io/emeraldpay/dshackle/test/ApiReaderMock.groovy
index 5f91e127b..7d1f6ac76 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/test/ApiReaderMock.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/test/ApiReaderMock.groovy
@@ -24,7 +24,7 @@ import io.emeraldpay.dshackle.reader.Reader
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcError
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.grpc.stub.StreamObserver
import io.netty.buffer.ByteBuf
import io.netty.buffer.ByteBufAllocator
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy
index 011aa3e96..78ce134bf 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumEgressSubscriptionSpec.groovy
@@ -20,7 +20,7 @@ import io.emeraldpay.dshackle.test.TestingCommons
import io.emeraldpay.dshackle.upstream.generic.GenericMultistream
import io.emeraldpay.dshackle.upstream.ethereum.subscribe.PendingTxesSource
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
-import io.emeraldpay.etherjar.hex.Hex32
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
import reactor.core.publisher.Flux
import reactor.core.scheduler.Schedulers
import spock.lang.Specification
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidatorSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidatorSpec.groovy
index 7ec7bf828..082288149 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidatorSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstreamValidatorSpec.groovy
@@ -26,8 +26,8 @@ import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcResponse
import io.emeraldpay.dshackle.upstream.Upstream
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
-import io.emeraldpay.etherjar.hex.HexData
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionCallJson
import reactor.core.publisher.Mono
import reactor.util.function.Tuples
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImplSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImplSpec.groovy
index ef6d7627a..cdebff861 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImplSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/WsConnectionImplSpec.groovy
@@ -22,7 +22,7 @@ import io.emeraldpay.dshackle.test.TestingCommons
import io.emeraldpay.dshackle.upstream.DefaultUpstream
import io.emeraldpay.dshackle.upstream.rpcclient.JsonRpcRequest
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionJson
import reactor.core.publisher.Flux
import reactor.core.scheduler.Schedulers
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogsSpec.groovy
index 367059f1f..8dceba0d6 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogsSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ConnectLogsSpec.groovy
@@ -20,8 +20,8 @@ import io.emeraldpay.dshackle.upstream.ethereum.subscribe.json.LogMessage
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.hex.Hex32
-import io.emeraldpay.etherjar.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import reactor.core.publisher.Flux
import reactor.core.scheduler.Schedulers
import spock.lang.Specification
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogsSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogsSpec.groovy
index 1ad9e6f73..2c1a41da4 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogsSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/ProduceLogsSpec.groovy
@@ -23,7 +23,7 @@ import io.emeraldpay.dshackle.upstream.ethereum.EthereumDirectReader
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionLogJson
import reactor.core.publisher.Mono
import spock.lang.Specification
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessageSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessageSpec.groovy
index e9796334f..6ee997158 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessageSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/LogMessageSpec.groovy
@@ -20,8 +20,8 @@ import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.TransactionId
-import io.emeraldpay.etherjar.hex.Hex32
-import io.emeraldpay.etherjar.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.hex.Hex32
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import spock.lang.Specification
class LogMessageSpec extends Specification {
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessageSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessageSpec.groovy
index 32c341218..63e217dad 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessageSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/ethereum/subscribe/json/NewHeadMessageSpec.groovy
@@ -5,7 +5,7 @@ import io.emeraldpay.dshackle.Global
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.domain.BlockHash
import io.emeraldpay.dshackle.upstream.ethereum.domain.Bloom
-import io.emeraldpay.etherjar.hex.HexData
+import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import spock.lang.Specification
import java.time.Instant
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcErrorSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcErrorSpec.groovy
index f45ef78ac..db3d116ff 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcErrorSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcErrorSpec.groovy
@@ -1,6 +1,6 @@
package io.emeraldpay.dshackle.upstream.rpcclient
-import io.emeraldpay.etherjar.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
import nl.jqno.equalsverifier.EqualsVerifier
import spock.lang.Specification
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClientSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClientSpec.groovy
index 79d7c99b8..5b8a024d2 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClientSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcGrpcClientSpec.groovy
@@ -6,8 +6,8 @@ import io.emeraldpay.api.proto.BlockchainOuterClass
import io.emeraldpay.api.proto.Common
import io.emeraldpay.dshackle.Chain
import io.emeraldpay.dshackle.test.MockGrpcServer
-import io.emeraldpay.etherjar.rpc.RpcException
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcException
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.grpc.stub.StreamObserver
import spock.lang.Specification
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClientSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClientSpec.groovy
index 16f5044ac..fa64ba4d5 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClientSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/JsonRpcHttpClientSpec.groovy
@@ -17,7 +17,7 @@ package io.emeraldpay.dshackle.upstream.rpcclient
import io.emeraldpay.dshackle.test.TestingCommons
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import io.micrometer.core.instrument.Counter
import io.micrometer.core.instrument.Timer
import org.mockserver.integration.ClientAndServer
diff --git a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/ResponseRpcParserSpec.groovy b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/ResponseRpcParserSpec.groovy
index f2f3542d2..f4c4f9be9 100644
--- a/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/ResponseRpcParserSpec.groovy
+++ b/src/test/groovy/io/emeraldpay/dshackle/upstream/rpcclient/ResponseRpcParserSpec.groovy
@@ -15,7 +15,7 @@
*/
package io.emeraldpay.dshackle.upstream.rpcclient
-import io.emeraldpay.etherjar.rpc.RpcResponseError
+import io.emeraldpay.dshackle.upstream.ethereum.rpc.RpcResponseError
import spock.lang.Specification
class ResponseRpcParserSpec extends Specification {