Skip to content

Commit

Permalink
remove wcm
Browse files Browse the repository at this point in the history
  • Loading branch information
llbartekll committed Sep 4, 2024
1 parent adfeb3a commit 81d3433
Show file tree
Hide file tree
Showing 117 changed files with 26 additions and 4,259 deletions.
9 changes: 0 additions & 9 deletions Example/DApp/Modules/Sign/SignPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import UIKit
import Combine

import ReownAppKit
import WalletConnectModal
import WalletConnectSign

final class SignPresenter: ObservableObject {
Expand Down Expand Up @@ -53,14 +52,6 @@ final class SignPresenter: ObservableObject {
AppKit.present(from: nil)
}

func connectWalletWithWCM() {
WalletConnectModal.set(sessionParams: .init(
requiredNamespaces: Proposal.requiredNamespaces,
optionalNamespaces: Proposal.optionalNamespaces
))
WalletConnectModal.present(from: nil)
}

@MainActor
func connectWalletWithSessionPropose() {
Task {
Expand Down
12 changes: 0 additions & 12 deletions Example/DApp/Modules/Sign/SignView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ struct SignView: View {
.background(Color(red: 95/255, green: 159/255, blue: 248/255))
.cornerRadius(16)
}

Button {
presenter.connectWalletWithWCM()
} label: {
Text("Connect with WalletConnectModal")
.font(.system(size: 16, weight: .semibold))
.foregroundColor(.white)
.padding(.horizontal, 16)
.padding(.vertical, 10)
.background(Color(red: 95/255, green: 159/255, blue: 248/255))
.cornerRadius(16)
}
}
.padding(.top, 10)
}
Expand Down
6 changes: 0 additions & 6 deletions Example/DApp/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import UIKit

import ReownAppKit
import WalletConnectModal
import WalletConnectRelay
import WalletConnectNetworking
import Combine
Expand Down Expand Up @@ -149,11 +148,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
}
}.store(in: &publishers)

WalletConnectModal.configure(
projectId: InputConfig.projectId,
metadata: metadata
)

Sign.instance.logger.setLogging(level: .debug)
Networking.instance.setLogging(level: .debug)

Expand Down
212 changes: 0 additions & 212 deletions Example/ExampleApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import Combine

import ReownWalletKit
import WalletConnectRouter
import ReownRouter

final class AuthRequestPresenter: ObservableObject {
enum Errors: Error {
Expand Down Expand Up @@ -63,7 +63,7 @@ final class AuthRequestPresenter: ObservableObject {
ActivityIndicatorManager.shared.stop()
/* Redirect */
if let uri = request.requester.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
router.dismiss()
} else {
showSignedSheet.toggle()
Expand All @@ -87,7 +87,7 @@ final class AuthRequestPresenter: ObservableObject {

/* Redirect */
if let uri = request.requester.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
router.dismiss()
} else {
showSignedSheet.toggle()
Expand All @@ -108,7 +108,7 @@ final class AuthRequestPresenter: ObservableObject {

/* Redirect */
if let uri = request.requester.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
}
ActivityIndicatorManager.shared.stop()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

import ReownWalletKit
import WalletConnectRouter
import ReownRouter

final class SessionProposalInteractor {
func approve(proposal: Session.Proposal, account: Account) async throws -> Bool {
Expand Down Expand Up @@ -42,7 +42,7 @@ final class SessionProposalInteractor {
}
_ = try await WalletKit.instance.approve(proposalId: proposal.id, namespaces: sessionNamespaces, sessionProperties: proposal.sessionProperties)
if let uri = proposal.proposer.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
return false
} else {
return true
Expand All @@ -53,7 +53,7 @@ final class SessionProposalInteractor {
try await WalletKit.instance.rejectSession(proposalId: proposal.id, reason: .userRejected)
/* Redirect */
if let uri = proposal.proposer.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

import ReownWalletKit
import WalletConnectRouter
import ReownRouter

final class SessionRequestInteractor {
func respondSessionRequest(sessionRequest: Request, importAccount: ImportAccount) async throws -> Bool {
Expand All @@ -15,7 +15,7 @@ final class SessionRequestInteractor {
/* Redirect */
let session = getSession(topic: sessionRequest.topic)
if let uri = session?.peer.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
return false
} else {
return true
Expand All @@ -35,7 +35,7 @@ final class SessionRequestInteractor {
/* Redirect */
let session = getSession(topic: sessionRequest.topic)
if let uri = session?.peer.redirect?.native {
WalletConnectRouter.goBack(uri: uri)
ReownRouter.goBack(uri: uri)
}
}

Expand Down
7 changes: 0 additions & 7 deletions Example/WalletConnect-Package.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@
"name" : "WalletConnectUtilsTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "WalletConnectModalTests",
"name" : "WalletConnectModalTests"
}
},
{
"target" : {
"containerPath" : "container:",
Expand Down
26 changes: 5 additions & 21 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ let package = Package(
name: "WalletConnectPush",
targets: ["WalletConnectPush"]),
.library(
name: "WalletConnectRouter",
targets: ["WalletConnectRouter", "WalletConnectRouterLegacy"]),
name: "ReownRouter",
targets: ["ReownRouter", "WalletConnectRouterLegacy"]),
.library(
name: "WalletConnectNetworking",
targets: ["WalletConnectNetworking"]),
.library(
name: "WalletConnectVerify",
targets: ["WalletConnectVerify"]),
.library(
name: "WalletConnectModal",
targets: ["WalletConnectModal"]),
.library(
name: "WalletConnectIdentity",
targets: ["WalletConnectIdentity"]),
Expand Down Expand Up @@ -116,11 +113,11 @@ let package = Package(
.target(
name: "WalletConnectRouterLegacy",
dependencies: [],
path: "Sources/WalletConnectRouter/RouterLegacy"),
path: "Sources/ReownRouter/RouterLegacy"),
.target(
name: "WalletConnectRouter",
name: "ReownRouter",
dependencies: ["WalletConnectRouterLegacy"],
path: "Sources/WalletConnectRouter/Router"),
path: "Sources/ReownRouter/Router"),
.target(
name: "WalletConnectVerify",
dependencies: ["WalletConnectUtils", "WalletConnectNetworking", "WalletConnectJWT"],
Expand All @@ -131,16 +128,6 @@ let package = Package(
.target(
name: "Events",
dependencies: ["WalletConnectUtils", "WalletConnectNetworking"]),
.target(
name: "WalletConnectModal",
dependencies: ["QRCode", "WalletConnectSign"],
exclude: ["Secrets/secrets.json.sample"],
resources: [
.copy("Secrets/secrets.json"),
.copy("Resources/Assets.xcassets"),
.process("Resources/PrivacyInfo.xcprivacy"),
]
),
.target(
name: "ReownAppKit",
dependencies: [
Expand Down Expand Up @@ -201,9 +188,6 @@ let package = Package(
.testTarget(
name: "CommonsTests",
dependencies: ["Commons", "TestingUtils"]),
.testTarget(
name: "WalletConnectModalTests",
dependencies: ["WalletConnectModal", "TestingUtils"]),
.testTarget(
name: "EventsTests",
dependencies: ["Events"]),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Swift implementation of WalletKit and AppKit for native iOS applications.
- [Beginner guide to WalletConnect v2.0 for iOS Developers](https://medium.com/walletconnect/beginner-guide-to-walletconnect-v2-0-for-swift-developers-4534b0975218)
- [Protocol Documentation](https://github.com/WalletConnect/walletconnect-specs)
- [Glossary](https://docs.walletconnect.com/2.0/introduction/glossary)
- [Migration guide to AppKit](https://github.com/WalletConnect/walletconnect-docs/blob/main/docs/swift/guides/web3wallet-migration.md)
- [Migration guide to AppKit](https://gist.github.com/llbartekll/a6fb18b48af837bcc46bb75b3eeaa781)
- [Migration guide to WalletKit](https://github.com/WalletConnect/walletconnect-docs/blob/main/docs/swift/guides/web3wallet-migration.md)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if os(iOS)
import UIKit
public struct WalletConnectRouter {
public struct ReownRouter {
public static func goBack(uri: String) {
if #available(iOS 17, *) {
DispatchQueue.main.async {
Expand Down
3 changes: 3 additions & 0 deletions Sources/ReownRouter/Router/RouterImports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if !CocoaPods
@_exported import ReownRouter
#endif
File renamed without changes.
3 changes: 3 additions & 0 deletions Sources/ReownRouter/RouterLegacy/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module ReownRouter {
header "Router.h"
}
12 changes: 0 additions & 12 deletions Sources/WalletConnectModal/Environment+ProjectId.swift

This file was deleted.

7 changes: 0 additions & 7 deletions Sources/WalletConnectModal/Extensions/Bundle.swift

This file was deleted.

8 changes: 0 additions & 8 deletions Sources/WalletConnectModal/Extensions/Collection.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Sources/WalletConnectModal/Extensions/Image+Backport.swift

This file was deleted.

50 changes: 0 additions & 50 deletions Sources/WalletConnectModal/Extensions/View+Backport.swift

This file was deleted.

20 changes: 0 additions & 20 deletions Sources/WalletConnectModal/Extensions/View+Modifiers.swift

This file was deleted.

Loading

0 comments on commit 81d3433

Please sign in to comment.