Skip to content

Commit f44ea44

Browse files
Merge pull request #78 from Adamant-im/dev/sockets
Sockets
2 parents 20cd76b + 9436465 commit f44ea44

20 files changed

+353
-61
lines changed

Adamant.xcodeproj/project.pbxproj

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
3A64FAA827BA67BF007D5588 /* AdamantSecret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A64FAA527BA67BF007D5588 /* AdamantSecret.swift */; };
1313
3A64FAA927BA67BF007D5588 /* AdamantSecret.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A64FAA527BA67BF007D5588 /* AdamantSecret.swift */; };
1414
3A8875EF27BBF38D00436195 /* Parchment in Frameworks */ = {isa = PBXBuildFile; productRef = 3A8875EE27BBF38D00436195 /* Parchment */; };
15+
3AA2D5F7280EADE3000ED971 /* SocketService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA2D5F6280EADE3000ED971 /* SocketService.swift */; };
16+
3AA2D5FA280EAF5D000ED971 /* AdamantSocketService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA2D5F9280EAF5D000ED971 /* AdamantSocketService.swift */; };
1517
3C06931576393125C61FB8F6 /* Pods_Adamant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33975C0D891698AA7E74EBCC /* Pods_Adamant.framework */; };
1618
6403F5DB2272389800D58779 /* (null) in Sources */ = {isa = PBXBuildFile; };
1719
6403F5DE22723C6800D58779 /* DashMainnet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6403F5DD22723C6800D58779 /* DashMainnet.swift */; };
@@ -607,6 +609,8 @@
607609
33975C0D891698AA7E74EBCC /* Pods_Adamant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Adamant.framework; sourceTree = BUILT_PRODUCTS_DIR; };
608610
36AB8CE9537B3B873972548B /* Pods_AdmCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AdmCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
609611
3A64FAA527BA67BF007D5588 /* AdamantSecret.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdamantSecret.swift; sourceTree = "<group>"; };
612+
3AA2D5F6280EADE3000ED971 /* SocketService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketService.swift; sourceTree = "<group>"; };
613+
3AA2D5F9280EAF5D000ED971 /* AdamantSocketService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdamantSocketService.swift; sourceTree = "<group>"; };
610614
4A4D67BD3DC89C07D1351248 /* Pods-AdmCore.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdmCore.release.xcconfig"; path = "Target Support Files/Pods-AdmCore/Pods-AdmCore.release.xcconfig"; sourceTree = "<group>"; };
611615
6403F5DD22723C6800D58779 /* DashMainnet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashMainnet.swift; sourceTree = "<group>"; };
612616
6403F5DF22723F6400D58779 /* DashWalletRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashWalletRouter.swift; sourceTree = "<group>"; };
@@ -1101,6 +1105,14 @@
11011105
path = Pods;
11021106
sourceTree = "<group>";
11031107
};
1108+
3AA2D5F8280EAF49000ED971 /* SocketService */ = {
1109+
isa = PBXGroup;
1110+
children = (
1111+
3AA2D5F9280EAF5D000ED971 /* AdamantSocketService.swift */,
1112+
);
1113+
path = SocketService;
1114+
sourceTree = "<group>";
1115+
};
11041116
6403F5DC22723C2800D58779 /* Dash */ = {
11051117
isa = PBXGroup;
11061118
children = (
@@ -1262,6 +1274,7 @@
12621274
E913C9071FFFA943001A83F7 /* AdamantCore.swift */,
12631275
6455E9F021075D3600B2E94C /* AddressBookService.swift */,
12641276
E91947AB20001A9A001362F8 /* ApiService.swift */,
1277+
3AA2D5F6280EADE3000ED971 /* SocketService.swift */,
12651278
648BCA6C213D384F00875EB5 /* AvatarService.swift */,
12661279
E9A174B22057EC47003667CD /* BackgroundFetchService.swift */,
12671280
E9E7CDBD2003AEFB00DFC4DB /* CellFactory.swift */,
@@ -1281,6 +1294,7 @@
12811294
E913C9061FFFA92E001A83F7 /* Services */ = {
12821295
isa = PBXGroup;
12831296
children = (
1297+
3AA2D5F8280EAF49000ED971 /* SocketService */,
12841298
E9CAE8D02018AA5000345E76 /* ApiService */,
12851299
E9B3D39F201FA2090019EB36 /* DataProviders */,
12861300
E9E7CD922002740500DFC4DB /* AdamantAccountService.swift */,
@@ -2311,6 +2325,8 @@
23112325
"${BUILT_PRODUCTS_DIR}/MessageKit/MessageKit.framework",
23122326
"${BUILT_PRODUCTS_DIR}/MyLittlePinpad/MyLittlePinpad.framework",
23132327
"${BUILT_PRODUCTS_DIR}/PMAlertController/PMAlertController.framework",
2328+
"${BUILT_PRODUCTS_DIR}/Socket.IO-Client-Swift/SocketIO.framework",
2329+
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
23142330
);
23152331
name = "[CP] Embed Pods Frameworks";
23162332
outputPaths = (
@@ -2320,6 +2336,8 @@
23202336
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MessageKit.framework",
23212337
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MyLittlePinpad.framework",
23222338
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PMAlertController.framework",
2339+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SocketIO.framework",
2340+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
23232341
);
23242342
runOnlyForDeploymentPostprocessing = 0;
23252343
shellPath = /bin/sh;
@@ -2516,6 +2534,7 @@
25162534
644793C32166314A00FC4CF5 /* OnboardPage.swift in Sources */,
25172535
64E1C831222E9617006C4DA7 /* DogeWalletService.swift in Sources */,
25182536
E91947B22000246A001362F8 /* AdamantError.swift in Sources */,
2537+
3AA2D5F7280EADE3000ED971 /* SocketService.swift in Sources */,
25192538
E95F85802008C8D70070534A /* ChatsRoutes.swift in Sources */,
25202539
6416B1A721B024B6006089AC /* LskWalletService+Send.swift in Sources */,
25212540
E9942B87203D9E5100C163AF /* EurekaQRRow.swift in Sources */,
@@ -2617,6 +2636,7 @@
26172636
E9502740202E257E002C1098 /* RepeaterService.swift in Sources */,
26182637
E93D7AC02052CF63005D19DC /* AdamantNotificationService.swift in Sources */,
26192638
645938942378395E00A2BE7C /* EulaViewController.swift in Sources */,
2639+
3AA2D5FA280EAF5D000ED971 /* AdamantSocketService.swift in Sources */,
26202640
649D6BEC21BD5A53009E727B /* UISuffixTextField.swift in Sources */,
26212641
E93B0D762028B28E00126346 /* AdamantChatsProvider.swift in Sources */,
26222642
E993302021354B1800CD5200 /* AdmWalletRoutes.swift in Sources */,
@@ -2877,7 +2897,7 @@
28772897
CODE_SIGN_ENTITLEMENTS = MessageNotificationContentExtension/Debug.entitlements;
28782898
CODE_SIGN_IDENTITY = "iPhone Developer";
28792899
CODE_SIGN_STYLE = Manual;
2880-
CURRENT_PROJECT_VERSION = 173;
2900+
CURRENT_PROJECT_VERSION = 180;
28812901
DEVELOPMENT_TEAM = J2L77FMN46;
28822902
INFOPLIST_FILE = MessageNotificationContentExtension/Info.plist;
28832903
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -2886,7 +2906,7 @@
28862906
"@executable_path/Frameworks",
28872907
"@executable_path/../../Frameworks",
28882908
);
2889-
MARKETING_VERSION = 2.3.0;
2909+
MARKETING_VERSION = 2.4.0;
28902910
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
28912911
MTL_FAST_MATH = YES;
28922912
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.MessageNotificationContentExtension";
@@ -2906,7 +2926,7 @@
29062926
CODE_SIGN_IDENTITY = "Apple Development";
29072927
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
29082928
CODE_SIGN_STYLE = Manual;
2909-
CURRENT_PROJECT_VERSION = 173;
2929+
CURRENT_PROJECT_VERSION = 180;
29102930
DEVELOPMENT_TEAM = J2L77FMN46;
29112931
INFOPLIST_FILE = MessageNotificationContentExtension/Info.plist;
29122932
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -2915,7 +2935,7 @@
29152935
"@executable_path/Frameworks",
29162936
"@executable_path/../../Frameworks",
29172937
);
2918-
MARKETING_VERSION = 2.3.0;
2938+
MARKETING_VERSION = 2.4.0;
29192939
MTL_FAST_MATH = YES;
29202940
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.MessageNotificationContentExtension";
29212941
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3053,7 +3073,7 @@
30533073
CODE_SIGN_ENTITLEMENTS = Adamant/Debug.entitlements;
30543074
CODE_SIGN_IDENTITY = "iPhone Developer";
30553075
CODE_SIGN_STYLE = Manual;
3056-
CURRENT_PROJECT_VERSION = 173;
3076+
CURRENT_PROJECT_VERSION = 180;
30573077
DEVELOPMENT_TEAM = J2L77FMN46;
30583078
DISPLAY_NAME = ADM.Dev;
30593079
EXCLUDED_SOURCE_FILE_NAMES = "";
@@ -3063,7 +3083,7 @@
30633083
"$(inherited)",
30643084
"@executable_path/Frameworks",
30653085
);
3066-
MARKETING_VERSION = 2.3.0;
3086+
MARKETING_VERSION = 2.4.0;
30673087
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev";
30683088
PRODUCT_NAME = "$(TARGET_NAME)";
30693089
PROVISIONING_PROFILE = "e4233bbf-3705-44fe-95b0-e77475672c60";
@@ -3082,7 +3102,7 @@
30823102
CODE_SIGN_IDENTITY = "Apple Development";
30833103
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
30843104
CODE_SIGN_STYLE = Manual;
3085-
CURRENT_PROJECT_VERSION = 173;
3105+
CURRENT_PROJECT_VERSION = 180;
30863106
DEVELOPMENT_TEAM = J2L77FMN46;
30873107
DISPLAY_NAME = Adamant;
30883108
EXCLUDED_SOURCE_FILE_NAMES = Debug.xcassets;
@@ -3092,7 +3112,7 @@
30923112
"$(inherited)",
30933113
"@executable_path/Frameworks",
30943114
);
3095-
MARKETING_VERSION = 2.3.0;
3115+
MARKETING_VERSION = 2.4.0;
30963116
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger";
30973117
PRODUCT_NAME = "$(TARGET_NAME)";
30983118
PROVISIONING_PROFILE = "bedd1b75-2f23-4a85-a0b2-14c424fcff42";
@@ -3110,7 +3130,7 @@
31103130
CODE_SIGN_ENTITLEMENTS = TransferNotificationContentExtension/Debug.entitlements;
31113131
CODE_SIGN_IDENTITY = "iPhone Developer";
31123132
CODE_SIGN_STYLE = Manual;
3113-
CURRENT_PROJECT_VERSION = 173;
3133+
CURRENT_PROJECT_VERSION = 180;
31143134
DEVELOPMENT_TEAM = J2L77FMN46;
31153135
INFOPLIST_FILE = TransferNotificationContentExtension/Info.plist;
31163136
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3119,7 +3139,7 @@
31193139
"@executable_path/Frameworks",
31203140
"@executable_path/../../Frameworks",
31213141
);
3122-
MARKETING_VERSION = 2.3.0;
3142+
MARKETING_VERSION = 2.4.0;
31233143
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31243144
MTL_FAST_MATH = YES;
31253145
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.TransferNotificationContentExtension";
@@ -3139,7 +3159,7 @@
31393159
CODE_SIGN_IDENTITY = "Apple Development";
31403160
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
31413161
CODE_SIGN_STYLE = Manual;
3142-
CURRENT_PROJECT_VERSION = 173;
3162+
CURRENT_PROJECT_VERSION = 180;
31433163
DEVELOPMENT_TEAM = J2L77FMN46;
31443164
INFOPLIST_FILE = TransferNotificationContentExtension/Info.plist;
31453165
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3148,7 +3168,7 @@
31483168
"@executable_path/Frameworks",
31493169
"@executable_path/../../Frameworks",
31503170
);
3151-
MARKETING_VERSION = 2.3.0;
3171+
MARKETING_VERSION = 2.4.0;
31523172
MTL_FAST_MATH = YES;
31533173
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.TransferNotificationContentExtension";
31543174
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -3168,7 +3188,7 @@
31683188
CODE_SIGN_ENTITLEMENTS = NotificationServiceExtension/Debug.entitlements;
31693189
CODE_SIGN_IDENTITY = "iPhone Developer";
31703190
CODE_SIGN_STYLE = Manual;
3171-
CURRENT_PROJECT_VERSION = 173;
3191+
CURRENT_PROJECT_VERSION = 180;
31723192
DEVELOPMENT_TEAM = J2L77FMN46;
31733193
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
31743194
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3177,7 +3197,7 @@
31773197
"@executable_path/Frameworks",
31783198
"@executable_path/../../Frameworks",
31793199
);
3180-
MARKETING_VERSION = 2.3.0;
3200+
MARKETING_VERSION = 2.4.0;
31813201
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31823202
MTL_FAST_MATH = YES;
31833203
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger-dev.NotificationServiceExtension";
@@ -3197,7 +3217,7 @@
31973217
CODE_SIGN_IDENTITY = "Apple Development";
31983218
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
31993219
CODE_SIGN_STYLE = Manual;
3200-
CURRENT_PROJECT_VERSION = 173;
3220+
CURRENT_PROJECT_VERSION = 180;
32013221
DEVELOPMENT_TEAM = J2L77FMN46;
32023222
INFOPLIST_FILE = NotificationServiceExtension/Info.plist;
32033223
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
@@ -3206,7 +3226,7 @@
32063226
"@executable_path/Frameworks",
32073227
"@executable_path/../../Frameworks",
32083228
);
3209-
MARKETING_VERSION = 2.3.0;
3229+
MARKETING_VERSION = 2.4.0;
32103230
MTL_FAST_MATH = YES;
32113231
PRODUCT_BUNDLE_IDENTIFIER = "im.adamant.adamant-messenger.NotificationServiceExtension";
32123232
PRODUCT_NAME = "$(TARGET_NAME)";

Adamant/AppDelegate.swift

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
182182

183183
// Register repeater services
184184
if let chatsProvider = container.resolve(ChatsProvider.self) {
185-
repeater.registerForegroundCall(label: "chatsProvider", interval: 3, queue: .global(qos: .utility), callback: chatsProvider.update)
185+
repeater.registerForegroundCall(label: "chatsProvider", interval: 10, queue: .global(qos: .utility), callback: chatsProvider.update)
186+
186187
} else {
187188
dialogService.showError(withMessage: "Failed to register ChatsProvider autoupdate. Please, report a bug", error: nil)
188189
}
@@ -264,7 +265,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
264265
}
265266

266267
// MARK: - Remote notifications
267-
extension AppDelegate {
268+
extension AppDelegate: UNUserNotificationCenterDelegate {
268269
private struct RegistrationPayload: Codable {
269270
let token: String
270271

@@ -283,7 +284,6 @@ extension AppDelegate {
283284
}
284285

285286
let token = deviceToken.map { String(format: "%02.2hhx", $0) }.joined()
286-
287287
// MARK: 1. Checking, if device token had not changed
288288
guard let securedStore = container.resolve(SecuredStore.self) else {
289289
fatalError("can't get secured store to get device token hash")
@@ -338,6 +338,66 @@ extension AppDelegate {
338338
service.showError(withMessage: String.localizedStringWithFormat(String.adamantLocalized.notifications.registerRemotesError, error.localizedDescription), error: error)
339339
}
340340
}
341+
342+
//MARK: Open Chat From Notification
343+
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
344+
if let recipientAddress = userInfo[AdamantNotificationUserInfoKeys.pushRecipient] as? String
345+
{
346+
if application.applicationState != .background && application.applicationState != .inactive {
347+
completionHandler(.noData)
348+
return
349+
}
350+
351+
if let tabbar = window?.rootViewController as? UITabBarController,
352+
let chats = tabbar.viewControllers?.first as? UISplitViewController,
353+
let chatList = chats.viewControllers.first as? UINavigationController,
354+
let list = chatList.viewControllers.first as? ChatListViewController {
355+
356+
switch list.accountService.state {
357+
case .loggedIn:
358+
self.openDialog(chatList: chatList, tabbar: tabbar, list: list, recipientAddress: recipientAddress)
359+
case .notLogged:
360+
break
361+
case .isLoggingIn:
362+
break
363+
case .updating:
364+
break
365+
}
366+
367+
// if not logged in
368+
list.didLoadedMessages = { [weak self] in
369+
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
370+
self?.openDialog(chatList: chatList, tabbar: tabbar, list: list, recipientAddress: recipientAddress)
371+
}
372+
}
373+
}
374+
completionHandler(.newData)
375+
} else {
376+
completionHandler(.noData)
377+
}
378+
}
379+
380+
func openDialog(chatList: UINavigationController, tabbar: UITabBarController, list: ChatListViewController, recipientAddress: String) {
381+
guard let chatroom = list.chatsController?.fetchedObjects?.first(where: { room in
382+
return room.lastTransaction?.recipientAddress == recipientAddress
383+
}) else { return }
384+
385+
chatList.popToRootViewController(animated: false)
386+
chatList.dismiss(animated: false, completion: nil)
387+
tabbar.selectedIndex = 0
388+
389+
let vc = list.chatViewController(for: chatroom, forceScrollToBottom: true)
390+
if let split = list.splitViewController {
391+
var timeout = 0.25
392+
if #available(iOS 13.0, *) { timeout = 0 }
393+
DispatchQueue.main.asyncAfter(deadline: .now() + timeout) {
394+
let chat = UINavigationController(rootViewController:vc)
395+
split.showDetailViewController(chat, sender: self)
396+
}
397+
} else {
398+
chatList.pushViewController(vc, animated: false)
399+
}
400+
}
341401
}
342402

343403

@@ -529,9 +589,9 @@ extension AppDelegate {
529589
}
530590

531591
// if not logged in
532-
list.didLoadedMessages = {
592+
list.didLoadedMessages = { [weak self] in
533593
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
534-
self.openDialog(chatList: chatList, tabbar: tabbar, router: router, list: list, adamantAdr: adamantAdr)
594+
self?.openDialog(chatList: chatList, tabbar: tabbar, router: router, list: list, adamantAdr: adamantAdr)
535595
}
536596
}
537597
}
@@ -541,7 +601,7 @@ extension AppDelegate {
541601
return true
542602
}
543603

544-
func openDialog(chatList: UINavigationController, tabbar: UITabBarController, router: Router, list: ChatListViewController, adamantAdr: AdamantAddress){
604+
func openDialog(chatList: UINavigationController, tabbar: UITabBarController, router: Router, list: ChatListViewController, adamantAdr: AdamantAddress) {
545605
chatList.popToRootViewController(animated: false)
546606
chatList.dismiss(animated: false, completion: nil)
547607
tabbar.selectedIndex = 0

Adamant/CoreData/Chatroom+CoreDataClass.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ public class Chatroom: NSManagedObject {
1515
static let entityName = "Chatroom"
1616

1717
func markAsReaded() {
18-
if hasUnreadMessages {
19-
hasUnreadMessages = false
20-
}
21-
18+
hasUnreadMessages = false
19+
2220
if let trs = transactions as? Set<ChatTransaction> {
2321
trs.filter { $0.isUnread }.forEach { $0.isUnread = false }
2422
}
23+
lastTransaction?.isUnread = false
2524
}
2625

2726
func getFirstUnread() -> ChatTransaction? {

Adamant/ServiceProtocols/NodesSource.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ protocol NodesSource {
4343
func getNewNode() -> Node
4444
func getValidNode(completion: @escaping ((Node?) -> Void))
4545

46+
func getSocketNewNode() -> Node
47+
4648
func saveNodes()
4749
func reloadNodes()
4850

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// SocketService.swift
3+
// Adamant
4+
//
5+
// Created by Stanislav Jelezoglo on 19.04.2022.
6+
// Copyright © 2022 Adamant. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
// - MARK: SocketService
12+
protocol SocketService: AnyObject {
13+
14+
/// Default is async queue with .utilities priority.
15+
var defaultResponseDispatchQueue: DispatchQueue { get }
16+
17+
// MARK: - Connection
18+
19+
func connect(address: String)
20+
21+
func disconnect()
22+
23+
// MARK: - Receive New Transaction
24+
25+
func receiveNewTransaction(completion: ((ApiServiceResult<Transaction>) -> Void)?)
26+
}

0 commit comments

Comments
 (0)