Skip to content

Commit bee699c

Browse files
add multiple wallet supportz
1 parent bfdbbcb commit bee699c

19 files changed

Lines changed: 883 additions & 49 deletions

Sources/Extensions/Notification+Names.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extension Notification.Name {
1919
static let didChangeCurrency = Notification.Name("didChangeCurrency")
2020
static let didChangeWalletAmount = Notification.Name("didChangeWalletAmount")
2121
static let didChangeReceiveAddress = Notification.Name("didChangeReceiveAddress")
22+
static let didSwitchWalletProfile = Notification.Name("didSwitchWalletProfile")
2223

2324
static let didFinishTorStart = Notification.Name("didFinishTorStart")
2425
static let didStartTorThread = Notification.Name("didStartTorThread")

Sources/Protocols/WalletClientProtocol.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ protocol WalletClientProtocol {
2626
completion: @escaping (Vws.WalletJoin?, Vws.WalletJoin.Error?, Error?) -> Void
2727
)
2828
func openWallet(completion: @escaping (Vws.WalletStatus?, Vws.WalletStatus.Error?, Error?) -> Void)
29+
func currentCopayerId() -> String
2930
func scanAddresses(completion: @escaping (_ error: Error?) -> Void)
3031

3132
func createAddress(

Sources/Providers/SettingsViewServiceProvider.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ class SettingsViewServiceProvider: ServiceProvider {
1515

1616
container.storyboardInitCompleted (SettingsTableViewController.self) { r, c in
1717
c.applicationRepository = r.resolve(ApplicationRepository.self)
18+
c.credentials = r.resolve(Credentials.self)
19+
c.walletClient = r.resolve(WalletClientProtocol.self)
20+
c.walletManager = r.resolve(WalletManagerProtocol.self)
21+
c.walletTicker = r.resolve(WalletTicker.self)
22+
c.fiatRateTicker = r.resolve(FiatRateTicker.self)
23+
c.transactionManager = r.resolve(TransactionManager.self)
1824
}
1925

2026
container.storyboardInitCompleted (TorConnectionTableViewController.self) { r, c in

Sources/Providers/SetupViewServiceProvider.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class SetupViewServiceProvider: ServiceProvider {
1414
c.transactionManager = r.resolve(TransactionManager.self)
1515
}
1616

17+
container.storyboardInitCompleted (PassphraseViewController.self) { r, c in
18+
c.applicationRepository = r.resolve(ApplicationRepository.self)
19+
}
20+
1721
container.storyboardInitCompleted (PassphraseConfirmationViewController.self) { r, c in
1822
c.applicationRepository = r.resolve(ApplicationRepository.self)
1923
}

Sources/Providers/WalletServiceProvider.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class WalletServiceProvider: ServiceProvider {
4040
registerLogger() // Must come first
4141
registerHttpSession() // HttpSessionProtocol
4242
registerRatesClient() // Must be before FiatRateTicker
43-
registerApplicationRepository()// Needed for Credentials & FiatRateTicker
4443
registerWalletCredentials() // Depends on ApplicationRepository
4544
registerWalletClient() // Depends on Credentials & HttpSession
4645
registerTransactionRepository()
@@ -169,13 +168,6 @@ class WalletServiceProvider: ServiceProvider {
169168
}.inObjectScope(.container)
170169
}
171170

172-
// MARK: - ApplicationRepository
173-
private func registerApplicationRepository() {
174-
container.register(ApplicationRepository.self) { _ in ApplicationRepository() }
175-
.inObjectScope(.container)
176-
}
177-
178-
179171
// MARK: - Wallet Credentials
180172
func registerWalletCredentials() {
181173
container.register(Credentials.self) { resolver in

0 commit comments

Comments
 (0)