-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from WalletConnect/develop
[Release] Develop -> Main v2-rc0
- Loading branch information
Showing
149 changed files
with
4,193 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import XCTest | ||
import WalletConnectRelay | ||
import WalletConnectKMS | ||
import WalletConnectUtils | ||
@testable import Chat | ||
|
||
final class RegistryTests: XCTestCase { | ||
|
||
func testRegistry() async throws { | ||
let client = HTTPClient(host: "keys.walletconnect.com") | ||
let registry = KeyserverRegistryProvider(client: client) | ||
let account = Account("eip155:1:" + Data.randomBytes(count: 16).toHexString())! | ||
let pubKey = SigningPrivateKey().publicKey.hexRepresentation | ||
try await registry.register(account: account, pubKey: pubKey) | ||
let resolvedKey = try await registry.resolve(account: account) | ||
XCTAssertEqual(resolvedKey, pubKey) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Example/Showcase/Classes/ApplicationLayer/AppDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import UIKit | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
// Override point for customization after application launch. | ||
return true | ||
} | ||
|
||
// MARK: UISceneSession Lifecycle | ||
|
||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { | ||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
|
||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Example/Showcase/Classes/ApplicationLayer/Application.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Foundation | ||
import Chat | ||
|
||
final class Application { | ||
|
||
let chatService: ChatService = { | ||
return ChatService(client: ChatFactory.create()) | ||
}() | ||
|
||
lazy var accountStorage: AccountStorage = { | ||
return AccountStorage(defaults: .standard) | ||
}() | ||
|
||
lazy var registerService: RegisterService = { | ||
return RegisterService(chatService: chatService) | ||
}() | ||
} |
19 changes: 19 additions & 0 deletions
19
Example/Showcase/Classes/ApplicationLayer/Configurator/AppearanceConfigurator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import UIKit | ||
|
||
struct AppearanceConfigurator: Configurator { | ||
|
||
func configure() { | ||
let appearance = UINavigationBarAppearance() | ||
appearance.backgroundColor = .w_background | ||
appearance.shadowColor = .clear | ||
appearance.titleTextAttributes = [ | ||
.foregroundColor: UIColor.w_foreground | ||
] | ||
|
||
UINavigationBar.appearance().standardAppearance = appearance | ||
UINavigationBar.appearance().scrollEdgeAppearance = appearance | ||
UINavigationBar.appearance().compactAppearance = appearance | ||
|
||
UIApplication.currentWindow.overrideUserInterfaceStyle = .dark | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Example/Showcase/Classes/ApplicationLayer/Configurator/ApplicationConfigurator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Combine | ||
|
||
struct ApplicationConfigurator: Configurator { | ||
|
||
private var publishers = Set<AnyCancellable>() | ||
|
||
private let app: Application | ||
|
||
init(app: Application) { | ||
self.app = app | ||
} | ||
|
||
func configure() { | ||
WelcomeModule.create(app: app).present() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
Example/Showcase/Classes/ApplicationLayer/Configurator/Configurator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
protocol Configurator { | ||
func configure() | ||
} | ||
|
||
extension Array where Element == Configurator { | ||
func configure() { | ||
forEach { $0.configure() } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Example/Showcase/Classes/ApplicationLayer/Configurator/MigrationConfigurator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
struct MigrationConfigurator: Configurator { | ||
|
||
let app: Application | ||
|
||
init(app: Application) { | ||
self.app = app | ||
} | ||
|
||
func configure() { | ||
|
||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Example/Showcase/Classes/ApplicationLayer/Configurator/ThirdPartyConfigurator.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
struct ThirdPartyConfigurator: Configurator { | ||
|
||
func configure() { | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Example/Showcase/Classes/ApplicationLayer/SceneDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import UIKit | ||
|
||
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
private let app = Application() | ||
|
||
private var configurators: [Configurator] { | ||
return [ | ||
MigrationConfigurator(app: app), | ||
ApplicationConfigurator(app: app), | ||
AppearanceConfigurator(), | ||
ThirdPartyConfigurator() | ||
] | ||
} | ||
|
||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | ||
guard let windowScene = (scene as? UIWindowScene) else { return } | ||
|
||
window = UIWindow(windowScene: windowScene) | ||
window?.makeKeyAndVisible() | ||
|
||
configurators.configure() | ||
} | ||
} |
Oops, something went wrong.