-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathBalanceLocksFetchingFactory.swift
More file actions
50 lines (45 loc) · 1.83 KB
/
Copy pathBalanceLocksFetchingFactory.swift
File metadata and controls
50 lines (45 loc) · 1.83 KB
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
import Foundation
import SSFModels
import SSFUtils
final class BalanceLocksFetchingFactory {
static func buildBalanceLocksFetcher(for chainAsset: ChainAsset) -> BalanceLocksFetching? {
let chainRegistry = ChainRegistryFacade.sharedRegistry
guard
let runtimeService = chainRegistry.getRuntimeProvider(for: chainAsset.chain.chainId),
let connection = chainRegistry.getConnection(for: chainAsset.chain.chainId)
else {
return nil
}
let operationManager = OperationManagerFacade.sharedManager
let storageRequestFactory = StorageRequestFactory(
remoteFactory: StorageKeyFactory(),
operationManager: operationManager
)
let storageRequestPerformer = StorageRequestPerformerDefault(
chainRegistry: chainRegistry
)
let crowdloanOperationFactory = CrowdloanOperationFactory(
requestOperationFactory: storageRequestFactory,
operationManager: operationManager,
chainRegistry: chainRegistry
)
let crowdloanService = CrowdloanServiceDefault(
crowdloanOperationFactory: crowdloanOperationFactory,
runtimeService: runtimeService,
connection: connection,
chainAsset: chainAsset,
operationManager: operationManager
)
let stakingPoolOperationFactory = StakingPoolOperationFactory(
chainAsset: chainAsset,
storageRequestFactory: storageRequestFactory,
chainRegistry: chainRegistry
)
return BalanceLocksFetchingDefault(
storageRequestPerformer: storageRequestPerformer,
chainAsset: chainAsset,
crowdloanService: crowdloanService,
stakingPoolOperationFactory: stakingPoolOperationFactory
)
}
}