I get a response from the server of this type, where the name of the pair is the key:
{
"BTC_BCN":{
"last":"0.00000057",
"percentChange":"0.03636363",
"baseVolume":"47.08463318"
},
"BTC_BELA":{
"last":"0.00001281",
"percentChange":"0.07376362",
"baseVolume":"5.46595029"
}
}
How can I decode it to a structure where the property name is the key from json:
struct Pair: Codable {
let name: String // need to put the name of the pair ("BTC_BCN")
let last: String
let percentChange: String
let baseVolume: String
}