File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ struct BTCOutput: Decodable {
227
227
enum CodingKeys : String , CodingKey {
228
228
case signature = " scriptPubKey "
229
229
case value
230
+ case valueSat
230
231
case spentTxId
231
232
case spentIndex
232
233
}
@@ -236,7 +237,7 @@ struct BTCOutput: Decodable {
236
237
}
237
238
238
239
let addresses : [ String ]
239
- let value : Decimal
240
+ var value : Decimal
240
241
let spentTxId : String ?
241
242
let spentIndex : Int ?
242
243
@@ -254,6 +255,12 @@ struct BTCOutput: Decodable {
254
255
self . value = 0
255
256
}
256
257
258
+ if let raw = try ? container. decode ( String . self, forKey: . valueSat) , let value = Decimal ( string: raw) {
259
+ self . value = Decimal ( sign: . plus, exponent: DogeWalletService . currencyExponent, significand: value)
260
+ } else if let raw = try ? container. decode ( Decimal . self, forKey: . valueSat) {
261
+ self . value = Decimal ( sign: . plus, exponent: DogeWalletService . currencyExponent, significand: raw)
262
+ }
263
+
257
264
self . spentTxId = try ? container. decode ( String . self, forKey: . spentTxId)
258
265
self . spentIndex = try ? container. decode ( Int . self, forKey: . spentIndex)
259
266
}
You can’t perform that action at this time.
0 commit comments