Skip to content

Commit 904d307

Browse files
authored
Merge pull request #531 from synonymdev/codex-paykit-public-endpoints-pr527
2 parents f96221e + 6aeb1a8 commit 904d307

53 files changed

Lines changed: 1851 additions & 198 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Bitkit.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
Extensions/PaymentDetails.swift,
8888
Models/BlocktankNotificationType.swift,
8989
Models/LnPeer.swift,
90+
Models/PubkyPublicKeyFormat.swift,
9091
Models/Toast.swift,
9192
Models/Transfer.swift,
9293
Models/TransferType.swift,
@@ -117,6 +118,7 @@
117118
Extensions/PaymentDetails.swift,
118119
Models/BlocktankNotificationType.swift,
119120
Models/LnPeer.swift,
121+
Models/PubkyPublicKeyFormat.swift,
120122
Models/Toast.swift,
121123
Services/CoreService.swift,
122124
Services/GeoService.swift,
@@ -904,8 +906,8 @@
904906
isa = XCRemoteSwiftPackageReference;
905907
repositoryURL = "https://github.com/pubky/paykit-rs";
906908
requirement = {
907-
kind = revision;
908-
revision = cd1253291b1582759d569372d5942b8871527ea1;
909+
kind = exactVersion;
910+
version = 0.1.0-rc5;
909911
};
910912
};
911913
18D65DFE2EB9649F00252335 /* XCRemoteSwiftPackageReference "vss-rust-client-ffi" */ = {
@@ -936,8 +938,8 @@
936938
isa = XCRemoteSwiftPackageReference;
937939
repositoryURL = "https://github.com/synonymdev/bitkit-core";
938940
requirement = {
939-
kind = revision;
940-
revision = 99bd86bb60c1f14e8ce8a6356cd2ab36f222fc69;
941+
kind = exactVersion;
942+
version = 0.1.58;
941943
};
942944
};
943945
96E20CD22CB6D91A00C24149 /* XCRemoteSwiftPackageReference "CodeScanner" */ = {

Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Bitkit/AppScene.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ struct AppScene: View {
560560
Task {
561561
await clearDeliveredNotifications()
562562
await LightningService.shared.reconnectPeers()
563+
await wallet.refreshPublicPaykitEndpointsOnForeground()
563564
}
564565
}
565566
}

Bitkit/Components/Activity/ActivityList.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import SwiftUI
33

44
struct ActivityList: View {
55
@EnvironmentObject var activity: ActivityListViewModel
6+
@EnvironmentObject var contactsManager: ContactsManager
67
@EnvironmentObject var feeEstimatesManager: FeeEstimatesManager
78
@State private var isHorizontalSwipe = false
89

@@ -28,7 +29,11 @@ struct ActivityList: View {
2829

2930
case let .activity(item):
3031
NavigationLink(value: Route.activityDetail(item)) {
31-
ActivityRow(item: item, feeEstimates: feeEstimatesManager.estimates)
32+
ActivityRow(
33+
item: item,
34+
feeEstimates: feeEstimatesManager.estimates,
35+
contact: item.contact(in: contactsManager.contacts)
36+
)
3237
}
3338
.accessibilityIdentifier("Activity-\(index)")
3439
.disabled(isHorizontalSwipe)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import SwiftUI
2+
3+
struct ContactAvatarLetter: View {
4+
let source: String
5+
let size: CGFloat
6+
var backgroundColor: Color = .white.opacity(0.1)
7+
var strokeColor: Color?
8+
var strokeWidth: CGFloat = 0
9+
10+
private var letter: String {
11+
String(source.prefix(1)).uppercased()
12+
}
13+
14+
var body: some View {
15+
Circle()
16+
.fill(backgroundColor)
17+
.frame(width: size, height: size)
18+
.overlay {
19+
avatarText
20+
}
21+
.overlay {
22+
if let strokeColor, strokeWidth > 0 {
23+
Circle()
24+
.stroke(strokeColor, lineWidth: strokeWidth)
25+
}
26+
}
27+
.accessibilityHidden(true)
28+
}
29+
30+
@ViewBuilder
31+
private var avatarText: some View {
32+
if size >= 72 {
33+
HeadlineText(letter)
34+
} else if size >= 56 {
35+
TitleText(letter)
36+
} else if size >= 44 {
37+
BodyMSBText(letter)
38+
} else {
39+
CaptionBText(letter, textColor: .textPrimary)
40+
}
41+
}
42+
}

Bitkit/Constants/Env.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ enum Env {
272272
case .bitcoin:
273273
return "/pub/bitkit.to/:rw,/pub/pubky.app/:r,/pub/paykit/v0/:rw"
274274
default:
275-
return "/pub/staging.bitkit.to/:rw,/pub/staging.pubky.app/:r,/pub/staging.paykit/v0/:rw"
275+
return "/pub/staging.bitkit.to/:rw,/pub/staging.pubky.app/:r,/pub/paykit/v0/:rw"
276276
}
277277
}
278278

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import BitkitCore
2+
3+
extension Activity {
4+
func contact(in contacts: [PubkyContact]) -> PubkyContact? {
5+
guard let contactPublicKey else { return nil }
6+
return contacts.first(where: { PubkyPublicKeyFormat.matches($0.publicKey, contactPublicKey) })
7+
}
8+
9+
private var contactPublicKey: String? {
10+
switch self {
11+
case let .lightning(lightning):
12+
return lightning.contact
13+
14+
case let .onchain(onchain):
15+
return onchain.contact
16+
}
17+
}
18+
}

Bitkit/MainNavView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ struct MainNavView: View {
385385
}
386386
case .contactsIntro: ContactsIntroView()
387387
case let .contactDetail(publicKey): ContactDetailView(publicKey: publicKey)
388+
case let .contactActivity(publicKey): ContactActivityView(publicKey: publicKey)
388389
case .contactImportOverview:
389390
if let fallbackRoute = fallbackRouteForMissingPendingImport(hasPendingImport: contactsManager.hasPendingImport) {
390391
missingPendingImportView(fallbackRoute: fallbackRoute)

0 commit comments

Comments
 (0)