An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/Trust/Models/EthereumUnit.swift

25 lines
591 B

// Copyright SIX DAY LLC. All rights reserved.
import Foundation
public enum EthereumUnit: Int64 {
case wei = 1
case kwei = 1_000
case gwei = 1_000_000_000
case finney = 1_000_000_000_000_000
case ether = 1_000_000_000_000_000_000
}
extension EthereumUnit {
var name: String {
switch self {
case .wei: return "Wei"
case .kwei: return "Kwei"
case .gwei: return "Gwei"
case .finney: return "Finney"
case .ether: return "Ether"
}
}
}
//https://github.com/ethereumjs/ethereumjs-units/blob/master/units.json