File tree 1 file changed +4
-3
lines changed
Sources/SwiftTrader/Model/Kucoin/Order
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ public struct KucoinFuturesOrder: Codable {
36
36
public let type : KucoinOrderType
37
37
public let side : KucoinOrderSide
38
38
39
- /// The price of one asset's unit.
40
- public let price : String
39
+ /// The price of one asset's unit. Although this is returned in Sandbox,
40
+ /// it returns `null` in production. Therefore it's an optional.
41
+ public let price : String ?
41
42
42
43
/// How much assets were bought.
43
44
public let size : Int
@@ -112,7 +113,7 @@ public struct KucoinFuturesOrder: Codable {
112
113
self . symbol = try container. decode ( String . self, forKey: . symbol)
113
114
self . type = try container. decode ( KucoinOrderType . self, forKey: . type)
114
115
self . side = try container. decode ( KucoinOrderSide . self, forKey: . side)
115
- self . price = try container. decode ( String . self, forKey: . price)
116
+ self . price = try container. decodeIfPresent ( String . self, forKey: . price)
116
117
self . size = try container. decode ( Int . self, forKey: . size)
117
118
self . value = try container. decode ( String . self, forKey: . value)
118
119
self . filledValue = try container. decode ( String . self, forKey: . filledValue)
You can’t perform that action at this time.
0 commit comments