diff --git a/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_notifyWatchSubscriptions/NotifyWatchSubscriptionsResponseSubscriber.swift b/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_notifyWatchSubscriptions/NotifyWatchSubscriptionsResponseSubscriber.swift index 04dfd9934..e96c8c614 100644 --- a/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_notifyWatchSubscriptions/NotifyWatchSubscriptionsResponseSubscriber.swift +++ b/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_notifyWatchSubscriptions/NotifyWatchSubscriptionsResponseSubscriber.swift @@ -43,6 +43,8 @@ class NotifyWatchSubscriptionsResponseSubscriber { let oldSubscriptions = notifyStorage.getSubscriptions() let newSubscriptions = try await notifySubscriptionsBuilder.buildSubscriptions(responsePayload.subscriptions) + try Task.checkCancellation() + logger.debug("number of subscriptions: \(newSubscriptions.count)") guard newSubscriptions != oldSubscriptions else {return} diff --git a/Sources/WalletConnectRelay/PackageConfig.json b/Sources/WalletConnectRelay/PackageConfig.json index 9c34e0b9a..383bc8548 100644 --- a/Sources/WalletConnectRelay/PackageConfig.json +++ b/Sources/WalletConnectRelay/PackageConfig.json @@ -1 +1 @@ -{"version": "1.8.5"} +{"version": "1.8.6"} diff --git a/Sources/WalletConnectUtils/WalletConnectURI.swift b/Sources/WalletConnectUtils/WalletConnectURI.swift index 91973f209..2e16a652d 100644 --- a/Sources/WalletConnectUtils/WalletConnectURI.swift +++ b/Sources/WalletConnectUtils/WalletConnectURI.swift @@ -1,7 +1,6 @@ -import UIKit +import Foundation public struct WalletConnectURI: Equatable { - public let topic: String public let version: String public let symKey: String @@ -51,20 +50,6 @@ public struct WalletConnectURI: Equatable { } return nil } - - public init?(connectionOptions: UIScene.ConnectionOptions) { - if let uri = connectionOptions.urlContexts.first?.url.query?.replacingOccurrences(of: "uri=", with: "") { - self.init(string: uri) - } - return nil - } - - public init?(urlContext: UIOpenURLContext) { - if let uri = urlContext.url.query?.replacingOccurrences(of: "uri=", with: "") { - self.init(string: uri) - } - return nil - } private var relayQuery: String { var query = "relay-protocol=\(relay.protocol)" @@ -82,3 +67,25 @@ public struct WalletConnectURI: Equatable { return URLComponents(string: urlString) } } + +#if canImport(UIKit) + +import UIKit + +extension WalletConnectURI { + public init?(connectionOptions: UIScene.ConnectionOptions) { + if let uri = connectionOptions.urlContexts.first?.url.query?.replacingOccurrences(of: "uri=", with: "") { + self.init(string: uri) + } + return nil + } + + public init?(urlContext: UIOpenURLContext) { + if let uri = urlContext.url.query?.replacingOccurrences(of: "uri=", with: "") { + self.init(string: uri) + } + return nil + } +} + +#endif