Update ios/Shared/MarketAPI+Electrum.swift

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Marcos Rodriguez Vélez 2024-11-18 02:17:14 -04:00 committed by GitHub
parent b71b87297d
commit 329b475ed9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,9 +50,7 @@ extension MarketAPI {
do {
let receivedData = try await client.receive()
print("Data received. Parsing...")
guard let responseString = String(data: receivedData, encoding: .utf8),
let responseData = responseString.data(using: .utf8),
let json = try JSONSerialization.jsonObject(with: responseData, options: .allowFragments) as? [String: AnyObject],
guard let json = try JSONSerialization.jsonObject(with: receivedData, options: .allowFragments) as? [String: AnyObject],
let feeHistogram = json["result"] as? [[Double]] else {
print("Failed to parse response from \(host).")
completion(nil, APIError())