22 lines
597 B
Swift
22 lines
597 B
Swift
//
|
|
// P2PModelBalance.swift
|
|
// Wallet
|
|
//
|
|
// 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 ?? "" }
|
|
}
|
|
}
|