diff --git a/Sources/Blockchain.swift b/Sources/Blockchain.swift index ba42879..d2e30e9 100644 --- a/Sources/Blockchain.swift +++ b/Sources/Blockchain.swift @@ -10,4 +10,15 @@ import Foundation public enum Blockchain { case bitcoin case ethereum + case poa + case ethereumClassic + case callisto + case gochain + + // test networks + + case ethereumRopsten + case ethereumKovan + case ethereumRinkeby + case ethereumSokol } diff --git a/Sources/HDWallet/HDWallet.swift b/Sources/HDWallet/HDWallet.swift index e198a73..119cb04 100644 --- a/Sources/HDWallet/HDWallet.swift +++ b/Sources/HDWallet/HDWallet.swift @@ -55,10 +55,13 @@ public class HDWallet { extension Blockchain { public var coinType: Int { switch self { - case .bitcoin: - return 0 - case .ethereum: - return 60 + case .bitcoin: return 0 + case .ethereum: return 60 + case .ethereumKovan, .ethereumRinkeby, .ethereumRopsten, .ethereumSokol: return 60 + case .poa: return 178 + case .ethereumClassic: return 61 + case .callisto: return 820 + case .gochain: return 6060 } } @@ -66,7 +69,15 @@ extension Blockchain { switch self { case .bitcoin: return DerivationPath(purpose: 44, coinType: coinType, account: 0, change: 0, address: index) - case .ethereum: + case .ethereum, + .poa, + .ethereumClassic, + .callisto, + .gochain, + .ethereumKovan, + .ethereumRinkeby, + .ethereumRopsten, + .ethereumSokol: return DerivationPath(purpose: 44, coinType: coinType, account: 0, change: 0, address: index) } } diff --git a/Sources/PrivateKey.swift b/Sources/PrivateKey.swift index e46a453..9a5ce80 100644 --- a/Sources/PrivateKey.swift +++ b/Sources/PrivateKey.swift @@ -66,7 +66,15 @@ public final class PrivateKey: Hashable, CustomStringConvertible { switch blockchain { case .bitcoin: return BitcoinPublicKey(data: Crypto.getPublicKey(from: data))! - case .ethereum: + case .ethereum, + .poa, + .ethereumClassic, + .callisto, + .gochain, + .ethereumKovan, + .ethereumRinkeby, + .ethereumRopsten, + .ethereumSokol: return EthereumPublicKey(data: Crypto.getPublicKey(from: data))! } }