Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ jobs:
-only-testing:BitkitTests/UtxoSelectionTests \
-only-testing:BitkitTests/BlocktankTests \
-only-testing:BitkitTests/PaymentFlowTests \
-only-testing:BitkitTests/BlocktankRefundAddressLiveIntegrationTests \
-only-testing:BitkitTests/AddressTypeIntegrationTests \
-only-testing:BitkitTests/RNMigrationCleanupTests \
| xcbeautify --report junit
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
-skip-testing:BitkitTests/UtxoSelectionTests \
-skip-testing:BitkitTests/BlocktankTests \
-skip-testing:BitkitTests/PaymentFlowTests \
-skip-testing:BitkitTests/BlocktankRefundAddressLiveIntegrationTests \
-skip-testing:BitkitTests/AddressTypeIntegrationTests \
-skip-testing:BitkitTests/RNMigrationCleanupTests \
| xcbeautify --report junit
Expand Down
6 changes: 2 additions & 4 deletions Bitkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
Models/TransferType.swift,
Services/BackupFieldMigration.swift,
Services/CoreService.swift,
Services/GeoService.swift,
Services/HwActivityTagBackup.swift,
Services/HwSnapshotMerge.swift,
Services/LightningService.swift,
Expand Down Expand Up @@ -205,7 +204,6 @@
Models/PubkyPublicKeyFormat.swift,
Models/Toast.swift,
Services/CoreService.swift,
Services/GeoService.swift,
Services/HwActivityTagBackup.swift,
Services/HwSnapshotMerge.swift,
Services/LightningService.swift,
Expand Down Expand Up @@ -886,7 +884,7 @@
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -warnings-as-errors -Wwarning DeprecatedDeclaration";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG CHECK_GEOBLOCK $(inherited)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
Expand Down Expand Up @@ -941,7 +939,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -warnings-as-errors -Wwarning DeprecatedDeclaration";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "CHECK_GEOBLOCK $(inherited)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_COMPILATION_MODE = wholemodule;
};
name = Release;
Expand Down
3 changes: 0 additions & 3 deletions Bitkit/AppScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,6 @@ struct AppScene: View {
await retryPendingPaykitEndpointRemoval()
}

// Start watching pending orders after wallet is ready
await blocktank.startWatchingPendingOrders(transferViewModel: transfer)

// Open the swap updates stream so any pending LN -> onchain swaps resume
// and auto-claim once their lockup confirms. Retries until the stream starts.
wallet.ensureSwapUpdatesRunning()
Expand Down
12 changes: 0 additions & 12 deletions Bitkit/Assets.xcassets/icons/arrow-cjit.imageset/Contents.json

This file was deleted.

Binary file not shown.
23 changes: 19 additions & 4 deletions Bitkit/Components/Activity/ActivityBanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,42 @@ import SwiftUI
enum ActivityBannerType {
case spending
case savings
case channelsClosing
}

struct ActivityBanner: View {
let type: ActivityBannerType
let remainingDuration: String?
/// Shrinks the title to fit one line instead of truncating it.
let autoSizeTitle: Bool

@State private var innerShadowOpacity: Double = 0.32
@State private var dropShadowOpacity: Double = 1.0
@State private var radialGradientOpacity: Double = 0.4
@State private var borderOpacity: Double = 0.32

init(type: ActivityBannerType, remainingDuration: String? = nil) {
init(type: ActivityBannerType, remainingDuration: String? = nil, autoSizeTitle: Bool = false) {
self.type = type
self.remainingDuration = remainingDuration
self.autoSizeTitle = autoSizeTitle
}

private var accentColor: Color {
type == .spending ? .purpleAccent : .brandAccent
switch type {
case .spending: .purpleAccent
case .savings: .brandAccent
case .channelsClosing: .yellowAccent
}
}

private var iconName: String {
type == .channelsClosing ? "warning" : "transfer"
}

private var bannerText: String {
if let duration = remainingDuration {
if type == .channelsClosing {
return t("lightning__channels_closing_banner", variables: ["date": ChannelsClosing.formattedCloseDate()])
} else if let duration = remainingDuration {
return t("wallet__activity_transfer_ready_in", variables: ["duration": duration])
} else {
return t("wallet__activity_transfer_in_progress")
Expand All @@ -34,7 +48,7 @@ struct ActivityBanner: View {

var body: some View {
HStack(spacing: 8) {
Image("transfer")
Image(iconName)
.resizable()
.scaledToFit()
.frame(width: 20, height: 20)
Expand All @@ -46,6 +60,7 @@ struct ActivityBanner: View {
.textCase(.uppercase)
.kerning(0)
.lineLimit(1)
.minimumScaleFactor(autoSizeTitle ? 12.0 / 20.0 : 1)
}
.frame(maxWidth: .infinity, alignment: .center)
.frame(height: 72)
Expand Down
1 change: 1 addition & 0 deletions Bitkit/Components/SheetIntro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct SheetIntro: View {
DisplayText(title, accentColor: accentColor)
.padding(.bottom, 14)
.frame(maxWidth: .infinity, alignment: .leading)
.accessibilityIdentifier("\(baseTestID)Title")

BodyMText(description, accentFont: accentFont)
.frame(maxWidth: .infinity, alignment: .leading)
Expand Down
21 changes: 0 additions & 21 deletions Bitkit/Components/TabBar/TabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ struct TabBar: View {
@Environment(CalculatorInputManager.self) private var calculatorInput
@EnvironmentObject var navigation: NavigationViewModel
@EnvironmentObject var sheets: SheetViewModel
@EnvironmentObject var wallet: WalletViewModel

var shouldShow: Bool {
if calculatorInput.isPresented {
Expand Down Expand Up @@ -69,18 +68,6 @@ struct TabBar: View {
hardwareWalletId: walletId
)
)
return
}

let hasPendingTransfersToSpending = wallet.balanceInTransferToSpending > 0

if Self.shouldOpenSpendingCjitEntry(
isSpendingWallet: navigation.currentRoute == .spendingWallet,
wallet: wallet,
hasPendingTransfersToSpending: hasPendingTransfersToSpending
) {
// On spending wallet screen, show CJIT flow when user can't receive normally
sheets.showSheet(.receive, data: ReceiveConfig(view: .cjitAmount))
} else {
sheets.showSheet(.receive)
}
Expand All @@ -89,14 +76,6 @@ struct TabBar: View {
private func onScanPress() {
sheets.showSheet(.scanner)
}

static func shouldOpenSpendingCjitEntry(
isSpendingWallet: Bool,
wallet: WalletViewModel,
hasPendingTransfersToSpending: Bool
) -> Bool {
isSpendingWallet && !wallet.canCreateReceiveLightningInvoice(amountSats: nil) && !hasPendingTransfersToSpending
}
}

#Preview {
Expand Down
19 changes: 3 additions & 16 deletions Bitkit/Components/Widgets/Suggestions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum SuggestionAction: Hashable {
case secure
case shop
case support
case transferToSpending
}

/// Wallet state used to choose which suggestion cards to show and in what order.
Expand All @@ -33,8 +32,8 @@ enum WalletSuggestionState {
/// Ordered suggestion card IDs per wallet state (priority: first = highest).
/// Max 4 cards are shown; when one is dismissed or completed, the next in this list is shown.
private let suggestionOrderByState: [WalletSuggestionState: [String]] = [
.empty: ["buyBitcoin", "transferToSpending", "hardware", "support", "backupSeedPhrase", "pin", "profile", "invite"],
.onchain: ["backupSeedPhrase", "pin", "transferToSpending", "hardware", "support", "profile", "invite", "buyBitcoin"],
.empty: ["buyBitcoin", "hardware", "support", "backupSeedPhrase", "pin", "profile", "invite"],
.onchain: ["backupSeedPhrase", "pin", "hardware", "support", "profile", "invite", "buyBitcoin"],
.spending: ["quickpay", "notifications", "shop", "hardware", "profile", "support", "invite", "buyBitcoin"],
]

Expand All @@ -47,14 +46,6 @@ let cards: [SuggestionCardData] = [
color: .blue24,
action: .backup
),
SuggestionCardData(
id: "transferToSpending",
title: t("cards__lightning__title"),
description: t("cards__lightning__description"),
imageName: "lightning",
color: .purple24,
action: .transferToSpending
),
SuggestionCardData(
id: "pin",
title: t("cards__pin__title"),
Expand Down Expand Up @@ -154,8 +145,6 @@ extension SuggestionCardData {
return "shop"
case .support:
return "support"
case .transferToSpending:
return "lightning"
}
}
}
Expand All @@ -170,7 +159,7 @@ struct Suggestions: View {

var previewCardIds: [String]?

static let previewSheetCardIds = ["backupSeedPhrase", "pin", "transferToSpending", "support"]
static let previewSheetCardIds = ["backupSeedPhrase", "pin", "buyBitcoin", "support"]

@EnvironmentObject var app: AppViewModel
@EnvironmentObject var navigation: NavigationViewModel
Expand Down Expand Up @@ -373,8 +362,6 @@ struct Suggestions: View {
route = .support
case .hardware:
sheets.showSheet(.hardwareConnect)
case .transferToSpending:
route = app.hasSeenTransferIntro ? .fundingOptions : .transferIntro
}

if let route {
Expand Down
14 changes: 1 addition & 13 deletions Bitkit/Constants/Env.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ enum Env {
}
}

static var isGeoblockingEnabled: Bool {
#if CHECK_GEOBLOCK
return true
#else
return ProcessInfo.processInfo.environment["GEO"] == "true"
#endif
}

/// The current execution context of the app
static var currentExecutionContext: ExecutionContext {
let isNotificationExtension = Bundle.main.bundleIdentifier?.lowercased().contains("notification") == true
Expand Down Expand Up @@ -304,14 +296,13 @@ enum Env {
}
}

// TODO: remove this to load from BT API instead
static var trustedLnPeers: [LnPeer] {
switch network {
case .bitcoin:
return [
.init(nodeId: "039b8b4dd1d88c2c5db374290cda397a8f5d79f312d6ea5d5bfdfc7c6ff363eae3", host: "34.65.111.104", port: 9735),
.init(nodeId: "03816141f1dce7782ec32b66a300783b1d436b19777e7c686ed00115bd4b88ff4b", host: "34.65.191.64", port: 9735),
.init(nodeId: "02a371038863605300d0b3fc9de0cf5ccb57728b7f8906535709a831b16e311187", host: "34.65.153.174", port: 9735),
.init(nodeId: "02a371038863605300d0b3fc9de0cf5ccb57728b7f8906535709a831b16e311187", host: "34.65.147.55", port: 9735),
]
case .signet:
return []
Expand Down Expand Up @@ -357,8 +348,6 @@ enum Env {
static let fxRateRefreshInterval: TimeInterval = 2 * 60 // 2 minutes
static let fxRateStaleThreshold: TimeInterval = 10 * 60 // After this we notify the user that the rates are stale due to a failed refresh

static let blocktankOrderRefreshInterval: TimeInterval = 2 * 60 // 2 minutes

static var pushNotificationFeatures: [BlocktankNotificationType] = [
.incomingHtlc,
.mutualClose,
Expand Down Expand Up @@ -433,7 +422,6 @@ enum Env {

static let termsOfServiceUrl = "https://www.bitkit.to/terms-of-use"
static let privacyPolicyUrl = "https://www.bitkit.to/privacy-policy"
static let geoCheckUrl = "https://api1.blocktank.to/api/geocheck"
static let bitrefillRef = "AL6dyZYt"
static let btcMapUrl = "https://btcmap.org/map"
static let helpUrl = "https://help.bitkit.to"
Expand Down
7 changes: 4 additions & 3 deletions Bitkit/MainNavView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ struct MainNavView: View {
config in BackupSheet(config: config)
}
.sheet(
item: $sheets.giftSheetItem,
item: $sheets.channelsUnavailableSheetItem,
onDismiss: {
sheets.hideSheetIfActive(.gift, reason: "Gift sheet dismissed")
sheets.hideSheetIfActive(.channelsUnavailable, reason: "Channels unavailable sheet dismissed")
}
) {
config in GiftSheet(config: config)
config in ChannelsUnavailableSheet(config: config)
}
.sheet(
item: $sheets.connectionClosedSheetItem,
Expand Down Expand Up @@ -560,6 +560,7 @@ struct MainNavView: View {
case .transferLearnMore: TransferLearnMoreView()
case .settingUp: SettingUpView()
case .fundingAdvanced: FundAdvancedOptions()
case .chooseLsp: ChooseLspView()
case let .fundManual(nodeUri): FundManualSetupView(initialNodeUri: nodeUri)
case let .fundManualAmount(lnPeer): FundManualAmountView(lnPeer: lnPeer)
case let .fundManualConfirm(lnPeer, amountSats): FundManualConfirmView(lnPeer: lnPeer, amountSats: amountSats)
Expand Down
15 changes: 15 additions & 0 deletions Bitkit/Models/ChannelsClosing.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Foundation

enum ChannelsClosing {
/// Date on which Blocktank closes the remaining Lightning channels; set before release.
static let CHANNELS_CLOSE_DATE = DateComponents(calendar: Calendar(identifier: .gregorian), year: 2026, month: 12, day: 15)

static func formattedCloseDate(locale: Locale = Locale(identifier: LocalizationHelper.currentLanguageCode)) -> String {
guard let date = CHANNELS_CLOSE_DATE.date else { return "" }
let formatter = DateFormatter()
formatter.locale = locale
formatter.dateStyle = .medium
formatter.timeStyle = .none
return formatter.string(from: date)
}
}
Loading
Loading