Files
raspberry/iOS/Wallet/Sources/P2P/Model/P2PModelBalance.swift
2022-05-27 20:21:01 +03:00

22 lines
602 B
Swift

//
// PaycashModelBalance.swift
// PayCash
//
// Created by Igor Danich on 30.08.2020.
// Copyright © 2020 List. All rights reserved.
//
import Foundation
extension P2P.Model {
// swiftlint:disable identifier_name
struct Balance: Codable {
let balance: String
let blocked_balance: String
var amount: Decimal { balance.components(separatedBy: " ").first?.toDecimal() ?? 0 }
var blocked: Decimal { blocked_balance.components(separatedBy: " ").first?.toDecimal() ?? 0 }
var symbol: String { balance.components(separatedBy: " ").last ?? "" }
}
}