Skip to content
Open
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
8 changes: 5 additions & 3 deletions Bitkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,15 @@
Models/TransferType.swift,
Services/CoreService.swift,
Services/GeoService.swift,
Services/HwSnapshotMerge.swift,
Services/LightningService.swift,
Services/MigrationsService.swift,
Services/WatchOnlyAccountService.swift,
Services/RNBackupClient.swift,
Services/ServiceQueue.swift,
Services/TransferStorage.swift,
Services/VssBackupClient.swift,
Services/VssStoreIdProvider.swift,
Services/WatchOnlyAccountService.swift,
Utilities/Crypto.swift,
Utilities/Errors.swift,
Utilities/Keychain.swift,
Expand All @@ -202,10 +203,11 @@
Models/Toast.swift,
Services/CoreService.swift,
Services/GeoService.swift,
Services/HwSnapshotMerge.swift,
Services/LightningService.swift,
Services/WatchOnlyAccountService.swift,
Services/ServiceQueue.swift,
Services/VssStoreIdProvider.swift,
Services/WatchOnlyAccountService.swift,
Utilities/Crypto.swift,
Utilities/Errors.swift,
Utilities/Keychain.swift,
Expand Down Expand Up @@ -1207,7 +1209,7 @@
repositoryURL = "https://github.com/synonymdev/bitkit-core";
requirement = {
kind = exactVersion;
version = 0.4.2;
version = 0.5.3;
};
};
96E20CD22CB6D91A00C24149 /* XCRemoteSwiftPackageReference "CodeScanner" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 12 additions & 19 deletions Bitkit/Extensions/Activity+Contact.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import BitkitCore

extension Activity {
/// The activity's own id, unique only within its `walletId` scope.
var activityId: String {
switch self {
case let .lightning(lightning):
return lightning.id
case let .onchain(onchain):
return onchain.id
}
}

/// bitkit-core wallet id scoping this activity (`"bitkit"` for the normal wallet, a derived
/// id for watch-only hardware wallets — see `HwWalletId`).
var walletId: String {
Expand All @@ -13,9 +23,8 @@ extension Activity {
}

/// Whether this activity belongs to a watch-only hardware wallet (not the normal Bitkit wallet).
// TODO: Used as an interim feature gate (see ActivityItemView.isHardwareActivity). The
// wallet-id shorthand holds only while CoreService activity mutations are default-scoped;
// replace with a real capability check when wallet_id mutation support lands.
/// Drives the blue hardware icon and the boost gate — a watch-only wallet has no signing keys,
/// so RBF/CPFP is impossible for it.
var isHardwareWallet: Bool {
walletId != WalletScope.default
}
Expand All @@ -40,19 +49,3 @@ extension Activity {
}
}
}

extension [Activity] {
/// Drop hardware-wallet on-chain rows whose tx already exists as a main-wallet activity, so a
/// transfer shows a single (main-wallet) row in the merged home / All Activity lists. The HW row
/// still appears on the hardware wallet detail screen (which fetches scoped to the device).
func withoutHardwareDuplicates() -> [Activity] {
let localTxIds = Set(compactMap { activity -> String? in
guard !activity.isHardwareWallet, case let .onchain(onchain) = activity else { return nil }
return onchain.txId
})
return filter { activity in
guard activity.isHardwareWallet, case let .onchain(onchain) = activity else { return true }
return !localTxIds.contains(onchain.txId)
}
}
}
8 changes: 6 additions & 2 deletions Bitkit/MainNavView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,12 @@ struct MainNavView: View {
if isPaykitUIActive { ContactDetailView(publicKey: publicKey, showsDeleteAction: true) } else { paykitDisabledRedirectView }
case let .contactActivity(publicKey):
if isPaykitUIActive { ContactActivityView(publicKey: publicKey) } else { paykitDisabledRedirectView }
case let .assignActivityContact(activityId):
if isPaykitUIActive { AssignActivityContactView(activityId: activityId) } else { paykitDisabledRedirectView }
case let .assignActivityContact(activityId, walletId):
if isPaykitUIActive {
AssignActivityContactView(activityId: activityId, walletId: walletId)
} else {
paykitDisabledRedirectView
}
case .contactImportOverview:
if !isPaykitUIActive {
paykitDisabledRedirectView
Expand Down
Loading
Loading