Skip to content

Commit

Permalink
Merge pull request #3362 from safe-global/GH-3355/fix-wallet-connect
Browse files Browse the repository at this point in the history
GH-3355 fixed wallet connect configuration
  • Loading branch information
DmitryBespalov authored Nov 7, 2023
2 parents 9e6a204 + 27b54a8 commit 2c28ef2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 29 deletions.
20 changes: 2 additions & 18 deletions Multisig.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,11 @@
0497B2AD29A641C9007109ED /* WalletConnect in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2AC29A641C9007109ED /* WalletConnect */; };
0497B2AF29A641C9007109ED /* WalletConnectAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2AE29A641C9007109ED /* WalletConnectAuth */; };
0497B2B129A641C9007109ED /* WalletConnectChat in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2B029A641C9007109ED /* WalletConnectChat */; };
0497B2B329A641C9007109ED /* WalletConnectEcho in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2B229A641C9007109ED /* WalletConnectEcho */; };
0497B2B529A641C9007109ED /* WalletConnectNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2B429A641C9007109ED /* WalletConnectNetworking */; };
0497B2B729A641C9007109ED /* WalletConnectPairing in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2B629A641C9007109ED /* WalletConnectPairing */; };
0497B2B929A641C9007109ED /* WalletConnectPush in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2B829A641C9007109ED /* WalletConnectPush */; };
0497B2BB29A641C9007109ED /* WalletConnectRouter in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2BA29A641C9007109ED /* WalletConnectRouter */; };
0497B2BD29A641C9007109ED /* WalletConnectVerify in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2BC29A641C9007109ED /* WalletConnectVerify */; };
0497B2BF29A641C9007109ED /* Web3Inbox in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2BE29A641C9007109ED /* Web3Inbox */; };
0497B2C129A641C9007109ED /* Web3Wallet in Frameworks */ = {isa = PBXBuildFile; productRef = 0497B2C029A641C9007109ED /* Web3Wallet */; };
049A9D0E25F7C66E00CA5723 /* OwnerKeysListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A9D0C25F7C66E00CA5723 /* OwnerKeysListViewController.swift */; };
049A9D3A25F81F2C00CA5723 /* EditOwnerKeyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A9D3825F81F2C00CA5723 /* EditOwnerKeyViewController.swift */; };
Expand Down Expand Up @@ -2127,7 +2125,6 @@
0A259AB5287D83F9006770E7 /* UnstoppableDomainsResolution in Frameworks */,
55D3FF90260B2B21008ABD2B /* TrustKit in Frameworks */,
55D3FE8C260A0F88008ABD2B /* SwiftCryptoTokenFormatter in Frameworks */,
0497B2B329A641C9007109ED /* WalletConnectEcho in Frameworks */,
0497B2AD29A641C9007109ED /* WalletConnect in Frameworks */,
04AECBB72A744B21008D5A35 /* MoonpaySDK in Frameworks */,
04C22B302A36807500F58A15 /* SafeWeb3 in Frameworks */,
Expand All @@ -2137,7 +2134,6 @@
0A7FBE2528BE684100B5FFCF /* WhatsNewKit in Frameworks */,
0497B2B129A641C9007109ED /* WalletConnectChat in Frameworks */,
0A3DAD9426270F4D00743E38 /* unistring.xcframework in Frameworks */,
0497B2BF29A641C9007109ED /* Web3Inbox in Frameworks */,
043350AF2808628E003725E2 /* Lottie in Frameworks */,
0A3E980B2806FAD300E90EEC /* Algorithms in Frameworks */,
D80B5A13276B5FAD00D6E024 /* SkeletonView in Frameworks */,
Expand Down Expand Up @@ -4780,13 +4776,11 @@
0497B2AC29A641C9007109ED /* WalletConnect */,
0497B2AE29A641C9007109ED /* WalletConnectAuth */,
0497B2B029A641C9007109ED /* WalletConnectChat */,
0497B2B229A641C9007109ED /* WalletConnectEcho */,
0497B2B429A641C9007109ED /* WalletConnectNetworking */,
0497B2B629A641C9007109ED /* WalletConnectPairing */,
0497B2B829A641C9007109ED /* WalletConnectPush */,
0497B2BA29A641C9007109ED /* WalletConnectRouter */,
0497B2BC29A641C9007109ED /* WalletConnectVerify */,
0497B2BE29A641C9007109ED /* Web3Inbox */,
0497B2C029A641C9007109ED /* Web3Wallet */,
04C22B2C2A367FF800F58A15 /* CustomAuth */,
04C22B2F2A36807500F58A15 /* SafeWeb3 */,
Expand Down Expand Up @@ -7373,7 +7367,7 @@
repositoryURL = "https://github.com/WalletConnect/WalletConnectSwiftV2";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.6.14;
minimumVersion = 1.9.5;
};
};
04AECBB52A744B21008D5A35 /* XCRemoteSwiftPackageReference "mobile-sdk-ios" */ = {
Expand Down Expand Up @@ -7501,7 +7495,7 @@
repositoryURL = "https://github.com/intercom/intercom-ios.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 14.0.0;
minimumVersion = 16.2.3;
};
};
D80B5A11276B5FAD00D6E024 /* XCRemoteSwiftPackageReference "SkeletonView" */ = {
Expand Down Expand Up @@ -7555,11 +7549,6 @@
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectChat;
};
0497B2B229A641C9007109ED /* WalletConnectEcho */ = {
isa = XCSwiftPackageProductDependency;
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectEcho;
};
0497B2B429A641C9007109ED /* WalletConnectNetworking */ = {
isa = XCSwiftPackageProductDependency;
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
Expand All @@ -7585,11 +7574,6 @@
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectVerify;
};
0497B2BE29A641C9007109ED /* Web3Inbox */ = {
isa = XCSwiftPackageProductDependency;
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = Web3Inbox;
};
0497B2C029A641C9007109ED /* Web3Wallet */ = {
isa = XCSwiftPackageProductDependency;
package = 0497B2AB29A641C9007109ED /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
"repositoryURL": "https://github.com/intercom/intercom-ios.git",
"state": {
"branch": null,
"revision": "f994f1f203ae7479381642b6d1c58ffe419ee0ea",
"version": "14.1.0"
"revision": "fcc1ad96bdc2e2dfe079852715bd265504432cdd",
"version": "16.2.3"
}
},
{
Expand Down Expand Up @@ -384,8 +384,8 @@
"repositoryURL": "https://github.com/WalletConnect/WalletConnectSwiftV2",
"state": {
"branch": null,
"revision": "7d4eca9cf4441bbfef649a055baea0a31fd96d83",
"version": "1.6.14"
"revision": "7cf45ea8f98097b5813cd3c99d08b87c1be28ebe",
"version": "1.9.5"
}
},
{
Expand Down
11 changes: 6 additions & 5 deletions Multisig/UI/WalletConnectV2/WalletConnectManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import WalletConnectPairing
import Combine
import WalletConnectSign
import WalletConnectUtils
import WalletConnectRouter
import SafeWeb3
import Web3Wallet
import UIKit
import WalletConnectRelay

class WalletConnectManager {
static let shared = WalletConnectManager()
Expand All @@ -27,13 +27,14 @@ class WalletConnectManager {
description: "The most trusted platform to manage digital assets on Ethereum",
url: App.configuration.services.webAppURL.absoluteString,
icons: ["https://app.safe.global/favicons/mstile-150x150.png",
"https://app.safe.global/favicons/logo_120x120.png"])
"https://app.safe.global/favicons/logo_120x120.png"],
redirect: AppMetadata.Redirect(native: "", universal: "https://app.safe.global/"))

private init() { }

func config() {
Networking.configure(projectId: App.configuration.protected[.WALLETCONNECT_PROJECT_ID],
socketFactory: SocketFactory())
let projectId = App.configuration.protected[.WALLETCONNECT_PROJECT_ID]
Networking.configure(projectId: projectId, socketFactory: SocketFactory())
Pair.configure(metadata: metadata)
Web3Wallet.configure(metadata: metadata, crypto: NullCryptoProvider())
setUpAuthSubscribing()
Expand Down Expand Up @@ -111,7 +112,7 @@ class WalletConnectManager {
} catch {
LogService.shared.error("DAPP: Pairing failed: \(error)")
Task { @MainActor in
if "\(error)" == "pairingAlreadyExist" {
if "\(error)".hasPrefix("pairingAlreadyExist") {
App.shared.snackbar.show(error: GSError.WC2PairingAlreadyExists())
} else {
App.shared.snackbar.show(error: GSError.WC2PairingFailed())
Expand Down
4 changes: 2 additions & 2 deletions bin/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ cp "${EXAMPLE_CONFIG}" "${CONFIG_FILE}"

# replace the example value with the environment key
if ! [ -z ${CONFIG_KEY_STAGING} ]; then
sed -i '' "s/your-staging-config-key/${CONFIG_KEY_STAGING}/g" "${CONFIG_FILE}"
sed -i '' "s;your-staging-config-key;${CONFIG_KEY_STAGING};g" "${CONFIG_FILE}"
fi

if ! [ -z ${CONFIG_KEY_PROD} ]; then
sed -i '' "s/your-production-config-key/${CONFIG_KEY_PROD}/g" "${CONFIG_FILE}"
sed -i '' "s;your-production-config-key;${CONFIG_KEY_PROD};g" "${CONFIG_FILE}"
fi

# decrypt configuration file with the key from environment
Expand Down

0 comments on commit 2c28ef2

Please sign in to comment.