mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
ADD: Bitstamp support for iOS widgets and watchOS
This commit is contained in:
parent
38e23a538e
commit
172a36683d
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user