Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created February 8, 2021 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/67194f07a965db5d7e7271c38e0d097b to your computer and use it in GitHub Desktop.
Save sturdysturge/67194f07a965db5d7e7271c38e0d097b to your computer and use it in GitHub Desktop.
import Foundation
struct TickerData: Codable {
let name: String
let tickers: [Ticker]
}
struct Ticker: Codable {
let base: Base
let target: String
let market: Market
let last, volume: Double
}
enum Base: String, Codable {
case dog = "DOG"
case doge = "DOGE"
case doge3L = "DOGE3L"
case xdg = "XDG"
}
struct Market: Codable {
let name, identifier: String
let hasTradingIncentive: Bool
enum CodingKeys: String, CodingKey {
case name, identifier
case hasTradingIncentive = "has_trading_incentive"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment