From 8b26111f17d6a007040eae00241eb36cf8740da5 Mon Sep 17 00:00:00 2001 From: liyongtuo <40377521+liyongtuo@users.noreply.github.com> Date: Fri, 17 Jan 2025 21:07:30 +0800 Subject: [PATCH 1/6] Update AutomaticSocketConnectionHandler.swift --- .../AutomaticSocketConnectionHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift index 99659761..fc8b3672 100644 --- a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift +++ b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift @@ -23,7 +23,7 @@ class AutomaticSocketConnectionHandler { // MARK: - Configuration - var requestTimeout: TimeInterval = 15 + var requestTimeout: TimeInterval = 60 let maxImmediateAttempts = 3 var periodicReconnectionInterval: TimeInterval = 5.0 From df4436d69f803f6579355f4c6aef17abe8e84893 Mon Sep 17 00:00:00 2001 From: Azu Date: Fri, 17 Jan 2025 22:37:17 +0800 Subject: [PATCH 2/6] update:timeout 60 --- Sources/WalletConnectRelay/Dispatching.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WalletConnectRelay/Dispatching.swift b/Sources/WalletConnectRelay/Dispatching.swift index ef075f72..71842c98 100644 --- a/Sources/WalletConnectRelay/Dispatching.swift +++ b/Sources/WalletConnectRelay/Dispatching.swift @@ -17,7 +17,7 @@ final class Dispatcher: NSObject, Dispatching { var socket: WebSocketConnecting var socketConnectionHandler: SocketConnectionHandler - private let defaultTimeout: Int = 15 + private let defaultTimeout: Int = 60 private let relayUrlFactory: RelayUrlFactory private let networkMonitor: NetworkMonitoring private let logger: ConsoleLogging From 0bdfb553bcb785cd38e8c2454ef68586c81845b2 Mon Sep 17 00:00:00 2001 From: Azu Date: Fri, 17 Jan 2025 23:53:26 +0800 Subject: [PATCH 3/6] relay timeout --- Sources/WalletConnectRelay/RelayClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WalletConnectRelay/RelayClient.swift b/Sources/WalletConnectRelay/RelayClient.swift index 4e946a59..7a76e11c 100644 --- a/Sources/WalletConnectRelay/RelayClient.swift +++ b/Sources/WalletConnectRelay/RelayClient.swift @@ -204,7 +204,7 @@ public final class RelayClient { // Convert Never to RelayError so we can throw on timeout .setFailureType(to: RelayError.self) // Enforce a 30-second timeout - .timeout(.seconds(30), scheduler: concurrentQueue, customError: { .requestTimeout }) + .timeout(.seconds(60), scheduler: concurrentQueue, customError: { .requestTimeout }) .sink( receiveCompletion: { [unowned self] completion in switch completion { From 66ddcff4f41977379b8b80ad2e5b76194eb7486c Mon Sep 17 00:00:00 2001 From: Azu Date: Sat, 18 Jan 2025 00:43:43 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=BA=86toast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/ReownAppKit/Screens/AccountView.swift | 6 +++--- .../ReownAppKit/Screens/ConnectWallet/AllWalletsView.swift | 4 ++-- .../Screens/ConnectWallet/ConnectWalletView.swift | 2 +- .../AutomaticSocketConnectionHandler.swift | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Sources/ReownAppKit/Screens/AccountView.swift b/Sources/ReownAppKit/Screens/AccountView.swift index 398ffe2f..8a892383 100644 --- a/Sources/ReownAppKit/Screens/AccountView.swift +++ b/Sources/ReownAppKit/Screens/AccountView.swift @@ -127,7 +127,7 @@ struct AccountView: View { do { try await blockchainApiInteractor.getBalance() } catch { - store.toast = .init(style: .error, message: "Network error") +// store.toast = .init(style: .error, message: "Network error") AppKit.config.onError(error) } } @@ -140,7 +140,7 @@ struct AccountView: View { do { try await blockchainApiInteractor.getIdentity() } catch { - store.toast = .init(style: .error, message: "Network error") +// store.toast = .init(style: .error, message: "Network error") AppKit.config.onError(error) } } @@ -171,7 +171,7 @@ struct AccountView: View { router.setRoute(Router.ConnectingSubpage.connectWallet) try await signInteractor.disconnect() } catch { - store.toast = .init(style: .error, message: "Network error") +// store.toast = .init(style: .error, message: "Network error") } } } diff --git a/Sources/ReownAppKit/Screens/ConnectWallet/AllWalletsView.swift b/Sources/ReownAppKit/Screens/ConnectWallet/AllWalletsView.swift index 184aba22..fd21c40c 100644 --- a/Sources/ReownAppKit/Screens/ConnectWallet/AllWalletsView.swift +++ b/Sources/ReownAppKit/Screens/ConnectWallet/AllWalletsView.swift @@ -144,7 +144,7 @@ struct AllWalletsView: View { analyticsService.track(.SELECT_WALLET(name: wallet.name, platform: .mobile)) router.setRoute(Router.ConnectingSubpage.walletDetail(wallet)) } catch { - store.toast = .init(style: .error, message: error.localizedDescription) +// store.toast = .init(style: .error, message: error.localizedDescription) } } }, label: { @@ -173,7 +173,7 @@ struct AllWalletsView: View { try await interactor.fetchWallets(search: search) } } catch { - store.toast = .init(style: .error, message: "Network error") +// store.toast = .init(style: .error, message: "Network error") } } } diff --git a/Sources/ReownAppKit/Screens/ConnectWallet/ConnectWalletView.swift b/Sources/ReownAppKit/Screens/ConnectWallet/ConnectWalletView.swift index c80b0acf..0cce0e06 100644 --- a/Sources/ReownAppKit/Screens/ConnectWallet/ConnectWalletView.swift +++ b/Sources/ReownAppKit/Screens/ConnectWallet/ConnectWalletView.swift @@ -68,7 +68,7 @@ struct ConnectWalletView: View { router.setRoute(Router.ConnectingSubpage.walletDetail(wallet)) analyticsService.track(.SELECT_WALLET(name: wallet.name, platform: .mobile)) } catch { - store.toast = .init(style: .error, message: error.localizedDescription) +// store.toast = .init(style: .error, message: error.localizedDescription) } } }, label: { diff --git a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift index fc8b3672..850997db 100644 --- a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift +++ b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift @@ -384,6 +384,9 @@ extension AutomaticSocketConnectionHandler: SocketConnectionHandler { self.logger.debug("Connection failed with error: \(error).") fail(with: error) } + self.syncQueue.async { + self.isConnecting = false + } }, receiveValue: { status in self.logger.debug("Received value (status): \(status)") From 95a0e2d3a32411c030e8a7a46a47ceb71d1edd92 Mon Sep 17 00:00:00 2001 From: Azu Date: Sat, 18 Jan 2025 01:17:23 +0800 Subject: [PATCH 5/6] up --- .../AutomaticSocketConnectionHandler.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift index 850997db..7d86ba6b 100644 --- a/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift +++ b/Sources/WalletConnectRelay/SocketConnectionHandler/AutomaticSocketConnectionHandler.swift @@ -384,9 +384,9 @@ extension AutomaticSocketConnectionHandler: SocketConnectionHandler { self.logger.debug("Connection failed with error: \(error).") fail(with: error) } - self.syncQueue.async { - self.isConnecting = false - } + self.syncQueue.async { + self.isConnecting = false + } }, receiveValue: { status in self.logger.debug("Received value (status): \(status)") From 42989e6faf23e325dde665e04afea5fb9e15bb9e Mon Sep 17 00:00:00 2001 From: Azu Date: Thu, 6 Feb 2025 13:31:17 +0800 Subject: [PATCH 6/6] =?UTF-8?q?update:=E5=8E=BB=E6=8E=89=E4=BA=86CoinBaseS?= =?UTF-8?q?DK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package.resolved | 13 +- Package.swift | 4 +- Sources/ReownAppKit/Core/AppKit.swift | 156 +++++++++--------- Sources/ReownAppKit/Core/AppKitClient.swift | 109 ++++++------ .../Core/W3MJSONRPC+Coinbase.swift | 126 +++++++------- .../NetworkDetailViewModel.swift | 32 ++-- Sources/ReownAppKit/Store.swift | 2 +- reown-swift.podspec | 1 - 8 files changed, 214 insertions(+), 229 deletions(-) diff --git a/Package.resolved b/Package.resolved index 7b2a29f1..0834824b 100644 --- a/Package.resolved +++ b/Package.resolved @@ -46,22 +46,13 @@ "version": "1.1.6" } }, - { - "package": "CoinbaseWalletSDK", - "repositoryURL": "https://github.com/MobileWalletProtocol/wallet-mobile-sdk", - "state": { - "branch": null, - "revision": "84b3d3f25a2e3b140ec12bb0d22c35b58f817d44", - "version": "1.0.0" - } - }, { "package": "Yttrium", "repositoryURL": "https://github.com/reown-com/yttrium", "state": { "branch": null, - "revision": "79fdd0d3be2d00e371b8f23998a4aa7b1c14e847", - "version": "0.4.7" + "revision": "533e9bacce2c7a45b1f9b3705726d03f2a37be4e", + "version": "0.4.8" } } ] diff --git a/Package.swift b/Package.swift index 0158ba62..d9cc8cbb 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let yttriumDebug = false var dependencies: [Package.Dependency] = [ .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/MobileWalletProtocol/wallet-mobile-sdk", .upToNextMinor(from: "1.0.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")), ] @@ -166,7 +166,7 @@ let package = Package( "WalletConnectSign", "ReownAppKitUI", "ReownAppKitBackport", - "CoinbaseWalletSDK" +// "CoinbaseWalletSDK" ], path: "Sources/ReownAppKit", resources: [ diff --git a/Sources/ReownAppKit/Core/AppKit.swift b/Sources/ReownAppKit/Core/AppKit.swift index 55addf58..947aaec6 100644 --- a/Sources/ReownAppKit/Core/AppKit.swift +++ b/Sources/ReownAppKit/Core/AppKit.swift @@ -1,4 +1,4 @@ -import CoinbaseWalletSDK +//import CoinbaseWalletSDK import Foundation import SwiftUI @@ -38,12 +38,6 @@ public class AppKit { store.session = session store.connectedWith = .wc store.account = .init(from: session) - } else if config.coinbaseEnabled, - CoinbaseWalletSDK.shared.isConnected() { - - let storedAccount = AccountStorage.read() - store.connectedWith = .cb - store.account = storedAccount } else { AccountStorage.clear() } @@ -122,11 +116,11 @@ public class AppKit { store.customWallets = customWallets - configureCoinbaseIfNeeded( - store: store, - metadata: metadata, - w3mApiInteractor: w3mApiInteractor - ) +// configureCoinbaseIfNeeded( +// store: store, +// metadata: metadata, +// w3mApiInteractor: w3mApiInteractor +// ) AppKit.viewModel = Web3ModalViewModel( router: router, @@ -149,75 +143,75 @@ public class AppKit { AppKit.config.sessionParams = sessionParams } - private static func configureCoinbaseIfNeeded( - store: Store, - metadata: AppMetadata, - w3mApiInteractor: W3MAPIInteractor - ) { - guard AppKit.config.coinbaseEnabled else { return } - - if let redirectLink = metadata.redirect?.universal ?? metadata.redirect?.native { - CoinbaseWalletSDK.configure(callback: URL(string: redirectLink)!) - } else { - CoinbaseWalletSDK.configure( - callback: URL(string: "w3mdapp://")! - ) - } - - var wallet: Wallet = .init( - id: "fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa", - name: "Coinbase", - homepage: "https://www.coinbase.com/wallet/", - imageId: "a5ebc364-8f91-4200-fcc6-be81310a0000", - order: 4, - mobileLink: nil, - linkMode: nil, - desktopLink: nil, - webappLink: nil, - appStore: "https://apps.apple.com/us/app/coinbase-wallet-nfts-crypto/id1278383455", - alternativeConnectionMethod: { - CoinbaseWalletSDK.shared.initiateHandshake { result, account in - switch result { - case .success: - guard - let account = account, - let blockchain = Blockchain( - namespace: account.chain == "eth" ? "eip155" : "", - reference: String(account.networkId) - ) - else { return } - - store.connectedWith = .cb - store.account = .init( - address: account.address, - chain: blockchain - ) - - withAnimation { - store.isModalShown = false - } - AppKit.viewModel.router.setRoute(Router.AccountSubpage.profile) - - let matchingChain = ChainPresets.ethChains.first(where: { - $0.chainNamespace == blockchain.namespace && $0.chainReference == blockchain.reference - }) - - store.selectedChain = matchingChain - case .failure(let error): - store.toast = .init(style: .error, message: error.localizedDescription) - } - } - } - ) - - wallet.isInstalled = CoinbaseWalletSDK.isCoinbaseWalletInstalled() - - store.customWallets.append(wallet) - - Task { [wallet] in - try? await w3mApiInteractor.fetchWalletImages(for: [wallet]) - } - } +// private static func configureCoinbaseIfNeeded( +// store: Store, +// metadata: AppMetadata, +// w3mApiInteractor: W3MAPIInteractor +// ) { +// guard AppKit.config.coinbaseEnabled else { return } +// +// if let redirectLink = metadata.redirect?.universal ?? metadata.redirect?.native { +// CoinbaseWalletSDK.configure(callback: URL(string: redirectLink)!) +// } else { +// CoinbaseWalletSDK.configure( +// callback: URL(string: "w3mdapp://")! +// ) +// } +// +// var wallet: Wallet = .init( +// id: "fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa", +// name: "Coinbase", +// homepage: "https://www.coinbase.com/wallet/", +// imageId: "a5ebc364-8f91-4200-fcc6-be81310a0000", +// order: 4, +// mobileLink: nil, +// linkMode: nil, +// desktopLink: nil, +// webappLink: nil, +// appStore: "https://apps.apple.com/us/app/coinbase-wallet-nfts-crypto/id1278383455", +// alternativeConnectionMethod: { +// CoinbaseWalletSDK.shared.initiateHandshake { result, account in +// switch result { +// case .success: +// guard +// let account = account, +// let blockchain = Blockchain( +// namespace: account.chain == "eth" ? "eip155" : "", +// reference: String(account.networkId) +// ) +// else { return } +// +// store.connectedWith = .cb +// store.account = .init( +// address: account.address, +// chain: blockchain +// ) +// +// withAnimation { +// store.isModalShown = false +// } +// AppKit.viewModel.router.setRoute(Router.AccountSubpage.profile) +// +// let matchingChain = ChainPresets.ethChains.first(where: { +// $0.chainNamespace == blockchain.namespace && $0.chainReference == blockchain.reference +// }) +// +// store.selectedChain = matchingChain +// case .failure(let error): +// store.toast = .init(style: .error, message: error.localizedDescription) +// } +// } +// } +// ) +// +// wallet.isInstalled = CoinbaseWalletSDK.isCoinbaseWalletInstalled() +// +// store.customWallets.append(wallet) +// +// Task { [wallet] in +// try? await w3mApiInteractor.fetchWalletImages(for: [wallet]) +// } +// } } diff --git a/Sources/ReownAppKit/Core/AppKitClient.swift b/Sources/ReownAppKit/Core/AppKitClient.swift index 10ac59b8..291da678 100644 --- a/Sources/ReownAppKit/Core/AppKitClient.swift +++ b/Sources/ReownAppKit/Core/AppKitClient.swift @@ -1,6 +1,6 @@ -import class CoinbaseWalletSDK.CoinbaseWalletSDK -import struct CoinbaseWalletSDK.Action -import struct CoinbaseWalletSDK.ActionError +//import class CoinbaseWalletSDK.CoinbaseWalletSDK +//import struct CoinbaseWalletSDK.Action +//import struct CoinbaseWalletSDK.ActionError import Combine import Foundation import UIKit @@ -175,44 +175,44 @@ public class AppKitClient { ) ) } - case .cb: - - guard let jsonRpc = request.toCbAction() else { return } - - // Execute on main as Coinbase SDK is not dispatching on main when calling UIApplication.openUrl() - DispatchQueue.main.async { - CoinbaseWalletSDK.shared.makeRequest( - .init( - actions: [ - Action(jsonRpc: jsonRpc) - ] - ) - ) { result in - let response: W3MResponse - switch result { - case let .success(payload): - - switch payload.content.first { - case let .success(JSONString): - response = .init(result: .response(AnyCodable(JSONString))) - case let .failure(error): - response = .init(result: .error(.init(code: error.code, message: error.message))) - case .none: - response = .init(result: .error(.init(code: -1, message: "Empty response"))) - } - case let .failure(error): - AppKit.config.onError(error) - - if let cbError = error as? ActionError { - response = .init(result: .error(.init(code: cbError.code, message: cbError.message))) - } else { - response = .init(result: .error(.init(code: -1, message: error.localizedDescription))) - } - } - - self.coinbaseResponseSubject.send(response) - } - } +// case .cb: +// +// guard let jsonRpc = request.toCbAction() else { return } +// +// // Execute on main as Coinbase SDK is not dispatching on main when calling UIApplication.openUrl() +// DispatchQueue.main.async { +// CoinbaseWalletSDK.shared.makeRequest( +// .init( +// actions: [ +// Action(jsonRpc: jsonRpc) +// ] +// ) +// ) { result in +// let response: W3MResponse +// switch result { +// case let .success(payload): +// +// switch payload.content.first { +// case let .success(JSONString): +// response = .init(result: .response(AnyCodable(JSONString))) +// case let .failure(error): +// response = .init(result: .error(.init(code: error.code, message: error.message))) +// case .none: +// response = .init(result: .error(.init(code: -1, message: "Empty response"))) +// } +// case let .failure(error): +// AppKit.config.onError(error) +// +// if let cbError = error as? ActionError { +// response = .init(result: .error(.init(code: cbError.code, message: cbError.message))) +// } else { +// response = .init(result: .error(.init(code: -1, message: error.localizedDescription))) +// } +// } +// +// self.coinbaseResponseSubject.send(response) +// } +// } case .none: break } @@ -247,13 +247,13 @@ public class AppKitClient { analyticsService.track(.DISCONNECT_ERROR) throw error } - case .cb: - if case let .failure(error) = CoinbaseWalletSDK.shared.resetSession() { - analyticsService.track(.DISCONNECT_ERROR) - throw error - } else { - analyticsService.track(.DISCONNECT_SUCCESS) - } +// case .cb: +// if case let .failure(error) = CoinbaseWalletSDK.shared.resetSession() { +// analyticsService.track(.DISCONNECT_ERROR) +// throw error +// } else { +// analyticsService.track(.DISCONNECT_SUCCESS) +// } case .none: break } @@ -330,12 +330,13 @@ public class AppKitClient { return false } } - do { - return try CoinbaseWalletSDK.shared.handleResponse(url) - } catch { - store.toast = .init(style: .error, message: error.localizedDescription) - return false - } + return false +// do { +// return try CoinbaseWalletSDK.shared.handleResponse(url) +// } catch { +// store.toast = .init(style: .error, message: error.localizedDescription) +// return false +// } } private func setUpConnectionEvents() { diff --git a/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift b/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift index 95caf791..8bf664b5 100644 --- a/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift +++ b/Sources/ReownAppKit/Core/W3MJSONRPC+Coinbase.swift @@ -1,66 +1,66 @@ -import CoinbaseWalletSDK +//import CoinbaseWalletSDK extension W3MJSONRPC { - func toCbAction() -> Web3JSONRPC? { - switch self { - case let .personal_sign(address, message): - return .personal_sign( - address: address, - message: message - ) - case .eth_requestAccounts: - return .eth_requestAccounts - case let .eth_signTransaction(from, to, value, data, nonce, _, gasPrice, maxFeePerGas, maxPriorityFeePerGas, gasLimit, chainId): - return .eth_signTransaction( - fromAddress: from, - toAddress: to, - weiValue: value, - data: data, - nonce: nonce, - gasPriceInWei: gasPrice, - maxFeePerGas: maxFeePerGas, - maxPriorityFeePerGas: maxPriorityFeePerGas, - gasLimit: gasLimit, - chainId: chainId - ) - case let .eth_sendTransaction(from, to, value, data, nonce, _, gasPrice, maxFeePerGas, maxPriorityFeePerGas, gasLimit, chainId): - return .eth_sendTransaction( - fromAddress: from, - toAddress: to, - weiValue: value, - data: data, - nonce: nonce, - gasPriceInWei: gasPrice, - maxFeePerGas: maxFeePerGas, - maxPriorityFeePerGas: maxPriorityFeePerGas, - gasLimit: gasLimit, - chainId: chainId - ) - case let .wallet_switchEthereumChain(chainId): - return .wallet_switchEthereumChain(chainId: chainId) - case let .wallet_addEthereumChain(chainId, blockExplorerUrls, chainName, iconUrls, nativeCurrency, rpcUrls): - return .wallet_addEthereumChain( - chainId: chainId, - blockExplorerUrls: blockExplorerUrls, - chainName: chainName, - iconUrls: iconUrls, - nativeCurrency: nativeCurrency != nil ? .init( - name: nativeCurrency!.name, - symbol: nativeCurrency!.symbol, - decimals: nativeCurrency!.decimals - ) : nil, - rpcUrls: rpcUrls - ) - case let .wallet_watchAsset(type, options): - return .wallet_watchAsset( - type: type, - options: .init( - address: options.address, - symbol: options.symbol, - decimals: options.decimals, - image: options.image - ) - ) - } - } +// func toCbAction() -> Web3JSONRPC? { +// switch self { +// case let .personal_sign(address, message): +// return .personal_sign( +// address: address, +// message: message +// ) +// case .eth_requestAccounts: +// return .eth_requestAccounts +// case let .eth_signTransaction(from, to, value, data, nonce, _, gasPrice, maxFeePerGas, maxPriorityFeePerGas, gasLimit, chainId): +// return .eth_signTransaction( +// fromAddress: from, +// toAddress: to, +// weiValue: value, +// data: data, +// nonce: nonce, +// gasPriceInWei: gasPrice, +// maxFeePerGas: maxFeePerGas, +// maxPriorityFeePerGas: maxPriorityFeePerGas, +// gasLimit: gasLimit, +// chainId: chainId +// ) +// case let .eth_sendTransaction(from, to, value, data, nonce, _, gasPrice, maxFeePerGas, maxPriorityFeePerGas, gasLimit, chainId): +// return .eth_sendTransaction( +// fromAddress: from, +// toAddress: to, +// weiValue: value, +// data: data, +// nonce: nonce, +// gasPriceInWei: gasPrice, +// maxFeePerGas: maxFeePerGas, +// maxPriorityFeePerGas: maxPriorityFeePerGas, +// gasLimit: gasLimit, +// chainId: chainId +// ) +// case let .wallet_switchEthereumChain(chainId): +// return .wallet_switchEthereumChain(chainId: chainId) +// case let .wallet_addEthereumChain(chainId, blockExplorerUrls, chainName, iconUrls, nativeCurrency, rpcUrls): +// return .wallet_addEthereumChain( +// chainId: chainId, +// blockExplorerUrls: blockExplorerUrls, +// chainName: chainName, +// iconUrls: iconUrls, +// nativeCurrency: nativeCurrency != nil ? .init( +// name: nativeCurrency!.name, +// symbol: nativeCurrency!.symbol, +// decimals: nativeCurrency!.decimals +// ) : nil, +// rpcUrls: rpcUrls +// ) +// case let .wallet_watchAsset(type, options): +// return .wallet_watchAsset( +// type: type, +// options: .init( +// address: options.address, +// symbol: options.symbol, +// decimals: options.decimals, +// image: options.image +// ) +// ) +// } +// } } diff --git a/Sources/ReownAppKit/Screens/ChainSwitch/NetworkDetail/NetworkDetailViewModel.swift b/Sources/ReownAppKit/Screens/ChainSwitch/NetworkDetail/NetworkDetailViewModel.swift index b5a992ef..df0553f0 100644 --- a/Sources/ReownAppKit/Screens/ChainSwitch/NetworkDetail/NetworkDetailViewModel.swift +++ b/Sources/ReownAppKit/Screens/ChainSwitch/NetworkDetail/NetworkDetailViewModel.swift @@ -148,8 +148,8 @@ final class NetworkDetailViewModel: ObservableObject { chainId: .init(from.id)! ) ) - case .cb: - try await AppKit.instance.request(.wallet_switchEthereumChain(chainId: to.chainReference)) +// case .cb: +// try await AppKit.instance.request(.wallet_switchEthereumChain(chainId: to.chainReference)) case .none: break } @@ -178,20 +178,20 @@ final class NetworkDetailViewModel: ObservableObject { chainId: .init(from.id)! ) ) - case .cb: - try await AppKit.instance.request( - .wallet_addEthereumChain( - chainId: addChainParams.chainId, - blockExplorerUrls: addChainParams.blockExplorerUrls, - chainName: addChainParams.chainName, - iconUrls: addChainParams.iconUrls, - nativeCurrency: .init( - name: addChainParams.nativeCurrency.name, - symbol: addChainParams.nativeCurrency.symbol, - decimals: addChainParams.nativeCurrency.decimals - ), - rpcUrls: addChainParams.rpcUrls - )) +// case .cb: +// try await AppKit.instance.request( +// .wallet_addEthereumChain( +// chainId: addChainParams.chainId, +// blockExplorerUrls: addChainParams.blockExplorerUrls, +// chainName: addChainParams.chainName, +// iconUrls: addChainParams.iconUrls, +// nativeCurrency: .init( +// name: addChainParams.nativeCurrency.name, +// symbol: addChainParams.nativeCurrency.symbol, +// decimals: addChainParams.nativeCurrency.decimals +// ), +// rpcUrls: addChainParams.rpcUrls +// )) case .none: break } diff --git a/Sources/ReownAppKit/Store.swift b/Sources/ReownAppKit/Store.swift index f5279a4b..530066af 100644 --- a/Sources/ReownAppKit/Store.swift +++ b/Sources/ReownAppKit/Store.swift @@ -3,7 +3,7 @@ import SwiftUI enum ConnectionProviderType { case wc - case cb +// case cb } class Store: ObservableObject { diff --git a/reown-swift.podspec b/reown-swift.podspec index 743fa949..0d36485b 100644 --- a/reown-swift.podspec +++ b/reown-swift.podspec @@ -52,7 +52,6 @@ Pod::Spec.new do |spec| 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/*'