diff --git a/core/src/main/java/org/web3j/protocol/core/methods/response/Authorization.java b/core/src/main/java/org/web3j/protocol/core/methods/response/Authorization.java new file mode 100644 index 0000000000..dcb0981617 --- /dev/null +++ b/core/src/main/java/org/web3j/protocol/core/methods/response/Authorization.java @@ -0,0 +1,74 @@ +package org.web3j.protocol.core.methods.response; + +/** + * @Author DylanYang + * @Date 2025/3/8 + */ +public class Authorization { + private String chainId; + private String nonce; + private String address; + private String yParity; + private String s; + private String r; + + public Authorization(String chainId, String r, String nonce, String address, String yParity, String s) { + this.chainId = chainId; + this.r = r; + this.nonce = nonce; + this.address = address; + this.yParity = yParity; + this.s = s; + } + + public Authorization() { + } + + public String getChainId() { + return chainId; + } + + public void setChainId(String chainId) { + this.chainId = chainId; + } + + public String getNonce() { + return nonce; + } + + public void setNonce(String nonce) { + this.nonce = nonce; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getyParity() { + return yParity; + } + + public void setyParity(String yParity) { + this.yParity = yParity; + } + + public String getS() { + return s; + } + + public void setS(String s) { + this.s = s; + } + + public String getR() { + return r; + } + + public void setR(String r) { + this.r = r; + } +} diff --git a/core/src/main/java/org/web3j/protocol/core/methods/response/Transaction.java b/core/src/main/java/org/web3j/protocol/core/methods/response/Transaction.java index 9f7ceff8f6..0f37c98c93 100644 --- a/core/src/main/java/org/web3j/protocol/core/methods/response/Transaction.java +++ b/core/src/main/java/org/web3j/protocol/core/methods/response/Transaction.java @@ -45,6 +45,7 @@ public class Transaction { private List accessList; private String maxFeePerBlobGas; private List blobVersionedHashes; + private List authorizationList; public Transaction() {} @@ -118,7 +119,9 @@ public Transaction( String type, String maxFeePerGas, String maxPriorityFeePerGas, - List accessList) { + List accessList, + List authorizationList + ) { this.hash = hash; this.nonce = nonce; this.blockHash = blockHash; @@ -142,6 +145,7 @@ public Transaction( this.maxFeePerGas = maxFeePerGas; this.maxPriorityFeePerGas = maxPriorityFeePerGas; this.accessList = accessList; + this.authorizationList = authorizationList; } public Transaction( @@ -169,7 +173,9 @@ public Transaction( String maxPriorityFeePerGas, List accessList, String maxFeePerBlobGas, - List versionedHashes) { + List versionedHashes, + List authorizationList + ) { this.hash = hash; this.nonce = nonce; this.blockHash = blockHash; @@ -195,6 +201,7 @@ public Transaction( this.accessList = accessList; this.maxFeePerBlobGas = maxFeePerBlobGas; this.blobVersionedHashes = versionedHashes; + this.authorizationList = authorizationList; } public void setChainId(String chainId) { @@ -357,6 +364,14 @@ public long getV() { return v; } + public List getAuthorizationList() { + return authorizationList; + } + + public void setAuthorizationList(List authorizationList) { + this.authorizationList = authorizationList; + } + // Workaround until Geth & Parity return consistent values. At present // Parity returns a byte value, Geth returns a hex-encoded string // https://github.com/ethereum/go-ethereum/issues/3339 @@ -575,6 +590,10 @@ public boolean equals(Object o) { : that.getAccessList() != null) { return false; } + if (getAuthorizationList() !=null ? !getAuthorizationList().equals(that.getAuthorizationList()) : + that.getAuthorizationList() != null) { + return false; + } return getS() != null ? getS().equals(that.getS()) : that.getS() == null; } @@ -621,6 +640,7 @@ public int hashCode() { ? getBlobVersionedHashes().hashCode() : 0); result = 31 * result + (getAccessList() != null ? getAccessList().hashCode() : 0); + result = 31 * result + (getAuthorizationList() != null ? getAuthorizationList().hashCode() : 0); return result; } } diff --git a/gradle.properties b/gradle.properties index 3fb684c939..1a64f7ee83 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group=org.web3j -version=4.13.0-SNAPSHOT +version=4.13.1-SNAPSHOT