diff --git a/Example/DApp/Modules/Sign/SignView.swift b/Example/DApp/Modules/Sign/SignView.swift index e59774df0..7be67ee89 100644 --- a/Example/DApp/Modules/Sign/SignView.swift +++ b/Example/DApp/Modules/Sign/SignView.swift @@ -34,7 +34,7 @@ struct SignView: View { Button { presenter.connectWalletWithW3M() } label: { - Text("Connect with Web3Modal") + Text("Connect with AppKit") .font(.system(size: 16, weight: .semibold)) .foregroundColor(.white) .padding(.horizontal, 16) diff --git a/Example/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 628dc6270..01ca2540d 100644 --- a/Example/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Example/ExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -174,11 +174,11 @@ }, { "package": "CoinbaseWalletSDK", - "repositoryURL": "https://github.com/WalletConnect/wallet-mobile-sdk", + "repositoryURL": "https://github.com/MobileWalletProtocol/wallet-mobile-sdk", "state": { "branch": null, - "revision": "b6dfb7d6b8447c7c5b238a10443a1ac28223f38f", - "version": "1.0.0" + "revision": "4aa89e682f8d7ab1515d85d0797f0d25306bb56a", + "version": "1.0.5" } }, { diff --git a/Package.swift b/Package.swift index 2be0ed0e8..3a37d537d 100644 --- a/Package.swift +++ b/Package.swift @@ -47,9 +47,8 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.3.0"), .package(url: "https://github.com/WalletConnect/QRCode", from: "14.3.1"), - .package(name: "CoinbaseWalletSDK", url: "https://github.com/WalletConnect/wallet-mobile-sdk", from: "1.0.0"), - .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", .upToNextMinor(from: "1.10.0") - ), + .package(name: "CoinbaseWalletSDK", url: "https://github.com/MobileWalletProtocol/wallet-mobile-sdk", .upToNextMinor(from: "1.0.0")), + .package(url: "https://github.com/pointfreeco/swift-snapshot-testing", .upToNextMinor(from: "1.10.0")), ], targets: [ .target( diff --git a/Sources/ReownAppKit/Core/AppKit.swift b/Sources/ReownAppKit/Core/AppKit.swift index b3f16f0c4..16ba47f13 100644 --- a/Sources/ReownAppKit/Core/AppKit.swift +++ b/Sources/ReownAppKit/Core/AppKit.swift @@ -52,16 +52,7 @@ public class AppKit { struct Config { static let sdkVersion: String = { - guard - let fileURL = Bundle.coreModule.url(forResource: "PackageConfig", withExtension: "json"), - let data = try? Data(contentsOf: fileURL), - let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any], - let version = jsonObject["version"] as? String - else { - return "undefined" - } - - return "swift-\(version)" + return EnvironmentInfo.sdkName }() static let sdkType = "appkit" diff --git a/Sources/ReownAppKit/Core/BlockchainAPIInteractor.swift b/Sources/ReownAppKit/Core/BlockchainAPIInteractor.swift index c8fd4b568..ee7229689 100644 --- a/Sources/ReownAppKit/Core/BlockchainAPIInteractor.swift +++ b/Sources/ReownAppKit/Core/BlockchainAPIInteractor.swift @@ -1,5 +1,4 @@ import Foundation -import WalletConnectNetworking class BlockchainAPIInteractor: ObservableObject { let store: Store diff --git a/Sources/ReownAppKit/Core/W3MAPIInteractor.swift b/Sources/ReownAppKit/Core/W3MAPIInteractor.swift index 919bb91f1..0820f6b92 100644 --- a/Sources/ReownAppKit/Core/W3MAPIInteractor.swift +++ b/Sources/ReownAppKit/Core/W3MAPIInteractor.swift @@ -242,6 +242,6 @@ extension URLRequest { setValue(AppKit.config.projectId, forHTTPHeaderField: "x-project-id") setValue(AppKit.Config.sdkType, forHTTPHeaderField: "x-sdk-type") setValue(AppKit.Config.sdkVersion, forHTTPHeaderField: "x-sdk-version") - setValue(EnvironmentInfo.sdkVersion, forHTTPHeaderField: "User-Agent") + setValue(EnvironmentInfo.sdkName, forHTTPHeaderField: "User-Agent") } } diff --git a/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift b/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift index 8ab70eb9d..95caf7919 100644 --- a/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift +++ b/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift @@ -34,8 +34,7 @@ extension W3MJSONRPC { maxFeePerGas: maxFeePerGas, maxPriorityFeePerGas: maxPriorityFeePerGas, gasLimit: gasLimit, - chainId: chainId, - actionSource: nil + chainId: chainId ) case let .wallet_switchEthereumChain(chainId): return .wallet_switchEthereumChain(chainId: chainId) diff --git a/Sources/ReownAppKit/Extensions/Sequence.swift b/Sources/ReownAppKit/Extensions/SequenceExtension.swift similarity index 100% rename from Sources/ReownAppKit/Extensions/Sequence.swift rename to Sources/ReownAppKit/Extensions/SequenceExtension.swift diff --git a/Sources/ReownAppKit/Helpers/EnvironmentInfo.swift b/Sources/ReownAppKit/Helpers/EnvironmentInfo.swift deleted file mode 100644 index 83669b63f..000000000 --- a/Sources/ReownAppKit/Helpers/EnvironmentInfo.swift +++ /dev/null @@ -1,34 +0,0 @@ -#if os(iOS) -import UIKit -#endif -import Foundation - -enum EnvironmentInfo { - - static var sdkVersion: String { - "swift-\(packageVersion)/\(operatingSystem)" - } - - static var packageVersion: String { - guard - let fileURL = Bundle.coreModule.url(forResource: "PackageConfig", withExtension: "json"), - let data = try? Data(contentsOf: fileURL), - let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any], - let version = jsonObject["version"] as? String - else { - return "undefined" - } - - return version - } - - public static var operatingSystem: String { -#if os(iOS) - return "\(UIDevice.current.systemName)-\(UIDevice.current.systemVersion)" -#elseif os(macOS) - return "macOS-\(ProcessInfo.processInfo.operatingSystemVersion)" -#elseif os(tvOS) - return "tvOS-\(ProcessInfo.processInfo.operatingSystemVersion)" -#endif - } -} diff --git a/Sources/ReownAppKit/Store.swift b/Sources/ReownAppKit/Store.swift index c439f5507..f5279a4b5 100644 --- a/Sources/ReownAppKit/Store.swift +++ b/Sources/ReownAppKit/Store.swift @@ -1,6 +1,5 @@ import Combine import SwiftUI -import WalletConnectUtils enum ConnectionProviderType { case wc diff --git a/Sources/ReownAppKit/Web3ModalImports.swift b/Sources/ReownAppKit/Web3ModalImports.swift index 8b2bdfadd..56380e540 100644 --- a/Sources/ReownAppKit/Web3ModalImports.swift +++ b/Sources/ReownAppKit/Web3ModalImports.swift @@ -2,4 +2,5 @@ @_exported import ReownAppKitUI @_exported import ReownAppKitBackport @_exported import WalletConnectSign +@_exported import WalletConnectUtils #endif diff --git a/Sources/WalletConnectRelay/PackageConfig.json b/Sources/WalletConnectRelay/PackageConfig.json index c2ad4cfcb..f212de827 100644 --- a/Sources/WalletConnectRelay/PackageConfig.json +++ b/Sources/WalletConnectRelay/PackageConfig.json @@ -1 +1 @@ -{"version": "1.0.3"} +{"version": "1.0.4"} diff --git a/reown-swift.podspec b/reown-swift.podspec index 3e22ab77a..6279b33b7 100644 --- a/reown-swift.podspec +++ b/reown-swift.podspec @@ -6,8 +6,8 @@ Pod::Spec.new do |spec| spec.name = "reown-swift" spec.version = package["version"] - spec.summary = "Reown WalletKit" - spec.description = "Implementation of WalletKit" + spec.summary = "Reown Swift WalletKit & AppKit" + spec.description = "Implementation of WalletKit and AppKit" spec.homepage = "https://reown.com" spec.license = { :type => 'Apache-2.0', :file => 'LICENSE' } spec.authors = "Reown, Inc." @@ -17,7 +17,7 @@ Pod::Spec.new do |spec| } spec.platform = :ios, '13.0' - spec.swift_versions = '5.3' + spec.swift_versions = '5.9' spec.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DCocoaPods' } @@ -31,6 +31,34 @@ Pod::Spec.new do |spec| ss.dependency 'reown-swift/WalletConnectVerify' end + spec.subspec 'ReownAppKitBackport' do |ss| + ss.source_files = 'Sources/ReownAppKitBackport/**/*.{h,m,swift}' + end + + spec.subspec 'ReownAppKitUI' do |ss| + ss.source_files = 'Sources/ReownAppKitUI/**/*.{h,m,swift}' + ss.dependency 'reown-swift/ReownAppKitBackport' + ss.resource_bundles = { + 'ReownAppKitUI' => [ + 'Sources/ReownAppKitUI/Resources/*' + ] + } + end + + spec.subspec 'ReownAppKit' do |ss| + ss.source_files = 'Sources/ReownAppKit/**/*.{h,m,swift}' + ss.dependency 'reown-swift/WalletConnectSign' + ss.dependency 'reown-swift/ReownAppKitUI' + ss.dependency 'reown-swift/ReownAppKitBackport' + ss.dependency 'DSF_QRCode', '~> 16.1.1' + ss.dependency 'CoinbaseWalletSDK', '~> 1.0.0' + ss.resource_bundles = { + 'ReownAppKit' => [ + 'Sources/ReownAppKit/Resources/*' + ] + } + end + spec.subspec 'WalletConnectSign' do |ss| ss.source_files = 'Sources/WalletConnectSign/**/*.{h,m,swift}' ss.dependency 'reown-swift/WalletConnectPairing'