@@ -12,6 +12,7 @@ public struct KdfParamsV3: Decodable, Encodable {
12
12
var r : Int ?
13
13
var c : Int ?
14
14
var prf : String ?
15
+
15
16
public init ( salt: String , dklen: Int , n: Int ? = nil , p: Int ? = nil , r: Int ? = nil , c: Int ? = nil , prf: String ? = nil ) {
16
17
self . salt = salt
17
18
self . dklen = dklen
@@ -25,6 +26,7 @@ public struct KdfParamsV3: Decodable, Encodable {
25
26
26
27
public struct CipherParamsV3 : Decodable , Encodable {
27
28
var iv : String
29
+
28
30
public init ( iv: String ) {
29
31
self . iv = iv
30
32
}
@@ -38,6 +40,7 @@ public struct CryptoParamsV3: Decodable, Encodable {
38
40
var kdfparams : KdfParamsV3
39
41
var mac : String
40
42
var version : String ?
43
+
41
44
public init ( ciphertext: String , cipher: String , cipherparams: CipherParamsV3 , kdf: String , kdfparams: KdfParamsV3 , mac: String , version: String ? = nil ) {
42
45
self . ciphertext = ciphertext
43
46
self . cipher = cipher
@@ -54,12 +57,12 @@ public protocol AbstractKeystoreParams: Codable {
54
57
var id : String ? { get }
55
58
var version : Int { get }
56
59
var isHDWallet : Bool { get }
57
-
58
60
}
59
61
60
62
public struct PathAddressPair : Codable {
61
63
public let path : String
62
64
public let address : String
65
+
63
66
public init ( path: String , address: String ) {
64
67
self . path = path
65
68
self . address = address
@@ -97,23 +100,20 @@ public struct KeystoreParamsBIP32: AbstractKeystoreParams {
97
100
self . rootPath = rootPath
98
101
self . isHDWallet = true
99
102
}
100
-
101
103
}
102
104
103
105
public struct KeystoreParamsV3 : AbstractKeystoreParams {
106
+ public var address : String ?
104
107
public var crypto : CryptoParamsV3
105
108
public var id : String ?
106
109
public var version : Int
107
110
public var isHDWallet : Bool
108
111
109
- public var address : String ?
110
-
111
- public init ( address ad: String ? , crypto cr: CryptoParamsV3 , id i: String , version ver: Int ) {
112
- address = ad
113
- self . crypto = cr
114
- self . id = i
115
- self . version = ver
112
+ public init ( address: String ? , crypto: CryptoParamsV3 , id: String , version: Int ) {
113
+ self . address = address
114
+ self . crypto = crypto
115
+ self . id = id
116
+ self . version = version
116
117
self . isHDWallet = false
117
118
}
118
-
119
119
}
0 commit comments