Skip to content

Commit

Permalink
Merge pull request #569 from WalletConnect/feature/cocoapods-#258
Browse files Browse the repository at this point in the history
[Infra] Cocoapods support #258
  • Loading branch information
flypaper0 authored Nov 8, 2022
2 parents 6984da1 + a47a80f commit 07cdbc5
Show file tree
Hide file tree
Showing 143 changed files with 206 additions and 360 deletions.
14 changes: 7 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ let package = Package(
targets: [
.target(
name: "WalletConnectSign",
dependencies: ["WalletConnectNetworking", "WalletConnectPairing"],
dependencies: ["WalletConnectPairing"],
path: "Sources/WalletConnectSign"),
.target(
name: "WalletConnectChat",
dependencies: ["WalletConnectNetworking"],
path: "Sources/Chat"),
.target(
name: "Auth",
dependencies: ["WalletConnectPairing", "WalletConnectNetworking", .product(name: "Web3", package: "Web3.swift")],
dependencies: ["WalletConnectPairing", .product(name: "Web3", package: "Web3.swift")],
path: "Sources/Auth"),
.target(
name: "WalletConnectPush",
dependencies: ["WalletConnectPairing", "WalletConnectNetworking"],
dependencies: ["WalletConnectPairing"],
path: "Sources/WalletConnectPush"),
.target(
name: "WalletConnectRelay",
dependencies: ["WalletConnectUtils", "WalletConnectKMS"],
dependencies: ["WalletConnectKMS"],
path: "Sources/WalletConnectRelay",
resources: [.copy("PackageConfig.json")]),
.target(
Expand All @@ -66,7 +66,7 @@ let package = Package(
dependencies: ["WalletConnectNetworking"]),
.target(
name: "WalletConnectUtils",
dependencies: ["Commons", "JSONRPC"]),
dependencies: ["JSONRPC"]),
.target(
name: "JSONRPC",
dependencies: ["Commons"]),
Expand All @@ -75,7 +75,7 @@ let package = Package(
dependencies: []),
.target(
name: "WalletConnectNetworking",
dependencies: ["JSONRPC", "WalletConnectKMS", "WalletConnectRelay", "WalletConnectUtils"]),
dependencies: ["WalletConnectRelay"]),
.target(
name: "WalletConnectRouter",
dependencies: []),
Expand All @@ -99,7 +99,7 @@ let package = Package(
dependencies: ["WalletConnectKMS", "WalletConnectUtils", "TestingUtils"]),
.target(
name: "TestingUtils",
dependencies: ["WalletConnectPairing", "WalletConnectNetworking"],
dependencies: ["WalletConnectPairing"],
path: "Tests/TestingUtils"),
.testTarget(
name: "WalletConnectUtilsTests",
Expand Down
2 changes: 0 additions & 2 deletions Sources/Auth/Auth.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Foundation
import WalletConnectNetworking
import WalletConnectPairing
import Combine

/// Auth instatnce wrapper
Expand Down
3 changes: 0 additions & 3 deletions Sources/Auth/AuthClient.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import Foundation
import Combine
import WalletConnectUtils
import WalletConnectPairing
import WalletConnectRelay

/// WalletConnect Auth Client
///
Expand Down
5 changes: 0 additions & 5 deletions Sources/Auth/AuthClientFactory.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import Foundation
import WalletConnectRelay
import WalletConnectUtils
import WalletConnectKMS
import WalletConnectPairing
import WalletConnectNetworking

public struct AuthClientFactory {

Expand Down
3 changes: 3 additions & 0 deletions Sources/Auth/AuthImports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if !CocoaPods
@_exported import WalletConnectPairing
#endif
1 change: 0 additions & 1 deletion Sources/Auth/AuthProtocolMethod.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

struct AuthRequestProtocolMethod: ProtocolMethod {
let method: String = "wc_authRequest"
Expand Down
26 changes: 0 additions & 26 deletions Sources/Auth/Services/App/AppPairService.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Auth/Services/App/AppRequestService.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Foundation
import JSONRPC
import WalletConnectNetworking
import WalletConnectUtils
import WalletConnectKMS

actor AppRequestService {
private let networkingInteractor: NetworkInteracting
Expand Down
4 changes: 0 additions & 4 deletions Sources/Auth/Services/App/AppRespondSubscriber.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Foundation
import Combine
import JSONRPC
import WalletConnectNetworking
import WalletConnectUtils
import WalletConnectPairing

class AppRespondSubscriber {
private let networkingInteractor: NetworkInteracting
Expand Down
1 change: 0 additions & 1 deletion Sources/Auth/Services/Common/SIWEMessageFormatter.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

protocol SIWEMessageFormatting {
func formatMessage(from authPayload: AuthPayload, address: String) -> String?
Expand Down
1 change: 0 additions & 1 deletion Sources/Auth/Services/Signer/DIDPKH.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

struct DIDPKH {
static let didPrefix: String = "did:pkh"
Expand Down
3 changes: 0 additions & 3 deletions Sources/Auth/Services/Signer/EIP1271/EIP1271Verifier.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import Foundation
import JSONRPC
import WalletConnectNetworking
import WalletConnectUtils

actor EIP1271Verifier {
private let projectId: String
Expand Down
1 change: 0 additions & 1 deletion Sources/Auth/Services/Signer/EIP1271/RPCService.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

struct RPCService: HTTPService {
let data: Data
Expand Down
1 change: 0 additions & 1 deletion Sources/Auth/Services/Signer/MessageSignerFactory.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

public struct MessageSignerFactory {

Expand Down
2 changes: 0 additions & 2 deletions Sources/Auth/Services/Wallet/PendingRequestsProvider.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Foundation
import JSONRPC
import WalletConnectUtils

class PendingRequestsProvider {
private let rpcHistory: RPCHistory
Expand Down
4 changes: 0 additions & 4 deletions Sources/Auth/Services/Wallet/WalletErrorResponder.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Foundation
import JSONRPC
import WalletConnectNetworking
import WalletConnectUtils
import WalletConnectKMS

actor WalletErrorResponder {
enum Errors: Error {
Expand Down
5 changes: 0 additions & 5 deletions Sources/Auth/Services/Wallet/WalletRequestSubscriber.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import Foundation
import Combine
import JSONRPC
import WalletConnectNetworking
import WalletConnectUtils
import WalletConnectKMS
import WalletConnectPairing

class WalletRequestSubscriber {
private let networkingInteractor: NetworkInteracting
Expand Down
4 changes: 0 additions & 4 deletions Sources/Auth/Services/Wallet/WalletRespondService.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Foundation
import JSONRPC
import WalletConnectKMS
import WalletConnectUtils
import WalletConnectNetworking

actor WalletRespondService {
enum Errors: Error {
Expand Down
4 changes: 0 additions & 4 deletions Sources/Auth/Types/Aliases/Account.swift

This file was deleted.

3 changes: 0 additions & 3 deletions Sources/Auth/Types/Aliases/AppMetadata.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Auth/Types/Aliases/Pairing.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Auth/Types/Aliases/RPCID.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Auth/Types/Aliases/WalletConnectURI.swift

This file was deleted.

1 change: 0 additions & 1 deletion Sources/Auth/Types/Errors/AuthError.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

/// Authentication error
public enum AuthError: Codable, Equatable, Error {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

/// wc_authRequest RPC method request param
struct AuthRequestParams: Codable, Equatable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

/// wc_authRequest RPC method respond param
typealias AuthResponseParams = Cacao
4 changes: 0 additions & 4 deletions Sources/Auth/Types/RelayProtocolOptions.swift

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/Chat/ChatClient.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Foundation
import WalletConnectUtils
import WalletConnectKMS
import WalletConnectRelay
import WalletConnectNetworking
import Combine

public class ChatClient {
Expand Down
4 changes: 0 additions & 4 deletions Sources/Chat/ChatClientFactory.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import Foundation
import WalletConnectRelay
import WalletConnectUtils
import WalletConnectKMS
import WalletConnectNetworking

public struct ChatClientFactory {

Expand Down
3 changes: 3 additions & 0 deletions Sources/Chat/ChatImports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if !CocoaPods
@_exported import WalletConnectNetworking
#endif
1 change: 0 additions & 1 deletion Sources/Chat/Database.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

class Database<Element> where Element: Codable {

Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/HTTPServices/RegisterService.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

struct RegisterService: HTTPService {

Expand Down
2 changes: 0 additions & 2 deletions Sources/Chat/HTTPServices/ResolveService.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Foundation
import WalletConnectNetworking
import WalletConnectUtils

struct ResolveService: HTTPService {

Expand Down
3 changes: 0 additions & 3 deletions Sources/Chat/ProtocolServices/Common/MessagingService.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import Foundation
import Combine
import JSONRPC
import WalletConnectUtils
import WalletConnectNetworking

class MessagingService {
enum Errors: Error {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import Foundation
import Combine
import WalletConnectRelay
import WalletConnectUtils
import WalletConnectNetworking

class ResubscriptionService {
private let networkingInteractor: NetworkInteracting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import Foundation
import Combine
import JSONRPC
import WalletConnectKMS
import WalletConnectUtils
import WalletConnectRelay
import WalletConnectNetworking

class InvitationHandlingService {
enum Error: Swift.Error {
Expand Down
3 changes: 0 additions & 3 deletions Sources/Chat/ProtocolServices/Invitee/RegistryService.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import Foundation
import WalletConnectUtils
import WalletConnectKMS
import WalletConnectNetworking

actor RegistryService {
let networkingInteractor: NetworkInteracting
Expand Down
4 changes: 0 additions & 4 deletions Sources/Chat/ProtocolServices/Inviter/InviteService.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Foundation
import Combine
import JSONRPC
import WalletConnectKMS
import WalletConnectUtils
import WalletConnectNetworking

class InviteService {
private var publishers = [AnyCancellable]()
Expand Down
2 changes: 0 additions & 2 deletions Sources/Chat/Registry.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Foundation
import WalletConnectNetworking
import WalletConnectUtils

public protocol Registry {
func register(account: Account, pubKey: String) async throws
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/ChatError.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

enum ChatError: Error {
case noInviteForId
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/ChatProtocolMethod.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectNetworking

struct ChatInviteProtocolMethod: ProtocolMethod {
let method: String = "wc_chatInvite"
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/Invite.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import WalletConnectUtils
import Foundation

struct InviteResponse: Codable {
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/Message.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

public struct Message: Codable, Equatable {
public var topic: String?
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/Thread.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import WalletConnectUtils

public struct Thread: Codable {
public let topic: String
Expand Down
1 change: 0 additions & 1 deletion Sources/Chat/Types/UserAccount.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import WalletConnectUtils

struct UserAccount: Codable {
let account: Account
Expand Down
2 changes: 0 additions & 2 deletions Sources/JSONRPC/JSONRPCError.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Commons

public struct JSONRPCError: Error, Equatable, Codable {
public let code: Int
public let message: String
Expand Down
3 changes: 3 additions & 0 deletions Sources/JSONRPC/JSONRPCImports.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#if !CocoaPods
@_exported import Commons
#endif
2 changes: 0 additions & 2 deletions Sources/JSONRPC/RPCID.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Foundation
import Commons
import Foundation

public typealias RPCID = Either<String, Int64>

Expand Down
Loading

0 comments on commit 07cdbc5

Please sign in to comment.