diff --git a/ios/Widgets/Shared/WidgetAPI.swift b/ios/Widgets/Shared/WidgetAPI.swift index 4b5fdaf13..4589ad4ca 100644 --- a/ios/Widgets/Shared/WidgetAPI.swift +++ b/ios/Widgets/Shared/WidgetAPI.swift @@ -35,6 +35,8 @@ class WidgetAPI { urlString = "https://api.exir.io/v1/ticker?symbol=btc-irt" case "wazirx": urlString = "https://api.wazirx.com/api/v2/tickers/btcinr" + case "Bitstamp": + urlString = "https://www.bitstamp.net/api/v2/ticker/btc\(endPointKey.lowercased())" default: urlString = "https://api.coindesk.com/v1/bpi/currentprice/\(endPointKey).json" } @@ -69,7 +71,7 @@ class WidgetAPI { let unix = Double(lastUpdated / 1_000) let lastUpdatedString = ISO8601DateFormatter().string(from: Date(timeIntervalSince1970: unix)) latestRateDataStore = WidgetDataStore(rate: String(rateDouble), lastUpdate: lastUpdatedString, rateDouble: rateDouble) - case "Exir": + case "Exir", "Bitstamp": guard let rateDouble = json["last"] as? Double else { break } let rateString = String(rateDouble) let lastUpdatedString = ISO8601DateFormatter().string(from: Date())