-
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 #711 from WalletConnect/develop
1.3.2
- Loading branch information
Showing
49 changed files
with
823 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SCHEME = "Showcase" | ||
APP_IDENTIFIER = "com.walletconnect.chat" | ||
MATCH_IDENTIFIERS = "com.walletconnect.chat" | ||
APPLE_ID = "1634760092" |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SCHEME = "WalletApp" | ||
APP_IDENTIFIER = "com.walletconnect.walletapp" | ||
MATCH_IDENTIFIERS = "com.walletconnect.walletapp,com.walletconnect.walletapp.PNDecryptionService" | ||
APPLE_ID = "1667351690" |
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,42 @@ | ||
name: release | ||
|
||
on: | ||
schedule: | ||
# Runs "Every Monday 10am CET" | ||
- cron: '0 10 * * 1' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Xcode Version | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: 14.1 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
.build | ||
SourcePackagesCache | ||
DerivedDataCache | ||
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} | ||
restore-keys: | | ||
${{ runner.os }}-spm- | ||
- name: Release | ||
shell: bash | ||
env: | ||
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
GH_USER: ${{ secrets.GH_USER }} | ||
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }} | ||
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }} | ||
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }} | ||
run: | | ||
make release_all APPLE_ID=${{ secrets.APPLE_ID }} TOKEN=$(echo -n $GH_USER:$GH_TOKEN | base64) |
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
67 changes: 67 additions & 0 deletions
67
.swiftpm/xcode/xcshareddata/xcschemes/WalletConnectEcho.xcscheme
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,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1420" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "WalletConnectEcho" | ||
BuildableName = "WalletConnectEcho" | ||
BlueprintName = "WalletConnectEcho" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "WalletConnectEcho" | ||
BuildableName = "WalletConnectEcho" | ||
BlueprintName = "WalletConnectEcho" | ||
ReferencedContainer = "container:"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
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
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,27 @@ | ||
import Foundation | ||
import WalletConnectPush | ||
|
||
class BuildConfiguration { | ||
enum Environment: String { | ||
case debug = "Debug" | ||
case release = "Release" | ||
} | ||
|
||
static let shared = BuildConfiguration() | ||
|
||
var environment: Environment | ||
|
||
var apnsEnvironment: APNSEnvironment { | ||
switch environment { | ||
case .debug: | ||
return .sandbox | ||
case .release: | ||
return .production | ||
} | ||
} | ||
|
||
init() { | ||
let currentConfiguration = Bundle.main.object(forInfoDictionaryKey: "CONFIGURATION") as! String | ||
environment = Environment(rawValue: currentConfiguration)! | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
Example/WalletApp/PresentationLayer/Wallet/Main/MainInteractor.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,15 @@ | ||
import Combine | ||
import Web3Wallet | ||
import WalletConnectPush | ||
import Foundation | ||
|
||
final class MainInteractor { | ||
|
||
var sessionProposalPublisher: AnyPublisher<Session.Proposal, Never> { | ||
return Web3Wallet.instance.sessionProposalPublisher | ||
} | ||
|
||
var pushRequestPublisher: AnyPublisher<(id: RPCID, account: Account, metadata: AppMetadata), Never> { | ||
return Push.wallet.requestPublisher | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Example/WalletApp/PresentationLayer/Wallet/Main/MainModule.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 SwiftUI | ||
|
||
final class MainModule { | ||
|
||
@discardableResult | ||
static func create(app: Application) -> UIViewController { | ||
let router = MainRouter(app: app) | ||
let interactor = MainInteractor() | ||
let presenter = MainPresenter(router: router, interactor: interactor) | ||
let viewController = MainViewController(presenter: presenter) | ||
|
||
router.viewController = viewController | ||
|
||
return viewController | ||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
Example/WalletApp/PresentationLayer/Wallet/Main/MainPresenter.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,48 @@ | ||
import UIKit | ||
import Combine | ||
|
||
final class MainPresenter { | ||
|
||
private let interactor: MainInteractor | ||
private let router: MainRouter | ||
private var disposeBag = Set<AnyCancellable>() | ||
|
||
var tabs: [TabPage] { | ||
return TabPage.allCases | ||
} | ||
|
||
var viewControllers: [UIViewController] { | ||
return [ | ||
router.walletViewController(), | ||
router.notificationsViewController(), | ||
] | ||
} | ||
|
||
init(router: MainRouter, | ||
interactor: MainInteractor) { | ||
defer { | ||
setupInitialState() | ||
} | ||
self.router = router | ||
self.interactor = interactor | ||
} | ||
} | ||
|
||
// MARK: - Private functions | ||
extension MainPresenter { | ||
private func setupInitialState() { | ||
interactor.pushRequestPublisher | ||
.receive(on: DispatchQueue.main) | ||
.sink { [weak self] request in | ||
self?.router.present(pushRequest: request) | ||
}.store(in: &disposeBag) | ||
|
||
interactor.sessionProposalPublisher | ||
.receive(on: DispatchQueue.main) | ||
.sink { [weak self] proposal in | ||
self?.router.present(proposal: proposal) | ||
} | ||
.store(in: &disposeBag) | ||
} | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
Example/WalletApp/PresentationLayer/Wallet/Main/MainRouter.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,33 @@ | ||
import UIKit | ||
import WalletConnectPush | ||
import Web3Wallet | ||
final class MainRouter { | ||
|
||
weak var viewController: UIViewController! | ||
|
||
private let app: Application | ||
|
||
func walletViewController() -> UIViewController { | ||
return WalletModule.create(app: app) | ||
.wrapToNavigationController() | ||
} | ||
|
||
func present(proposal: Session.Proposal) { | ||
SessionProposalModule.create(app: app, proposal: proposal) | ||
.presentFullScreen(from: viewController, transparentBackground: true) | ||
} | ||
|
||
func notificationsViewController() -> UIViewController { | ||
return NotificationsModule.create(app: app) | ||
.wrapToNavigationController() | ||
} | ||
|
||
func present(pushRequest: PushRequest) { | ||
PushRequestModule.create(app: app, pushRequest: pushRequest) | ||
.presentFullScreen(from: viewController, transparentBackground: true) | ||
} | ||
|
||
init(app: Application) { | ||
self.app = app | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
Example/WalletApp/PresentationLayer/Wallet/Main/MainViewController.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,38 @@ | ||
import UIKit | ||
|
||
final class MainViewController: UITabBarController { | ||
|
||
private let presenter: MainPresenter | ||
|
||
init(presenter: MainPresenter) { | ||
self.presenter = presenter | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
setupTabs() | ||
} | ||
|
||
private func setupTabs() { | ||
let viewControllers = presenter.viewControllers | ||
|
||
for (index, viewController) in viewControllers.enumerated() { | ||
let model = presenter.tabs[index] | ||
let item = UITabBarItem() | ||
item.title = model.title | ||
item.image = model.icon | ||
item.isEnabled = TabPage.enabledTabs.contains(model) | ||
viewController.tabBarItem = item | ||
viewController.view.backgroundColor = .w_background | ||
} | ||
|
||
self.viewControllers = viewControllers | ||
self.selectedIndex = TabPage.selectedIndex | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} |
Oops, something went wrong.