Skip to content

Commit

Permalink
GH-2464 revert package to previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryBespalov committed Apr 19, 2024
1 parent 4bdbbc6 commit 5bf8bd2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Multisig.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7403,8 +7403,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/WalletConnect/WalletConnectSwiftV2";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.9.9;
kind = exactVersion;
version = 1.18.4;
};
};
04AECBB52A744B21008D5A35 /* XCRemoteSwiftPackageReference "mobile-sdk-ios" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@
"repositoryURL": "https://github.com/WalletConnect/WalletConnectSwiftV2",
"state": {
"branch": null,
"revision": "963473b0f431a880c00a59eeda9760df02950379",
"version": "1.18.5"
"revision": "58d2b49eeac5cf94432e2647b9107577c156a25c",
"version": "1.9.9"
}
},
{
Expand Down
29 changes: 12 additions & 17 deletions Multisig/UI/WalletConnectV2/WalletConnectManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class WalletConnectManager {

func config() {
let projectId = App.configuration.protected[.WALLETCONNECT_PROJECT_ID]
Networking.configure(groupIdentifier: "", projectId: projectId, socketFactory: SocketFactory())
Networking.configure(projectId: projectId, socketFactory: SocketFactory())
Pair.configure(metadata: metadata)
Web3Wallet.configure(metadata: metadata, crypto: NullCryptoProvider())
setUpAuthSubscribing()
Expand Down Expand Up @@ -107,17 +107,12 @@ class WalletConnectManager {
}

private func wcURI(string: String) -> WalletConnectURI? {
do {
if string.hasPrefix("safe://wc?uri=") {
let wcString = string.replacingOccurrences(of: "safe://wc?uri=", with: "wc://wc?uri=").removingPercentEncoding!
let url = URL(string: wcString)!
return try WalletConnectURI(deeplinkUri: url)
} else {
return try WalletConnectURI(uriString: string)
}
} catch {
LogService.shared.error("WC URI: \(error)")
return nil
if string.hasPrefix("safe://wc?uri=") {
let wcString = string.replacingOccurrences(of: "safe://wc?uri=", with: "wc://wc?uri=").removingPercentEncoding!
let url = URL(string: wcString)!
return WalletConnectURI(deeplinkUri: url)
} else {
return WalletConnectURI(string: string)
}
}

Expand Down Expand Up @@ -221,8 +216,8 @@ class WalletConnectManager {
let accounts = chains.compactMap { Account(blockchain: $0, address: address) }

let creme = SessionNamespace(
chains: chains,
accounts: accounts,
chains: Set(chains),
accounts: Set(accounts),
methods: Set(methods),
events: Set(events)
)
Expand Down Expand Up @@ -274,19 +269,19 @@ class WalletConnectManager {
switch failure {
case .preconditionsNotSatisfied(let id):
App.shared.snackbar.show(error: GSError.WC2SessionApprovalFailed())
try? await Web3Wallet.instance.rejectSession(proposalId: id, reason: .userRejected)
try? await Web3Wallet.instance.reject(proposalId: id, reason: .userRejected)

case .chainNotFound(let id):
App.shared.snackbar.show(error: GSError.WC2SessionApprovalFailedWrongChain())
try? await Web3Wallet.instance.rejectSession(proposalId: id, reason: .unsupportedChains)
try? await Web3Wallet.instance.reject(proposalId: id, reason: .userRejectedChains)
}
}
}

override func approve(proposalId: String, namespaces: [String: SessionNamespace]) {
Task { @MainActor in
do {
_ = try await Web3Wallet.instance.approve(proposalId: proposalId, namespaces: namespaces)
try await Web3Wallet.instance.approve(proposalId: proposalId, namespaces: namespaces)
} catch {
LogService.shared.error("Approval failed: \(error)")
App.shared.snackbar.show(error: GSError.WC2SessionApprovalFailed())
Expand Down

0 comments on commit 5bf8bd2

Please sign in to comment.