Skip to content

Commit 01feef5

Browse files
Merge pull request #551 from Adamant-im/release/3.9.0
Release 3.9.0
2 parents ec4b606 + 8803443 commit 01feef5

File tree

346 files changed

+7011
-4132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+7011
-4132
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ xcuserdata/
104104

105105
### Here we store Release password. It's super-secret, not for git. ###
106106
AdamantSecret.swift
107+
GitData.plist
107108
runkit ex.rtf
108109
to do.rtf
109110
tz.rtf

Adamant.xcodeproj/project.pbxproj

Lines changed: 325 additions & 286 deletions
Large diffs are not rendered by default.

Adamant.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"repositoryURL": "https://github.com/Alamofire/Alamofire.git",
1616
"state": {
1717
"branch": null,
18-
"revision": "d120af1e8638c7da36c8481fd61a66c0c08dc4fc",
19-
"version": "5.4.4"
18+
"revision": "bc268c28fb170f494de9e9927c371b8342979ece",
19+
"version": "5.7.1"
2020
}
2121
},
2222
{
@@ -60,7 +60,7 @@
6060
"repositoryURL": "https://github.com/EFPrefix/EFQRCode.git",
6161
"state": {
6262
"branch": null,
63-
"revision": "2991c2f318ad9529d93b2a73a382a3f9c72c64ce",
63+
"revision": "3a6c5012f1a0df404a92e55bb01b4b685ff5a2d1",
6464
"version": "6.2.2"
6565
}
6666
},
@@ -309,11 +309,11 @@
309309
},
310310
{
311311
"package": "swift_qrcodejs",
312-
"repositoryURL": "https://github.com/ApolloZhu/swift_qrcodejs.git",
312+
"repositoryURL": "https://github.com/EFPrefix/swift_qrcodejs.git",
313313
"state": {
314314
"branch": null,
315-
"revision": "374dc7f7b9e76c6aeb393f6a84590c6d387e1ecb",
316-
"version": "2.2.2"
315+
"revision": "817ba220a2eba840bae888e7eeb11207bec05f8c",
316+
"version": "2.3.0"
317317
}
318318
},
319319
{

Adamant/App/AppDelegate.swift

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ extension StoreKey {
3838
struct application {
3939
static let welcomeScreensIsShown = "app.welcomeScreensIsShown"
4040
static let eulaAccepted = "app.eulaAccepted"
41-
static let firstRun = "app.firstRun"
4241

4342
private init() {}
4443
}
@@ -62,10 +61,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
6261

6362
// MARK: - Lifecycle
6463

65-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
66-
// MARK: 0. Migrate keychain if needed
67-
KeychainStore.migrateIfNeeded()
68-
64+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
6965
// MARK: 1. Initiating Swinject
7066
container = AppContainer()
7167
screensFactory = AdamantScreensFactory(assembler: container.assembler)
@@ -82,17 +78,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8278
.resolve(CrashlyticsService.self)?
8379
.configureIfNeeded()
8480

85-
// MARK: 1.2 First run flag
86-
let firstRun = UserDefaults.standard.bool(forKey: StoreKey.application.firstRun)
87-
88-
if !firstRun {
89-
UserDefaults.standard.set(true, forKey: StoreKey.application.firstRun)
90-
91-
if let securedStore = container.resolve(SecuredStore.self) {
92-
securedStore.purgeStore()
93-
}
94-
}
95-
9681
// MARK: 2. Init UI
9782
let window = UIWindow(frame: UIScreen.main.bounds)
9883
self.window = window
@@ -263,11 +248,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
263248
dialogService.showError(withMessage: "Failed to register AddressBookService autoupdate. Please, report a bug", supportEmail: true, error: nil)
264249
}
265250

266-
if let currencyInfoService = container.resolve(CurrencyInfoService.self) {
251+
if let currencyInfoService = container.resolve(InfoServiceProtocol.self) {
267252
currencyInfoService.update() // Initial update
268253
repeater.registerForegroundCall(label: "currencyInfoService", interval: 60, queue: .global(qos: .utility), callback: currencyInfoService.update)
269254
} else {
270-
dialogService.showError(withMessage: "Failed to register CurrencyInfoService autoupdate. Please, report a bug", supportEmail: true, error: nil)
255+
dialogService.showError(withMessage: "Failed to register InfoServiceProtocol autoupdate. Please, report a bug", supportEmail: true, error: nil)
271256
}
272257

273258
// MARK: 7. Logout reset

Adamant/App/DI/AppAssembly.swift

Lines changed: 84 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ struct AppAssembly: Assembly {
2929
container.register(CellFactory.self) { _ in AdamantCellFactory() }.inObjectScope(.container)
3030

3131
// MARK: Secured Store
32-
container.register(SecuredStore.self) { _ in KeychainStore() }.inObjectScope(.container)
32+
container.register(SecuredStore.self) { _ in
33+
KeychainStore(secureStorage: AdamantSecureStorage())
34+
}.inObjectScope(.container)
3335

3436
// MARK: LocalAuthentication
3537
container.register(LocalAuthentication.self) { _ in AdamantAuthentication() }.inObjectScope(.container)
@@ -43,16 +45,23 @@ struct AppAssembly: Assembly {
4345
// MARK: - Services with dependencies
4446
// MARK: DialogService
4547
container.register(DialogService.self) { r in
46-
AdamantDialogService(vibroService: r.resolve(VibroService.self)!)
48+
AdamantDialogService(
49+
vibroService: r.resolve(VibroService.self)!,
50+
notificationsService: r.resolve(NotificationsService.self)!
51+
)
4752
}.inObjectScope(.container)
4853

4954
// MARK: Notifications
5055
container.register(NotificationsService.self) { r in
51-
AdamantNotificationsService(securedStore: r.resolve(SecuredStore.self)!)
56+
AdamantNotificationsService(
57+
securedStore: r.resolve(SecuredStore.self)!,
58+
vibroService: r.resolve(VibroService.self)!
59+
)
5260
}.initCompleted { (r, c) in // Weak reference
5361
Task { @MainActor in
5462
guard let service = c as? AdamantNotificationsService else { return }
5563
service.accountService = r.resolve(AccountService.self)
64+
service.chatsProvider = r.resolve(ChatsProvider.self)
5665
}
5766
}.inObjectScope(.container)
5867

@@ -95,15 +104,21 @@ struct AppAssembly: Assembly {
95104
container.register(PushNotificationsTokenService.self) { r in
96105
AdamantPushNotificationsTokenService(
97106
securedStore: r.resolve(SecuredStore.self)!,
98-
apiService: r.resolve(ApiService.self)!,
107+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
99108
adamantCore: r.resolve(AdamantCore.self)!,
100109
accountService: r.resolve(AccountService.self)!
101110
)
102111
}.inObjectScope(.container)
103112

104113
// MARK: NodesStorage
105114
container.register(NodesStorageProtocol.self) { r in
106-
NodesStorage(securedStore: r.resolve(SecuredStore.self)!)
115+
NodesStorage(
116+
securedStore: r.resolve(SecuredStore.self)!,
117+
nodesMergingService: r.resolve(NodesMergingServiceProtocol.self)!,
118+
defaultNodes: { [provider = r.resolve(DefaultNodesProvider.self)!] groups in
119+
provider.get(groups)
120+
}
121+
)
107122
}.inObjectScope(.container)
108123

109124
// MARK: NodesAdditionalParamsStorage
@@ -117,28 +132,30 @@ struct AppAssembly: Assembly {
117132
}.inObjectScope(.container)
118133

119134
// MARK: ApiService
120-
container.register(ApiService.self) { r in
135+
container.register(AdamantApiServiceProtocol.self) { r in
121136
AdamantApiService(
122137
healthCheckWrapper: .init(
123138
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
124139
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
125140
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
126-
nodeGroup: .adm
141+
isActive: true,
142+
params: NodeGroup.adm.blockchainHealthCheckParams,
143+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
127144
),
128145
adamantCore: r.resolve(AdamantCore.self)!
129146
)
130147
}.inObjectScope(.container)
131148

132149
// MARK: IPFSApiService
133150
container.register(IPFSApiService.self) { r in
134-
IPFSApiService(
135-
healthCheckWrapper: .init(
136-
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
137-
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
138-
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
139-
nodeGroup: .ipfs
140-
)
141-
)
151+
IPFSApiService(healthCheckWrapper: .init(
152+
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
153+
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
154+
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
155+
isActive: true,
156+
params: NodeGroup.ipfs.blockchainHealthCheckParams,
157+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
158+
))
142159
}.inObjectScope(.container)
143160

144161
// MARK: FilesNetworkManagerProtocol
@@ -152,7 +169,9 @@ struct AppAssembly: Assembly {
152169
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
153170
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
154171
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
155-
nodeGroup: .btc
172+
isActive: true,
173+
params: NodeGroup.btc.blockchainHealthCheckParams,
174+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
156175
))
157176
}.inObjectScope(.container)
158177

@@ -162,7 +181,9 @@ struct AppAssembly: Assembly {
162181
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
163182
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
164183
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
165-
nodeGroup: .doge
184+
isActive: true,
185+
params: NodeGroup.doge.blockchainHealthCheckParams,
186+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
166187
))
167188
}.inObjectScope(.container)
168189

@@ -172,7 +193,9 @@ struct AppAssembly: Assembly {
172193
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
173194
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
174195
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
175-
nodeGroup: .dash
196+
isActive: true,
197+
params: NodeGroup.dash.blockchainHealthCheckParams,
198+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
176199
))
177200
}.inObjectScope(.container)
178201

@@ -182,7 +205,9 @@ struct AppAssembly: Assembly {
182205
service: .init(),
183206
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
184207
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
185-
nodeGroup: .klyNode
208+
isActive: true,
209+
params: NodeGroup.klyNode.blockchainHealthCheckParams,
210+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
186211
))
187212
}.inObjectScope(.container)
188213

@@ -192,7 +217,9 @@ struct AppAssembly: Assembly {
192217
service: .init(),
193218
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
194219
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
195-
nodeGroup: .klyService
220+
isActive: true,
221+
params: NodeGroup.klyService.blockchainHealthCheckParams,
222+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
196223
))
197224
}.inObjectScope(.container)
198225

@@ -207,7 +234,9 @@ struct AppAssembly: Assembly {
207234
service: .init(apiCore: r.resolve(APICoreProtocol.self)!),
208235
nodesStorage: r.resolve(NodesStorageProtocol.self)!,
209236
nodesAdditionalParamsStorage: r.resolve(NodesAdditionalParamsStorageProtocol.self)!,
210-
nodeGroup: .eth
237+
isActive: true,
238+
params: NodeGroup.eth.blockchainHealthCheckParams,
239+
connection: r.resolve(ReachabilityMonitor.self)!.connectionPublisher
211240
))
212241
}.inObjectScope(.container)
213242

@@ -222,40 +251,32 @@ struct AppAssembly: Assembly {
222251
// MARK: AccountService
223252
container.register(AccountService.self) { r in
224253
AdamantAccountService(
225-
apiService: r.resolve(ApiService.self)!,
254+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
226255
adamantCore: r.resolve(AdamantCore.self)!,
227256
dialogService: r.resolve(DialogService.self)!,
228257
securedStore: r.resolve(SecuredStore.self)!,
229-
walletServiceCompose: r.resolve(WalletServiceCompose.self)!
258+
walletServiceCompose: r.resolve(WalletServiceCompose.self)!,
259+
currencyInfoService: r.resolve(InfoServiceProtocol.self)!
230260
)
231261
}.inObjectScope(.container).initCompleted { (r, c) in
232262
Task { @MainActor in
233263
guard let service = c as? AdamantAccountService else { return }
234264
service.notificationsService = r.resolve(NotificationsService.self)!
235265
service.pushNotificationsTokenService = r.resolve(PushNotificationsTokenService.self)!
236-
service.currencyInfoService = r.resolve(CurrencyInfoService.self)!
237266
service.visibleWalletService = r.resolve(VisibleWalletsService.self)!
238267
}
239268
}
240269

241270
// MARK: AddressBookServeice
242271
container.register(AddressBookService.self) { r in
243272
AdamantAddressBookService(
244-
apiService: r.resolve(ApiService.self)!,
273+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
245274
adamantCore: r.resolve(AdamantCore.self)!,
246275
accountService: r.resolve(AccountService.self)!,
247276
dialogService: r.resolve(DialogService.self)!
248277
)
249278
}.inObjectScope(.container)
250279

251-
// MARK: CurrencyInfoService
252-
container.register(CurrencyInfoService.self) { r in
253-
AdamantCurrencyInfoService(
254-
securedStore: r.resolve(SecuredStore.self)!,
255-
walletServiceCompose: r.resolve(WalletServiceCompose.self)!
256-
)
257-
}.inObjectScope(.container)
258-
259280
// MARK: LanguageStorageProtocol
260281
container.register(LanguageStorageProtocol.self) { _ in
261282
LanguageStorageService()
@@ -271,15 +292,15 @@ struct AppAssembly: Assembly {
271292
container.register(AccountsProvider.self) { r in
272293
AdamantAccountsProvider(
273294
stack: r.resolve(CoreDataStack.self)!,
274-
apiService: r.resolve(ApiService.self)!,
295+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
275296
addressBookService: r.resolve(AddressBookService.self)!
276297
)
277298
}.inObjectScope(.container)
278299

279300
// MARK: Transfers
280301
container.register(TransfersProvider.self) { r in
281302
AdamantTransfersProvider(
282-
apiService: r.resolve(ApiService.self)!,
303+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
283304
stack: r.resolve(CoreDataStack.self)!,
284305
adamantCore: r.resolve(AdamantCore.self)!,
285306
accountService: r.resolve(AccountService.self)!,
@@ -312,7 +333,7 @@ struct AppAssembly: Assembly {
312333
container.register(ChatsProvider.self) { r in
313334
AdamantChatsProvider(
314335
accountService: r.resolve(AccountService.self)!,
315-
apiService: r.resolve(ApiService.self)!,
336+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
316337
socketService: r.resolve(SocketService.self)!,
317338
stack: r.resolve(CoreDataStack.self)!,
318339
adamantCore: r.resolve(AdamantCore.self)!,
@@ -344,7 +365,7 @@ struct AppAssembly: Assembly {
344365
container.register(RichTransactionReplyService.self) { r in
345366
AdamantRichTransactionReplyService(
346367
coreDataStack: r.resolve(CoreDataStack.self)!,
347-
apiService: r.resolve(ApiService.self)!,
368+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
348369
adamantCore: r.resolve(AdamantCore.self)!,
349370
accountService: r.resolve(AccountService.self)!,
350371
walletServiceCompose: r.resolve(WalletServiceCompose.self)!
@@ -355,7 +376,7 @@ struct AppAssembly: Assembly {
355376
container.register(RichTransactionReactService.self) { r in
356377
AdamantRichTransactionReactService(
357378
coreDataStack: r.resolve(CoreDataStack.self)!,
358-
apiService: r.resolve(ApiService.self)!,
379+
apiService: r.resolve(AdamantApiServiceProtocol.self)!,
359380
adamantCore: r.resolve(AdamantCore.self)!,
360381
accountService: r.resolve(AccountService.self)!
361382
)
@@ -400,5 +421,30 @@ struct AppAssembly: Assembly {
400421
}
401422
}
402423
}
424+
425+
// MARK: ApiService Compose
426+
container.register(ApiServiceComposeProtocol.self) {
427+
ApiServiceCompose(
428+
btc: $0.resolve(BtcApiService.self)!,
429+
eth: $0.resolve(EthApiService.self)!,
430+
klyNode: $0.resolve(KlyNodeApiService.self)!,
431+
klyService: $0.resolve(KlyServiceApiService.self)!,
432+
doge: $0.resolve(DogeApiService.self)!,
433+
dash: $0.resolve(DashApiService.self)!,
434+
adm: $0.resolve(AdamantApiServiceProtocol.self)!,
435+
ipfs: $0.resolve(IPFSApiService.self)!,
436+
infoService: $0.resolve(InfoServiceApiServiceProtocol.self)!
437+
)
438+
}.inObjectScope(.transient)
439+
440+
// MARK: NodesMergingService
441+
container.register(NodesMergingServiceProtocol.self) { _ in
442+
NodesMergingService()
443+
}.inObjectScope(.transient)
444+
445+
// MARK: DefaultNodesProvider
446+
container.register(DefaultNodesProvider.self) { _ in
447+
DefaultNodesProvider()
448+
}.inObjectScope(.transient)
403449
}
404450
}

Adamant/App/DI/AppContainer.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import Swinject
1010

1111
struct AppContainer {
12-
let assembler = Assembler([AppAssembly()])
12+
let assembler = Assembler([
13+
AppAssembly(),
14+
InfoServiceAssembly()
15+
])
1316

1417
func resolve<T>(_ type: T.Type) -> T? {
1518
assembler.resolve(T.self)

Adamant/Assets/antic.mp3

35.8 KB
Binary file not shown.

Adamant/Assets/cheers.mp3

38.8 KB
Binary file not shown.

Adamant/Assets/chord.mp3

81.7 KB
Binary file not shown.

Adamant/Assets/droplet.mp3

13.7 KB
Binary file not shown.

Adamant/Assets/handoff.mp3

72.5 KB
Binary file not shown.

Adamant/Assets/milestone.mp3

72.5 KB
Binary file not shown.

Adamant/Assets/note.mp3

70.9 KB
Binary file not shown.

Adamant/Assets/passage.mp3

41.3 KB
Binary file not shown.

Adamant/Assets/portal.mp3

49.9 KB
Binary file not shown.

Adamant/Assets/rattle.mp3

36.4 KB
Binary file not shown.

Adamant/Assets/rebound.mp3

44.4 KB
Binary file not shown.

Adamant/Assets/slide.mp3

29.7 KB
Binary file not shown.

Adamant/Assets/welcome.mp3

65.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)