Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed Nov 15, 2024
2 parents 9aa5729 + 3d02742 commit 59f0a3c
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 231 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ jobs:
# Build and archive for main or develop
- name: Build and Archive
if: github.ref == 'refs/heads/main'
run: xcodebuild -scheme "Kukai Mobile Release" -sdk iphoneos -configuration Release -archivePath $PWD/build/Kukai-mobile.xcarchive clean archive
run: xcodebuild -scheme "Kukai Mobile Release" -sdk iphoneos -configuration Release -archivePath $PWD/build/Kukai-mobile.xcarchive clean archive OTHER_SWIFT_FLAGS="-Xfrontend -internalize-at-link"

- name: Build and Archive
if: github.ref != 'refs/heads/main'
run: xcodebuild -scheme "Kukai Mobile Beta" -sdk iphoneos -configuration Beta -archivePath $PWD/build/Kukai-mobile.xcarchive clean archive
run: xcodebuild -scheme "Kukai Mobile Beta" -sdk iphoneos -configuration Beta -archivePath $PWD/build/Kukai-mobile.xcarchive clean archive OTHER_SWIFT_FLAGS="-Xfrontend -internalize-at-link"

# Export .ipa for main or develop
- name: Export .ipa
Expand Down
20 changes: 13 additions & 7 deletions Kukai Mobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2444,7 +2444,7 @@
CODE_SIGN_ENTITLEMENTS = "Kukai Mobile/Kukai Mobile-dev.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 348;
CURRENT_PROJECT_VERSION = 350;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
Expand All @@ -2461,8 +2461,10 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
OTHER_SWIFT_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "app.kukai.mobile${BUNDLE_ID_SUFFIX}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Kukai Mobile Debug Prov Dev";
Expand All @@ -2486,7 +2488,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 348;
CURRENT_PROJECT_VERSION = 350;
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
ENABLE_BITCODE = NO;
Expand All @@ -2502,7 +2504,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
OTHER_CFLAGS = "";
OTHER_SWIFT_FLAGS = "-Xfrontend -internalize-at-link";
PRODUCT_BUNDLE_IDENTIFIER = "app.kukai.mobile${BUNDLE_ID_SUFFIX}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Kukai Mobile Prov Dist App Store";
Expand Down Expand Up @@ -2670,7 +2674,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 348;
CURRENT_PROJECT_VERSION = 350;
DEVELOPMENT_TEAM = TK7KK2VPJP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = TK7KK2VPJP;
ENABLE_BITCODE = NO;
Expand All @@ -2687,7 +2691,9 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
OTHER_CFLAGS = "";
OTHER_SWIFT_FLAGS = "-Xfrontend -internalize-at-link";
PRODUCT_BUNDLE_IDENTIFIER = "app.kukai.mobile${BUNDLE_ID_SUFFIX}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Kukai Mobile Beta Prov Dist App Store";
Expand Down Expand Up @@ -2800,7 +2806,7 @@
repositoryURL = "https://github.com/reown-com/reown-swift";
requirement = {
kind = upToNextMinorVersion;
minimumVersion = 1.0.5;
minimumVersion = 1.0.7;
};
};
C055EF1F2A2F95ED0031CB5F /* XCRemoteSwiftPackageReference "QRCode" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"location" : "https://github.com/kukai-wallet/kukai-core-swift",
"state" : {
"branch" : "develop",
"revision" : "e7fe6e2e8d95feffbd8fd81bf4eeabef1b372a37"
"revision" : "192d9cd46876e493a113d81833cac1d1969056bf"
}
},
{
Expand All @@ -96,8 +96,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/reown-com/reown-swift",
"state" : {
"revision" : "de2a59434695985fcd541a94b3f635f537c09d97",
"version" : "1.0.5"
"revision" : "a27be063042e54685b0f8a2bde9c143c5da69312",
"version" : "1.0.7"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Kukai Mobile/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>348</string>
<string>350</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 2 additions & 0 deletions Kukai Mobile/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"error-wc2-cant-open-more-modals"="An incoming wallet connect request was automatically rejected, as you are in the middle of an activity. Please return to one of the main tabs and try again.";
"error-wc2-switch-no-pairing"="Unbale to locate details about this connection. Please try again";
"error-wc2-reconnect"="Failed to reconnect to WalletConnect 3 times in a row, retrying. Please check your internet connection";
"error-wc2-invalid-proposal"="Kukai received an invalid proposal. Please refresh the application you are trying to connect with and try again";
"error-wc2-invalid-request"="Kukai received an invalid request. Please refresh the application you are trying to use with and try again";

"error-unknown"="Unknwon error occured";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class WalletConnectPairViewController: UIViewController, BottomSheetCustomFixedP
rejectButton.customButtonType = .secondary

guard let proposal = TransactionService.shared.walletConnectOperationData.proposal else {
self.nameLabel.text = "..."
return
}

Expand Down
73 changes: 1 addition & 72 deletions Kukai Mobile/Modules/Home/HomeTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
private var gradientLayers: [CAGradientLayer] = []
private var highlightedGradient = CAGradientLayer()
private var sideMenuVc: SideMenuViewController? = nil
private var walletConnectActivity = UIActivityIndicatorView()

private var activityAnimationFrames: [UIImage] = []
private var activityTabBarImageView: UIImageView? = nil
Expand Down Expand Up @@ -67,7 +66,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat

DispatchQueue.global(qos: .background).async {
DependencyManager.shared.balanceService.loadCache(address: address)
//self?.reconnectWalletConnectIfNeeded()

DispatchQueue.main.async {
DependencyManager.shared.addressLoaded = address
Expand All @@ -90,7 +88,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat

DispatchQueue.global(qos: .background).async {
DependencyManager.shared.balanceService.loadCache(address: address)
//self?.reconnectWalletConnectIfNeeded()

DispatchQueue.main.async {

Expand Down Expand Up @@ -126,8 +123,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
.dropFirst()
.sink { [weak self] address in

//self?.reconnectWalletConnectIfNeeded()

if DependencyManager.shared.appUpdateService.isRequiredUpdate {
self?.displayUpdateRequired()
}
Expand All @@ -148,7 +143,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
DependencyManager.shared.balanceService.$addressErrored
.dropFirst()
.sink { [weak self] obj in
//self?.reconnectWalletConnectIfNeeded()

if let obj = obj, obj.address == DependencyManager.shared.selectedWalletAddress {

Expand All @@ -167,14 +161,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
self?.supressAutoRefreshError = true
self?.refreshType = .refreshEverything
self?.refresh(addresses: nil)

/*
// When returning from a long background, WC2 can sometimes be stuck in a disconnected state.
// Give it a few seconds to try connect by itself, and then try manual intervention
DispatchQueue.main.asyncAfter(deadline: .now() + 3) { [weak self] in
self?.recheckWalletConnectAnimation(tryManualReconnect: true)
}
*/
}.store(in: &bag)

ThemeManager.shared.$themeDidChange
Expand Down Expand Up @@ -266,25 +252,6 @@ public class HomeTabBarController: UITabBarController, UITabBarControllerDelegat
}
}

public override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

//recheckWalletConnectAnimation()
}

// When returning from background, WC2 socket can get stuck sometimes.
// First we double check that no event was missed by running the logic again
// Second we have an optional request to attempt to reconnect the socket by re-initalising the WC2 singletons
public func recheckWalletConnectAnimation(tryManualReconnect: Bool = false) {
/*let isConnected = WalletConnectService.shared.isConnected
connectionStatusChanged(status: isConnected ? .connected : .disconnected)

if !isConnected && tryManualReconnect {
attemptWC2Reconnect()
}
*/
}

public override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

Expand Down Expand Up @@ -525,46 +492,8 @@ extension HomeTabBarController: ScanViewControllerDelegate {
extension HomeTabBarController: WalletConnectServiceDelegate {

public func connectionStatusChanged(status: SocketConnectionStatus) {
/*if status == .disconnected {

if walletConnectActivity.superview == nil {
self.walletConnectActivity.frame = self.scanButton.frame
self.walletConnectActivity.isUserInteractionEnabled = true
self.walletConnectActivity.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(attemptWC2Reconnect)))
self.scanButton.addSubview(self.walletConnectActivity)
}

self.scanButton.setImage(UIImage(), for: .normal) // passing in nil doesn't work sometimes, needs to be an empty image
self.walletConnectActivity.color = ThemeManager.shared.currentInterfaceStyle() == .dark ? .white : .black
self.walletConnectActivity.startAnimating()

} else {
self.scanButton.setImage(UIImage(named: "ScanQR"), for: .normal)
self.walletConnectActivity.stopAnimating()
self.walletConnectActivity.removeFromSuperview()
}
*/
}

@objc private func attemptWC2Reconnect() {
//WalletConnectService.shared.setup(force: true)
}

/*
public func walletConnectSocketFailedToReconnect3Times() {
DispatchQueue.main.async {
self.windowError(withTitle: "error".localized(), description: "error-wc2-reconnect".localized())
}
}
*/

/*
public func reconnectWalletConnectIfNeeded() {
if !WalletConnectService.shared.isConnected {
WalletConnectService.shared.reconnect()
}

}
*/

public func pairRequested() {
if self.presentedViewController == nil {
Expand Down
48 changes: 5 additions & 43 deletions Kukai Mobile/Modules/Stake/BakerDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ class BakerDetailsViewController: UIViewController {
@IBOutlet weak var spaceLabel: UILabel!
@IBOutlet weak var rewardslabel: UILabel!
@IBOutlet weak var freeLabel: UILabel!
@IBOutlet weak var accuracyLabel: UILabel!
@IBOutlet weak var payoutStabilityLabel: UILabel!

@IBOutlet weak var stakeButton: CustomisableButton!

Expand All @@ -39,49 +37,13 @@ class BakerDetailsViewController: UIViewController {

stakeButton.isHidden = DependencyManager.shared.balanceService.account.delegate?.address == baker.address

MediaProxyService.load(url: URL(string: baker.logo ?? ""), to: bakerIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())
MediaProxyService.load(url: baker.logo, to: bakerIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())

bakerNameLabel.text = baker.name ?? baker.address.truncateTezosAddress()
splitLabel.text = (Decimal(baker.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
spaceLabel.text = baker.stakingCapacity.rounded(scale: 0, roundingMode: .bankers).description + " XTZ"
rewardslabel.text = (baker.estimatedRoi * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
freeLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.freeSpace, decimalPlaces: 0) + " XTZ"

switch baker.payoutAccuracy {
case .precise:
accuracyLabel.text = "PRECISE"
accuracyLabel.textColor = .colorNamed("TxtGood4")

case .inaccurate:
accuracyLabel.text = "INACCURATE"
accuracyLabel.textColor = .colorNamed("TxtB-alt4")

case .suspicious:
accuracyLabel.text = "SUSPICIOUS"
accuracyLabel.textColor = .colorNamed("TxtAlert4")

case .no_data:
accuracyLabel.text = "NO DATA"
accuracyLabel.textColor = .colorNamed("Txt8")
}

switch baker.payoutTiming {
case .stable:
payoutStabilityLabel.text = "STABLE"
payoutStabilityLabel.textColor = .colorNamed("TxtGood4")

case .unstable:
payoutStabilityLabel.text = "UNSTABLE"
payoutStabilityLabel.textColor = .colorNamed("TxtB-alt4")

case .suspicious:
payoutStabilityLabel.text = "SUSPICIOUS"
payoutStabilityLabel.textColor = .colorNamed("TxtAlert4")

case .no_data:
payoutStabilityLabel.text = "NO DATA"
payoutStabilityLabel.textColor = .colorNamed("Txt8")
}
splitLabel.text = (Decimal(baker.delegation.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
spaceLabel.text = baker.delegation.capacity.rounded(scale: 0, roundingMode: .bankers).description + " XTZ"
rewardslabel.text = Decimal(baker.delegation.estimatedApy * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
freeLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.delegation.freeSpace, decimalPlaces: 0) + " XTZ"
}

@IBAction func closeTapped(_ sender: Any) {
Expand Down
8 changes: 4 additions & 4 deletions Kukai Mobile/Modules/Stake/Cells/PublicBakerCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class PublicBakerCell: UITableViewCell, UITableViewCellImageDownloading {
}

public func setup(withBaker baker: TzKTBaker) {
MediaProxyService.load(url: URL(string: baker.logo ?? ""), to: bakerIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())
MediaProxyService.load(url: baker.logo, to: bakerIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())

bakerNameLabel.text = baker.name ?? baker.address.truncateTezosAddress()
splitLabel.text = (Decimal(baker.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
spaceLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.freeSpace, decimalPlaces: 0) + " XTZ"
estRewardsLabel.text = (baker.estimatedRoi * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
splitLabel.text = (Decimal(baker.delegation.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
spaceLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.delegation.freeSpace, decimalPlaces: 0) + " XTZ"
estRewardsLabel.text = Decimal((baker.delegation.estimatedApy * 100)).rounded(scale: 2, roundingMode: .bankers).description + "%"

bakerNameLabel.accessibilityIdentifier = "baker-list-name"
}
Expand Down
12 changes: 6 additions & 6 deletions Kukai Mobile/Modules/Stake/ConfirmStakeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class ConfirmStakeViewController: SendAbstractConfirmViewController, SlideButton
confirmBakerRemoveView.isHidden = true

bakerAddNameLabel.text = baker.name ?? baker.address.truncateTezosAddress()
if baker.name == nil && baker.fee == 0 && baker.stakingCapacity == 0 && baker.estimatedRoi == 0 {
if baker.name == nil && baker.delegation.fee == 0 && baker.delegation.capacity == 0 && baker.delegation.estimatedApy == 0 {
bakerAddSplitLabel.text = "N/A"
bakerAddSpaceLabel.text = "N/A"
bakerAddEstimatedRewardLabel.text = "N/A"

} else {
bakerAddSplitLabel.text = (Decimal(baker.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
bakerAddSpaceLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.freeSpace, decimalPlaces: 0) + " XTZ"
bakerAddEstimatedRewardLabel.text = (baker.estimatedRoi * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
bakerAddSplitLabel.text = (Decimal(baker.delegation.fee) * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
bakerAddSpaceLabel.text = DependencyManager.shared.coinGeckoService.formatLargeTokenDisplay(baker.delegation.freeSpace, decimalPlaces: 0) + " XTZ"
bakerAddEstimatedRewardLabel.text = Decimal(baker.delegation.estimatedApy * 100).rounded(scale: 2, roundingMode: .bankers).description + "%"
}

} else {
Expand Down Expand Up @@ -137,10 +137,10 @@ class ConfirmStakeViewController: SendAbstractConfirmViewController, SlideButton
}

if self.currentDelegateData.isAdd == true {
MediaProxyService.load(url: URL(string: baker.logo ?? ""), to: bakerAddIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())
MediaProxyService.load(url: baker.logo, to: bakerAddIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())

} else {
MediaProxyService.load(url: URL(string: baker.logo ?? ""), to: bakerRemoveIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())
MediaProxyService.load(url: baker.logo, to: bakerRemoveIcon, withCacheType: .temporary, fallback: UIImage.unknownToken())
}
}

Expand Down
Loading

0 comments on commit 59f0a3c

Please sign in to comment.