From 367aa5172e5ec48453e7ae5f02391e1ed05c4e87 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 12 Oct 2026 18:00:34 +0700 Subject: [PATCH] fix(eip712): make EIP712Domain.verifyingContract deserializable by Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #14 StructuredDataEncoder.parseJSONMessage() deserializes typed-data JSON with a plain Jackson ObjectMapper into EIP712Message/EIP712Domain. The Moshi @Json annotations on the DTOs are invisible to Jackson, so Jackson relies on setter-based property detection: every EIP712Domain field was a var (setter present) except verifyingContract, which was a val. A typed-data payload containing domain.verifyingContract therefore failed with: UnrecognizedPropertyException: Unrecognized field "verifyingContract" (class com.circle.modularwallets.core.models.EIP712Domain), not marked as ignorable making signTypedData() unusable for any EIP-712 flow that targets a specific contract — i.e. most non-trivial typed-data use cases. Change val to var so the property has a setter, matching the other four fields in the same class. Note: @JsonIgnoreProperties(ignoreUnknown = true) would "fix" the crash but silently DROP verifyingContract from the parsed domain, producing wrong domain-separator hashes — not used here deliberately. --- .../com/circle/modularwallets/core/models/EIP712TypedData.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/main/java/com/circle/modularwallets/core/models/EIP712TypedData.kt b/lib/src/main/java/com/circle/modularwallets/core/models/EIP712TypedData.kt index 470b628..21d6f37 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/models/EIP712TypedData.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/models/EIP712TypedData.kt @@ -41,7 +41,7 @@ data class EIP712Domain @JvmOverloads constructor( @Json(name = "name") var name: String? = null, @Json(name = "version") var version: String? = null, @Json(name = "chainId") var chainId: Long? = null, - @Json(name = "verifyingContract") val verifyingContract: String? = null, + @Json(name = "verifyingContract") var verifyingContract: String? = null, @Json(name = "salt") var salt: String? = null, )