forked from oday0311/TrustCore
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSLIP.swift
70 lines (64 loc) · 2.01 KB
/
SLIP.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright © 2017-2018 Trust.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
import Foundation
public struct SLIP {
/// Coin type for Level 2 of BIP44.
///
/// - SeeAlso: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
public enum CoinType: Int {
case bitcoin = 0
case litecoin = 2
case bitcoincash = 145
case dash = 5
case ethereum = 60
case ethereumClassic = 61
case thunderToken = 1001
case go = 6060
case poa = 178
case tron = 195
case vechain = 818
case callisto = 820
case tomoChain = 889
case wanchain = 5718350
case icon = 74
case eos = 194
}
/// Network type for coins with distinguished testnet keys derivation
///
/// - SeeAlso: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
public enum Network: Int {
case main
case test = 1
}
/// Registered HD version bytes
///
/// - SeeAlso: https://github.com/satoshilabs/slips/blob/master/slip-0132.md
public enum HDVersion: UInt32 {
// Bitcoin
case xpub = 0x0488b21e
case xprv = 0x0488ade4
case ypub = 0x049d7cb2
case yprv = 0x049d7878
case zpub = 0x04b24746
case zprv = 0x04b2430c
// Litecoin
case ltub = 0x019da462
case ltpv = 0x019d9cfe
case mtub = 0x01b26ef6
case mtpv = 0x01b26792
}
/// Registered human-readable parts for BIP-0173
///
/// - SeeAlso: https://github.com/satoshilabs/slips/blob/master/slip-0173.md
public enum HRP: String, CaseIterable {
case bitcoin = "bc"
case bitcoinTest = "tb"
case litecoin = "ltc"
case litecoinTest = "tltc"
case bitcoincash = "bitcoincash"
case bitcoincashTest = "bchtest"
}
}