File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
app/src/main/java/to/bitkit/utils Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ package to.bitkit.utils
33import io.ktor.client.HttpClient
44import io.ktor.client.call.body
55import io.ktor.client.request.get
6+ import io.ktor.http.contentType
67import kotlinx.serialization.Serializable
8+ import kotlinx.serialization.json.Json
79import to.bitkit.env.Env
810import javax.inject.Inject
911import javax.inject.Singleton
@@ -32,8 +34,17 @@ class AddressChecker @Inject constructor(
3234 try {
3335 val response = client.get(" ${Env .esploraServerUrl} /tx/$txid " )
3436
35- return response.body<TxDetails >()
37+ // Debug: Check content type and body
38+ Logger .debug(" Response status: ${response.status} " )
39+ Logger .debug(" Response content type: ${response.contentType()} " )
40+
41+ val bodyAsString = response.body<String >()
42+ Logger .debug(" Response body: $bodyAsString " )
43+
44+ // Parse manually to see if the JSON structure is correct
45+ return Json .decodeFromString<TxDetails >(bodyAsString)
3646 } catch (e: Exception ) {
47+ Logger .error(" getTransaction error" , e)
3748 throw AddressCheckerError .NetworkError (e)
3849 }
3950 }
You can’t perform that action at this time.
0 commit comments