Compare commits
1 Commits
quote-q-ta
...
unicode-16
| Author | SHA1 | Date | |
|---|---|---|---|
|
d26804d665
|
59
CHANGELOG.md
59
CHANGELOG.md
@@ -1,62 +1,3 @@
|
||||
## [1.13.1] - 2025-03-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue where threads would not load properly (Daniel D’Aquino)
|
||||
|
||||
|
||||
[1.13.1]: https://github.com/damus-io/damus/releases/tag/v1.13.1
|
||||
|
||||
|
||||
## [1.13] - 2025-03-14
|
||||
|
||||
### Added
|
||||
|
||||
- Added local persistence of note drafts (Daniel D’Aquino)
|
||||
- Added user-friendly error view for errors around the app that would not fit in other places (Daniel D’Aquino)
|
||||
- Coinos connection button in Wallet view (ericholguin)
|
||||
- Added Alby Go to mobile wallets selection menu (Tomek ⚡ K)
|
||||
- Minor accessibility improvements around picture editing and onboarding (Daniel D’Aquino)
|
||||
- Profile image cropping tools (Daniel D’Aquino)
|
||||
- Added Conversations tab to profiles (Terry Yiu)
|
||||
- Added profile pictures to push notifications (William Casarin)
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Don't show reposts for the same note more than once in your home feed (William Casarin)
|
||||
- Improved profile image bandwidth optimization (Daniel D’Aquino)
|
||||
- Improved reliability of picture selector (Daniel D’Aquino)
|
||||
- Changed spaces to newlines in new posts to provide cleaner separation between text, uploaded media, and quoted notes (Terry Yiu)
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed issue where some push notifications would not open in the app and leave users confused (Daniel D’Aquino)
|
||||
- Fixed issue where app would need a restart for new NWC wallets to work (Daniel D’Aquino)
|
||||
- Fixed overly sensitive horizontal swipe on thread chat view (Daniel D’Aquino)
|
||||
- Trim whitespaces from Lightning addresses (Terry Yiu)
|
||||
- Fixed translation export script by upgrading nostr-sdk-swift dependency to support Mac Catalyst (Terry Yiu)
|
||||
- Fixed issue where users continue to receive push notifications after logout (Daniel D’Aquino)
|
||||
- Fixed an issue where events on a thread view would occasionally disappear (Daniel D’Aquino)
|
||||
- Improved robustness of the URL handler (Daniel D’Aquino)
|
||||
- Translate notes even if they are in a preferred language but not the current language as that is what users expect (Terry Yiu)
|
||||
- Cancel ongoing uploading operations after the user cancels the post (Swift Coder)
|
||||
- Fixed link and photo sharing support on macOS (Swift Coder)
|
||||
- Fix bug where profile view was showing more than just the notes and replies on the notes / notes & replies tabs (Terry Yiu)
|
||||
- Fixed reposts banner to be localizable (Terry Yiu)
|
||||
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed language filtering from Universe feed because language detection can be inaccurate (Terry Yiu)
|
||||
- Removed mystery tabs meant to fix tab switching bug that no longer exists (Terry Yiu)
|
||||
|
||||
|
||||
|
||||
[1.13](https://github.com/damus-io/damus/releases/tag/v1.13): https://github.com/damus-io/damus/releases/tag/v1.13
|
||||
|
||||
|
||||
## [1.12.3] - 2025-02-06
|
||||
|
||||
### Added
|
||||
|
||||
@@ -408,22 +408,10 @@
|
||||
5C6E1DAD2A193EC2008FC15A /* GradientButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E1DAC2A193EC2008FC15A /* GradientButtonStyle.swift */; };
|
||||
5C6E1DAF2A194075008FC15A /* PinkGradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E1DAE2A194075008FC15A /* PinkGradient.swift */; };
|
||||
5C7389B12B6EFA7100781E0A /* ProxyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C7389B02B6EFA7100781E0A /* ProxyView.swift */; };
|
||||
5C8498022D5D150000F74FEB /* ZapExplainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C8498012D5D14FA00F74FEB /* ZapExplainer.swift */; };
|
||||
5C8498032D5D150000F74FEB /* ZapExplainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C8498012D5D14FA00F74FEB /* ZapExplainer.swift */; };
|
||||
5C8498042D5D150000F74FEB /* ZapExplainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C8498012D5D14FA00F74FEB /* ZapExplainer.swift */; };
|
||||
5C8711DE2C460C06007879C2 /* PostingTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C8711DD2C460C06007879C2 /* PostingTimelineView.swift */; };
|
||||
5CB017212D2D985E00A9ED05 /* CoinosButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017202D2D985800A9ED05 /* CoinosButton.swift */; };
|
||||
5CB017222D2D985E00A9ED05 /* CoinosButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017202D2D985800A9ED05 /* CoinosButton.swift */; };
|
||||
5CB017232D2D985E00A9ED05 /* CoinosButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017202D2D985800A9ED05 /* CoinosButton.swift */; };
|
||||
5CB017252D42C5C400A9ED05 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */; };
|
||||
5CB017262D42C5C400A9ED05 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */; };
|
||||
5CB017272D42C5C400A9ED05 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */; };
|
||||
5CB0172D2D42C76A00A9ED05 /* BalanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB0172C2D42C76600A9ED05 /* BalanceView.swift */; };
|
||||
5CB0172E2D42C76A00A9ED05 /* BalanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB0172C2D42C76600A9ED05 /* BalanceView.swift */; };
|
||||
5CB0172F2D42C76A00A9ED05 /* BalanceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB0172C2D42C76600A9ED05 /* BalanceView.swift */; };
|
||||
5CB017312D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
|
||||
5CB017322D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
|
||||
5CB017332D4422DB00A9ED05 /* NWCSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB017302D4422D600A9ED05 /* NWCSettings.swift */; };
|
||||
5CC8529D2BD741CD0039FFC5 /* HighlightEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC8529C2BD741CD0039FFC5 /* HighlightEvent.swift */; };
|
||||
5CC8529F2BD744F60039FFC5 /* HighlightView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC8529E2BD744F60039FFC5 /* HighlightView.swift */; };
|
||||
5CC852A22BDED9B90039FFC5 /* HighlightDescription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CC852A12BDED9B90039FFC5 /* HighlightDescription.swift */; };
|
||||
@@ -1097,9 +1085,6 @@
|
||||
D7373BA62B688EA300F7783D /* DamusPurpleTranslationSetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7373BA52B688EA200F7783D /* DamusPurpleTranslationSetupView.swift */; };
|
||||
D7373BA82B68974500F7783D /* DamusPurpleNewUserOnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7373BA72B68974500F7783D /* DamusPurpleNewUserOnboardingView.swift */; };
|
||||
D7373BAA2B68A65A00F7783D /* PurpleAccountUpdateNotify.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7373BA92B68A65A00F7783D /* PurpleAccountUpdateNotify.swift */; };
|
||||
D73B74E12D8365BA0067BDBC /* ExtraFonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = D73B74E02D8365B40067BDBC /* ExtraFonts.swift */; };
|
||||
D73B74E22D8365BA0067BDBC /* ExtraFonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = D73B74E02D8365B40067BDBC /* ExtraFonts.swift */; };
|
||||
D73B74E32D8365BA0067BDBC /* ExtraFonts.swift in Sources */ = {isa = PBXBuildFile; fileRef = D73B74E02D8365B40067BDBC /* ExtraFonts.swift */; };
|
||||
D73E5E162C6A9619007EB227 /* PostView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C75EFA327FA577B0006080F /* PostView.swift */; };
|
||||
D73E5E172C6A962A007EB227 /* ImageUploadModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CD348EE29C3659D00497EB2 /* ImageUploadModel.swift */; };
|
||||
D73E5E182C6A963D007EB227 /* AttachMediaUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CA876E129A00CE90003B9A3 /* AttachMediaUtility.swift */; };
|
||||
@@ -1496,18 +1481,6 @@
|
||||
D78DB8592C1CE9CA00F0AB12 /* SwipeActions in Frameworks */ = {isa = PBXBuildFile; productRef = D78DB8582C1CE9CA00F0AB12 /* SwipeActions */; };
|
||||
D78DB85B2C20FE5000F0AB12 /* VectorMath.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78DB85A2C20FE4F00F0AB12 /* VectorMath.swift */; };
|
||||
D78DB85F2C20FED300F0AB12 /* ChatBubbleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78DB85E2C20FED300F0AB12 /* ChatBubbleView.swift */; };
|
||||
D78F080C2D7F78EF00FC6C75 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F080B2D7F78EB00FC6C75 /* Request.swift */; };
|
||||
D78F080D2D7F78EF00FC6C75 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F080B2D7F78EB00FC6C75 /* Request.swift */; };
|
||||
D78F080E2D7F78EF00FC6C75 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F080B2D7F78EB00FC6C75 /* Request.swift */; };
|
||||
D78F080F2D7F78EF00FC6C75 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F080B2D7F78EB00FC6C75 /* Request.swift */; };
|
||||
D78F08112D7F78F900FC6C75 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08102D7F78F600FC6C75 /* Response.swift */; };
|
||||
D78F08122D7F78F900FC6C75 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08102D7F78F600FC6C75 /* Response.swift */; };
|
||||
D78F08132D7F78F900FC6C75 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08102D7F78F600FC6C75 /* Response.swift */; };
|
||||
D78F08142D7F78F900FC6C75 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08102D7F78F600FC6C75 /* Response.swift */; };
|
||||
D78F08172D7F7F7500FC6C75 /* NIP04.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08162D7F7F6C00FC6C75 /* NIP04.swift */; };
|
||||
D78F08182D7F7F7500FC6C75 /* NIP04.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08162D7F7F6C00FC6C75 /* NIP04.swift */; };
|
||||
D78F08192D7F7F7500FC6C75 /* NIP04.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08162D7F7F6C00FC6C75 /* NIP04.swift */; };
|
||||
D78F081A2D7F803100FC6C75 /* NIP04.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78F08162D7F7F6C00FC6C75 /* NIP04.swift */; };
|
||||
D798D21A2B0856CC00234419 /* Mentions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FF7D42823313F009601DB /* Mentions.swift */; };
|
||||
D798D21B2B0856F200234419 /* NdbTagsIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDD1AE12A6B3074001CD4DF /* NdbTagsIterator.swift */; };
|
||||
D798D21C2B0857E400234419 /* Bech32Object.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CF0ABEF29857E9200D66079 /* Bech32Object.swift */; };
|
||||
@@ -2395,12 +2368,8 @@
|
||||
5C6E1DAC2A193EC2008FC15A /* GradientButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientButtonStyle.swift; sourceTree = "<group>"; };
|
||||
5C6E1DAE2A194075008FC15A /* PinkGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinkGradient.swift; sourceTree = "<group>"; };
|
||||
5C7389B02B6EFA7100781E0A /* ProxyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProxyView.swift; sourceTree = "<group>"; };
|
||||
5C8498012D5D14FA00F74FEB /* ZapExplainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZapExplainer.swift; sourceTree = "<group>"; };
|
||||
5C8711DD2C460C06007879C2 /* PostingTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostingTimelineView.swift; sourceTree = "<group>"; };
|
||||
5CB017202D2D985800A9ED05 /* CoinosButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoinosButton.swift; sourceTree = "<group>"; };
|
||||
5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsView.swift; sourceTree = "<group>"; };
|
||||
5CB0172C2D42C76600A9ED05 /* BalanceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BalanceView.swift; sourceTree = "<group>"; };
|
||||
5CB017302D4422D600A9ED05 /* NWCSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NWCSettings.swift; sourceTree = "<group>"; };
|
||||
5CC8529C2BD741CD0039FFC5 /* HighlightEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightEvent.swift; sourceTree = "<group>"; };
|
||||
5CC8529E2BD744F60039FFC5 /* HighlightView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightView.swift; sourceTree = "<group>"; };
|
||||
5CC852A12BDED9B90039FFC5 /* HighlightDescription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightDescription.swift; sourceTree = "<group>"; };
|
||||
@@ -2482,7 +2451,6 @@
|
||||
D7373BA52B688EA200F7783D /* DamusPurpleTranslationSetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusPurpleTranslationSetupView.swift; sourceTree = "<group>"; };
|
||||
D7373BA72B68974500F7783D /* DamusPurpleNewUserOnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusPurpleNewUserOnboardingView.swift; sourceTree = "<group>"; };
|
||||
D7373BA92B68A65A00F7783D /* PurpleAccountUpdateNotify.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurpleAccountUpdateNotify.swift; sourceTree = "<group>"; };
|
||||
D73B74E02D8365B40067BDBC /* ExtraFonts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtraFonts.swift; sourceTree = "<group>"; };
|
||||
D73E5F7E2C6AA066007EB227 /* DamusAliases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusAliases.swift; sourceTree = "<group>"; };
|
||||
D73E5F802C6AA07A007EB227 /* HighlighterExtensionAliases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlighterExtensionAliases.swift; sourceTree = "<group>"; };
|
||||
D74AAFC12B153395006CF0F4 /* HeadlessDamusState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlessDamusState.swift; sourceTree = "<group>"; };
|
||||
@@ -2509,9 +2477,6 @@
|
||||
D78CD5972B8990300014D539 /* DamusAppNotificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamusAppNotificationView.swift; sourceTree = "<group>"; };
|
||||
D78DB85A2C20FE4F00F0AB12 /* VectorMath.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VectorMath.swift; sourceTree = "<group>"; };
|
||||
D78DB85E2C20FED300F0AB12 /* ChatBubbleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatBubbleView.swift; sourceTree = "<group>"; };
|
||||
D78F080B2D7F78EB00FC6C75 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = "<group>"; };
|
||||
D78F08102D7F78F600FC6C75 /* Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = "<group>"; };
|
||||
D78F08162D7F7F6C00FC6C75 /* NIP04.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NIP04.swift; sourceTree = "<group>"; };
|
||||
D798D21D2B0858BB00234419 /* MigratedTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigratedTypes.swift; sourceTree = "<group>"; };
|
||||
D798D2272B085CDA00234419 /* NdbNote+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NdbNote+.swift"; sourceTree = "<group>"; };
|
||||
D798D22B2B086C7400234419 /* NostrEvent+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NostrEvent+.swift"; sourceTree = "<group>"; };
|
||||
@@ -3257,10 +3222,6 @@
|
||||
4C7D095A2A098C5C00943473 /* Wallet */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5C8498012D5D14FA00F74FEB /* ZapExplainer.swift */,
|
||||
5CB017302D4422D600A9ED05 /* NWCSettings.swift */,
|
||||
5CB0172C2D42C76600A9ED05 /* BalanceView.swift */,
|
||||
5CB017242D42C5BD00A9ED05 /* TransactionsView.swift */,
|
||||
4C7D095C2A098C5D00943473 /* ConnectWalletView.swift */,
|
||||
4C7D095D2A098C5D00943473 /* WalletView.swift */,
|
||||
4C7D09672A0AE9B200943473 /* NWCScannerView.swift */,
|
||||
@@ -3286,12 +3247,11 @@
|
||||
4C7FF7D628233637009601DB /* Util */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D73B74E02D8365B40067BDBC /* ExtraFonts.swift */,
|
||||
D7DB93042D66A43B00DA1EE5 /* Undistractor.swift */,
|
||||
D73E5F7E2C6AA066007EB227 /* DamusAliases.swift */,
|
||||
E04A37C52B544F090029650D /* URIParsing.swift */,
|
||||
4C1D4FB02A7958E60024F453 /* VersionInfo.swift */,
|
||||
D78F080A2D7F78B000FC6C75 /* WalletConnect */,
|
||||
4C7D09612A098D0E00943473 /* WalletConnect.swift */,
|
||||
4C198DF329F88D23004C165C /* Images */,
|
||||
4C198DEA29F88C6B004C165C /* BlurHash */,
|
||||
4CE4F0F329D779B5005914DB /* PostBox.swift */,
|
||||
@@ -3341,6 +3301,7 @@
|
||||
D7EDED2D2B128E8A0018B19C /* CollectionExtension.swift */,
|
||||
D74AAFCE2B155D8C006CF0F4 /* ZapDataModel.swift */,
|
||||
D74AAFD32B155ECB006CF0F4 /* Zaps+.swift */,
|
||||
D74AAFD52B155F0C006CF0F4 /* WalletConnect+.swift */,
|
||||
);
|
||||
path = Util;
|
||||
sourceTree = "<group>";
|
||||
@@ -3652,7 +3613,6 @@
|
||||
children = (
|
||||
D7DB1FDC2D5A77E500CF06DA /* NIP44 */,
|
||||
D755B28B2D3E7D6500BBEEFA /* NIP37 */,
|
||||
D78F08152D7F7F5F00FC6C75 /* NIP04 */,
|
||||
4C45E5002BED4CE10025A428 /* NIP10 */,
|
||||
4C1D4FB32A7967990024F453 /* build-git-hash.txt */,
|
||||
4CA3529C2A76AE47003BB08B /* Notify */,
|
||||
@@ -3993,25 +3953,6 @@
|
||||
path = Chat;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D78F080A2D7F78B000FC6C75 /* WalletConnect */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D78F08102D7F78F600FC6C75 /* Response.swift */,
|
||||
D78F080B2D7F78EB00FC6C75 /* Request.swift */,
|
||||
4C7D09612A098D0E00943473 /* WalletConnect.swift */,
|
||||
D74AAFD52B155F0C006CF0F4 /* WalletConnect+.swift */,
|
||||
);
|
||||
path = WalletConnect;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D78F08152D7F7F5F00FC6C75 /* NIP04 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D78F08162D7F7F6C00FC6C75 /* NIP04.swift */,
|
||||
);
|
||||
path = NIP04;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D79C4C152AFEB061003A41B4 /* DamusNotificationService */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -4463,7 +4404,6 @@
|
||||
D7CBD1D42B8D21DC00BFD889 /* DamusPurpleNotificationManagement.swift in Sources */,
|
||||
4C32B9572A9AD44700DC3548 /* Root.swift in Sources */,
|
||||
4C3EA64428FF558100C48A62 /* sha256.c in Sources */,
|
||||
5C8498032D5D150000F74FEB /* ZapExplainer.swift in Sources */,
|
||||
504323A72A34915F006AE6DC /* RelayModel.swift in Sources */,
|
||||
4CF0ABF62985CD5500D66079 /* UserSearch.swift in Sources */,
|
||||
4C32B9542A9AD44700DC3548 /* FlatBuffersUtils.swift in Sources */,
|
||||
@@ -4662,7 +4602,6 @@
|
||||
4CE879522996B68900F758CC /* RelayType.swift in Sources */,
|
||||
4CE8795B2996C47A00F758CC /* ZapsModel.swift in Sources */,
|
||||
4C3A1D3729637E0500558C0F /* PreviewCache.swift in Sources */,
|
||||
D78F08142D7F78F900FC6C75 /* Response.swift in Sources */,
|
||||
4C3EA67528FF7A5A00C48A62 /* take.c in Sources */,
|
||||
4C3AC7A12835A81400E1F516 /* SetupView.swift in Sources */,
|
||||
4C06670128FC7C5900038D2A /* RelayView.swift in Sources */,
|
||||
@@ -4688,7 +4627,6 @@
|
||||
4CAAD8AD298851D000060CEA /* AccountDeletion.swift in Sources */,
|
||||
4CFF8F6329CC9AD7008DB934 /* ImageContextMenuModifier.swift in Sources */,
|
||||
4C54AA0A29A55429003E4487 /* EventGroup.swift in Sources */,
|
||||
D73B74E12D8365BA0067BDBC /* ExtraFonts.swift in Sources */,
|
||||
4C7D09622A098D0E00943473 /* WalletConnect.swift in Sources */,
|
||||
4C3EA67928FF7ABF00C48A62 /* list.c in Sources */,
|
||||
4C64987E286D082C00EAE2B3 /* DirectMessagesModel.swift in Sources */,
|
||||
@@ -4725,7 +4663,6 @@
|
||||
4C3EA64C28FF59AC00C48A62 /* bech32_util.c in Sources */,
|
||||
4CA9276C2A2910D10098A105 /* ReplyPart.swift in Sources */,
|
||||
D7C6787E2B2D34CC00BCEAFB /* NIP98AuthenticatedRequest.swift in Sources */,
|
||||
5CB017252D42C5C400A9ED05 /* TransactionsView.swift in Sources */,
|
||||
4CE1399029F0661A00AC6A0B /* RepostAction.swift in Sources */,
|
||||
4CE1399229F0666100AC6A0B /* ShareActionButton.swift in Sources */,
|
||||
4C42812C298C848200DBF26F /* TranslateView.swift in Sources */,
|
||||
@@ -4775,8 +4712,6 @@
|
||||
4C8EC52529D1FA6C0085D9A8 /* DamusColors.swift in Sources */,
|
||||
3A4647CF2A413ADC00386AD8 /* CondensedProfilePicturesView.swift in Sources */,
|
||||
5C14C29B2BBBA29C00079FD2 /* RelaySoftwareDetail.swift in Sources */,
|
||||
5CB017312D4422DB00A9ED05 /* NWCSettings.swift in Sources */,
|
||||
D78F080D2D7F78EF00FC6C75 /* Request.swift in Sources */,
|
||||
D78DB85F2C20FED300F0AB12 /* ChatBubbleView.swift in Sources */,
|
||||
D2277EEA2A089BD5006C3807 /* Router.swift in Sources */,
|
||||
4C9D6D162B1AA9C6004E5CD9 /* DisplayTabBarNotify.swift in Sources */,
|
||||
@@ -4856,7 +4791,6 @@
|
||||
4C9146FE2A2A87C200DDEA40 /* nostrscript.c in Sources */,
|
||||
4C5F9118283D88E40052CD1C /* FollowingModel.swift in Sources */,
|
||||
4C1A9A1A29DCA17E00516EAC /* ReplyCounter.swift in Sources */,
|
||||
D78F08182D7F7F7500FC6C75 /* NIP04.swift in Sources */,
|
||||
50B5685329F97CB400A23243 /* CredentialHandler.swift in Sources */,
|
||||
643EA5C8296B764E005081BB /* RelayFilterView.swift in Sources */,
|
||||
F71694EC2A662292001F4053 /* SuggestedUsersViewModel.swift in Sources */,
|
||||
@@ -4875,7 +4809,6 @@
|
||||
F7908E92298B0F0700AB113A /* RelayDetailView.swift in Sources */,
|
||||
4C9147002A2A891E00DDEA40 /* error.c in Sources */,
|
||||
4CE879552996BAB900F758CC /* RelayPaidDetail.swift in Sources */,
|
||||
5CB0172F2D42C76A00A9ED05 /* BalanceView.swift in Sources */,
|
||||
4C1253602A76CF890004F4B8 /* ScrollToTopNotify.swift in Sources */,
|
||||
4CA3529E2A76AE67003BB08B /* FollowNotify.swift in Sources */,
|
||||
4CF0ABD42980996B00D66079 /* Report.swift in Sources */,
|
||||
@@ -5020,7 +4953,6 @@
|
||||
82D6FABC2CD99F7900C925F4 /* refmap.c in Sources */,
|
||||
82D6FABD2CD99F7900C925F4 /* verifier.c in Sources */,
|
||||
82D6FABE2CD99F7900C925F4 /* NdbProfile.swift in Sources */,
|
||||
D78F08112D7F78F900FC6C75 /* Response.swift in Sources */,
|
||||
82D6FABF2CD99F7900C925F4 /* NdbTagIterator.swift in Sources */,
|
||||
82D6FAC02CD99F7900C925F4 /* NdbNote.swift in Sources */,
|
||||
82D6FAC12CD99F7900C925F4 /* AsciiCharacter.swift in Sources */,
|
||||
@@ -5057,7 +4989,6 @@
|
||||
82D6FAE02CD99F7900C925F4 /* DisplayTabBarNotify.swift in Sources */,
|
||||
82D6FAE12CD99F7900C925F4 /* BroadcastNotify.swift in Sources */,
|
||||
82D6FAE22CD99F7900C925F4 /* ComposeNotify.swift in Sources */,
|
||||
D73B74E22D8365BA0067BDBC /* ExtraFonts.swift in Sources */,
|
||||
82D6FAE32CD99F7900C925F4 /* FollowedNotify.swift in Sources */,
|
||||
82D6FAE42CD99F7900C925F4 /* FollowNotify.swift in Sources */,
|
||||
82D6FAE52CD99F7900C925F4 /* LikedNotify.swift in Sources */,
|
||||
@@ -5090,7 +5021,6 @@
|
||||
82D6FAFE2CD99F7900C925F4 /* Pubkey.swift in Sources */,
|
||||
82D6FAFF2CD99F7900C925F4 /* NoteId.swift in Sources */,
|
||||
82D6FB002CD99F7900C925F4 /* Referenced.swift in Sources */,
|
||||
5CB0172D2D42C76A00A9ED05 /* BalanceView.swift in Sources */,
|
||||
82D6FB012CD99F7900C925F4 /* Block.swift in Sources */,
|
||||
82D6FB022CD99F7900C925F4 /* MigratedTypes.swift in Sources */,
|
||||
82D6FB032CD99F7900C925F4 /* DamusDuration.swift in Sources */,
|
||||
@@ -5098,7 +5028,6 @@
|
||||
82D6FB052CD99F7900C925F4 /* MusicController.swift in Sources */,
|
||||
82D6FB062CD99F7900C925F4 /* UserStatusView.swift in Sources */,
|
||||
82D6FB072CD99F7900C925F4 /* UserStatus.swift in Sources */,
|
||||
5CB017262D42C5C400A9ED05 /* TransactionsView.swift in Sources */,
|
||||
82D6FB082CD99F7900C925F4 /* UserStatusSheet.swift in Sources */,
|
||||
82D6FB092CD99F7900C925F4 /* SearchHeaderView.swift in Sources */,
|
||||
82D6FB0A2CD99F7900C925F4 /* DamusGradient.swift in Sources */,
|
||||
@@ -5144,7 +5073,6 @@
|
||||
82D6FB322CD99F7900C925F4 /* FillAndStroke.swift in Sources */,
|
||||
82D6FB332CD99F7900C925F4 /* Array.swift in Sources */,
|
||||
82D6FB342CD99F7900C925F4 /* VectorMath.swift in Sources */,
|
||||
5C8498022D5D150000F74FEB /* ZapExplainer.swift in Sources */,
|
||||
82D6FB352CD99F7900C925F4 /* OffsetExtension.swift in Sources */,
|
||||
82D6FB362CD99F7900C925F4 /* RelayFilters.swift in Sources */,
|
||||
82D6FB372CD99F7900C925F4 /* RelayModelCache.swift in Sources */,
|
||||
@@ -5190,7 +5118,6 @@
|
||||
82D6FB5E2CD99F7900C925F4 /* CredentialHandler.swift in Sources */,
|
||||
82D6FB5F2CD99F7900C925F4 /* KeyboardVisible.swift in Sources */,
|
||||
82D6FB602CD99F7900C925F4 /* StringUtil.swift in Sources */,
|
||||
D78F08172D7F7F7500FC6C75 /* NIP04.swift in Sources */,
|
||||
82D6FB612CD99F7900C925F4 /* Router.swift in Sources */,
|
||||
82D6FB622CD99F7900C925F4 /* Log.swift in Sources */,
|
||||
82D6FB632CD99F7900C925F4 /* AVPlayer+Additions.swift in Sources */,
|
||||
@@ -5420,7 +5347,6 @@
|
||||
82D6FC432CD99F7900C925F4 /* ReactionView.swift in Sources */,
|
||||
82D6FC442CD99F7900C925F4 /* EventActionBar.swift in Sources */,
|
||||
82D6FC452CD99F7900C925F4 /* EventDetailBar.swift in Sources */,
|
||||
D78F080C2D7F78EF00FC6C75 /* Request.swift in Sources */,
|
||||
82D6FC462CD99F7900C925F4 /* ShareAction.swift in Sources */,
|
||||
82D6FC472CD99F7900C925F4 /* RepostAction.swift in Sources */,
|
||||
82D6FC482CD99F7900C925F4 /* ShareActionButton.swift in Sources */,
|
||||
@@ -5446,7 +5372,6 @@
|
||||
82D6FC5A2CD99F7900C925F4 /* QRScanNSECView.swift in Sources */,
|
||||
82D6FC5B2CD99F7900C925F4 /* NoteContentView.swift in Sources */,
|
||||
82D6FC5C2CD99F7900C925F4 /* PostButton.swift in Sources */,
|
||||
5CB017322D4422DB00A9ED05 /* NWCSettings.swift in Sources */,
|
||||
82D6FC5D2CD99F7900C925F4 /* PostView.swift in Sources */,
|
||||
82D6FC5E2CD99F7900C925F4 /* AttachMediaUtility.swift in Sources */,
|
||||
82D6FC5F2CD99F7900C925F4 /* MediaPicker.swift in Sources */,
|
||||
@@ -5598,7 +5523,6 @@
|
||||
D73E5E8A2C6A97F4007EB227 /* PurpleStoreKitManager.swift in Sources */,
|
||||
D73E5E8D2C6A97F4007EB227 /* CameraService+Extensions.swift in Sources */,
|
||||
D73E5E8E2C6A97F4007EB227 /* ImageResizer.swift in Sources */,
|
||||
D78F080E2D7F78EF00FC6C75 /* Request.swift in Sources */,
|
||||
D73E5E8F2C6A97F4007EB227 /* PhotoCaptureProcessor.swift in Sources */,
|
||||
D773BC602C6D538500349F0A /* CommentItem.swift in Sources */,
|
||||
D73E5E902C6A97F4007EB227 /* VideoCaptureProcessor.swift in Sources */,
|
||||
@@ -5613,7 +5537,6 @@
|
||||
D73E5E992C6A97F4007EB227 /* Liked.swift in Sources */,
|
||||
D73E5E9A2C6A97F4007EB227 /* ProfileUpdate.swift in Sources */,
|
||||
D73E5E9B2C6A97F4007EB227 /* PostBlock.swift in Sources */,
|
||||
5CB017332D4422DB00A9ED05 /* NWCSettings.swift in Sources */,
|
||||
D73E5E9C2C6A97F4007EB227 /* Reply.swift in Sources */,
|
||||
D73E5E9D2C6A97F4007EB227 /* SearchModel.swift in Sources */,
|
||||
D73E5E9E2C6A97F4007EB227 /* NostrFilter+Hashable.swift in Sources */,
|
||||
@@ -5621,7 +5544,6 @@
|
||||
D73E5F912C6AA71B007EB227 /* InputDismissKeyboard.swift in Sources */,
|
||||
D73E5E9F2C6A97F4007EB227 /* CreateAccountModel.swift in Sources */,
|
||||
D73E5EA12C6A97F4007EB227 /* SignalModel.swift in Sources */,
|
||||
5CB017272D42C5C400A9ED05 /* TransactionsView.swift in Sources */,
|
||||
D73E5EA22C6A97F4007EB227 /* FollowTarget.swift in Sources */,
|
||||
D73E5EA32C6A97F4007EB227 /* BookmarksManager.swift in Sources */,
|
||||
D73E5EA42C6A97F4007EB227 /* EventsModel.swift in Sources */,
|
||||
@@ -5629,7 +5551,6 @@
|
||||
D73E5EA62C6A97F4007EB227 /* FollowersModel.swift in Sources */,
|
||||
D73E5EA72C6A97F4007EB227 /* SearchHomeModel.swift in Sources */,
|
||||
D73E5EA82C6A97F4007EB227 /* DirectMessageModel.swift in Sources */,
|
||||
D78F08132D7F78F900FC6C75 /* Response.swift in Sources */,
|
||||
D73E5EA92C6A97F4007EB227 /* Report.swift in Sources */,
|
||||
D73E5EAA2C6A97F4007EB227 /* ZapsModel.swift in Sources */,
|
||||
D73E5EAB2C6A97F4007EB227 /* DraftsModel.swift in Sources */,
|
||||
@@ -5705,12 +5626,10 @@
|
||||
D73E5EF22C6A97F4007EB227 /* DamusPurpleURLSheetView.swift in Sources */,
|
||||
D73E5EF32C6A97F4007EB227 /* DamusPurpleVerifyNpubView.swift in Sources */,
|
||||
D73E5EF42C6A97F4007EB227 /* DamusPurpleAccountView.swift in Sources */,
|
||||
5CB0172E2D42C76A00A9ED05 /* BalanceView.swift in Sources */,
|
||||
D73E5EF52C6A97F4007EB227 /* DamusPurpleNewUserOnboardingView.swift in Sources */,
|
||||
D73E5EF62C6A97F4007EB227 /* SearchingEventView.swift in Sources */,
|
||||
D73E5EF72C6A97F4007EB227 /* PullDownSearch.swift in Sources */,
|
||||
D73E5EF82C6A97F4007EB227 /* NotificationsView.swift in Sources */,
|
||||
D73B74E32D8365BA0067BDBC /* ExtraFonts.swift in Sources */,
|
||||
D73E5EF92C6A97F4007EB227 /* EventGroupView.swift in Sources */,
|
||||
D73E5EFA2C6A97F4007EB227 /* NotificationItemView.swift in Sources */,
|
||||
D73E5EFB2C6A97F4007EB227 /* ProfilePicturesView.swift in Sources */,
|
||||
@@ -5765,7 +5684,6 @@
|
||||
D73E5F292C6A97F4007EB227 /* ReplyDescription.swift in Sources */,
|
||||
D73E5F2A2C6A97F4007EB227 /* RelativeTime.swift in Sources */,
|
||||
D73E5F732C6A9885007EB227 /* TestData.swift in Sources */,
|
||||
D78F08192D7F7F7500FC6C75 /* NIP04.swift in Sources */,
|
||||
D73E5F2B2C6A97F4007EB227 /* ReplyPart.swift in Sources */,
|
||||
D73E5F2C2C6A97F4007EB227 /* ProxyView.swift in Sources */,
|
||||
D73E5F2D2C6A97F4007EB227 /* SelectedEventView.swift in Sources */,
|
||||
@@ -5855,7 +5773,6 @@
|
||||
D703D7A32C670E1D00A400EA /* nostr_bech32.c in Sources */,
|
||||
D703D7992C670DF900A400EA /* sha256.c in Sources */,
|
||||
D703D7972C670DED00A400EA /* wasm.c in Sources */,
|
||||
5C8498042D5D150000F74FEB /* ZapExplainer.swift in Sources */,
|
||||
D703D7842C670C4700A400EA /* SequenceUtils.swift in Sources */,
|
||||
D703D7912C670D1E00A400EA /* DisplayName.swift in Sources */,
|
||||
D703D7B02C6710A500A400EA /* Root.swift in Sources */,
|
||||
@@ -6068,7 +5985,6 @@
|
||||
D798D2232B0859B700234419 /* KeychainStorage.swift in Sources */,
|
||||
D74AAFC32B153395006CF0F4 /* HeadlessDamusState.swift in Sources */,
|
||||
D7CE1B272B0BE224002EDAD4 /* bech32_util.c in Sources */,
|
||||
D78F08122D7F78F900FC6C75 /* Response.swift in Sources */,
|
||||
D7CCFC102B05880F00323D86 /* Id.swift in Sources */,
|
||||
D7CB5D532B1174E900AD4105 /* DeepLPlan.swift in Sources */,
|
||||
D7EDED282B1180940018B19C /* ImageUploadModel.swift in Sources */,
|
||||
@@ -6078,11 +5994,9 @@
|
||||
D7CE1B332B0BE6DE002EDAD4 /* Nostr.swift in Sources */,
|
||||
D7CE1B3D2B0BE719002EDAD4 /* Verifiable.swift in Sources */,
|
||||
D7CE1B382B0BE719002EDAD4 /* VeriferOptions.swift in Sources */,
|
||||
D78F080F2D7F78EF00FC6C75 /* Request.swift in Sources */,
|
||||
D7CCFC152B05891000323D86 /* Referenced.swift in Sources */,
|
||||
D7CE1B2B2B0BE243002EDAD4 /* hex.c in Sources */,
|
||||
D798D2222B08598A00234419 /* ReferencedId.swift in Sources */,
|
||||
D78F081A2D7F803100FC6C75 /* NIP04.swift in Sources */,
|
||||
D7B76C912C82507F003A16CB /* NIP98AuthenticatedRequest.swift in Sources */,
|
||||
D7CE1B492B0BE729002EDAD4 /* DisplayName.swift in Sources */,
|
||||
D7CE1B192B0BE132002EDAD4 /* builder.c in Sources */,
|
||||
@@ -6314,7 +6228,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@@ -6337,7 +6251,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||
MARKETING_VERSION = 1.14;
|
||||
MARKETING_VERSION = 1.13;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -6383,7 +6297,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@@ -6402,7 +6316,7 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||
MARKETING_VERSION = 1.14;
|
||||
MARKETING_VERSION = 1.13;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
||||
@@ -232,7 +232,7 @@ func send_zap(damus_state: DamusState, target: ZapTarget, lnurl: String, is_cust
|
||||
flusher = .once({ pe in
|
||||
// send donation zap when the pending zap is flushed, this allows user to cancel and not send a donation
|
||||
Task { @MainActor in
|
||||
await WalletConnect.send_donation_zap(pool: damus_state.pool, postbox: damus_state.postbox, nwc: nwc_state.url, percent: damus_state.settings.donation_percent, base_msats: amount_msat)
|
||||
await send_donation_zap(pool: damus_state.pool, postbox: damus_state.postbox, nwc: nwc_state.url, percent: damus_state.settings.donation_percent, base_msats: amount_msat)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func send_zap(damus_state: DamusState, target: ZapTarget, lnurl: String, is_cust
|
||||
// we don't have a delay on one-tap nozaps (since this will be from customize zap view)
|
||||
let delay = damus_state.settings.nozaps ? nil : 5.0
|
||||
|
||||
let nwc_req = WalletConnect.pay(url: nwc_state.url, pool: damus_state.pool, post: damus_state.postbox, invoice: inv, delay: delay, on_flush: flusher)
|
||||
let nwc_req = nwc_pay(url: nwc_state.url, pool: damus_state.pool, post: damus_state.postbox, invoice: inv, delay: delay, on_flush: flusher)
|
||||
|
||||
guard let nwc_req, case .nwc(let pzap_state) = pending_zap_state else {
|
||||
print("nwc: failed to send nwc request for zapreq \(reqid.reqid)")
|
||||
|
||||
@@ -367,9 +367,7 @@ struct ContentView: View {
|
||||
self.confirm_mute = true
|
||||
}
|
||||
.onReceive(handle_notify(.attached_wallet)) { nwc in
|
||||
// Ensure to add NWC relay to the pool and connect it.
|
||||
try? damus_state.pool.add_relay(.nwc(url: nwc.relay))
|
||||
damus_state.pool.connect(to: [nwc.relay])
|
||||
|
||||
// update the lightning address on our profile when we attach a
|
||||
// wallet with an associated
|
||||
|
||||
@@ -260,7 +260,7 @@ class HomeModel: ContactsDelegate {
|
||||
// TODO: Adapt KeychainStorage to StringCodable and instead of parsing to WalletConnectURL every time
|
||||
guard let nwc_str = damus_state.settings.nostr_wallet_connect,
|
||||
let nwc = WalletConnectURL(str: nwc_str),
|
||||
let resp = await WalletConnect.FullWalletResponse(from: ev, nwc: nwc) else {
|
||||
let resp = await FullWalletResponse(from: ev, nwc: nwc) else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -274,24 +274,12 @@ class HomeModel: ContactsDelegate {
|
||||
|
||||
guard resp.response.error == nil else {
|
||||
print("nwc error: \(resp.response)")
|
||||
WalletConnect.handle_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp)
|
||||
nwc_error(zapcache: self.damus_state.zaps, evcache: self.damus_state.events, resp: resp)
|
||||
return
|
||||
}
|
||||
|
||||
if resp.response.result_type == .list_transactions {
|
||||
Log.info("Received NWC transaction list from %s", for: .nwc, relay.absoluteString)
|
||||
damus_state.wallet.handle_nwc_response(response: resp)
|
||||
return
|
||||
}
|
||||
|
||||
if resp.response.result_type == .get_balance {
|
||||
Log.info("Received NWC balance information from %s", for: .nwc, relay.absoluteString)
|
||||
damus_state.wallet.handle_nwc_response(response: resp)
|
||||
return
|
||||
}
|
||||
|
||||
print("nwc success: \(resp.response.result.debugDescription) [\(relay)]")
|
||||
WalletConnect.handle_zap_success(state: self.damus_state, resp: resp)
|
||||
nwc_success(state: self.damus_state, resp: resp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,7 +453,7 @@ class HomeModel: ContactsDelegate {
|
||||
let nwc = WalletConnectURL(str: nwc_str),
|
||||
nwc.relay == relay_id
|
||||
{
|
||||
WalletConnect.subscribe(url: nwc, pool: pool)
|
||||
subscribe_to_nwc(url: nwc, pool: pool)
|
||||
}
|
||||
case .error(let merr):
|
||||
let desc = String(describing: merr)
|
||||
|
||||
@@ -29,18 +29,7 @@ class ThreadModel: ObservableObject {
|
||||
///
|
||||
/// This is a computed property because we then don't need to worry about keeping things in sync
|
||||
var parent_events: [NostrEvent] {
|
||||
// This block of code helps ensure `ThreadEventMap` stays in sync with `EventCache`
|
||||
let parent_events_from_cache = damus_state.events.parent_events(event: selected_event, keypair: damus_state.keypair)
|
||||
for parent_event in parent_events_from_cache {
|
||||
add_event(
|
||||
parent_event,
|
||||
keypair: damus_state.keypair,
|
||||
look_for_parent_events: false, // We have all parents we need for now
|
||||
publish_changes: false // Publishing changes during a view render is problematic
|
||||
)
|
||||
}
|
||||
|
||||
return parent_events_from_cache
|
||||
return event_map.parent_events(of: selected_event)
|
||||
}
|
||||
/// All of the direct and indirect replies of `selected_event` in the thread. sorted chronologically
|
||||
///
|
||||
@@ -136,13 +125,7 @@ class ThreadModel: ObservableObject {
|
||||
/// Adds an event to this thread.
|
||||
/// Normally this does not need to be called externally because it is the responsibility of this class to load the events, not the view's.
|
||||
/// However, this can be called externally for testing purposes (e.g. injecting events for testing)
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - ev: The event to add into the thread event map
|
||||
/// - keypair: The user's keypair
|
||||
/// - look_for_parent_events: Whether to search for parent events of the input event in NostrDB
|
||||
/// - publish_changes: Whether to publish changes at the end
|
||||
func add_event(_ ev: NostrEvent, keypair: Keypair, look_for_parent_events: Bool = true, publish_changes: Bool = true) {
|
||||
func add_event(_ ev: NostrEvent, keypair: Keypair) {
|
||||
if event_map.contains(id: ev.id) {
|
||||
return
|
||||
}
|
||||
@@ -153,22 +136,8 @@ class ThreadModel: ObservableObject {
|
||||
|
||||
event_map.add(event: ev)
|
||||
|
||||
if look_for_parent_events {
|
||||
// Add all parent events that we have on EventCache (and subsequently on NostrDB)
|
||||
// This helps ensure we include as many locally-stored notes as possible — even on poor networking conditions
|
||||
damus_state.events.parent_events(event: ev, keypair: damus_state.keypair).forEach {
|
||||
add_event(
|
||||
$0, // The `lookup` function in `parent_events` turns the event into an "owned" object, so we do not need to clone here
|
||||
keypair: damus_state.keypair,
|
||||
look_for_parent_events: false, // We do not need deep recursion
|
||||
publish_changes: false // Do not publish changes multiple times
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if publish_changes {
|
||||
objectWillChange.send()
|
||||
}
|
||||
// Publish changes
|
||||
objectWillChange.send()
|
||||
}
|
||||
|
||||
/// Handles an incoming event from a relay pool
|
||||
|
||||
@@ -13,17 +13,10 @@ enum WalletConnectState {
|
||||
case none
|
||||
}
|
||||
|
||||
/// Models and manages the user's NWC wallet based on the app's settings
|
||||
class WalletModel: ObservableObject {
|
||||
var settings: UserSettingsStore
|
||||
private(set) var previous_state: WalletConnectState
|
||||
var initial_percent: Int
|
||||
/// The wallet's balance, in sats.
|
||||
/// Starts with `nil` to signify it is not loaded yet
|
||||
@Published private(set) var balance: Int64? = nil
|
||||
/// The list of NWC transactions made in the wallet
|
||||
/// Starts with `nil` to signify it is not loaded yet
|
||||
@Published private(set) var transactions: [WalletConnect.Transaction]? = nil
|
||||
|
||||
@Published private(set) var connect_state: WalletConnectState
|
||||
|
||||
@@ -68,27 +61,4 @@ class WalletModel: ObservableObject {
|
||||
self.connect_state = .existing(nwc)
|
||||
self.previous_state = .existing(nwc)
|
||||
}
|
||||
|
||||
/// Handles an NWC response event and updates the model.
|
||||
///
|
||||
/// This takes a response received from the NWC relay and updates the internal state of this model.
|
||||
///
|
||||
/// - Parameter response: The NWC response received from the network
|
||||
func handle_nwc_response(response: WalletConnect.FullWalletResponse) {
|
||||
switch response.response.result {
|
||||
case .get_balance(let balanceResp):
|
||||
self.balance = balanceResp.balance / 1000
|
||||
case .none:
|
||||
return
|
||||
case .some(.pay_invoice(_)):
|
||||
return
|
||||
case .list_transactions(let transactionsResp):
|
||||
self.transactions = transactionsResp.transactions
|
||||
}
|
||||
}
|
||||
|
||||
func resetWalletStateInformation() {
|
||||
self.transactions = nil
|
||||
self.balance = nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
//
|
||||
// NIP04.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2025-03-10.
|
||||
//
|
||||
import Foundation
|
||||
|
||||
/// Functions and utilities for the NIP-04 spec
|
||||
struct NIP04 {}
|
||||
|
||||
extension NIP04 {
|
||||
/// Encrypts a message using NIP-04.
|
||||
static func encrypt_message(message: String, privkey: Privkey, to_pk: Pubkey, encoding: EncEncoding = .base64) -> String? {
|
||||
let iv = random_bytes(count: 16).bytes
|
||||
guard let shared_sec = get_shared_secret(privkey: privkey, pubkey: to_pk) else {
|
||||
return nil
|
||||
}
|
||||
let utf8_message = Data(message.utf8).bytes
|
||||
guard let enc_message = aes_encrypt(data: utf8_message, iv: iv, shared_sec: shared_sec) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch encoding {
|
||||
case .base64:
|
||||
return encode_dm_base64(content: enc_message.bytes, iv: iv)
|
||||
case .bech32:
|
||||
return encode_dm_bech32(content: enc_message.bytes, iv: iv)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Creates an event with encrypted `contents` field, using NIP-04
|
||||
static func create_encrypted_event(_ message: String, to_pk: Pubkey, tags: [[String]], keypair: FullKeypair, created_at: UInt32, kind: UInt32) -> NostrEvent? {
|
||||
let privkey = keypair.privkey
|
||||
|
||||
guard let enc_content = encrypt_message(message: message, privkey: privkey, to_pk: to_pk) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return NostrEvent(content: enc_content, keypair: keypair.to_keypair(), kind: kind, tags: tags, createdAt: created_at)
|
||||
}
|
||||
|
||||
/// Creates a NIP-04 style direct message event
|
||||
static func create_dm(_ message: String, to_pk: Pubkey, tags: [[String]], keypair: Keypair, created_at: UInt32? = nil) -> NostrEvent?
|
||||
{
|
||||
let created = created_at ?? UInt32(Date().timeIntervalSince1970)
|
||||
|
||||
guard let keypair = keypair.to_full() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return create_encrypted_event(message, to_pk: to_pk, tags: tags, keypair: keypair, created_at: created, kind: 4)
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func make_private_zap_request_event(identity: FullKeypair, enc_key: FullKeypair,
|
||||
|
||||
guard let note = NostrEvent(content: message, keypair: identity.to_keypair(), kind: 9733, tags: tags),
|
||||
let note_json = encode_json(note),
|
||||
let enc = NIP04.encrypt_message(message: note_json, privkey: enc_key.privkey, to_pk: target.pubkey, encoding: .bech32)
|
||||
let enc = encrypt_message(message: note_json, privkey: enc_key.privkey, to_pk: target.pubkey, encoding: .bech32)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ enum NostrResponse {
|
||||
|
||||
static func owned_from_json(json: String) -> NostrResponse? {
|
||||
return json.withCString{ cstr in
|
||||
let bufsize: Int = max(Int(Double(json.utf8.count) * 8.0), Int(getpagesize()))
|
||||
let bufsize: Int = max(Int(Double(json.utf8.count) * 4.0), Int(getpagesize()))
|
||||
let data = malloc(bufsize)
|
||||
|
||||
if data == nil {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// ExtraFonts.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2025-03-13.
|
||||
//
|
||||
import SwiftUI
|
||||
|
||||
extension Font {
|
||||
// Note: When changing the font size accessibility setting, these styles only update after an app restart. It's a current limitation of this.
|
||||
|
||||
static let veryLargeTitle: Font = .system(size: UIFont.preferredFont(forTextStyle: .largeTitle).pointSize * 1.5, weight: .bold) // Makes a bigger title while allowing for iOS dynamic font sizing to take effect
|
||||
static let veryVeryLargeTitle: Font = .system(size: UIFont.preferredFont(forTextStyle: .largeTitle).pointSize * 2.1, weight: .bold) // Makes a bigger title while allowing for iOS dynamic font sizing to take effect
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ enum LogCategory: String {
|
||||
case storage
|
||||
case networking
|
||||
case timeline
|
||||
/// Logs related to Nostr Wallet Connect components
|
||||
case nwc
|
||||
case push_notifications
|
||||
case damus_purple
|
||||
case image_uploading
|
||||
|
||||
118
damus/Util/WalletConnect+.swift
Normal file
118
damus/Util/WalletConnect+.swift
Normal file
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// WalletConnect+.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2023-11-27.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
func make_wallet_pay_invoice_request(invoice: String) -> WalletRequest<PayInvoiceRequest> {
|
||||
let data = PayInvoiceRequest(invoice: invoice)
|
||||
return WalletRequest(method: "pay_invoice", params: data)
|
||||
}
|
||||
|
||||
func make_wallet_balance_request() -> WalletRequest<EmptyRequest> {
|
||||
return WalletRequest(method: "get_balance", params: nil)
|
||||
}
|
||||
|
||||
struct EmptyRequest: Codable {
|
||||
}
|
||||
|
||||
struct PayInvoiceRequest: Codable {
|
||||
let invoice: String
|
||||
}
|
||||
|
||||
func make_wallet_connect_request<T>(req: WalletRequest<T>, to_pk: Pubkey, keypair: FullKeypair) -> NostrEvent? {
|
||||
let tags = [to_pk.tag]
|
||||
let created_at = UInt32(Date().timeIntervalSince1970)
|
||||
guard let content = encode_json(req) else {
|
||||
return nil
|
||||
}
|
||||
return create_encrypted_event(content, to_pk: to_pk, tags: tags, keypair: keypair, created_at: created_at, kind: 23194)
|
||||
}
|
||||
|
||||
func subscribe_to_nwc(url: WalletConnectURL, pool: RelayPool) {
|
||||
var filter = NostrFilter(kinds: [.nwc_response])
|
||||
filter.authors = [url.pubkey]
|
||||
filter.limit = 0
|
||||
let sub = NostrSubscribe(filters: [filter], sub_id: "nwc")
|
||||
|
||||
pool.send(.subscribe(sub), to: [url.relay], skip_ephemeral: false)
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func nwc_pay(url: WalletConnectURL, pool: RelayPool, post: PostBox, invoice: String, delay: TimeInterval? = 5.0, on_flush: OnFlush? = nil) -> NostrEvent? {
|
||||
let req = make_wallet_pay_invoice_request(invoice: invoice)
|
||||
guard let ev = make_wallet_connect_request(req: req, to_pk: url.pubkey, keypair: url.keypair) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
try? pool.add_relay(.nwc(url: url.relay))
|
||||
subscribe_to_nwc(url: url, pool: pool)
|
||||
post.send(ev, to: [url.relay], skip_ephemeral: false, delay: delay, on_flush: on_flush)
|
||||
return ev
|
||||
}
|
||||
|
||||
|
||||
func nwc_success(state: DamusState, resp: FullWalletResponse) {
|
||||
// find the pending zap and mark it as pending-confirmed
|
||||
for kv in state.zaps.our_zaps {
|
||||
let zaps = kv.value
|
||||
|
||||
for zap in zaps {
|
||||
guard case .pending(let pzap) = zap,
|
||||
case .nwc(let nwc_state) = pzap.state,
|
||||
case .postbox_pending(let nwc_req) = nwc_state.state,
|
||||
nwc_req.id == resp.req_id
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
if nwc_state.update_state(state: .confirmed) {
|
||||
// notify the zaps model of an update so it can mark them as paid
|
||||
state.events.get_cache_data(NoteId(pzap.target.id)).zaps_model.objectWillChange.send()
|
||||
print("NWC success confirmed")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func send_donation_zap(pool: RelayPool, postbox: PostBox, nwc: WalletConnectURL, percent: Int, base_msats: Int64) async {
|
||||
let percent_f = Double(percent) / 100.0
|
||||
let donations_msats = Int64(percent_f * Double(base_msats))
|
||||
|
||||
let payreq = LNUrlPayRequest(allowsNostr: true, commentAllowed: nil, nostrPubkey: "", callback: "https://sendsats.lol/@damus")
|
||||
guard let invoice = await fetch_zap_invoice(payreq, zapreq: nil, msats: donations_msats, zap_type: .non_zap, comment: nil) else {
|
||||
// we failed... oh well. no donation for us.
|
||||
print("damus-donation failed to fetch invoice")
|
||||
return
|
||||
}
|
||||
|
||||
print("damus-donation donating...")
|
||||
nwc_pay(url: nwc, pool: pool, post: postbox, invoice: invoice, delay: nil)
|
||||
}
|
||||
|
||||
func nwc_error(zapcache: Zaps, evcache: EventCache, resp: FullWalletResponse) {
|
||||
// find a pending zap with the nwc request id associated with this response and remove it
|
||||
for kv in zapcache.our_zaps {
|
||||
let zaps = kv.value
|
||||
|
||||
for zap in zaps {
|
||||
guard case .pending(let pzap) = zap,
|
||||
case .nwc(let nwc_state) = pzap.state,
|
||||
case .postbox_pending(let req) = nwc_state.state,
|
||||
req.id == resp.req_id
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
// remove the pending zap if there was an error
|
||||
let reqid = ZapRequestId(from_pending: pzap)
|
||||
remove_zap(reqid: reqid, zapcache: zapcache, evcache: evcache)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
155
damus/Util/WalletConnect.swift
Normal file
155
damus/Util/WalletConnect.swift
Normal file
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// WalletConnect.swift
|
||||
// damus
|
||||
//
|
||||
// Created by William Casarin on 2023-03-22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct WalletConnectURL: Equatable {
|
||||
static func == (lhs: WalletConnectURL, rhs: WalletConnectURL) -> Bool {
|
||||
return lhs.keypair == rhs.keypair &&
|
||||
lhs.pubkey == rhs.pubkey &&
|
||||
lhs.relay == rhs.relay
|
||||
}
|
||||
|
||||
let relay: RelayURL
|
||||
let keypair: FullKeypair
|
||||
let pubkey: Pubkey
|
||||
let lud16: String?
|
||||
|
||||
func to_url() -> URL {
|
||||
var urlComponents = URLComponents()
|
||||
urlComponents.scheme = "nostrwalletconnect"
|
||||
urlComponents.host = pubkey.hex()
|
||||
urlComponents.queryItems = [
|
||||
URLQueryItem(name: "relay", value: relay.absoluteString),
|
||||
URLQueryItem(name: "secret", value: keypair.privkey.hex())
|
||||
]
|
||||
|
||||
if let lud16 {
|
||||
urlComponents.queryItems?.append(URLQueryItem(name: "lud16", value: lud16))
|
||||
}
|
||||
|
||||
return urlComponents.url!
|
||||
}
|
||||
|
||||
init?(str: String) {
|
||||
guard let components = URLComponents(string: str),
|
||||
components.scheme == "nostrwalletconnect" || components.scheme == "nostr+walletconnect",
|
||||
// The line below provides flexibility for both `nostrwalletconnect://` (non-compliant, but commonly used) and `nostrwalletconnect:` (NIP-47 compliant) formats
|
||||
let encoded_pubkey = components.path == "" ? components.host : components.path,
|
||||
let pubkey = hex_decode_pubkey(encoded_pubkey),
|
||||
let items = components.queryItems,
|
||||
let relay = items.first(where: { qi in qi.name == "relay" })?.value,
|
||||
let relay_url = RelayURL(relay),
|
||||
let secret = items.first(where: { qi in qi.name == "secret" })?.value,
|
||||
secret.utf8.count == 64,
|
||||
let decoded = hex_decode(secret)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let privkey = Privkey(Data(decoded))
|
||||
guard let our_pk = privkey_to_pubkey(privkey: privkey) else { return nil }
|
||||
|
||||
let lud16 = items.first(where: { qi in qi.name == "lud16" })?.value
|
||||
let keypair = FullKeypair(pubkey: our_pk, privkey: privkey)
|
||||
self = WalletConnectURL(pubkey: pubkey, relay: relay_url, keypair: keypair, lud16: lud16)
|
||||
}
|
||||
|
||||
init(pubkey: Pubkey, relay: RelayURL, keypair: FullKeypair, lud16: String?) {
|
||||
self.pubkey = pubkey
|
||||
self.relay = relay
|
||||
self.keypair = keypair
|
||||
self.lud16 = lud16
|
||||
}
|
||||
}
|
||||
|
||||
struct WalletRequest<T: Codable>: Codable {
|
||||
let method: String
|
||||
let params: T?
|
||||
}
|
||||
|
||||
struct WalletResponseErr: Codable {
|
||||
let code: String?
|
||||
let message: String?
|
||||
}
|
||||
|
||||
struct PayInvoiceResponse: Decodable {
|
||||
let preimage: String
|
||||
}
|
||||
|
||||
enum WalletResponseResultType: String {
|
||||
case pay_invoice
|
||||
}
|
||||
|
||||
enum WalletResponseResult {
|
||||
case pay_invoice(PayInvoiceResponse)
|
||||
}
|
||||
|
||||
struct FullWalletResponse {
|
||||
let req_id: NoteId
|
||||
let response: WalletResponse
|
||||
|
||||
init?(from: NostrEvent, nwc: WalletConnectURL) async {
|
||||
guard let note_id = from.referenced_ids.first else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.req_id = note_id
|
||||
|
||||
let ares = Task {
|
||||
guard let json = decrypt_dm(nwc.keypair.privkey, pubkey: nwc.pubkey, content: from.content, encoding: .base64),
|
||||
let resp: WalletResponse = decode_json(json)
|
||||
else {
|
||||
let resp: WalletResponse? = nil
|
||||
return resp
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
guard let res = await ares.value else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.response = res
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct WalletResponse: Decodable {
|
||||
let result_type: WalletResponseResultType
|
||||
let error: WalletResponseErr?
|
||||
let result: WalletResponseResult?
|
||||
|
||||
private enum CodingKeys: CodingKey {
|
||||
case result_type, error, result
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
let result_type_str = try container.decode(String.self, forKey: .result_type)
|
||||
|
||||
guard let result_type = WalletResponseResultType(rawValue: result_type_str) else {
|
||||
throw DecodingError.typeMismatch(WalletResponseResultType.self, .init(codingPath: decoder.codingPath, debugDescription: "result_type \(result_type_str) is unknown"))
|
||||
}
|
||||
|
||||
self.result_type = result_type
|
||||
self.error = try container.decodeIfPresent(WalletResponseErr.self, forKey: .error)
|
||||
|
||||
guard self.error == nil else {
|
||||
self.result = nil
|
||||
return
|
||||
}
|
||||
|
||||
switch result_type {
|
||||
case .pay_invoice:
|
||||
let res = try container.decode(PayInvoiceResponse.self, forKey: .result)
|
||||
self.result = .pay_invoice(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
//
|
||||
// Request.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2025-03-10.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension WalletConnect {
|
||||
/// Models a request to an NWC wallet provider
|
||||
enum Request: Codable {
|
||||
/// Pay an invoice
|
||||
case payInvoice(
|
||||
/// bolt-11 invoice string
|
||||
invoice: String
|
||||
)
|
||||
/// Get the current wallet balance
|
||||
case getBalance
|
||||
/// Get the current wallet transaction history
|
||||
case getTransactionList(
|
||||
/// Starting timestamp in seconds since epoch (inclusive), optional.
|
||||
from: UInt64?,
|
||||
/// Ending timestamp in seconds since epoch (inclusive), optional.
|
||||
until: UInt64?,
|
||||
/// Maximum number of invoices to return, optional.
|
||||
limit: Int?,
|
||||
/// Offset of the first invoice to return, optional.
|
||||
offset: Int?,
|
||||
/// Include unpaid invoices, optional, default false.
|
||||
unpaid: Bool?,
|
||||
/// "incoming" for invoices, "outgoing" for payments, undefined for both.
|
||||
type: String?
|
||||
)
|
||||
|
||||
|
||||
// MARK: - Interface
|
||||
|
||||
/// Converts the NWC request into a raw Nostr event to be sent in the network
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - to_pk: The destination pubkey (used for encryption)
|
||||
/// - keypair: The requester's pubkey (used for encryption and signing)
|
||||
/// - Returns: The NWC request in a raw Nostr Event format, or nil if it cannot be encoded
|
||||
func to_nostr_event(to_pk: Pubkey, keypair: FullKeypair) -> NostrEvent? {
|
||||
let tags = [to_pk.tag]
|
||||
let created_at = UInt32(Date().timeIntervalSince1970)
|
||||
guard let content = encode_json(self) else {
|
||||
return nil
|
||||
}
|
||||
return NIP04.create_encrypted_event(content, to_pk: to_pk, tags: tags, keypair: keypair, created_at: created_at, kind: NostrKind.nwc_request.rawValue)
|
||||
}
|
||||
|
||||
// MARK: - Encoding and decoding
|
||||
|
||||
/// Keys for top-level JSON
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case method
|
||||
case params
|
||||
}
|
||||
|
||||
/// Keys for the JSON inside the "params" object
|
||||
private enum ParamKeys: String, CodingKey {
|
||||
case invoice
|
||||
case from, until, limit, offset, unpaid, type
|
||||
}
|
||||
|
||||
/// Constants for possible request "method" verbs
|
||||
private enum Method: String {
|
||||
case payInvoice = "pay_invoice"
|
||||
case getBalance = "get_balance"
|
||||
case listTransactions = "list_transactions"
|
||||
}
|
||||
|
||||
/// Decodes a payload into this request structure
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
let method = try container.decode(String.self, forKey: .method)
|
||||
|
||||
|
||||
switch method {
|
||||
case Method.payInvoice.rawValue:
|
||||
let paramsContainer = try container.nestedContainer(keyedBy: ParamKeys.self, forKey: .params)
|
||||
let invoice = try paramsContainer.decode(String.self, forKey: .invoice)
|
||||
self = .payInvoice(invoice: invoice)
|
||||
|
||||
case Method.getBalance.rawValue:
|
||||
// No params to decode
|
||||
self = .getBalance
|
||||
|
||||
case Method.listTransactions.rawValue:
|
||||
let paramsContainer = try container.nestedContainer(keyedBy: ParamKeys.self, forKey: .params)
|
||||
let from = try paramsContainer.decodeIfPresent(UInt64.self, forKey: .from)
|
||||
let until = try paramsContainer.decodeIfPresent(UInt64.self, forKey: .until)
|
||||
let limit = try paramsContainer.decodeIfPresent(Int.self, forKey: .limit)
|
||||
let offset = try paramsContainer.decodeIfPresent(Int.self, forKey: .offset)
|
||||
let unpaid = try paramsContainer.decodeIfPresent(Bool.self, forKey: .unpaid)
|
||||
let type = try paramsContainer.decodeIfPresent(String.self, forKey: .type)
|
||||
self = .getTransactionList(from: from, until: until, limit: limit, offset: offset, unpaid: unpaid, type: type)
|
||||
|
||||
default:
|
||||
throw DecodingError.dataCorruptedError(
|
||||
forKey: .method,
|
||||
in: container,
|
||||
debugDescription: "Unknown wallet method \"\(method)\""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Encodes this request structure into a payload
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
switch self {
|
||||
case .payInvoice(let invoice):
|
||||
try container.encode(Method.payInvoice.rawValue, forKey: .method)
|
||||
var paramsContainer = container.nestedContainer(keyedBy: ParamKeys.self, forKey: .params)
|
||||
try paramsContainer.encode(invoice, forKey: .invoice)
|
||||
|
||||
case .getBalance:
|
||||
try container.encode(Method.getBalance.rawValue, forKey: .method)
|
||||
// "params": null
|
||||
try container.encodeNil(forKey: .params)
|
||||
|
||||
case .getTransactionList(let from, let until, let limit, let offset, let unpaid, let type):
|
||||
try container.encode(Method.listTransactions.rawValue, forKey: .method)
|
||||
var paramsContainer = container.nestedContainer(keyedBy: ParamKeys.self, forKey: .params)
|
||||
try paramsContainer.encodeIfPresent(from, forKey: .from)
|
||||
try paramsContainer.encodeIfPresent(until, forKey: .until)
|
||||
try paramsContainer.encodeIfPresent(limit, forKey: .limit)
|
||||
try paramsContainer.encodeIfPresent(offset, forKey: .offset)
|
||||
try paramsContainer.encodeIfPresent(unpaid, forKey: .unpaid)
|
||||
try paramsContainer.encodeIfPresent(type, forKey: .type)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
//
|
||||
// Response.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2025-03-10.
|
||||
//
|
||||
|
||||
extension WalletConnect {
|
||||
/// Models a response from the NWC provider
|
||||
struct Response: Decodable {
|
||||
let result_type: Response.Result.ResultType
|
||||
let error: WalletResponseErr?
|
||||
let result: Response.Result?
|
||||
|
||||
private enum CodingKeys: CodingKey {
|
||||
case result_type, error, result
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
let result_type_str = try container.decode(String.self, forKey: .result_type)
|
||||
|
||||
guard let result_type = Response.Result.ResultType(rawValue: result_type_str) else {
|
||||
throw DecodingError.typeMismatch(Response.Result.ResultType.self, .init(codingPath: decoder.codingPath, debugDescription: "result_type \(result_type_str) is unknown"))
|
||||
}
|
||||
|
||||
self.result_type = result_type
|
||||
self.error = try container.decodeIfPresent(WalletResponseErr.self, forKey: .error)
|
||||
|
||||
guard self.error == nil else {
|
||||
self.result = nil
|
||||
return
|
||||
}
|
||||
|
||||
switch result_type {
|
||||
case .pay_invoice:
|
||||
let res = try container.decode(Result.PayInvoiceResponse.self, forKey: .result)
|
||||
self.result = .pay_invoice(res)
|
||||
case .get_balance:
|
||||
let res = try container.decode(Result.GetBalanceResponse.self, forKey: .result)
|
||||
self.result = .get_balance(res)
|
||||
case .list_transactions:
|
||||
let res = try container.decode(Result.ListTransactionsResponse.self, forKey: .result)
|
||||
self.result = .list_transactions(res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct FullWalletResponse {
|
||||
let req_id: NoteId
|
||||
let response: Response
|
||||
|
||||
init?(from: NostrEvent, nwc: WalletConnect.ConnectURL) async {
|
||||
guard let note_id = from.referenced_ids.first else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.req_id = note_id
|
||||
|
||||
let ares = Task {
|
||||
guard let json = decrypt_dm(nwc.keypair.privkey, pubkey: nwc.pubkey, content: from.content, encoding: .base64),
|
||||
let resp: WalletConnect.Response = decode_json(json)
|
||||
else {
|
||||
let resp: WalletConnect.Response? = nil
|
||||
return resp
|
||||
}
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
guard let res = await ares.value else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.response = res
|
||||
}
|
||||
}
|
||||
|
||||
struct WalletResponseErr: Codable {
|
||||
let code: String?
|
||||
let message: String?
|
||||
}
|
||||
}
|
||||
|
||||
extension WalletConnect.Response {
|
||||
/// The response data resulting from an NWC request
|
||||
enum Result {
|
||||
case pay_invoice(PayInvoiceResponse)
|
||||
case get_balance(GetBalanceResponse)
|
||||
case list_transactions(ListTransactionsResponse)
|
||||
|
||||
enum ResultType: String {
|
||||
case pay_invoice
|
||||
case get_balance
|
||||
case list_transactions
|
||||
}
|
||||
|
||||
struct PayInvoiceResponse: Decodable {
|
||||
let preimage: String
|
||||
}
|
||||
|
||||
struct GetBalanceResponse: Decodable {
|
||||
let balance: Int64
|
||||
}
|
||||
|
||||
struct ListTransactionsResponse: Decodable {
|
||||
let transactions: [WalletConnect.Transaction]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
//
|
||||
// WalletConnect+.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino on 2023-11-27.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
// TODO: Eventually we should move these convenience functions into structured classes responsible for managing this type of functionality, such as `WalletModel`
|
||||
|
||||
extension WalletConnect {
|
||||
/// Creates and sends a subscription to an NWC relay requesting NWC responses to be sent back.
|
||||
///
|
||||
/// Notes: This assumes there is already a listener somewhere else
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - url: The Nostr Wallet Connect URL containing connection info to the NWC wallet
|
||||
/// - pool: The RelayPool to send the subscription request through
|
||||
static func subscribe(url: WalletConnectURL, pool: RelayPool) {
|
||||
var filter = NostrFilter(kinds: [.nwc_response])
|
||||
filter.authors = [url.pubkey]
|
||||
filter.limit = 0
|
||||
let sub = NostrSubscribe(filters: [filter], sub_id: "nwc")
|
||||
|
||||
pool.send(.subscribe(sub), to: [url.relay], skip_ephemeral: false)
|
||||
}
|
||||
|
||||
/// Sends out a request to pay an invoice to the NWC relay, and ensures that:
|
||||
/// 1. the NWC relay is connected and we are listening to NWC events
|
||||
/// 2. the NWC relay is connected and we are listening to NWC
|
||||
///
|
||||
/// Note: This does not return information about whether the payment is succesful or not. The actual confirmation is handled elsewhere around `HomeModel` and `WalletModel`
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - url: The NWC wallet connection URL
|
||||
/// - pool: The relay pool to connect to
|
||||
/// - post: The postbox to send events in
|
||||
/// - delay: The delay before actually sending the request to the network _(this makes it possible to cancel a zap)_
|
||||
/// - on_flush: A callback to call after the event has been flushed to the network
|
||||
/// - Returns: The Nostr Event that was sent to the network, representing the request that was made
|
||||
@discardableResult
|
||||
static func pay(url: WalletConnectURL, pool: RelayPool, post: PostBox, invoice: String, delay: TimeInterval? = 5.0, on_flush: OnFlush? = nil) -> NostrEvent? {
|
||||
let req = WalletConnect.Request.payInvoice(invoice: invoice)
|
||||
guard let ev = req.to_nostr_event(to_pk: url.pubkey, keypair: url.keypair) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
try? pool.add_relay(.nwc(url: url.relay)) // Ensure the NWC relay is connected
|
||||
WalletConnect.subscribe(url: url, pool: pool) // Ensure we are listening to NWC updates from the relay
|
||||
post.send(ev, to: [url.relay], skip_ephemeral: false, delay: delay, on_flush: on_flush)
|
||||
return ev
|
||||
}
|
||||
|
||||
/// Sends out a wallet balance request to the NWC relay, and ensures that:
|
||||
/// 1. the NWC relay is connected and we are listening to NWC events
|
||||
/// 2. the NWC relay is connected and we are listening to NWC
|
||||
///
|
||||
/// Note: This does not return the actual balance information. The actual balance is handled elsewhere around `HomeModel` and `WalletModel`
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - url: The NWC wallet connection URL
|
||||
/// - pool: The relay pool to connect to
|
||||
/// - post: The postbox to send events in
|
||||
/// - delay: The delay before actually sending the request to the network
|
||||
/// - on_flush: A callback to call after the event has been flushed to the network
|
||||
/// - Returns: The Nostr Event that was sent to the network, representing the request that was made
|
||||
@discardableResult
|
||||
static func request_balance_information(url: WalletConnectURL, pool: RelayPool, post: PostBox, delay: TimeInterval? = 0.0, on_flush: OnFlush? = nil) -> NostrEvent? {
|
||||
let req = WalletConnect.Request.getBalance
|
||||
guard let ev = req.to_nostr_event(to_pk: url.pubkey, keypair: url.keypair) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
try? pool.add_relay(.nwc(url: url.relay)) // Ensure the NWC relay is connected
|
||||
WalletConnect.subscribe(url: url, pool: pool) // Ensure we are listening to NWC updates from the relay
|
||||
post.send(ev, to: [url.relay], skip_ephemeral: false, delay: delay, on_flush: on_flush)
|
||||
return ev
|
||||
}
|
||||
|
||||
/// Sends out a wallet transaction list request to the NWC relay, and ensures that:
|
||||
/// 1. the NWC relay is connected and we are listening to NWC events
|
||||
/// 2. the NWC relay is connected and we are listening to NWC
|
||||
///
|
||||
/// Note: This does not return the actual transaction list. The actual transaction list is handled elsewhere around `HomeModel` and `WalletModel`
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - url: The NWC wallet connection URL
|
||||
/// - pool: The relay pool to connect to
|
||||
/// - post: The postbox to send events in
|
||||
/// - delay: The delay before actually sending the request to the network
|
||||
/// - on_flush: A callback to call after the event has been flushed to the network
|
||||
/// - Returns: The Nostr Event that was sent to the network, representing the request that was made
|
||||
@discardableResult
|
||||
static func request_transaction_list(url: WalletConnectURL, pool: RelayPool, post: PostBox, delay: TimeInterval? = 0.0, on_flush: OnFlush? = nil) -> NostrEvent? {
|
||||
let req = WalletConnect.Request.getTransactionList(from: nil, until: nil, limit: 10, offset: 0, unpaid: false, type: "")
|
||||
guard let ev = req.to_nostr_event(to_pk: url.pubkey, keypair: url.keypair) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
try? pool.add_relay(.nwc(url: url.relay)) // Ensure the NWC relay is connected
|
||||
WalletConnect.subscribe(url: url, pool: pool) // Ensure we are listening to NWC updates from the relay
|
||||
post.send(ev, to: [url.relay], skip_ephemeral: false, delay: delay, on_flush: on_flush)
|
||||
return ev
|
||||
}
|
||||
|
||||
static func handle_zap_success(state: DamusState, resp: WalletConnect.FullWalletResponse) {
|
||||
// find the pending zap and mark it as pending-confirmed
|
||||
for kv in state.zaps.our_zaps {
|
||||
let zaps = kv.value
|
||||
|
||||
for zap in zaps {
|
||||
guard case .pending(let pzap) = zap,
|
||||
case .nwc(let nwc_state) = pzap.state,
|
||||
case .postbox_pending(let nwc_req) = nwc_state.state,
|
||||
nwc_req.id == resp.req_id
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
if nwc_state.update_state(state: .confirmed) {
|
||||
// notify the zaps model of an update so it can mark them as paid
|
||||
state.events.get_cache_data(NoteId(pzap.target.id)).zaps_model.objectWillChange.send()
|
||||
print("NWC success confirmed")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Send a donation zap to the Damus team
|
||||
static func send_donation_zap(pool: RelayPool, postbox: PostBox, nwc: WalletConnectURL, percent: Int, base_msats: Int64) async {
|
||||
let percent_f = Double(percent) / 100.0
|
||||
let donations_msats = Int64(percent_f * Double(base_msats))
|
||||
|
||||
let payreq = LNUrlPayRequest(allowsNostr: true, commentAllowed: nil, nostrPubkey: "", callback: "https://sendsats.lol/@damus")
|
||||
guard let invoice = await fetch_zap_invoice(payreq, zapreq: nil, msats: donations_msats, zap_type: .non_zap, comment: nil) else {
|
||||
// we failed... oh well. no donation for us.
|
||||
print("damus-donation failed to fetch invoice")
|
||||
return
|
||||
}
|
||||
|
||||
print("damus-donation donating...")
|
||||
WalletConnect.pay(url: nwc, pool: pool, post: postbox, invoice: invoice, delay: nil)
|
||||
}
|
||||
|
||||
/// Handles a received Nostr Wallet Connect error
|
||||
static func handle_error(zapcache: Zaps, evcache: EventCache, resp: WalletConnect.FullWalletResponse) {
|
||||
// find a pending zap with the nwc request id associated with this response and remove it
|
||||
for kv in zapcache.our_zaps {
|
||||
let zaps = kv.value
|
||||
|
||||
for zap in zaps {
|
||||
guard case .pending(let pzap) = zap,
|
||||
case .nwc(let nwc_state) = pzap.state,
|
||||
case .postbox_pending(let req) = nwc_state.state,
|
||||
req.id == resp.req_id
|
||||
else {
|
||||
continue
|
||||
}
|
||||
|
||||
// remove the pending zap if there was an error
|
||||
let reqid = ZapRequestId(from_pending: pzap)
|
||||
remove_zap(reqid: reqid, zapcache: zapcache, evcache: evcache)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
//
|
||||
// WalletConnect.swift
|
||||
// damus
|
||||
//
|
||||
// Created by William Casarin on 2023-03-22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct WalletConnect {}
|
||||
|
||||
typealias WalletConnectURL = WalletConnect.ConnectURL // Declared to facilitate refactor
|
||||
|
||||
extension WalletConnect {
|
||||
/// Models a decoded NWC URL, containing information to connect to an NWC wallet.
|
||||
struct ConnectURL: Equatable {
|
||||
let relay: RelayURL
|
||||
let keypair: FullKeypair
|
||||
let pubkey: Pubkey
|
||||
let lud16: String?
|
||||
|
||||
static func == (lhs: ConnectURL, rhs: ConnectURL) -> Bool {
|
||||
return lhs.keypair == rhs.keypair &&
|
||||
lhs.pubkey == rhs.pubkey &&
|
||||
lhs.relay == rhs.relay
|
||||
}
|
||||
|
||||
func to_url() -> URL {
|
||||
var urlComponents = URLComponents()
|
||||
urlComponents.scheme = "nostrwalletconnect"
|
||||
urlComponents.host = pubkey.hex()
|
||||
urlComponents.queryItems = [
|
||||
URLQueryItem(name: "relay", value: relay.absoluteString),
|
||||
URLQueryItem(name: "secret", value: keypair.privkey.hex())
|
||||
]
|
||||
|
||||
if let lud16 {
|
||||
urlComponents.queryItems?.append(URLQueryItem(name: "lud16", value: lud16))
|
||||
}
|
||||
|
||||
return urlComponents.url!
|
||||
}
|
||||
|
||||
init?(str: String) {
|
||||
guard let components = URLComponents(string: str),
|
||||
components.scheme == "nostrwalletconnect" || components.scheme == "nostr+walletconnect",
|
||||
// The line below provides flexibility for both `nostrwalletconnect://` (non-compliant, but commonly used) and `nostrwalletconnect:` (NIP-47 compliant) formats
|
||||
let encoded_pubkey = components.path == "" ? components.host : components.path,
|
||||
let pubkey = hex_decode_pubkey(encoded_pubkey),
|
||||
let items = components.queryItems,
|
||||
let relay = items.first(where: { qi in qi.name == "relay" })?.value,
|
||||
let relay_url = RelayURL(relay),
|
||||
let secret = items.first(where: { qi in qi.name == "secret" })?.value,
|
||||
secret.utf8.count == 64,
|
||||
let decoded = hex_decode(secret)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
|
||||
let privkey = Privkey(Data(decoded))
|
||||
guard let our_pk = privkey_to_pubkey(privkey: privkey) else { return nil }
|
||||
|
||||
let lud16 = items.first(where: { qi in qi.name == "lud16" })?.value
|
||||
let keypair = FullKeypair(pubkey: our_pk, privkey: privkey)
|
||||
self = ConnectURL(pubkey: pubkey, relay: relay_url, keypair: keypair, lud16: lud16)
|
||||
}
|
||||
|
||||
init(pubkey: Pubkey, relay: RelayURL, keypair: FullKeypair, lud16: String?) {
|
||||
self.pubkey = pubkey
|
||||
self.relay = relay
|
||||
self.keypair = keypair
|
||||
self.lud16 = lud16
|
||||
}
|
||||
}
|
||||
|
||||
/// Models an NWC wallet transaction
|
||||
struct Transaction: Decodable, Equatable, Hashable {
|
||||
let type: String
|
||||
let invoice: String?
|
||||
let description: String?
|
||||
let description_hash: String?
|
||||
let preimage: String?
|
||||
let payment_hash: String?
|
||||
let amount: Int64
|
||||
let fees_paid: Int64?
|
||||
let created_at: UInt64 // unixtimestamp, // invoice/payment creation time
|
||||
let expires_at: UInt64? // unixtimestamp, // invoice expiration time, optional if not applicable
|
||||
let settled_at: UInt64? // unixtimestamp, // invoice/payment settlement time, optional if unpaid
|
||||
//"metadata": {} // generic metadata that can be used to add things like zap/boostagram details for a payer name/comment/etc.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,26 +18,11 @@ struct ConfigView: View {
|
||||
@State var delete_account_warning: Bool = false
|
||||
@State var confirm_delete_account: Bool = false
|
||||
@State var delete_text: String = ""
|
||||
@State private var searchText: String = ""
|
||||
|
||||
@ObservedObject var settings: UserSettingsStore
|
||||
|
||||
// String constants
|
||||
|
||||
private let DELETE_KEYWORD = "DELETE"
|
||||
private let keysTitle = NSLocalizedString("Keys", comment: "Settings section for managing keys")
|
||||
private let appearanceTitle = NSLocalizedString("Appearance and filters", comment: "Section header for text, appearance, and content filter settings")
|
||||
private let searchUniverseTitle = NSLocalizedString("Search / Universe", comment: "Section header for search/universe settings")
|
||||
private let notificationsTitle = NSLocalizedString("Notifications", comment: "Section header for Damus notifications")
|
||||
private let zapsTitle = NSLocalizedString("Zaps", comment: "Section header for zap settings")
|
||||
private let translationTitle = NSLocalizedString("Translation", comment: "Section header for text and appearance settings")
|
||||
private let reactionsTitle = NSLocalizedString("Reactions", comment: "Section header for reactions settings")
|
||||
private let developerTitle = NSLocalizedString("Developer", comment: "Section header for developer settings")
|
||||
private let firstAidTitle = NSLocalizedString("First Aid", comment: "Section header for first aid tools and settings")
|
||||
private let signOutTitle = NSLocalizedString("Sign out", comment: "Sidebar menu label to sign out of the account.")
|
||||
private let deleteAccountTitle = NSLocalizedString("Delete Account", comment: "Button to delete the user's account.")
|
||||
private let versionTitle = NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")
|
||||
private let copyString = NSLocalizedString("Copy", comment: "Context menu option for copying the version of damus.")
|
||||
|
||||
|
||||
init(state: DamusState) {
|
||||
self.state = state
|
||||
_settings = ObservedObject(initialValue: state.settings)
|
||||
@@ -46,122 +31,91 @@ struct ConfigView: View {
|
||||
func textColor() -> Color {
|
||||
colorScheme == .light ? DamusColors.black : DamusColors.white
|
||||
}
|
||||
|
||||
func showSettingsButton(title : String)->Bool{
|
||||
return searchText.isEmpty || title.lowercased().contains(searchText.lowercased())
|
||||
}
|
||||
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
Form {
|
||||
Section {
|
||||
// Keys
|
||||
if showSettingsButton(title: keysTitle){
|
||||
NavigationLink(value:Route.KeySettings(keypair: state.keypair)){
|
||||
IconLabel(keysTitle,img_name:"Key",color:.purple)
|
||||
}
|
||||
}
|
||||
// Appearance and filters
|
||||
if showSettingsButton(title: appearanceTitle){
|
||||
NavigationLink(value:Route.AppearanceSettings(settings: settings)){
|
||||
IconLabel(appearanceTitle,img_name:"eye",color:.red)
|
||||
}
|
||||
}
|
||||
// Search/Universe
|
||||
if showSettingsButton(title: searchUniverseTitle){
|
||||
NavigationLink(value: Route.SearchSettings(settings: settings)){
|
||||
IconLabel(searchUniverseTitle,img_name:"search",color:.red)
|
||||
}
|
||||
NavigationLink(value: Route.KeySettings(keypair: state.keypair)) {
|
||||
IconLabel(NSLocalizedString("Keys", comment: "Settings section for managing keys"), img_name: "Key", color: .purple)
|
||||
}
|
||||
|
||||
//Notifications
|
||||
if showSettingsButton(title: notificationsTitle){
|
||||
NavigationLink(value: Route.NotificationSettings(settings: settings)){
|
||||
IconLabel(notificationsTitle,img_name:"notification-bell-on",color:.blue)
|
||||
}
|
||||
NavigationLink(value: Route.AppearanceSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Appearance and filters", comment: "Section header for text, appearance, and content filter settings"), img_name: "eye", color: .red)
|
||||
}
|
||||
//Zaps
|
||||
if showSettingsButton(title: zapsTitle){
|
||||
NavigationLink(value: Route.ZapSettings(settings: settings)){
|
||||
IconLabel(zapsTitle,img_name:"zap.fill",color:.orange)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.SearchSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Search/Universe", comment: "Section header for search/universe settings"), img_name: "search", color: .red)
|
||||
}
|
||||
//Translation
|
||||
if showSettingsButton(title: translationTitle){
|
||||
NavigationLink(value: Route.TranslationSettings(settings: settings)){
|
||||
IconLabel(translationTitle,img_name:"globe",color:.green)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.NotificationSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Notifications", comment: "Section header for Damus notifications"), img_name: "notification-bell-on", color: .blue)
|
||||
}
|
||||
//Reactions
|
||||
if showSettingsButton(title: reactionsTitle){
|
||||
NavigationLink(value: Route.ReactionsSettings(settings: settings)){
|
||||
IconLabel(reactionsTitle,img_name:"shaka.fill",color:.purple)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.ZapSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Zaps", comment: "Section header for zap settings"), img_name: "zap.fill", color: .orange)
|
||||
}
|
||||
//Developer
|
||||
if showSettingsButton(title: developerTitle){
|
||||
NavigationLink(value: Route.DeveloperSettings(settings: settings)){
|
||||
IconLabel(developerTitle,img_name:"magic-stick2.fill",color:DamusColors.adaptableBlack)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.TranslationSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Translation", comment: "Section header for text and appearance settings"), img_name: "globe", color: .green)
|
||||
}
|
||||
//First Aid
|
||||
if showSettingsButton(title: firstAidTitle){
|
||||
NavigationLink(value: Route.FirstAidSettings(settings: settings)){
|
||||
IconLabel(firstAidTitle,img_name:"help2",color: .red)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.ReactionsSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Reactions", comment: "Section header for reactions settings"), img_name: "shaka.fill", color: .purple)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.DeveloperSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("Developer", comment: "Section header for developer settings"), img_name: "magic-stick2.fill", color: DamusColors.adaptableBlack)
|
||||
}
|
||||
|
||||
NavigationLink(value: Route.FirstAidSettings(settings: settings)) {
|
||||
IconLabel(NSLocalizedString("First Aid", comment: "Section header for first aid tools and settings"), img_name: "help2", color: .red)
|
||||
}
|
||||
}
|
||||
//Sign out Section
|
||||
if showSettingsButton(title: signOutTitle){
|
||||
Section(signOutTitle){
|
||||
|
||||
Section(NSLocalizedString("Sign Out", comment: "Section title for signing out")) {
|
||||
Button(action: {
|
||||
if state.keypair.privkey == nil {
|
||||
logout(state)
|
||||
} else {
|
||||
confirm_logout = true
|
||||
}
|
||||
}, label: {
|
||||
Label(NSLocalizedString("Sign out", comment: "Sidebar menu label to sign out of the account."), image: "logout")
|
||||
.foregroundColor(textColor())
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
})
|
||||
}
|
||||
|
||||
if state.is_privkey_user {
|
||||
Section(header: Text("Permanently Delete Account", comment: "Section title for deleting the user")) {
|
||||
Button(action: {
|
||||
if state.keypair.privkey == nil {
|
||||
logout(state)
|
||||
} else {
|
||||
confirm_logout = true
|
||||
}
|
||||
delete_account_warning = true
|
||||
}, label: {
|
||||
Label(signOutTitle, image: "logout")
|
||||
.foregroundColor(textColor())
|
||||
Label(NSLocalizedString("Delete Account", comment: "Button to delete the user's account."), image: "delete")
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundColor(.red)
|
||||
})
|
||||
}
|
||||
}
|
||||
// Delete Account
|
||||
if showSettingsButton(title: deleteAccountTitle){
|
||||
if state.is_privkey_user {
|
||||
Section(header: Text("Permanently Delete Account", comment: "Section title for deleting the user")) {
|
||||
Button(action: {
|
||||
delete_account_warning = true
|
||||
}, label: {
|
||||
Label(deleteAccountTitle, image: "delete")
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.foregroundColor(.red)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
// Version info
|
||||
if showSettingsButton(title: versionTitle) {
|
||||
Section(
|
||||
header: Text(versionTitle),
|
||||
footer: Text("").padding(.bottom, tabHeight + getSafeAreaBottom())
|
||||
) {
|
||||
Text(verbatim: VersionInfo.version)
|
||||
.contextMenu {
|
||||
Button {
|
||||
UIPasteboard.general.string = VersionInfo.version
|
||||
} label: {
|
||||
Label(copyString, image: "copy2")
|
||||
}
|
||||
|
||||
Section(
|
||||
header: Text(NSLocalizedString("Version", comment: "Section title for displaying the version number of the Damus app.")),
|
||||
footer: Text("").padding(.bottom, tabHeight + getSafeAreaBottom())
|
||||
) {
|
||||
Text(verbatim: VersionInfo.version)
|
||||
.contextMenu {
|
||||
Button {
|
||||
UIPasteboard.general.string = VersionInfo.version
|
||||
} label: {
|
||||
Label(NSLocalizedString("Copy", comment: "Context menu option for copying the version of damus."), image: "copy2")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle(NSLocalizedString("Settings", comment: "Navigation title for Settings view."))
|
||||
.navigationBarTitleDisplayMode(.large)
|
||||
.searchable(text: $searchText,prompt: "Search within settings")
|
||||
.alert(NSLocalizedString("WARNING:\n\nTHIS WILL SIGN AN EVENT THAT DELETES THIS ACCOUNT.\n\nYOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY.\n\n ARE YOU SURE YOU WANT TO CONTINUE?", comment: "Alert for deleting the users account."), isPresented: $delete_account_warning) {
|
||||
|
||||
Button(NSLocalizedString("Cancel", comment: "Cancel deleting the user."), role: .cancel) {
|
||||
@@ -200,6 +154,7 @@ struct ConfigView: View {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct ConfigView_Previews: PreviewProvider {
|
||||
|
||||
@@ -131,7 +131,7 @@ struct DMChatView: View, KeyboardReadable {
|
||||
.map(\.asString)
|
||||
.joined(separator: "")
|
||||
|
||||
guard let dm = NIP04.create_dm(content, to_pk: pubkey, tags: tags, keypair: damus_state.keypair) else {
|
||||
guard let dm = create_dm(content, to_pk: pubkey, tags: tags, keypair: damus_state.keypair) else {
|
||||
print("error creating dm")
|
||||
return
|
||||
}
|
||||
@@ -176,6 +176,46 @@ struct DMChatView_Previews: PreviewProvider {
|
||||
}
|
||||
}
|
||||
|
||||
func encrypt_message(message: String, privkey: Privkey, to_pk: Pubkey, encoding: EncEncoding = .base64) -> String? {
|
||||
let iv = random_bytes(count: 16).bytes
|
||||
guard let shared_sec = get_shared_secret(privkey: privkey, pubkey: to_pk) else {
|
||||
return nil
|
||||
}
|
||||
let utf8_message = Data(message.utf8).bytes
|
||||
guard let enc_message = aes_encrypt(data: utf8_message, iv: iv, shared_sec: shared_sec) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch encoding {
|
||||
case .base64:
|
||||
return encode_dm_base64(content: enc_message.bytes, iv: iv)
|
||||
case .bech32:
|
||||
return encode_dm_bech32(content: enc_message.bytes, iv: iv)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func create_encrypted_event(_ message: String, to_pk: Pubkey, tags: [[String]], keypair: FullKeypair, created_at: UInt32, kind: UInt32) -> NostrEvent? {
|
||||
let privkey = keypair.privkey
|
||||
|
||||
guard let enc_content = encrypt_message(message: message, privkey: privkey, to_pk: to_pk) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return NostrEvent(content: enc_content, keypair: keypair.to_keypair(), kind: kind, tags: tags, createdAt: created_at)
|
||||
}
|
||||
|
||||
func create_dm(_ message: String, to_pk: Pubkey, tags: [[String]], keypair: Keypair, created_at: UInt32? = nil) -> NostrEvent?
|
||||
{
|
||||
let created = created_at ?? UInt32(Date().timeIntervalSince1970)
|
||||
|
||||
guard let keypair = keypair.to_full() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return create_encrypted_event(message, to_pk: to_pk, tags: tags, keypair: keypair, created_at: created, kind: 4)
|
||||
}
|
||||
|
||||
extension View {
|
||||
/// Layers the given views behind this ``TextEditor``.
|
||||
func textEditorBackground<V>(@ViewBuilder _ content: () -> V) -> some View where V : View {
|
||||
|
||||
@@ -883,8 +883,6 @@ func build_post(state: DamusState, post: NSAttributedString, action: PostAction,
|
||||
case .quoting(let ev):
|
||||
content.append("\n\nnostr:" + bech32_note_id(ev.id))
|
||||
|
||||
tags.append(["q", ev.id.hex()]);
|
||||
|
||||
if let quoted_ev = state.events.lookup(ev.id) {
|
||||
tags.append(["p", quoted_ev.pubkey.hex()])
|
||||
}
|
||||
|
||||
@@ -162,9 +162,6 @@ struct SideMenuView: View {
|
||||
|
||||
PubkeyView(pubkey: damus_state.pubkey, sidemenu: true)
|
||||
.pubkey_context_menu(pubkey: damus_state.pubkey)
|
||||
.simultaneousGesture(TapGesture().onEnded{
|
||||
isSidebarVisible = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
//
|
||||
// BalanceView.swift
|
||||
// damus
|
||||
//
|
||||
// Created by eric on 1/23/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct BalanceView: View {
|
||||
var balance: Int64?
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 5) {
|
||||
Text("Current balance", comment: "Label for displaying current wallet balance")
|
||||
.foregroundStyle(DamusColors.neutral6)
|
||||
if let balance {
|
||||
self.numericalBalanceView(text: NumberFormatter.localizedString(from: NSNumber(integerLiteral: Int(balance)), number: .decimal))
|
||||
}
|
||||
else {
|
||||
// Make sure we do not show any numeric value to the user when still loading (or when failed to load)
|
||||
// This is important because if we show a numeric value like "zero" when things are not loaded properly, we risk scaring the user into thinking that they have lost funds.
|
||||
self.numericalBalanceView(text: "??")
|
||||
.redacted(reason: .placeholder)
|
||||
.shimmer(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func numericalBalanceView(text: String) -> some View {
|
||||
HStack {
|
||||
Text(verbatim: text)
|
||||
.lineLimit(1)
|
||||
.minimumScaleFactor(0.70)
|
||||
.font(.veryVeryLargeTitle)
|
||||
.fontWeight(.heavy)
|
||||
.foregroundStyle(PinkGradient)
|
||||
|
||||
HStack(alignment: .top) {
|
||||
Text("SATS", comment: "Abbreviation for Satoshis, smallest bitcoin unit")
|
||||
.font(.caption)
|
||||
.fontWeight(.heavy)
|
||||
.foregroundStyle(PinkGradient)
|
||||
}
|
||||
}
|
||||
.padding(.bottom)
|
||||
}
|
||||
}
|
||||
|
||||
struct BalanceView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
BalanceView(balance: 100000000)
|
||||
BalanceView(balance: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ struct ConnectWalletView: View {
|
||||
@State private var showAlert = false
|
||||
@State var error: String? = nil
|
||||
@State var wallet_scan_result: WalletScanResult = .scanning
|
||||
@State var show_introduction: Bool = true
|
||||
var nav: NavigationCoordinator
|
||||
|
||||
var body: some View {
|
||||
MainContent
|
||||
.navigationTitle(NSLocalizedString("Wallet", comment: "Navigation title for attaching Nostr Wallet Connect lightning wallet."))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.padding()
|
||||
.onChange(of: wallet_scan_result) { res in
|
||||
scanning = false
|
||||
|
||||
@@ -48,137 +48,57 @@ struct ConnectWalletView: View {
|
||||
}
|
||||
}
|
||||
|
||||
struct AreYouSure: View {
|
||||
let nwc: WalletConnectURL
|
||||
@Binding var show_introduction: Bool
|
||||
@ObservedObject var model: WalletModel
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 25) {
|
||||
|
||||
Text("Setup Wallet", comment: "Heading for wallet setup confirmation screen")
|
||||
.font(.veryLargeTitle)
|
||||
.fontWeight(.bold)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Spacer()
|
||||
|
||||
ConnectGraphic
|
||||
|
||||
Spacer()
|
||||
|
||||
NWCSettings.AccountDetailsView(nwc: nwc)
|
||||
|
||||
Spacer()
|
||||
|
||||
Button(action: {
|
||||
model.connect(nwc)
|
||||
show_introduction = false
|
||||
}) {
|
||||
HStack {
|
||||
Text("Connect", comment: "Text for button to conect to Nostr Wallet Connect lightning wallet.")
|
||||
.fontWeight(.semibold)
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
|
||||
Button(action: {
|
||||
model.cancel()
|
||||
show_introduction = true
|
||||
}) {
|
||||
HStack {
|
||||
Text("Cancel", comment: "Text for button to cancel out of connecting Nostr Wallet Connect lightning wallet.")
|
||||
.padding()
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, alignment: .center)
|
||||
}
|
||||
.buttonStyle(NeutralButtonStyle())
|
||||
func AreYouSure(nwc: WalletConnectURL) -> some View {
|
||||
VStack(spacing: 25) {
|
||||
|
||||
Text("Are you sure you want to connect this wallet?", comment: "Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.")
|
||||
.fontWeight(.bold)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Text(nwc.relay.absoluteString)
|
||||
.font(.body)
|
||||
.foregroundColor(.gray)
|
||||
|
||||
if let lud16 = nwc.lud16 {
|
||||
Text(lud16)
|
||||
.font(.body)
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
model.connect(nwc)
|
||||
}) {
|
||||
HStack {
|
||||
Text("Connect", comment: "Text for button to conect to Nostr Wallet Connect lightning wallet.")
|
||||
.fontWeight(.semibold)
|
||||
}
|
||||
.padding(.bottom, 50)
|
||||
.padding()
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
}
|
||||
|
||||
var ConnectGraphic: some View {
|
||||
HStack(spacing: 0) {
|
||||
Button(action: {}, label: {
|
||||
Image("damus-home")
|
||||
.resizable()
|
||||
.frame(width: 30, height: 30)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 15, leading: 15, bottom: 15, trailing: 15), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
.padding(.horizontal, 30)
|
||||
|
||||
Image("chevron-double-right")
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
|
||||
Button(action: {}, label: {
|
||||
Image("wallet")
|
||||
.resizable()
|
||||
.frame(width: 30, height: 30)
|
||||
.foregroundStyle(LINEAR_GRADIENT)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 15, leading: 15, bottom: 15, trailing: 15), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
.padding(.horizontal, 30)
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
|
||||
Button(action: {
|
||||
model.cancel()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Cancel", comment: "Text for button to cancel out of connecting Nostr Wallet Connect lightning wallet.")
|
||||
.padding()
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, alignment: .center)
|
||||
}
|
||||
.buttonStyle(NeutralButtonStyle())
|
||||
}
|
||||
}
|
||||
|
||||
var AutomaticSetup: some View {
|
||||
VStack(spacing: 10) {
|
||||
Text("AUTOMATIC SETUP", comment: "Heading for the section that performs an automatic wallet connection setup.")
|
||||
.font(.caption)
|
||||
.padding(.top)
|
||||
.foregroundStyle(PinkGradient)
|
||||
var ConnectWallet: some View {
|
||||
VStack(spacing: 25) {
|
||||
|
||||
Text("Create new wallet", comment: "Button text for creating a new wallet.")
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
|
||||
Text("Easily create a new wallet and attach it to your account.", comment: "Description for the create new wallet feature.")
|
||||
.font(.body)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Spacer()
|
||||
AlbyButton() {
|
||||
openURL(URL(string:"https://nwc.getalby.com/apps/new?c=Damus")!)
|
||||
}
|
||||
|
||||
CoinosButton() {
|
||||
show_introduction = false
|
||||
openURL(URL(string:"https://coinos.io/settings/nostr")!)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.frame(minHeight: 250)
|
||||
.padding(10)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 25)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 2)
|
||||
.padding(2) // Avoids border clipping on the sides
|
||||
)
|
||||
.padding(.top, 20)
|
||||
}
|
||||
|
||||
var ManualSetup: some View {
|
||||
VStack(spacing: 10) {
|
||||
Text("MANUAL SETUP", comment: "Label for manual wallet setup.")
|
||||
.font(.caption)
|
||||
.padding(.top)
|
||||
.foregroundStyle(PinkGradient)
|
||||
|
||||
Text("Use existing", comment: "Button text to use an existing wallet.")
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
|
||||
Text("Attach to any third party provider you already use.", comment: "Information text guiding users on attaching existing provider.")
|
||||
.font(.body)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
Spacer()
|
||||
|
||||
Button(action: {
|
||||
if let pasted_nwc = UIPasteboard.general.string {
|
||||
@@ -195,10 +115,9 @@ struct ConnectWalletView: View {
|
||||
Text("Paste NWC Address", comment: "Text for button to connect a lightning wallet.")
|
||||
.fontWeight(.semibold)
|
||||
}
|
||||
.frame(minWidth: 250, maxWidth: .infinity, maxHeight: 15, alignment: .center)
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
.padding(.horizontal)
|
||||
|
||||
Button(action: {
|
||||
nav.push(route: Route.WalletScanner(result: $wallet_scan_result))
|
||||
@@ -208,80 +127,74 @@ struct ConnectWalletView: View {
|
||||
Text("Scan NWC Address", comment: "Text for button to connect a lightning wallet.")
|
||||
.fontWeight(.semibold)
|
||||
}
|
||||
.frame(minWidth: 250, maxWidth: .infinity, maxHeight: 15, alignment: .center)
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
.padding(.horizontal)
|
||||
.padding(.bottom)
|
||||
|
||||
|
||||
if let err = self.error {
|
||||
Text(err)
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
}
|
||||
.frame(minHeight: 300)
|
||||
.padding(10)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 25)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 2)
|
||||
.padding(2) // Avoids border clipping on the sides
|
||||
)
|
||||
.padding(.top, 20)
|
||||
}
|
||||
|
||||
var ConnectWallet: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 25) {
|
||||
|
||||
Text("Setup Wallet", comment: "Heading for Nostr Wallet Connect setup screen")
|
||||
.font(.veryLargeTitle)
|
||||
.fontWeight(.bold)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
AutomaticSetup
|
||||
|
||||
ManualSetup
|
||||
|
||||
if let err = self.error {
|
||||
Text(err)
|
||||
.foregroundColor(.red)
|
||||
}
|
||||
}
|
||||
.padding(.bottom, 50)
|
||||
.padding()
|
||||
var TopSection: some View {
|
||||
HStack(spacing: 0) {
|
||||
Button(action: {}, label: {
|
||||
Image("damus-home")
|
||||
.resizable()
|
||||
.frame(width: 30, height: 30)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 15, leading: 15, bottom: 15, trailing: 15), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
.padding(.horizontal, 30)
|
||||
|
||||
Image("chevron-double-right")
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
|
||||
Button(action: {}, label: {
|
||||
Image("wallet")
|
||||
.resizable()
|
||||
.frame(width: 30, height: 30)
|
||||
.foregroundStyle(LINEAR_GRADIENT)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 15, leading: 15, bottom: 15, trailing: 15), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
.padding(.horizontal, 30)
|
||||
}
|
||||
}
|
||||
|
||||
var TitleSection: some View {
|
||||
VStack(spacing: 25) {
|
||||
Text("Damus Wallet", comment: "Title text for Damus Wallet view.")
|
||||
.fontWeight(.bold)
|
||||
|
||||
Text("Securely connect your Damus app to your wallet using Nostr Wallet Connect", comment: "Text to prompt user to connect their wallet using 'Nostr Wallet Connect'.")
|
||||
.font(.caption)
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
}
|
||||
|
||||
var MainContent: some View {
|
||||
Group {
|
||||
TopSection
|
||||
switch model.connect_state {
|
||||
case .new(let nwc):
|
||||
AreYouSure(nwc: nwc, show_introduction: $show_introduction, model: self.model)
|
||||
.onAppear() {
|
||||
show_introduction = false
|
||||
}
|
||||
AreYouSure(nwc: nwc)
|
||||
case .existing:
|
||||
Text(verbatim: "Shouldn't happen")
|
||||
case .none:
|
||||
TitleSection
|
||||
ConnectWallet
|
||||
}
|
||||
}
|
||||
.fullScreenCover(isPresented: $show_introduction, content: {
|
||||
ZapExplainerView(show_introduction: $show_introduction, nav: nav)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct ConnectWalletView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ConnectWalletView(model: WalletModel(settings: UserSettingsStore()), nav: .init())
|
||||
.previewDisplayName("Main Wallet Connect View")
|
||||
ConnectWalletView.AreYouSure(nwc: get_test_nwc(), show_introduction: .constant(false), model: WalletModel(settings: test_damus_state.settings))
|
||||
.previewDisplayName("Are you sure screen")
|
||||
}
|
||||
|
||||
static func get_test_nwc() -> WalletConnectURL {
|
||||
let pk = "9d088f4760422443d4699b485e2ac66e565a2f5da1198c55ddc5679458e3f67a"
|
||||
let sec = "ff2eefd57196d42089e1b42acc39916d7ecac52e0625bd70597bbd5be14aff18"
|
||||
let relay = "wss://relay.getalby.com/v1"
|
||||
let str = "nostrwalletconnect://\(pk)?relay=\(relay)&secret=\(sec)"
|
||||
|
||||
return WalletConnectURL(str: str)!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
//
|
||||
// NWCSettings.swift
|
||||
// damus
|
||||
//
|
||||
// Created by eric on 1/24/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct NWCSettings: View {
|
||||
|
||||
let damus_state: DamusState
|
||||
let nwc: WalletConnectURL
|
||||
@ObservedObject var model: WalletModel
|
||||
@ObservedObject var settings: UserSettingsStore
|
||||
|
||||
|
||||
func donation_binding() -> Binding<Double> {
|
||||
return Binding(get: {
|
||||
return Double(model.settings.donation_percent)
|
||||
}, set: { v in
|
||||
model.settings.donation_percent = Int(v)
|
||||
})
|
||||
}
|
||||
|
||||
static let min_donation: Double = 0.0
|
||||
static let max_donation: Double = 100.0
|
||||
|
||||
var percent: Double {
|
||||
Double(model.settings.donation_percent) / 100.0
|
||||
}
|
||||
|
||||
var tip_msats: String {
|
||||
let msats = Int64(percent * Double(model.settings.default_zap_amount * 1000))
|
||||
let s = format_msats_abbrev(msats)
|
||||
// TODO: fix formatting and remove this hack
|
||||
let parts = s.split(separator: ".")
|
||||
if parts.count == 1 {
|
||||
return s
|
||||
}
|
||||
if let end = parts[safe: 1] {
|
||||
if end.allSatisfy({ c in c.isNumber }) {
|
||||
return String(parts[0])
|
||||
} else {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
var SupportDamus: some View {
|
||||
ZStack(alignment: .topLeading) {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.fill(DamusGradient.gradient.opacity(0.5))
|
||||
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
HStack {
|
||||
Image("logo-nobg")
|
||||
.resizable()
|
||||
.frame(width: 50, height: 50)
|
||||
Text("Support Damus", comment: "Text calling for the user to support Damus through zaps")
|
||||
.font(.title.bold())
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Text("Help build the future of decentralized communication on the web.", comment: "Text indicating the goal of developing Damus which the user can help with.")
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text("An additional percentage of each zap will be sent to support Damus development", comment: "Text indicating that they can contribute zaps to support Damus development.")
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.foregroundColor(.white)
|
||||
|
||||
let binding = donation_binding()
|
||||
|
||||
HStack {
|
||||
Slider(value: binding,
|
||||
in: NWCSettings.min_donation...NWCSettings.max_donation,
|
||||
label: { })
|
||||
Text("\(Int(binding.wrappedValue))%", comment: "Percentage of additional zap that should be sent to support Damus development.")
|
||||
.font(.title.bold())
|
||||
.foregroundColor(.white)
|
||||
.frame(width: 80)
|
||||
}
|
||||
|
||||
HStack{
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
HStack {
|
||||
Text("\(Image("zap.fill")) \(format_msats_abbrev(Int64(model.settings.default_zap_amount) * 1000))")
|
||||
.font(.title)
|
||||
.foregroundColor(percent == 0 ? .gray : .yellow)
|
||||
.frame(width: 120)
|
||||
}
|
||||
|
||||
Text("Zap", comment: "Text underneath the number of sats indicating that it's the amount used for zaps.")
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
Spacer()
|
||||
|
||||
Text(verbatim: "+")
|
||||
.font(.title)
|
||||
.foregroundColor(.white)
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
HStack {
|
||||
Text("\(Image("zap.fill")) \(tip_msats)")
|
||||
.font(.title)
|
||||
.foregroundColor(percent == 0 ? .gray : Color.yellow)
|
||||
.frame(width: 120)
|
||||
}
|
||||
|
||||
Text(verbatim: percent == 0 ? "🩶" : "💜")
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
||||
EventProfile(damus_state: damus_state, pubkey: damus_state.pubkey, size: .small)
|
||||
}
|
||||
.padding(25)
|
||||
}
|
||||
.frame(height: 370)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
|
||||
SupportDamus
|
||||
.padding(.bottom)
|
||||
|
||||
AccountDetailsView(nwc: nwc)
|
||||
|
||||
Button(action: {
|
||||
self.model.disconnect()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Disconnect Wallet", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.")
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
}
|
||||
.padding()
|
||||
.onAppear() {
|
||||
model.initial_percent = model.settings.donation_percent
|
||||
}
|
||||
.onChange(of: model.settings.donation_percent) { p in
|
||||
let profile_txn = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||
guard let profile = profile_txn?.unsafeUnownedValue else {
|
||||
return
|
||||
}
|
||||
|
||||
let prof = Profile(name: profile.name, display_name: profile.display_name, about: profile.about, picture: profile.picture, banner: profile.banner, website: profile.website, lud06: profile.lud06, lud16: profile.lud16, nip05: profile.nip05, damus_donation: p, reactions: profile.reactions)
|
||||
|
||||
notify(.profile_updated(.manual(pubkey: self.damus_state.pubkey, profile: prof)))
|
||||
}
|
||||
.onDisappear {
|
||||
let profile_txn = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||
|
||||
guard let keypair = damus_state.keypair.to_full(),
|
||||
let profile = profile_txn?.unsafeUnownedValue,
|
||||
model.initial_percent != profile.damus_donation
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
let prof = Profile(name: profile.name, display_name: profile.display_name, about: profile.about, picture: profile.picture, banner: profile.banner, website: profile.website, lud06: profile.lud06, lud16: profile.lud16, nip05: profile.nip05, damus_donation: model.settings.donation_percent, reactions: profile.reactions)
|
||||
|
||||
guard let meta = make_metadata_event(keypair: keypair, metadata: prof) else {
|
||||
return
|
||||
}
|
||||
damus_state.postbox.send(meta)
|
||||
}
|
||||
}
|
||||
|
||||
struct AccountDetailsView: View {
|
||||
let nwc: WalletConnect.ConnectURL
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
Text("Account details", comment: "Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.")
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.bottom)
|
||||
|
||||
Text("Routing", comment: "Label indicating the routing address for Nostr Wallet Connect payments. In other words, the relay used by the NWC wallet provider")
|
||||
.font(.headline)
|
||||
|
||||
Text(nwc.relay.absoluteString)
|
||||
.font(.body)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(.gray)
|
||||
.padding(.bottom)
|
||||
|
||||
if let lud16 = nwc.lud16 {
|
||||
Text("Account", comment: "Label for the user account information with the Nostr Wallet Connect wallet provider.")
|
||||
.font(.headline)
|
||||
|
||||
Text(lud16)
|
||||
.font(.body)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 250, alignment: .leading)
|
||||
.padding(.horizontal, 20)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 25)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 2)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct NWCSettings_Previews: PreviewProvider {
|
||||
static let tds = test_damus_state
|
||||
static var previews: some View {
|
||||
NWCSettings(damus_state: tds, nwc: test_wallet_connect_url, model: WalletModel(state: .existing(test_wallet_connect_url), settings: tds.settings), settings: tds.settings)
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
//
|
||||
// TransactionsView.swift
|
||||
// damus
|
||||
//
|
||||
// Created by eric on 1/23/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct TransactionView: View {
|
||||
|
||||
let damus_state: DamusState
|
||||
var transaction: WalletConnect.Transaction
|
||||
|
||||
var body: some View {
|
||||
let isIncomingTransaction = transaction.type == "incoming"
|
||||
let txType = isIncomingTransaction ? "arrow-bottom-left" : "arrow-top-right"
|
||||
let txColor = isIncomingTransaction ? DamusColors.success : Color.gray
|
||||
let txOp = isIncomingTransaction ? "+" : "-"
|
||||
let created_at = Date.init(timeIntervalSince1970: TimeInterval(transaction.created_at))
|
||||
let formatter = RelativeDateTimeFormatter()
|
||||
let relativeDate = formatter.localizedString(for: created_at, relativeTo: Date.now)
|
||||
let event = decode_nostr_event_json(transaction.description ?? "")
|
||||
let pubkey = (event?.pubkey ?? ANON_PUBKEY)
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
HStack(alignment: .center) {
|
||||
ZStack {
|
||||
ProfilePicView(pubkey: pubkey, size: 45, highlight: .custom(.damusAdaptableBlack, 0.1), profiles: damus_state.profiles, disable_animation: damus_state.settings.disable_animation)
|
||||
|
||||
Image(txType)
|
||||
.resizable()
|
||||
.frame(width: 18, height: 18)
|
||||
.foregroundColor(.white)
|
||||
.padding(2)
|
||||
.background(txColor)
|
||||
.clipShape(Circle())
|
||||
.overlay(Circle().stroke(Color.damusAdaptableWhite, lineWidth: 1.0))
|
||||
.padding(.top, 25)
|
||||
.padding(.leading, 35)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
|
||||
Text(self.userDisplayName(pubkey: pubkey))
|
||||
.font(.headline)
|
||||
.bold()
|
||||
.foregroundColor(DamusColors.adaptableBlack)
|
||||
|
||||
Text(relativeDate)
|
||||
.font(.caption)
|
||||
.foregroundColor(Color.gray)
|
||||
}
|
||||
.padding(.horizontal, 10)
|
||||
|
||||
Spacer()
|
||||
|
||||
Text(verbatim: "\(txOp) \(format_msats(transaction.amount))")
|
||||
.font(.headline)
|
||||
.foregroundColor(txColor)
|
||||
.bold()
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 75, alignment: .center)
|
||||
.padding(.horizontal, 10)
|
||||
.background(DamusColors.neutral1)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
func userDisplayName(pubkey: Pubkey) -> String {
|
||||
let profile_txn = damus_state.profiles.lookup(id: pubkey, txn_name: "txview-profile")
|
||||
let profile = profile_txn?.unsafeUnownedValue
|
||||
|
||||
if let display_name = profile?.display_name {
|
||||
return display_name
|
||||
} else if let name = profile?.name {
|
||||
return "@" + name
|
||||
} else {
|
||||
return NSLocalizedString("Unknown", comment: "A name label for an unknown user")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct TransactionsView: View {
|
||||
|
||||
let damus_state: DamusState
|
||||
let transactions: [WalletConnect.Transaction]?
|
||||
var sortedTransactions: [WalletConnect.Transaction]? {
|
||||
transactions?.sorted(by: { $0.created_at > $1.created_at })
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text("Latest transactions", comment: "Heading for latest wallet transactions list")
|
||||
.foregroundStyle(DamusColors.neutral6)
|
||||
|
||||
if let sortedTransactions {
|
||||
if sortedTransactions.isEmpty {
|
||||
emptyTransactions
|
||||
} else {
|
||||
ForEach(sortedTransactions, id: \.self) { transaction in
|
||||
TransactionView(damus_state: damus_state, transaction: transaction)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Make sure we do not show "No transactions yet" to the user when still loading (or when failed to load)
|
||||
// This is important because if we show that when things are not loaded properly, we risk scaring the user into thinking that they have lost funds.
|
||||
emptyTransactions
|
||||
.redacted(reason: .placeholder)
|
||||
.shimmer(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var emptyTransactions: some View {
|
||||
HStack {
|
||||
Text("No transactions yet", comment: "Message shown when no transactions are available")
|
||||
.foregroundStyle(DamusColors.neutral6)
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 75, alignment: .center)
|
||||
.padding(.horizontal, 10)
|
||||
.background(DamusColors.neutral1)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct TransactionsView_Previews: PreviewProvider {
|
||||
static let tds = test_damus_state
|
||||
static let transaction1: WalletConnect.Transaction = WalletConnect.Transaction(type: "incoming", invoice: "", description: "{\"id\":\"7c0999a5870ca3ba0186a29a8650152b555cee29b53b5b8747d8a3798042d01c\",\"pubkey\":\"b8851a06dfd79d48fc325234a15e9a46a32a0982a823b54cdf82514b9b120ba1\",\"created_at\":1736383715,\"kind\":9734,\"tags\":[[\"p\",\"520830c334a3f79f88cac934580d26f91a7832c6b21fb9625690ea2ed81b5626\"],[\"amount\",\"21000\"],[\"e\",\"a25e152a4cd1b3bbc3d22e8e9315d8ea1f35c227b2f212c7cff18abff36fa208\"],[\"relays\",\"wss://nos.lol\",\"wss://nostr.wine\",\"wss://premium.primal.net\",\"wss://relay.damus.io\",\"wss://relay.nostr.band\",\"wss://relay.nostrarabia.com\"]],\"content\":\"🫡 Onward!\",\"sig\":\"e77d16822fa21b9c2e6b580b51c470588052c14aeb222f08f0e735027e366157c8742a6d5cb850780c2bf44ac63d89b048e5cc56dd47a1bfc740a3173e578f4e\"}", description_hash: "", preimage: "", payment_hash: "1234567890", amount: 21000, fees_paid: 0, created_at: 1737736866, expires_at: 0, settled_at: 0)
|
||||
static let transaction2: WalletConnect.Transaction = WalletConnect.Transaction(type: "incoming", invoice: "", description: "", description_hash: "", preimage: "", payment_hash: "123456789033", amount: 100000000, fees_paid: 0, created_at: 1737690090, expires_at: 0, settled_at: 0)
|
||||
static let transaction3: WalletConnect.Transaction = WalletConnect.Transaction(type: "outgoing", invoice: "", description: "", description_hash: "", preimage: "", payment_hash: "123456789042", amount: 303000, fees_paid: 0, created_at: 1737590101, expires_at: 0, settled_at: 0)
|
||||
static let transaction4: WalletConnect.Transaction = WalletConnect.Transaction(type: "incoming", invoice: "", description: "", description_hash: "", preimage: "", payment_hash: "1234567890662", amount: 720000, fees_paid: 0, created_at: 1737090300, expires_at: 0, settled_at: 0)
|
||||
static var test_transactions: [WalletConnect.Transaction] = [transaction1, transaction2, transaction3, transaction4]
|
||||
|
||||
static var previews: some View {
|
||||
TransactionsView(damus_state: tds, transactions: test_transactions)
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import SwiftUI
|
||||
|
||||
struct WalletView: View {
|
||||
let damus_state: DamusState
|
||||
@State var show_settings: Bool = false
|
||||
@ObservedObject var model: WalletModel
|
||||
@ObservedObject var settings: UserSettingsStore
|
||||
|
||||
@@ -22,20 +21,178 @@ struct WalletView: View {
|
||||
func MainWalletView(nwc: WalletConnectURL) -> some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 35) {
|
||||
VStack(spacing: 5) {
|
||||
|
||||
BalanceView(balance: model.balance)
|
||||
|
||||
TransactionsView(damus_state: damus_state, transactions: model.transactions)
|
||||
if !damus_state.settings.nozaps {
|
||||
SupportDamus
|
||||
.padding(.vertical, 20)
|
||||
}
|
||||
|
||||
VStack(spacing: 5) {
|
||||
VStack(spacing: 10) {
|
||||
Text("Wallet Relay", comment: "Label text indicating that below it is the information about the wallet relay.")
|
||||
.fontWeight(.semibold)
|
||||
.padding(.top)
|
||||
|
||||
Divider()
|
||||
|
||||
RelayView(state: damus_state, relay: nwc.relay, showActionButtons: .constant(false), recommended: false)
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 125, alignment: .top)
|
||||
.padding(.horizontal, 10)
|
||||
.background(DamusColors.neutral1)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 1)
|
||||
)
|
||||
|
||||
if let lud16 = nwc.lud16 {
|
||||
VStack(spacing: 10) {
|
||||
Text("Wallet Address", comment: "Label text indicating that below it is the wallet address.")
|
||||
.fontWeight(.semibold)
|
||||
|
||||
Divider()
|
||||
|
||||
Text(lud16)
|
||||
}
|
||||
.frame(maxWidth: .infinity, minHeight: 75, alignment: .center)
|
||||
.padding(.horizontal, 10)
|
||||
.background(DamusColors.neutral1)
|
||||
.cornerRadius(10)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.stroke(DamusColors.neutral3, lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
self.model.disconnect()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Disconnect Wallet", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.")
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
.padding(.bottom, 50) // Bottom padding while Scrolling
|
||||
|
||||
}
|
||||
.navigationTitle(NSLocalizedString("Wallet", comment: "Navigation title for Wallet view"))
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.padding()
|
||||
.padding(.bottom, 50)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func donation_binding() -> Binding<Double> {
|
||||
return Binding(get: {
|
||||
return Double(model.settings.donation_percent)
|
||||
}, set: { v in
|
||||
model.settings.donation_percent = Int(v)
|
||||
})
|
||||
}
|
||||
|
||||
static let min_donation: Double = 0.0
|
||||
static let max_donation: Double = 100.0
|
||||
|
||||
var percent: Double {
|
||||
Double(model.settings.donation_percent) / 100.0
|
||||
}
|
||||
|
||||
var tip_msats: String {
|
||||
let msats = Int64(percent * Double(model.settings.default_zap_amount * 1000))
|
||||
let s = format_msats_abbrev(msats)
|
||||
// TODO: fix formatting and remove this hack
|
||||
let parts = s.split(separator: ".")
|
||||
if parts.count == 1 {
|
||||
return s
|
||||
}
|
||||
if let end = parts[safe: 1] {
|
||||
if end.allSatisfy({ c in c.isNumber }) {
|
||||
return String(parts[0])
|
||||
} else {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
var SupportDamus: some View {
|
||||
ZStack(alignment: .topLeading) {
|
||||
RoundedRectangle(cornerRadius: 20)
|
||||
.fill(DamusGradient.gradient.opacity(0.5))
|
||||
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
HStack {
|
||||
Image("logo-nobg")
|
||||
.resizable()
|
||||
.frame(width: 50, height: 50)
|
||||
Text("Support Damus", comment: "Text calling for the user to support Damus through zaps")
|
||||
.font(.title.bold())
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Text("Help build the future of decentralized communication on the web.", comment: "Text indicating the goal of developing Damus which the user can help with.")
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text("An additional percentage of each zap will be sent to support Damus development", comment: "Text indicating that they can contribute zaps to support Damus development.")
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.foregroundColor(.white)
|
||||
|
||||
let binding = donation_binding()
|
||||
|
||||
HStack {
|
||||
Slider(value: binding,
|
||||
in: WalletView.min_donation...WalletView.max_donation,
|
||||
label: { })
|
||||
Text("\(Int(binding.wrappedValue))%", comment: "Percentage of additional zap that should be sent to support Damus development.")
|
||||
.font(.title.bold())
|
||||
.foregroundColor(.white)
|
||||
.frame(width: 80)
|
||||
}
|
||||
|
||||
HStack{
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
HStack {
|
||||
Text("\(Image("zap.fill")) \(format_msats_abbrev(Int64(model.settings.default_zap_amount) * 1000))")
|
||||
.font(.title)
|
||||
.foregroundColor(percent == 0 ? .gray : .yellow)
|
||||
.frame(width: 120)
|
||||
}
|
||||
|
||||
Text("Zap", comment: "Text underneath the number of sats indicating that it's the amount used for zaps.")
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
Spacer()
|
||||
|
||||
Text(verbatim: "+")
|
||||
.font(.title)
|
||||
.foregroundColor(.white)
|
||||
Spacer()
|
||||
|
||||
VStack {
|
||||
HStack {
|
||||
Text("\(Image("zap.fill")) \(tip_msats)")
|
||||
.font(.title)
|
||||
.foregroundColor(percent == 0 ? .gray : Color.yellow)
|
||||
.frame(width: 120)
|
||||
}
|
||||
|
||||
Text(verbatim: percent == 0 ? "🩶" : "💜")
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
||||
EventProfile(damus_state: damus_state, pubkey: damus_state.pubkey, size: .small)
|
||||
}
|
||||
.padding(25)
|
||||
}
|
||||
.frame(height: 370)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
switch model.connect_state {
|
||||
case .new:
|
||||
@@ -44,50 +201,38 @@ struct WalletView: View {
|
||||
ConnectWalletView(model: model, nav: damus_state.nav)
|
||||
case .existing(let nwc):
|
||||
MainWalletView(nwc: nwc)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button(
|
||||
action: { show_settings = true },
|
||||
label: {
|
||||
Image("settings")
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
.onAppear() {
|
||||
Task { await self.updateWalletInformation() }
|
||||
model.initial_percent = settings.donation_percent
|
||||
}
|
||||
.refreshable {
|
||||
model.resetWalletStateInformation()
|
||||
await self.updateWalletInformation()
|
||||
}
|
||||
.sheet(isPresented: $show_settings, onDismiss: { self.show_settings = false }) {
|
||||
ScrollView {
|
||||
NWCSettings(damus_state: damus_state, nwc: nwc, model: model, settings: settings)
|
||||
.padding(.top, 30)
|
||||
.onChange(of: settings.donation_percent) { p in
|
||||
let profile_txn = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||
guard let profile = profile_txn?.unsafeUnownedValue else {
|
||||
return
|
||||
}
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationDetents([.large])
|
||||
|
||||
let prof = Profile(name: profile.name, display_name: profile.display_name, about: profile.about, picture: profile.picture, banner: profile.banner, website: profile.website, lud06: profile.lud06, lud16: profile.lud16, nip05: profile.nip05, damus_donation: p, reactions: profile.reactions)
|
||||
|
||||
notify(.profile_updated(.manual(pubkey: self.damus_state.pubkey, profile: prof)))
|
||||
}
|
||||
.onDisappear {
|
||||
let profile_txn = damus_state.profiles.lookup(id: damus_state.pubkey)
|
||||
|
||||
guard let keypair = damus_state.keypair.to_full(),
|
||||
let profile = profile_txn?.unsafeUnownedValue,
|
||||
model.initial_percent != profile.damus_donation
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
let prof = Profile(name: profile.name, display_name: profile.display_name, about: profile.about, picture: profile.picture, banner: profile.banner, website: profile.website, lud06: profile.lud06, lud16: profile.lud16, nip05: profile.nip05, damus_donation: settings.donation_percent, reactions: profile.reactions)
|
||||
|
||||
guard let meta = make_metadata_event(keypair: keypair, metadata: prof) else {
|
||||
return
|
||||
}
|
||||
damus_state.postbox.send(meta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func updateWalletInformation() async {
|
||||
guard let url = damus_state.settings.nostr_wallet_connect,
|
||||
let nwc = WalletConnectURL(str: url) else {
|
||||
return
|
||||
}
|
||||
|
||||
let flusher: OnFlush? = nil
|
||||
|
||||
let delay = 0.0 // We don't need a delay when fetching a transaction list or balance
|
||||
|
||||
WalletConnect.request_transaction_list(url: nwc, pool: damus_state.pool, post: damus_state.postbox, delay: delay, on_flush: flusher)
|
||||
WalletConnect.request_balance_information(url: nwc, pool: damus_state.pool, post: damus_state.postbox, delay: delay, on_flush: flusher)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let test_wallet_connect_url = WalletConnectURL(pubkey: test_pubkey, relay: .init("wss://relay.damus.io")!, keypair: test_damus_state.keypair.to_full()!, lud16: "jb55@sendsats.com")
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
//
|
||||
// ZapExplainer.swift
|
||||
// damus
|
||||
//
|
||||
// Created by eric on 2/12/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ZapExplainerView: View {
|
||||
|
||||
@Binding var show_introduction: Bool
|
||||
var nav: NavigationCoordinator
|
||||
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack {
|
||||
Text("Get cash instantly from your followers", comment: "Feature description for receiving money instantly.")
|
||||
.font(.veryLargeTitle)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.top)
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
GetPaid
|
||||
Gift
|
||||
GiveThanks
|
||||
}
|
||||
|
||||
WhyZaps
|
||||
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 20) {
|
||||
FindWallet
|
||||
|
||||
LinkAccount
|
||||
|
||||
StartReceiving
|
||||
}
|
||||
.padding(5)
|
||||
}
|
||||
.scrollIndicators(.hidden)
|
||||
|
||||
Button(action: {
|
||||
show_introduction = false
|
||||
}) {
|
||||
HStack {
|
||||
Text("Set up wallet", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.")
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
}
|
||||
.buttonStyle(GradientButtonStyle())
|
||||
.padding(.top, 30)
|
||||
|
||||
Button(action: {
|
||||
nav.popToRoot()
|
||||
}) {
|
||||
HStack {
|
||||
Text("Maybe later", comment: "Text for button to disconnect from Nostr Wallet Connect lightning wallet.")
|
||||
}
|
||||
.frame(minWidth: 300, maxWidth: .infinity, maxHeight: 18, alignment: .center)
|
||||
.padding()
|
||||
}
|
||||
.buttonStyle(NeutralButtonStyle())
|
||||
}
|
||||
.padding(.bottom)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
.scrollIndicators(.never)
|
||||
.background(
|
||||
Image("eula-bg")
|
||||
.resizable()
|
||||
.blur(radius: 70)
|
||||
.opacity(colorScheme == .light ? 0.6 : 1.0)
|
||||
.ignoresSafeArea(),
|
||||
alignment: .top
|
||||
)
|
||||
}
|
||||
|
||||
var GetPaid: some View {
|
||||
self.benefitPoint(
|
||||
imageName: "zap.fill",
|
||||
heading: NSLocalizedString("Get paid for being you", comment: "Description for monetizing one's presence."),
|
||||
description: NSLocalizedString("Setting up Zaps lets people know you're ready to start receiving money.", comment: "Information about enabling payments.")
|
||||
)
|
||||
}
|
||||
|
||||
var Gift: some View {
|
||||
self.benefitPoint(
|
||||
imageName: "gift",
|
||||
heading: NSLocalizedString("Let your fans show their support", comment: "Heading pointing out a benefit of connecting a lightning wallet."),
|
||||
description: NSLocalizedString("You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes.", comment: "Text explaining the benefit of connecting a lightning wallet for content creators.")
|
||||
)
|
||||
}
|
||||
|
||||
var GiveThanks: some View {
|
||||
self.benefitPoint(
|
||||
imageName: "gift",
|
||||
heading: NSLocalizedString("Give thanks", comment: "Heading explaining a benefit of connecting a lightning wallet."),
|
||||
description: NSLocalizedString("When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude.", comment: "Description explaining a benefit of connecting a lightning wallet.")
|
||||
)
|
||||
}
|
||||
|
||||
func benefitPoint(imageName: String, heading: String, description: String) -> some View {
|
||||
VStack(alignment: .leading) {
|
||||
HStack(alignment: .top, spacing: 10) {
|
||||
Button(action: {}, label: {
|
||||
Image(imageName)
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
Text(heading)
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
|
||||
Text(description)
|
||||
.font(.body)
|
||||
}
|
||||
.padding(.top, 9)
|
||||
}
|
||||
}
|
||||
.padding(.top)
|
||||
}
|
||||
|
||||
var WhyZaps: some View {
|
||||
VStack(alignment: .leading, spacing: 15) {
|
||||
Text("Why add Zaps?", comment: "Heading to explain the benefits of zaps.")
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
|
||||
Text("Zaps are an easy way to support the incredible\nvoices that make up the conversation on nostr.\nHere's how it works", comment: "Describing the functional benefits of Zaps.")
|
||||
.lineLimit(4)
|
||||
.font(.body)
|
||||
}
|
||||
.padding(.top, 30)
|
||||
}
|
||||
|
||||
var FindWallet: some View {
|
||||
self.WhyAddZapsBox(
|
||||
iconName: "wallet.fill",
|
||||
heading: NSLocalizedString("Find a Wallet", comment: "The heading for one of the \"Why add Zaps?\" boxes"),
|
||||
description: NSLocalizedString("Choose the third-party payment provider you'd like to use.", comment: "The description for one of the \"Why add Zaps?\" boxes")
|
||||
)
|
||||
}
|
||||
|
||||
var LinkAccount: some View {
|
||||
self.WhyAddZapsBox(
|
||||
iconName: "link",
|
||||
heading: NSLocalizedString("Link your account", comment: "The heading for one of the \"Why add Zaps?\" boxes"),
|
||||
description: NSLocalizedString("Link to services that support Nostr Wallet Connect like Alby, Coinos and more.", comment: "The description for one of the \"Why add Zaps?\" boxes")
|
||||
)
|
||||
}
|
||||
|
||||
var StartReceiving: some View {
|
||||
self.WhyAddZapsBox(
|
||||
iconName: "bitcoin",
|
||||
heading: NSLocalizedString("Start receiving money", comment: "The heading for one of the \"Why add Zaps?\" boxes"),
|
||||
description: NSLocalizedString("People will be able to send you cash from your profile. No money goes to Damus.", comment: "The description for one of the \"Why add Zaps?\" boxes")
|
||||
)
|
||||
}
|
||||
|
||||
func WhyAddZapsBox(iconName: String, heading: String, description: String) -> some View {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Button(action: {}, label: {
|
||||
Image(iconName)
|
||||
.resizable()
|
||||
.frame(width: 25, height: 25)
|
||||
})
|
||||
.buttonStyle(NeutralButtonStyle(padding: EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10), cornerRadius: 9999))
|
||||
.disabled(true)
|
||||
|
||||
Text(heading)
|
||||
.font(.title2)
|
||||
.fontWeight(.bold)
|
||||
.padding(.bottom, 2)
|
||||
|
||||
Text(description)
|
||||
.font(.caption)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.frame(maxWidth: 175, minHeight: 175)
|
||||
.padding(10)
|
||||
.background(DamusColors.neutral1)
|
||||
.cornerRadius(15)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 15)
|
||||
.stroke(DamusColors.neutral1, lineWidth: 2)
|
||||
)
|
||||
.padding(.top, 20)
|
||||
}
|
||||
}
|
||||
|
||||
struct ZapExplainerView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ZapExplainerView(show_introduction: .constant(true), nav: .init())
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -77,7 +77,7 @@
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ und %1$d weiteres Profil teilten</string>
|
||||
<string>%2$@ und %1$d teilten</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ und %1$d weitere teilten</string>
|
||||
</dict>
|
||||
|
||||
@@ -164,11 +164,6 @@ Sentence composed of 2 variables to describe how many zap payments there are on
|
||||
<target>API Key (required)</target>
|
||||
<note>Prompt for required entry of API Key to use translation server.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="AUTOMATIC SETUP" xml:space="preserve">
|
||||
<source>AUTOMATIC SETUP</source>
|
||||
<target>AUTOMATIC SETUP</target>
|
||||
<note>Heading for the section that performs an automatic wallet connection setup.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="About Me" xml:space="preserve">
|
||||
<source>About Me</source>
|
||||
<target>About Me</target>
|
||||
@@ -189,21 +184,11 @@ Sentence composed of 2 variables to describe how many zap payments there are on
|
||||
<target>Accessibility</target>
|
||||
<note>Section header for accessibility settings</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account" xml:space="preserve">
|
||||
<source>Account</source>
|
||||
<target>Account</target>
|
||||
<note>Label for the user account information with the Nostr Wallet Connect wallet provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account creation" xml:space="preserve">
|
||||
<source>Account creation</source>
|
||||
<target>Account creation</target>
|
||||
<note>Label for Purple account creation date</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account details" xml:space="preserve">
|
||||
<source>Account details</source>
|
||||
<target>Account details</target>
|
||||
<note>Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account private key" xml:space="preserve">
|
||||
<source>Account private key</source>
|
||||
<target>Account private key</target>
|
||||
@@ -351,6 +336,11 @@ Section header for text and appearance settings</note>
|
||||
<target>Are you sure you want to clear the cache? This will free space, but images may take longer to load again.</target>
|
||||
<note>Message explaining what it means to clear the cache, asking if user wants to proceed.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Are you sure you want to connect this wallet?" xml:space="preserve">
|
||||
<source>Are you sure you want to connect this wallet?</source>
|
||||
<target>Are you sure you want to connect this wallet?</target>
|
||||
<note>Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Are you sure you want to delete all of your bookmarks?" xml:space="preserve">
|
||||
<source>Are you sure you want to delete all of your bookmarks?</source>
|
||||
<target>Are you sure you want to delete all of your bookmarks?</target>
|
||||
@@ -380,11 +370,6 @@ Tip: You can always change this later in Settings → Translations</source>
|
||||
Tip: You can always change this later in Settings → Translations</target>
|
||||
<note>Message notifying the user that they get auto-translations as part of their service</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Attach to any third party provider you already use." xml:space="preserve">
|
||||
<source>Attach to any third party provider you already use.</source>
|
||||
<target>Attach to any third party provider you already use.</target>
|
||||
<note>Information text guiding users on attaching existing provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Authenticated" xml:space="preserve">
|
||||
<source>Authenticated</source>
|
||||
<target>Authenticated</target>
|
||||
@@ -501,11 +486,6 @@ Text for button to cancel out of connecting Nostr Wallet Connect lightning walle
|
||||
<target>Choose from Library</target>
|
||||
<note>Option to select photo from library</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Choose the third-party payment provider you'd like to use." xml:space="preserve">
|
||||
<source>Choose the third-party payment provider you'd like to use.</source>
|
||||
<target>Choose the third-party payment provider you'd like to use.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Clear All" xml:space="preserve">
|
||||
<source>Clear All</source>
|
||||
<target>Clear All</target>
|
||||
@@ -719,16 +699,6 @@ Context menu option for copying the version of damus.</note>
|
||||
<target>Create new mutelist</target>
|
||||
<note>Title of alert prompting the user to create a new mutelist.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Create new wallet" xml:space="preserve">
|
||||
<source>Create new wallet</source>
|
||||
<target>Create new wallet</target>
|
||||
<note>Button text for creating a new wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Current balance" xml:space="preserve">
|
||||
<source>Current balance</source>
|
||||
<target>Current balance</target>
|
||||
<note>Label for displaying current wallet balance</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Custom" xml:space="preserve">
|
||||
<source>Custom</source>
|
||||
<target>Custom</target>
|
||||
@@ -763,6 +733,11 @@ Toolbar label for DMs view, where DM is the English abbreviation for Direct Mess
|
||||
<target>Damus Purple environment</target>
|
||||
<note>Prompt selection of the Damus purple environment (Developer feature to switch between real/production mode to test modes).</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Damus Wallet" xml:space="preserve">
|
||||
<source>Damus Wallet</source>
|
||||
<target>Damus Wallet</target>
|
||||
<note>Title text for Damus Wallet view.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Damus logo" xml:space="preserve">
|
||||
<source>Damus logo</source>
|
||||
<target>Damus logo</target>
|
||||
@@ -864,11 +839,6 @@ The duration in which to mute the given item.</note>
|
||||
<target>Earn Money</target>
|
||||
<note>Heading indicating that this application allows users to earn money.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Easily create a new wallet and attach it to your account." xml:space="preserve">
|
||||
<source>Easily create a new wallet and attach it to your account.</source>
|
||||
<target>Easily create a new wallet and attach it to your account.</target>
|
||||
<note>Description for the create new wallet feature.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Edit" xml:space="preserve">
|
||||
<source>Edit</source>
|
||||
<target>Edit</target>
|
||||
@@ -1014,11 +984,6 @@ Title indicating that an error has occurred.</note>
|
||||
<target>Failed to parse</target>
|
||||
<note>NostrScript error message when it fails to parse a script.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Find a Wallet" xml:space="preserve">
|
||||
<source>Find a Wallet</source>
|
||||
<target>Find a Wallet</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="First Aid" xml:space="preserve">
|
||||
<source>First Aid</source>
|
||||
<target>First Aid</target>
|
||||
@@ -1153,21 +1118,6 @@ Button to navigate to translate.nostr.wine to get a translation API key.</note>
|
||||
<target>Get a special badge on your profile to show everyone your contribution to Freedom tech</target>
|
||||
<note>Supporter badge description</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Get cash instantly from your followers" xml:space="preserve">
|
||||
<source>Get cash instantly from your followers</source>
|
||||
<target>Get cash instantly from your followers</target>
|
||||
<note>Feature description for receiving money instantly.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Get paid for being you" xml:space="preserve">
|
||||
<source>Get paid for being you</source>
|
||||
<target>Get paid for being you</target>
|
||||
<note>Description for monetizing one's presence.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Give thanks" xml:space="preserve">
|
||||
<source>Give thanks</source>
|
||||
<target>Give thanks</target>
|
||||
<note>Heading explaining a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Go to the app" xml:space="preserve">
|
||||
<source>Go to the app</source>
|
||||
<target>Go to the app</target>
|
||||
@@ -1333,11 +1283,6 @@ Settings section for managing keys</note>
|
||||
<target>LIVE</target>
|
||||
<note>Text indicator that the video is a livestream.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Latest transactions" xml:space="preserve">
|
||||
<source>Latest transactions</source>
|
||||
<target>Latest transactions</target>
|
||||
<note>Heading for latest wallet transactions list</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Learn more about the features" xml:space="preserve">
|
||||
<source>Learn more about the features</source>
|
||||
<target>Learn more about the features</target>
|
||||
@@ -1348,11 +1293,6 @@ Settings section for managing keys</note>
|
||||
<target>Left Handed</target>
|
||||
<note>Moves the post button to the left side of the screen</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Let your fans show their support" xml:space="preserve">
|
||||
<source>Let your fans show their support</source>
|
||||
<target>Let your fans show their support</target>
|
||||
<note>Heading pointing out a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="LibreTranslate (Open Source)" xml:space="preserve">
|
||||
<source>LibreTranslate (Open Source)</source>
|
||||
<target>LibreTranslate (Open Source)</target>
|
||||
@@ -1378,16 +1318,6 @@ Settings section for managing keys</note>
|
||||
<target>Likes</target>
|
||||
<note>Setting to enable Like Local Notification</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Link to services that support Nostr Wallet Connect like Alby, Coinos and more." xml:space="preserve">
|
||||
<source>Link to services that support Nostr Wallet Connect like Alby, Coinos and more.</source>
|
||||
<target>Link to services that support Nostr Wallet Connect like Alby, Coinos and more.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Link your account" xml:space="preserve">
|
||||
<source>Link your account</source>
|
||||
<target>Link your account</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Load media" xml:space="preserve">
|
||||
<source>Load media</source>
|
||||
<target>Load media</target>
|
||||
@@ -1431,11 +1361,6 @@ Sidebar menu label to sign out of the account.</note>
|
||||
<target>Looking for %@...</target>
|
||||
<note>Label that appears when searching for note or profile</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="MANUAL SETUP" xml:space="preserve">
|
||||
<source>MANUAL SETUP</source>
|
||||
<target>MANUAL SETUP</target>
|
||||
<note>Label for manual wallet setup.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Make Default" xml:space="preserve">
|
||||
<source>Make Default</source>
|
||||
<target>Make Default</target>
|
||||
@@ -1461,11 +1386,6 @@ Sidebar menu label to sign out of the account.</note>
|
||||
<target>Manage subscription</target>
|
||||
<note>Button to take user to manage Damus Purple subscription</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Maybe later" xml:space="preserve">
|
||||
<source>Maybe later</source>
|
||||
<target>Maybe later</target>
|
||||
<note>Text for button to disconnect from Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Media previews" xml:space="preserve">
|
||||
<source>Media previews</source>
|
||||
<target>Media previews</target>
|
||||
@@ -1635,11 +1555,6 @@ User confirm No</note>
|
||||
<target>No text selected</target>
|
||||
<note>Title indicating that a highlight cannot be posted because no text was selected.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="No transactions yet" xml:space="preserve">
|
||||
<source>No transactions yet</source>
|
||||
<target>No transactions yet</target>
|
||||
<note>Message shown when no transactions are available</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="No zaps will be sent, only a lightning payment." xml:space="preserve">
|
||||
<source>No zaps will be sent, only a lightning payment.</source>
|
||||
<target>No zaps will be sent, only a lightning payment.</target>
|
||||
@@ -1845,11 +1760,6 @@ Button label to dismiss an error dialog</note>
|
||||
<target>People</target>
|
||||
<note>Label for filter for seeing only people follows.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="People will be able to send you cash from your profile. No money goes to Damus." xml:space="preserve">
|
||||
<source>People will be able to send you cash from your profile. No money goes to Damus.</source>
|
||||
<target>People will be able to send you cash from your profile. No money goes to Damus.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Permanently Delete Account" xml:space="preserve">
|
||||
<source>Permanently Delete Account</source>
|
||||
<target>Permanently Delete Account</target>
|
||||
@@ -2180,11 +2090,6 @@ Setting to enable Repost Local Notification</note>
|
||||
<target>Retry</target>
|
||||
<note>Button to retry completing account creation after an error occurred.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Routing" xml:space="preserve">
|
||||
<source>Routing</source>
|
||||
<target>Routing</target>
|
||||
<note>Label indicating the routing address for Nostr Wallet Connect payments. In other words, the relay used by the NWC wallet provider</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Run" xml:space="preserve">
|
||||
<source>Run</source>
|
||||
<target>Run</target>
|
||||
@@ -2200,11 +2105,6 @@ Setting to enable Repost Local Notification</note>
|
||||
<target>Runtime error</target>
|
||||
<note>Indication that a runtime error occurred when running a NostrScript.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="SATS" xml:space="preserve">
|
||||
<source>SATS</source>
|
||||
<target>SATS</target>
|
||||
<note>Abbreviation for Satoshis, smallest bitcoin unit</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="SOFTWARE" xml:space="preserve">
|
||||
<source>SOFTWARE</source>
|
||||
<target>SOFTWARE</target>
|
||||
@@ -2313,6 +2213,11 @@ Section header for search/universe settings</note>
|
||||
<target>Secret Account Login Key</target>
|
||||
<note>Section title for user's secret account login key.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Securely connect your Damus app to your wallet using Nostr Wallet Connect" xml:space="preserve">
|
||||
<source>Securely connect your Damus app to your wallet using Nostr Wallet Connect</source>
|
||||
<target>Securely connect your Damus app to your wallet using Nostr Wallet Connect</target>
|
||||
<note>Text to prompt user to connect their wallet using 'Nostr Wallet Connect'.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Select a Lightning wallet" xml:space="preserve">
|
||||
<source>Select a Lightning wallet</source>
|
||||
<target>Select a Lightning wallet</target>
|
||||
@@ -2348,27 +2253,11 @@ Section header for search/universe settings</note>
|
||||
<target>Service</target>
|
||||
<note>Prompt selection of translation service provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Set up wallet" xml:space="preserve">
|
||||
<source>Set up wallet</source>
|
||||
<target>Set up wallet</target>
|
||||
<note>Text for button to disconnect from Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Setting up Zaps lets people know you're ready to start receiving money." xml:space="preserve">
|
||||
<source>Setting up Zaps lets people know you're ready to start receiving money.</source>
|
||||
<target>Setting up Zaps lets people know you're ready to start receiving money.</target>
|
||||
<note>Information about enabling payments.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Settings" xml:space="preserve">
|
||||
<source>Settings</source>
|
||||
<target>Settings</target>
|
||||
<note>Navigation title for Settings view.
|
||||
Sidebar menu label for accessing the app settings</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Setup Wallet" xml:space="preserve">
|
||||
<source>Setup Wallet</source>
|
||||
<target>Setup Wallet</target>
|
||||
<note>Heading for Nostr Wallet Connect setup screen
|
||||
Heading for wallet setup confirmation screen</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Share" xml:space="preserve">
|
||||
<source>Share</source>
|
||||
@@ -2521,11 +2410,6 @@ Section header for Universe/Search spam</note>
|
||||
<target>Staging (for dev builds)</target>
|
||||
<note>Label indicating the staging environment for Push notification functionality</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Start receiving money" xml:space="preserve">
|
||||
<source>Start receiving money</source>
|
||||
<target>Start receiving money</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Staying humble..." xml:space="preserve">
|
||||
<source>Staying humble...</source>
|
||||
<target>Staying humble...</target>
|
||||
@@ -2804,11 +2688,6 @@ Example URL to LibreTranslate server</note>
|
||||
<target>Universe 🛸</target>
|
||||
<note>Toolbar label for the universal view where notes from all connected relay servers appear.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Unknown" xml:space="preserve">
|
||||
<source>Unknown</source>
|
||||
<target>Unknown</target>
|
||||
<note>A name label for an unknown user</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Unmute" xml:space="preserve">
|
||||
<source>Unmute</source>
|
||||
<target>Unmute</target>
|
||||
@@ -2839,11 +2718,6 @@ Example URL to LibreTranslate server</note>
|
||||
<target>Upload</target>
|
||||
<note>Button to proceed with uploading.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Use existing" xml:space="preserve">
|
||||
<source>Use existing</source>
|
||||
<target>Use existing</target>
|
||||
<note>Button text to use an existing wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="User Statuses" xml:space="preserve">
|
||||
<source>User Statuses</source>
|
||||
<target>User Statuses</target>
|
||||
@@ -2948,6 +2822,16 @@ Navigation title for attaching Nostr Wallet Connect lightning wallet.
|
||||
Sidebar menu label for Wallet view.
|
||||
Title for section in zap settings that controls the Lightning wallet selection.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Wallet Address" xml:space="preserve">
|
||||
<source>Wallet Address</source>
|
||||
<target>Wallet Address</target>
|
||||
<note>Label text indicating that below it is the wallet address.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Wallet Relay" xml:space="preserve">
|
||||
<source>Wallet Relay</source>
|
||||
<target>Wallet Relay</target>
|
||||
<note>Label text indicating that below it is the information about the wallet relay.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)" xml:space="preserve">
|
||||
<source>We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)</source>
|
||||
<target>We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)</target>
|
||||
@@ -3008,21 +2892,11 @@ Title for section in zap settings that controls the Lightning wallet selection.<
|
||||
<target>What do you want to report?</target>
|
||||
<note>Header text to prompt user what issue they want to report.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude." xml:space="preserve">
|
||||
<source>When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude.</source>
|
||||
<target>When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude.</target>
|
||||
<note>Description explaining a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Who to Follow" xml:space="preserve">
|
||||
<source>Who to Follow</source>
|
||||
<target>Who to Follow</target>
|
||||
<note>Title for a screen displaying suggestions of who to follow</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Why add Zaps?" xml:space="preserve">
|
||||
<source>Why add Zaps?</source>
|
||||
<target>Why add Zaps?</target>
|
||||
<note>Heading to explain the benefits of zaps.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Words" xml:space="preserve">
|
||||
<source>Words</source>
|
||||
<target>Words</target>
|
||||
@@ -3059,11 +2933,6 @@ User confirm Yes</note>
|
||||
<target>You clicked on a Purple welcome link, but we could not find your checkout. This is likely a bug.</target>
|
||||
<note>Error label upon continuing in the app from a Damus Purple purchase</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes." xml:space="preserve">
|
||||
<source>You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes.</source>
|
||||
<target>You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes.</target>
|
||||
<note>Text explaining the benefit of connecting a lightning wallet for content creators.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="You have no bookmarks yet, add them in the context menu" xml:space="preserve">
|
||||
<source>You have no bookmarks yet, add them in the context menu</source>
|
||||
<target>You have no bookmarks yet, add them in the context menu</target>
|
||||
@@ -3178,15 +3047,6 @@ Section header for zap settings
|
||||
Setting to enable Zap Local Notification
|
||||
Title for section in zap settings that controls general zap preferences.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Zaps are an easy way to support the incredible voices that make up the conversation on nostr. Here's how it works" xml:space="preserve">
|
||||
<source>Zaps are an easy way to support the incredible
|
||||
voices that make up the conversation on nostr.
|
||||
Here's how it works</source>
|
||||
<target>Zaps are an easy way to support the incredible
|
||||
voices that make up the conversation on nostr.
|
||||
Here's how it works</target>
|
||||
<note>Describing the functional benefits of Zaps.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="apple_translation_service" xml:space="preserve">
|
||||
<source>Apple</source>
|
||||
<target>Apple</target>
|
||||
@@ -3941,11 +3801,6 @@ Sentence composed of 2 variables to describe how many zap payments there are on
|
||||
<target state="new">API Key (required)</target>
|
||||
<note>Prompt for required entry of API Key to use translation server.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="AUTOMATIC SETUP" xml:space="preserve">
|
||||
<source>AUTOMATIC SETUP</source>
|
||||
<target state="new">AUTOMATIC SETUP</target>
|
||||
<note>Heading for the section that performs an automatic wallet connection setup.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="About Me" xml:space="preserve">
|
||||
<source>About Me</source>
|
||||
<target state="new">About Me</target>
|
||||
@@ -3966,21 +3821,11 @@ Sentence composed of 2 variables to describe how many zap payments there are on
|
||||
<target state="new">Accessibility</target>
|
||||
<note>Section header for accessibility settings</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account" xml:space="preserve">
|
||||
<source>Account</source>
|
||||
<target state="new">Account</target>
|
||||
<note>Label for the user account information with the Nostr Wallet Connect wallet provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account creation" xml:space="preserve">
|
||||
<source>Account creation</source>
|
||||
<target state="new">Account creation</target>
|
||||
<note>Label for Purple account creation date</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account details" xml:space="preserve">
|
||||
<source>Account details</source>
|
||||
<target state="new">Account details</target>
|
||||
<note>Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Account private key" xml:space="preserve">
|
||||
<source>Account private key</source>
|
||||
<target state="new">Account private key</target>
|
||||
@@ -4128,6 +3973,11 @@ Section header for text and appearance settings</note>
|
||||
<target state="new">Are you sure you want to clear the cache? This will free space, but images may take longer to load again.</target>
|
||||
<note>Message explaining what it means to clear the cache, asking if user wants to proceed.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Are you sure you want to connect this wallet?" xml:space="preserve">
|
||||
<source>Are you sure you want to connect this wallet?</source>
|
||||
<target state="new">Are you sure you want to connect this wallet?</target>
|
||||
<note>Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Are you sure you want to delete all of your bookmarks?" xml:space="preserve">
|
||||
<source>Are you sure you want to delete all of your bookmarks?</source>
|
||||
<target state="new">Are you sure you want to delete all of your bookmarks?</target>
|
||||
@@ -4157,11 +4007,6 @@ Tip: You can always change this later in Settings → Translations</source>
|
||||
Tip: You can always change this later in Settings → Translations</target>
|
||||
<note>Message notifying the user that they get auto-translations as part of their service</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Attach to any third party provider you already use." xml:space="preserve">
|
||||
<source>Attach to any third party provider you already use.</source>
|
||||
<target state="new">Attach to any third party provider you already use.</target>
|
||||
<note>Information text guiding users on attaching existing provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Authenticated" xml:space="preserve">
|
||||
<source>Authenticated</source>
|
||||
<target state="new">Authenticated</target>
|
||||
@@ -4278,11 +4123,6 @@ Text for button to cancel out of connecting Nostr Wallet Connect lightning walle
|
||||
<target state="new">Choose from Library</target>
|
||||
<note>Option to select photo from library</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Choose the third-party payment provider you'd like to use." xml:space="preserve">
|
||||
<source>Choose the third-party payment provider you'd like to use.</source>
|
||||
<target state="new">Choose the third-party payment provider you'd like to use.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Clear All" xml:space="preserve">
|
||||
<source>Clear All</source>
|
||||
<target state="new">Clear All</target>
|
||||
@@ -4499,16 +4339,6 @@ Context menu option for copying the version of damus.</note>
|
||||
<target state="new">Create new mutelist</target>
|
||||
<note>Title of alert prompting the user to create a new mutelist.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Create new wallet" xml:space="preserve">
|
||||
<source>Create new wallet</source>
|
||||
<target state="new">Create new wallet</target>
|
||||
<note>Button text for creating a new wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Current balance" xml:space="preserve">
|
||||
<source>Current balance</source>
|
||||
<target state="new">Current balance</target>
|
||||
<note>Label for displaying current wallet balance</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Custom" xml:space="preserve">
|
||||
<source>Custom</source>
|
||||
<target state="new">Custom</target>
|
||||
@@ -4543,6 +4373,11 @@ Toolbar label for DMs view, where DM is the English abbreviation for Direct Mess
|
||||
<target state="new">Damus Purple environment</target>
|
||||
<note>Prompt selection of the Damus purple environment (Developer feature to switch between real/production mode to test modes).</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Damus Wallet" xml:space="preserve">
|
||||
<source>Damus Wallet</source>
|
||||
<target state="new">Damus Wallet</target>
|
||||
<note>Title text for Damus Wallet view.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Damus logo" xml:space="preserve">
|
||||
<source>Damus logo</source>
|
||||
<target state="new">Damus logo</target>
|
||||
@@ -4644,11 +4479,6 @@ The duration in which to mute the given item.</note>
|
||||
<target state="new">Earn Money</target>
|
||||
<note>Heading indicating that this application allows users to earn money.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Easily create a new wallet and attach it to your account." xml:space="preserve">
|
||||
<source>Easily create a new wallet and attach it to your account.</source>
|
||||
<target state="new">Easily create a new wallet and attach it to your account.</target>
|
||||
<note>Description for the create new wallet feature.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Edit" xml:space="preserve">
|
||||
<source>Edit</source>
|
||||
<target state="new">Edit</target>
|
||||
@@ -4794,11 +4624,6 @@ Title indicating that an error has occurred.</note>
|
||||
<target state="new">Failed to parse</target>
|
||||
<note>NostrScript error message when it fails to parse a script.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Find a Wallet" xml:space="preserve">
|
||||
<source>Find a Wallet</source>
|
||||
<target state="new">Find a Wallet</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="First Aid" xml:space="preserve">
|
||||
<source>First Aid</source>
|
||||
<target state="new">First Aid</target>
|
||||
@@ -4933,21 +4758,6 @@ Button to navigate to translate.nostr.wine to get a translation API key.</note>
|
||||
<target state="new">Get a special badge on your profile to show everyone your contribution to Freedom tech</target>
|
||||
<note>Supporter badge description</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Get cash instantly from your followers" xml:space="preserve">
|
||||
<source>Get cash instantly from your followers</source>
|
||||
<target state="new">Get cash instantly from your followers</target>
|
||||
<note>Feature description for receiving money instantly.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Get paid for being you" xml:space="preserve">
|
||||
<source>Get paid for being you</source>
|
||||
<target state="new">Get paid for being you</target>
|
||||
<note>Description for monetizing one's presence.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Give thanks" xml:space="preserve">
|
||||
<source>Give thanks</source>
|
||||
<target state="new">Give thanks</target>
|
||||
<note>Heading explaining a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Go to the app" xml:space="preserve">
|
||||
<source>Go to the app</source>
|
||||
<target state="new">Go to the app</target>
|
||||
@@ -5113,11 +4923,6 @@ Settings section for managing keys</note>
|
||||
<target state="new">LIVE</target>
|
||||
<note>Text indicator that the video is a livestream.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Latest transactions" xml:space="preserve">
|
||||
<source>Latest transactions</source>
|
||||
<target state="new">Latest transactions</target>
|
||||
<note>Heading for latest wallet transactions list</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Learn more about the features" xml:space="preserve">
|
||||
<source>Learn more about the features</source>
|
||||
<target state="new">Learn more about the features</target>
|
||||
@@ -5128,11 +4933,6 @@ Settings section for managing keys</note>
|
||||
<target state="new">Left Handed</target>
|
||||
<note>Moves the post button to the left side of the screen</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Let your fans show their support" xml:space="preserve">
|
||||
<source>Let your fans show their support</source>
|
||||
<target state="new">Let your fans show their support</target>
|
||||
<note>Heading pointing out a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="LibreTranslate (Open Source)" xml:space="preserve">
|
||||
<source>LibreTranslate (Open Source)</source>
|
||||
<target state="new">LibreTranslate (Open Source)</target>
|
||||
@@ -5158,16 +4958,6 @@ Settings section for managing keys</note>
|
||||
<target state="new">Likes</target>
|
||||
<note>Setting to enable Like Local Notification</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Link to services that support Nostr Wallet Connect like Alby, Coinos and more." xml:space="preserve">
|
||||
<source>Link to services that support Nostr Wallet Connect like Alby, Coinos and more.</source>
|
||||
<target state="new">Link to services that support Nostr Wallet Connect like Alby, Coinos and more.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Link your account" xml:space="preserve">
|
||||
<source>Link your account</source>
|
||||
<target state="new">Link your account</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Load media" xml:space="preserve">
|
||||
<source>Load media</source>
|
||||
<target state="new">Load media</target>
|
||||
@@ -5211,11 +5001,6 @@ Sidebar menu label to sign out of the account.</note>
|
||||
<target state="new">Looking for %@...</target>
|
||||
<note>Label that appears when searching for note or profile</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="MANUAL SETUP" xml:space="preserve">
|
||||
<source>MANUAL SETUP</source>
|
||||
<target state="new">MANUAL SETUP</target>
|
||||
<note>Label for manual wallet setup.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Make Default" xml:space="preserve">
|
||||
<source>Make Default</source>
|
||||
<target state="new">Make Default</target>
|
||||
@@ -5241,11 +5026,6 @@ Sidebar menu label to sign out of the account.</note>
|
||||
<target state="new">Manage subscription</target>
|
||||
<note>Button to take user to manage Damus Purple subscription</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Maybe later" xml:space="preserve">
|
||||
<source>Maybe later</source>
|
||||
<target state="new">Maybe later</target>
|
||||
<note>Text for button to disconnect from Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Media previews" xml:space="preserve">
|
||||
<source>Media previews</source>
|
||||
<target state="new">Media previews</target>
|
||||
@@ -5410,11 +5190,6 @@ User confirm No</note>
|
||||
<target state="new">No results</target>
|
||||
<note>A label indicating that note search resulted in no results</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="No transactions yet" xml:space="preserve">
|
||||
<source>No transactions yet</source>
|
||||
<target state="new">No transactions yet</target>
|
||||
<note>Message shown when no transactions are available</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="No zaps will be sent, only a lightning payment." xml:space="preserve">
|
||||
<source>No zaps will be sent, only a lightning payment.</source>
|
||||
<target state="new">No zaps will be sent, only a lightning payment.</target>
|
||||
@@ -5620,11 +5395,6 @@ Button label to dismiss an error dialog</note>
|
||||
<target state="new">People</target>
|
||||
<note>Label for filter for seeing only people follows.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="People will be able to send you cash from your profile. No money goes to Damus." xml:space="preserve">
|
||||
<source>People will be able to send you cash from your profile. No money goes to Damus.</source>
|
||||
<target state="new">People will be able to send you cash from your profile. No money goes to Damus.</target>
|
||||
<note>The description for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Permanently Delete Account" xml:space="preserve">
|
||||
<source>Permanently Delete Account</source>
|
||||
<target state="new">Permanently Delete Account</target>
|
||||
@@ -5945,11 +5715,6 @@ Setting to enable Repost Local Notification</note>
|
||||
<target state="new">Retry</target>
|
||||
<note>Button to retry completing account creation after an error occurred.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Routing" xml:space="preserve">
|
||||
<source>Routing</source>
|
||||
<target state="new">Routing</target>
|
||||
<note>Label indicating the routing address for Nostr Wallet Connect payments. In other words, the relay used by the NWC wallet provider</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Run" xml:space="preserve">
|
||||
<source>Run</source>
|
||||
<target state="new">Run</target>
|
||||
@@ -5965,11 +5730,6 @@ Setting to enable Repost Local Notification</note>
|
||||
<target state="new">Runtime error</target>
|
||||
<note>Indication that a runtime error occurred when running a NostrScript.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="SATS" xml:space="preserve">
|
||||
<source>SATS</source>
|
||||
<target state="new">SATS</target>
|
||||
<note>Abbreviation for Satoshis, smallest bitcoin unit</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="SOFTWARE" xml:space="preserve">
|
||||
<source>SOFTWARE</source>
|
||||
<target state="new">SOFTWARE</target>
|
||||
@@ -6078,6 +5838,11 @@ Section header for search/universe settings</note>
|
||||
<target state="new">Secret Account Login Key</target>
|
||||
<note>Section title for user's secret account login key.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Securely connect your Damus app to your wallet using Nostr Wallet Connect" xml:space="preserve">
|
||||
<source>Securely connect your Damus app to your wallet using Nostr Wallet Connect</source>
|
||||
<target state="new">Securely connect your Damus app to your wallet using Nostr Wallet Connect</target>
|
||||
<note>Text to prompt user to connect their wallet using 'Nostr Wallet Connect'.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Select a Lightning wallet" xml:space="preserve">
|
||||
<source>Select a Lightning wallet</source>
|
||||
<target state="new">Select a Lightning wallet</target>
|
||||
@@ -6113,27 +5878,11 @@ Section header for search/universe settings</note>
|
||||
<target state="new">Service</target>
|
||||
<note>Prompt selection of translation service provider.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Set up wallet" xml:space="preserve">
|
||||
<source>Set up wallet</source>
|
||||
<target state="new">Set up wallet</target>
|
||||
<note>Text for button to disconnect from Nostr Wallet Connect lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Setting up Zaps lets people know you're ready to start receiving money." xml:space="preserve">
|
||||
<source>Setting up Zaps lets people know you're ready to start receiving money.</source>
|
||||
<target state="new">Setting up Zaps lets people know you're ready to start receiving money.</target>
|
||||
<note>Information about enabling payments.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Settings" xml:space="preserve">
|
||||
<source>Settings</source>
|
||||
<target state="new">Settings</target>
|
||||
<note>Navigation title for Settings view.
|
||||
Sidebar menu label for accessing the app settings</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Setup Wallet" xml:space="preserve">
|
||||
<source>Setup Wallet</source>
|
||||
<target state="new">Setup Wallet</target>
|
||||
<note>Heading for Nostr Wallet Connect setup screen
|
||||
Heading for wallet setup confirmation screen</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Share" xml:space="preserve">
|
||||
<source>Share</source>
|
||||
@@ -6296,11 +6045,6 @@ Section header for Universe/Search spam</note>
|
||||
<target state="new">Staging (for dev builds)</target>
|
||||
<note>Label indicating the staging environment for Push notification functionality</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Start receiving money" xml:space="preserve">
|
||||
<source>Start receiving money</source>
|
||||
<target state="new">Start receiving money</target>
|
||||
<note>The heading for one of the "Why add Zaps?" boxes</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Staying humble..." xml:space="preserve">
|
||||
<source>Staying humble...</source>
|
||||
<target state="new">Staying humble...</target>
|
||||
@@ -6579,11 +6323,6 @@ Example URL to LibreTranslate server</note>
|
||||
<target state="new">Universe 🛸</target>
|
||||
<note>Toolbar label for the universal view where notes from all connected relay servers appear.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Unknown" xml:space="preserve">
|
||||
<source>Unknown</source>
|
||||
<target state="new">Unknown</target>
|
||||
<note>A name label for an unknown user</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Unmute" xml:space="preserve">
|
||||
<source>Unmute</source>
|
||||
<target state="new">Unmute</target>
|
||||
@@ -6614,11 +6353,6 @@ Example URL to LibreTranslate server</note>
|
||||
<target state="new">Upload</target>
|
||||
<note>Button to proceed with uploading.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Use existing" xml:space="preserve">
|
||||
<source>Use existing</source>
|
||||
<target state="new">Use existing</target>
|
||||
<note>Button text to use an existing wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="User Statuses" xml:space="preserve">
|
||||
<source>User Statuses</source>
|
||||
<target state="new">User Statuses</target>
|
||||
@@ -6723,6 +6457,16 @@ Navigation title for attaching Nostr Wallet Connect lightning wallet.
|
||||
Sidebar menu label for Wallet view.
|
||||
Title for section in zap settings that controls the Lightning wallet selection.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Wallet Address" xml:space="preserve">
|
||||
<source>Wallet Address</source>
|
||||
<target state="new">Wallet Address</target>
|
||||
<note>Label text indicating that below it is the wallet address.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Wallet Relay" xml:space="preserve">
|
||||
<source>Wallet Relay</source>
|
||||
<target state="new">Wallet Relay</target>
|
||||
<note>Label text indicating that below it is the information about the wallet relay.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)" xml:space="preserve">
|
||||
<source>We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)</source>
|
||||
<target state="new">We did not detect any issues that we can automatically fix for you. If you are having issues, please contact Damus support: [support@damus.io](mailto:support@damus.io)</target>
|
||||
@@ -6783,21 +6527,11 @@ Title for section in zap settings that controls the Lightning wallet selection.<
|
||||
<target state="new">What do you want to report?</target>
|
||||
<note>Header text to prompt user what issue they want to report.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude." xml:space="preserve">
|
||||
<source>When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude.</source>
|
||||
<target state="new">When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude.</target>
|
||||
<note>Description explaining a benefit of connecting a lightning wallet.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Who to Follow" xml:space="preserve">
|
||||
<source>Who to Follow</source>
|
||||
<target state="new">Who to Follow</target>
|
||||
<note>Title for a screen displaying suggestions of who to follow</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Why add Zaps?" xml:space="preserve">
|
||||
<source>Why add Zaps?</source>
|
||||
<target state="new">Why add Zaps?</target>
|
||||
<note>Heading to explain the benefits of zaps.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Words" xml:space="preserve">
|
||||
<source>Words</source>
|
||||
<target state="new">Words</target>
|
||||
@@ -6829,11 +6563,6 @@ User confirm Yes</note>
|
||||
<target state="new">You clicked on a Purple welcome link, but we could not find your checkout. This is likely a bug.</target>
|
||||
<note>Error label upon continuing in the app from a Damus Purple purchase</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes." xml:space="preserve">
|
||||
<source>You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes.</source>
|
||||
<target state="new">You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes.</target>
|
||||
<note>Text explaining the benefit of connecting a lightning wallet for content creators.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="You have no bookmarks yet, add them in the context menu" xml:space="preserve">
|
||||
<source>You have no bookmarks yet, add them in the context menu</source>
|
||||
<target state="new">You have no bookmarks yet, add them in the context menu</target>
|
||||
@@ -6948,15 +6677,6 @@ Section header for zap settings
|
||||
Setting to enable Zap Local Notification
|
||||
Title for section in zap settings that controls general zap preferences.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="Zaps are an easy way to support the incredible voices that make up the conversation on nostr. Here's how it works" xml:space="preserve">
|
||||
<source>Zaps are an easy way to support the incredible
|
||||
voices that make up the conversation on nostr.
|
||||
Here's how it works</source>
|
||||
<target state="new">Zaps are an easy way to support the incredible
|
||||
voices that make up the conversation on nostr.
|
||||
Here's how it works</target>
|
||||
<note>Describing the functional benefits of Zaps.</note>
|
||||
</trans-unit>
|
||||
<trans-unit id="apple_translation_service" xml:space="preserve">
|
||||
<source>Apple</source>
|
||||
<target state="new">Apple</target>
|
||||
|
||||
@@ -105,15 +105,9 @@
|
||||
"Accessibility" : {
|
||||
"comment" : "Section header for accessibility settings"
|
||||
},
|
||||
"Account" : {
|
||||
"comment" : "Label for the user account information with the Nostr Wallet Connect wallet provider."
|
||||
},
|
||||
"Account creation" : {
|
||||
"comment" : "Label for Purple account creation date"
|
||||
},
|
||||
"Account details" : {
|
||||
"comment" : "Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet."
|
||||
},
|
||||
"Account private key" : {
|
||||
"comment" : "Accessibility label for the private key input field"
|
||||
},
|
||||
@@ -219,6 +213,9 @@
|
||||
"Are you sure you want to clear the cache? This will free space, but images may take longer to load again." : {
|
||||
"comment" : "Message explaining what it means to clear the cache, asking if user wants to proceed."
|
||||
},
|
||||
"Are you sure you want to connect this wallet?" : {
|
||||
"comment" : "Prompt to ask user if they want to attach their Nostr Wallet Connect lightning wallet."
|
||||
},
|
||||
"Are you sure you want to delete all of your bookmarks?" : {
|
||||
"comment" : "Alert for deleting all of the bookmarks."
|
||||
},
|
||||
@@ -234,15 +231,9 @@
|
||||
"As part of your Damus Purple membership, you get complimentary and automated translations. Would you like to enable Damus Purple translations?\n\nTip: You can always change this later in Settings → Translations" : {
|
||||
"comment" : "Message notifying the user that they get auto-translations as part of their service"
|
||||
},
|
||||
"Attach to any third party provider you already use." : {
|
||||
"comment" : "Information text guiding users on attaching existing provider."
|
||||
},
|
||||
"Authenticated" : {
|
||||
"comment" : "Label to display that authentication to a server has succeeded."
|
||||
},
|
||||
"AUTOMATIC SETUP" : {
|
||||
"comment" : "Heading for the section that performs an automatic wallet connection setup."
|
||||
},
|
||||
"Automatic translations" : {
|
||||
"comment" : "Part 1 of 2 in message 'You unlocked automatic translations' the user gets when they sign up for Damus Purple"
|
||||
},
|
||||
@@ -297,9 +288,6 @@
|
||||
"Choose from Library" : {
|
||||
"comment" : "Option to select photo from library"
|
||||
},
|
||||
"Choose the third-party payment provider you'd like to use." : {
|
||||
"comment" : "The description for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"Clear All" : {
|
||||
"comment" : "Button for clearing bookmarks data."
|
||||
},
|
||||
@@ -426,12 +414,6 @@
|
||||
"Create new mutelist" : {
|
||||
"comment" : "Title of alert prompting the user to create a new mutelist."
|
||||
},
|
||||
"Create new wallet" : {
|
||||
"comment" : "Button text for creating a new wallet."
|
||||
},
|
||||
"Current balance" : {
|
||||
"comment" : "Label for displaying current wallet balance"
|
||||
},
|
||||
"Custom" : {
|
||||
"comment" : "Dropdown option for selecting a custom translation server."
|
||||
},
|
||||
@@ -450,6 +432,9 @@
|
||||
"Damus Purple environment" : {
|
||||
"comment" : "Prompt selection of the Damus purple environment (Developer feature to switch between real/production mode to test modes)."
|
||||
},
|
||||
"Damus Wallet" : {
|
||||
"comment" : "Title text for Damus Wallet view."
|
||||
},
|
||||
"DeepL (Proprietary, Higher Accuracy)" : {
|
||||
"comment" : "Dropdown option for selecting DeepL as the translation service."
|
||||
},
|
||||
@@ -504,9 +489,6 @@
|
||||
"Earn Money" : {
|
||||
"comment" : "Heading indicating that this application allows users to earn money."
|
||||
},
|
||||
"Easily create a new wallet and attach it to your account." : {
|
||||
"comment" : "Description for the create new wallet feature."
|
||||
},
|
||||
"Edit" : {
|
||||
"comment" : "Button to edit user's profile.\nButton to enter edit mode for modifying the list of relays.\nEdit Button for editing profile"
|
||||
},
|
||||
@@ -594,9 +576,6 @@
|
||||
"Failed to parse" : {
|
||||
"comment" : "NostrScript error message when it fails to parse a script."
|
||||
},
|
||||
"Find a Wallet" : {
|
||||
"comment" : "The heading for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"First Aid" : {
|
||||
"comment" : "Navigation title for first aid settings and tools\nSection header for first aid tools and settings"
|
||||
},
|
||||
@@ -688,15 +667,6 @@
|
||||
"Get API Key with BTC/Lightning" : {
|
||||
"comment" : "Button to navigate to nokyctranslate website to get a translation API key.\nButton to navigate to translate.nostr.wine to get a translation API key."
|
||||
},
|
||||
"Get cash instantly from your followers" : {
|
||||
"comment" : "Feature description for receiving money instantly."
|
||||
},
|
||||
"Get paid for being you" : {
|
||||
"comment" : "Description for monetizing one's presence."
|
||||
},
|
||||
"Give thanks" : {
|
||||
"comment" : "Heading explaining a benefit of connecting a lightning wallet."
|
||||
},
|
||||
"Go to the app" : {
|
||||
"comment" : "Button label giving the user the option to go to the app after sharing content"
|
||||
},
|
||||
@@ -790,18 +760,12 @@
|
||||
"Keys" : {
|
||||
"comment" : "Navigation title for managing keys.\nSettings section for managing keys"
|
||||
},
|
||||
"Latest transactions" : {
|
||||
"comment" : "Heading for latest wallet transactions list"
|
||||
},
|
||||
"Learn more about the features" : {
|
||||
"comment" : "Label for a link to the Damus website, to allow the user to learn more about the features of Purple"
|
||||
},
|
||||
"Left Handed" : {
|
||||
"comment" : "Moves the post button to the left side of the screen"
|
||||
},
|
||||
"Let your fans show their support" : {
|
||||
"comment" : "Heading pointing out a benefit of connecting a lightning wallet."
|
||||
},
|
||||
"LibreTranslate (Open Source)" : {
|
||||
"comment" : "Dropdown option for selecting LibreTranslate as the translation service."
|
||||
},
|
||||
@@ -817,12 +781,6 @@
|
||||
"Likes" : {
|
||||
"comment" : "Setting to enable Like Local Notification"
|
||||
},
|
||||
"Link to services that support Nostr Wallet Connect like Alby, Coinos and more." : {
|
||||
"comment" : "The description for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"Link your account" : {
|
||||
"comment" : "The heading for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"LIVE" : {
|
||||
"comment" : "Text indicator that the video is a livestream."
|
||||
},
|
||||
@@ -865,12 +823,6 @@
|
||||
"Manage subscription" : {
|
||||
"comment" : "Button to take user to manage Damus Purple subscription"
|
||||
},
|
||||
"MANUAL SETUP" : {
|
||||
"comment" : "Label for manual wallet setup."
|
||||
},
|
||||
"Maybe later" : {
|
||||
"comment" : "Text for button to disconnect from Nostr Wallet Connect lightning wallet."
|
||||
},
|
||||
"Media previews" : {
|
||||
"comment" : "Setting to show media"
|
||||
},
|
||||
@@ -964,9 +916,6 @@
|
||||
"No results" : {
|
||||
"comment" : "A label indicating that note search resulted in no results"
|
||||
},
|
||||
"No transactions yet" : {
|
||||
"comment" : "Message shown when no transactions are available"
|
||||
},
|
||||
"No zaps will be sent, only a lightning payment." : {
|
||||
"comment" : "Description of non-zap type where sats are sent to the user's wallet as a regular Lightning payment, not as a zap."
|
||||
},
|
||||
@@ -1114,9 +1063,6 @@
|
||||
"People" : {
|
||||
"comment" : "Label for filter for seeing only people follows."
|
||||
},
|
||||
"People will be able to send you cash from your profile. No money goes to Damus." : {
|
||||
"comment" : "The description for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"Permanently Delete Account" : {
|
||||
"comment" : "Alert for deleting the users account.\nSection title for deleting the user"
|
||||
},
|
||||
@@ -1323,9 +1269,6 @@
|
||||
"Retry" : {
|
||||
"comment" : "Button to retry completing account creation after an error occurred."
|
||||
},
|
||||
"Routing" : {
|
||||
"comment" : "Label indicating the routing address for Nostr Wallet Connect payments. In other words, the relay used by the NWC wallet provider"
|
||||
},
|
||||
"Run" : {
|
||||
"comment" : "Button that runs a NostrScript."
|
||||
},
|
||||
@@ -1338,9 +1281,6 @@
|
||||
"Satoshi Nakamoto" : {
|
||||
"comment" : "Name of Bitcoin creator(s)."
|
||||
},
|
||||
"SATS" : {
|
||||
"comment" : "Abbreviation for Satoshis, smallest bitcoin unit"
|
||||
},
|
||||
"Save" : {
|
||||
"comment" : "Button for saving profile.\nButton to save key, complete account creation, and start using the app."
|
||||
},
|
||||
@@ -1398,6 +1338,9 @@
|
||||
"Secret Account Login Key" : {
|
||||
"comment" : "Section title for user's secret account login key."
|
||||
},
|
||||
"Securely connect your Damus app to your wallet using Nostr Wallet Connect" : {
|
||||
"comment" : "Text to prompt user to connect their wallet using 'Nostr Wallet Connect'."
|
||||
},
|
||||
"Select a Lightning wallet" : {
|
||||
"comment" : "Title of section for selecting a Lightning wallet to pay a Lightning invoice."
|
||||
},
|
||||
@@ -1422,18 +1365,9 @@
|
||||
"Service" : {
|
||||
"comment" : "Prompt selection of translation service provider."
|
||||
},
|
||||
"Set up wallet" : {
|
||||
"comment" : "Text for button to disconnect from Nostr Wallet Connect lightning wallet."
|
||||
},
|
||||
"Setting up Zaps lets people know you're ready to start receiving money." : {
|
||||
"comment" : "Information about enabling payments."
|
||||
},
|
||||
"Settings" : {
|
||||
"comment" : "Navigation title for Settings view.\nSidebar menu label for accessing the app settings"
|
||||
},
|
||||
"Setup Wallet" : {
|
||||
"comment" : "Heading for Nostr Wallet Connect setup screen\nHeading for wallet setup confirmation screen"
|
||||
},
|
||||
"Share" : {
|
||||
"comment" : "Button to share a note\nButton to share an image.\nButton to share the link to a profile.\nSave button text for saving profile status settings."
|
||||
},
|
||||
@@ -1530,9 +1464,6 @@
|
||||
"Staging (for dev builds)" : {
|
||||
"comment" : "Label indicating the staging environment for Push notification functionality"
|
||||
},
|
||||
"Start receiving money" : {
|
||||
"comment" : "The heading for one of the \"Why add Zaps?\" boxes"
|
||||
},
|
||||
"Staying humble..." : {
|
||||
"comment" : "Placeholder as an example of what the user could set as their profile status."
|
||||
},
|
||||
@@ -1689,9 +1620,6 @@
|
||||
"Universe 🛸" : {
|
||||
"comment" : "Toolbar label for the universal view where notes from all connected relay servers appear."
|
||||
},
|
||||
"Unknown" : {
|
||||
"comment" : "A name label for an unknown user"
|
||||
},
|
||||
"Unmute" : {
|
||||
"comment" : "Button to unmute a profile."
|
||||
},
|
||||
@@ -1713,9 +1641,6 @@
|
||||
"URL" : {
|
||||
"comment" : "Custom URL host for Damus Purple testing\nCustom URL host for Damus push notification testing\nExample URL to LibreTranslate server"
|
||||
},
|
||||
"Use existing" : {
|
||||
"comment" : "Button text to use an existing wallet."
|
||||
},
|
||||
"User has been muted" : {
|
||||
"comment" : "Alert message that informs a user was muted."
|
||||
},
|
||||
@@ -1761,6 +1686,12 @@
|
||||
"Wallet" : {
|
||||
"comment" : "Navigation title for Wallet view\nNavigation title for attaching Nostr Wallet Connect lightning wallet.\nSidebar menu label for Wallet view.\nTitle for section in zap settings that controls the Lightning wallet selection."
|
||||
},
|
||||
"Wallet Address" : {
|
||||
"comment" : "Label text indicating that below it is the wallet address."
|
||||
},
|
||||
"Wallet Relay" : {
|
||||
"comment" : "Label text indicating that below it is the information about the wallet relay."
|
||||
},
|
||||
"WARNING:\n\nThis will reset your contact list, including the list of everyone you follow and the list of all relays you usually connect to. ONLY PROCEED IF YOU ARE SURE YOU HAVE LOST YOUR CONTACT LIST BEYOND RECOVERABILITY." : {
|
||||
"comment" : "Alert for resetting the user's contact list."
|
||||
},
|
||||
@@ -1803,15 +1734,9 @@
|
||||
"What do you want to report?" : {
|
||||
"comment" : "Header text to prompt user what issue they want to report."
|
||||
},
|
||||
"When supporters tip with Zaps, they can add a note and we can make it easy for you to instantly reply to show your gratitude." : {
|
||||
"comment" : "Description explaining a benefit of connecting a lightning wallet."
|
||||
},
|
||||
"Who to Follow" : {
|
||||
"comment" : "Title for a screen displaying suggestions of who to follow"
|
||||
},
|
||||
"Why add Zaps?" : {
|
||||
"comment" : "Heading to explain the benefits of zaps."
|
||||
},
|
||||
"Words" : {
|
||||
"comment" : "Section header title for a list of words that are muted."
|
||||
},
|
||||
@@ -1836,9 +1761,6 @@
|
||||
"You clicked on a Purple welcome link, but we could not find your checkout. This is likely a bug." : {
|
||||
"comment" : "Error label upon continuing in the app from a Damus Purple purchase"
|
||||
},
|
||||
"You drive the conversation and we want to make it easier for people to support your work beyond follows, reposts, and likes." : {
|
||||
"comment" : "Text explaining the benefit of connecting a lightning wallet for content creators."
|
||||
},
|
||||
"You have no bookmarks yet, add them in the context menu" : {
|
||||
"comment" : "Text indicating that there are no bookmarks to be viewed"
|
||||
},
|
||||
@@ -1901,9 +1823,6 @@
|
||||
},
|
||||
"Zaps" : {
|
||||
"comment" : "Label for filter for zap notifications.\nNavigation bar title for the Zaps view.\nNavigation title for zap settings.\nSection header for zap settings\nSetting to enable Zap Local Notification\nTitle for section in zap settings that controls general zap preferences."
|
||||
},
|
||||
"Zaps are an easy way to support the incredible\nvoices that make up the conversation on nostr.\nHere's how it works" : {
|
||||
"comment" : "Describing the functional benefits of Zaps."
|
||||
}
|
||||
},
|
||||
"version" : "1.0"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -66,22 +66,6 @@
|
||||
<string>Importok</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>people_reposted_count</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
<string>%#@REPOSTED@</string>
|
||||
<key>REPOSTED</key>
|
||||
<dict>
|
||||
<key>NSStringFormatSpecTypeKey</key>
|
||||
<string>NSStringPluralRuleType</string>
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ és %1$d egyéb újraosztva</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ és %1$d egyebek újraosztva</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>reacted_tagged_in_3</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -82,26 +82,6 @@
|
||||
<string>Importa</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>people_reposted_count</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
<string>%#@REPOSTED@</string>
|
||||
<key>REPOSTED</key>
|
||||
<dict>
|
||||
<key>NSStringFormatSpecTypeKey</key>
|
||||
<string>NSStringPluralRuleType</string>
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ i %1$d inna osoba podała dalej</string>
|
||||
<key>few</key>
|
||||
<string>%2$@ i %1$d inne osoby podały dalej</string>
|
||||
<key>many</key>
|
||||
<string>%2$@ i %1$d innych osób podało dalej</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ i %1$d innej osoby podało dalej</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>reacted_tagged_in_3</key>
|
||||
<dict>
|
||||
<key>NSStringLocalizedFormatKey</key>
|
||||
@@ -233,13 +213,13 @@
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ i %1$d inna osoba podała dalej notatkę, w której cię oznaczono</string>
|
||||
<string>%2$@ i %1$d inna osoba opublikowała notatkę, w której Cię oznaczono</string>
|
||||
<key>few</key>
|
||||
<string>%2$@ i %1$d inne osoby podały dalej notatkę, w której cię oznaczono</string>
|
||||
<string>%2$@ i %1$d inne osoby opublikowały notatkę, w której Cię oznaczono</string>
|
||||
<key>many</key>
|
||||
<string>%2$@ i %1$d innych osób podało dalej notatkę, w której cię oznaczono</string>
|
||||
<string>%2$@ i %1$d innych osób opublikowało notatkę, w której Cię oznaczono</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ i %1$d innej osoby podało dalej notatkę, w której cię oznaczono</string>
|
||||
<string>%2$@ i %1$d innej osoby opublikowało wiadomość, w której jesteś oznaczony</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>reposted_your_note_3</key>
|
||||
@@ -253,13 +233,13 @@
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ i %1$d inna osoba podała dalej twoją notatkę</string>
|
||||
<string>%2$@ i %1$d inna osoba opublikowała twoją notatkę</string>
|
||||
<key>few</key>
|
||||
<string>%2$@ i %1$d inne osoby podały dalej twoją notatkę</string>
|
||||
<string>%2$@ i %1$d inne osoby opublikowały twoją notatkę</string>
|
||||
<key>many</key>
|
||||
<string>%2$@ i %1$d innych osób podało dalej twoją notatkę</string>
|
||||
<string>%2$@ i %1$d innych osób opublikowały twoją notatkę</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ i %1$d innej osoby podało dalej twoją notatkę</string>
|
||||
<string>%2$@ i %1$d innej osoby opublikowało twoją notatkę</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>reposted_your_profile_3</key>
|
||||
@@ -273,13 +253,13 @@
|
||||
<key>NSStringFormatValueTypeKey</key>
|
||||
<string>d</string>
|
||||
<key>one</key>
|
||||
<string>%2$@ i %1$d inna osoba podała dalej twój profil</string>
|
||||
<string>%2$@ i %1$d inna osoba opublikowała twój profil</string>
|
||||
<key>few</key>
|
||||
<string>%2$@ i %1$d inne osoby podały dalej twój profil</string>
|
||||
<string>%2$@ i %1$d inne osoby opublikowały twój profil</string>
|
||||
<key>many</key>
|
||||
<string>%2$@ i %1$d innych osób podało dalej twój profil</string>
|
||||
<string>%2$@ i %1$d innych osób opublikowało twój profil</string>
|
||||
<key>other</key>
|
||||
<string>%2$@ i %1$d innych osoby podało dalej twój profil</string>
|
||||
<string>%2$@ i %1$d innych osób opublikowało twój profil</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>reposts_count</key>
|
||||
@@ -299,7 +279,7 @@
|
||||
<key>many</key>
|
||||
<string>Podanych dalej</string>
|
||||
<key>other</key>
|
||||
<string>Podane dalej</string>
|
||||
<string>Podanych dalej</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>quoted_reposts_count</key>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -170,12 +170,6 @@ final class PostViewTests: XCTestCase {
|
||||
|
||||
nonAlphaNumerics.forEach { testAddingStringAfterLink(str: $0)}
|
||||
}
|
||||
|
||||
func testQuoteRepost() {
|
||||
let post = build_post(state: test_damus_state, post: .init(), action: .quoting(test_note), uploadedMedias: [], pubkeys: [])
|
||||
|
||||
XCTAssertEqual(post.tags, [["q", test_note.id.hex()]])
|
||||
}
|
||||
}
|
||||
|
||||
func checkMentionLinkEditorHandling(
|
||||
|
||||
@@ -87,7 +87,7 @@ final class WalletConnectTests: XCTestCase {
|
||||
let pool = RelayPool(ndb: .empty)
|
||||
let box = PostBox(pool: pool)
|
||||
|
||||
WalletConnect.pay(url: nwc, pool: pool, post: box, invoice: "invoice")
|
||||
nwc_pay(url: nwc, pool: pool, post: box, invoice: "invoice")
|
||||
|
||||
XCTAssertEqual(pool.our_descriptors.count, 0)
|
||||
XCTAssertEqual(pool.all_descriptors.count, 1)
|
||||
|
||||
Reference in New Issue
Block a user