Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof-of-Concept: BLIP 42 #645

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
object Versions {
const val lightningKmp = "1.8.4"
const val lightningKmp = "1.8.5-SNAPSHOT"
const val secp256k1 = "0.14.0"
const val torMobile = "0.2.0"

const val kotlin = "1.9.22"

Expand Down
22 changes: 18 additions & 4 deletions phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
DC18C418256FE22300A2D083 /* Prefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC18C417256FE22300A2D083 /* Prefs.swift */; };
DC18C41D256FF91100A2D083 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC18C41C256FF91100A2D083 /* Utils.swift */; };
DC1916B029CB6C1D00917F06 /* Text_CurrencyName.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1916AF29CB6C1D00917F06 /* Text_CurrencyName.swift */; };
DC1B71C52CCBE31900914D80 /* AddToContactsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1B71C42CCBE31900914D80 /* AddToContactsInfo.swift */; };
DC1B71C62CCBE9A400914D80 /* AddToContactsInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1B71C42CCBE31900914D80 /* AddToContactsInfo.swift */; };
DC1D2B4B2593EB860036AD38 /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1D2B4A2593EB850036AD38 /* Currency.swift */; };
DC1D2B502594CE900036AD38 /* FormattedAmount.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1D2B4F2594CE900036AD38 /* FormattedAmount.swift */; };
DC1E75722B73DD500026F36E /* LogFileParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC1E75712B73DD500026F36E /* LogFileParser.swift */; };
Expand Down Expand Up @@ -185,7 +187,6 @@
DC6F04232C35EB9900627B4F /* SummaryInfoGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F04222C35EB9900627B4F /* SummaryInfoGrid.swift */; };
DC6F04252C38807300627B4F /* PhotosManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F04242C38807300627B4F /* PhotosManager.swift */; };
DC6F04272C3895E300627B4F /* ContactPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F04262C3895E300627B4F /* ContactPhoto.swift */; };
DC6F042B2C3DA7AD00627B4F /* ContactsListSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F042A2C3DA7AD00627B4F /* ContactsListSheet.swift */; };
DC6F19BF2C46FB0F004EC469 /* NSItemProvider+Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F19BE2C46FB0F004EC469 /* NSItemProvider+Async.swift */; };
DC6F19C12C470F70004EC469 /* PickerResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC6F19C02C470F70004EC469 /* PickerResult.swift */; };
DC70A99C2BBB6093002DBFF8 /* InboundFeeWarning.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC70A99B2BBB6093002DBFF8 /* InboundFeeWarning.swift */; };
Expand All @@ -212,6 +213,8 @@
DC949E6A2B45B1EC00E80BB5 /* LiquidityAdsHelp.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC949E692B45B1EC00E80BB5 /* LiquidityAdsHelp.swift */; };
DC98D3962AF170AC005BD177 /* PaymentWarningPopover.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC98D3952AF170AC005BD177 /* PaymentWarningPopover.swift */; };
DC98D3982AF2AE41005BD177 /* ReceiveView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC98D3972AF2AE41005BD177 /* ReceiveView.swift */; };
DC9933322CC03D7500EB3100 /* ContactsListSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9933312CC03D7500EB3100 /* ContactsListSheet.swift */; };
DC9933342CC0426300EB3100 /* AddContactOptionsSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC9933332CC0426300EB3100 /* AddContactOptionsSheet.swift */; };
DC99E90925B78FA800FB20F7 /* EnabledSecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99E90825B78FA800FB20F7 /* EnabledSecurity.swift */; };
DC99E94025BA141000FB20F7 /* LocalWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC99E93F25BA141000FB20F7 /* LocalWebView.swift */; };
DC99E94D25BA258C00FB20F7 /* about.html in Resources */ = {isa = PBXBuildFile; fileRef = DC99E94825BA258C00FB20F7 /* about.html */; };
Expand Down Expand Up @@ -284,6 +287,7 @@
DCC3E57F2D08A63900CCDA40 /* XPC+Foreground.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC3E57E2D08A63500CCDA40 /* XPC+Foreground.swift */; };
DCC3E5822D08A65400CCDA40 /* XPC+Background.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC3E5812D08A65000CCDA40 /* XPC+Background.swift */; };
DCC46F1625C3521C005D32D9 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = DC72C31825A3CF87008A927A /* FirebaseMessaging */; };
DCC753E32CB98221006F646B /* String+Email.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC753E22CB98221006F646B /* String+Email.swift */; };
DCC9D99A267BD28600EA36DD /* SyncBackupManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC9D999267BD28600EA36DD /* SyncBackupManager.swift */; };
DCC9D99C267BEB3D00EA36DD /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCC9D99B267BEB3D00EA36DD /* CloudKit.framework */; };
DCCC7FD526B0A006008ACD9B /* SquareSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCC7FD426B0A006008ACD9B /* SquareSize.swift */; };
Expand Down Expand Up @@ -481,6 +485,7 @@
DC18C417256FE22300A2D083 /* Prefs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Prefs.swift; sourceTree = "<group>"; };
DC18C41C256FF91100A2D083 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
DC1916AF29CB6C1D00917F06 /* Text_CurrencyName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Text_CurrencyName.swift; sourceTree = "<group>"; };
DC1B71C42CCBE31900914D80 /* AddToContactsInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddToContactsInfo.swift; sourceTree = "<group>"; };
DC1D2B4A2593EB850036AD38 /* Currency.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Currency.swift; sourceTree = "<group>"; };
DC1D2B4F2594CE900036AD38 /* FormattedAmount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormattedAmount.swift; sourceTree = "<group>"; };
DC1E75712B73DD500026F36E /* LogFileParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogFileParser.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -592,7 +597,6 @@
DC6F04222C35EB9900627B4F /* SummaryInfoGrid.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SummaryInfoGrid.swift; sourceTree = "<group>"; };
DC6F04242C38807300627B4F /* PhotosManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotosManager.swift; sourceTree = "<group>"; };
DC6F04262C3895E300627B4F /* ContactPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactPhoto.swift; sourceTree = "<group>"; };
DC6F042A2C3DA7AD00627B4F /* ContactsListSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsListSheet.swift; sourceTree = "<group>"; };
DC6F19BE2C46FB0F004EC469 /* NSItemProvider+Async.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSItemProvider+Async.swift"; sourceTree = "<group>"; };
DC6F19C02C470F70004EC469 /* PickerResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerResult.swift; sourceTree = "<group>"; };
DC70A99B2BBB6093002DBFF8 /* InboundFeeWarning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboundFeeWarning.swift; sourceTree = "<group>"; };
Expand All @@ -619,6 +623,8 @@
DC949E692B45B1EC00E80BB5 /* LiquidityAdsHelp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiquidityAdsHelp.swift; sourceTree = "<group>"; };
DC98D3952AF170AC005BD177 /* PaymentWarningPopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentWarningPopover.swift; sourceTree = "<group>"; };
DC98D3972AF2AE41005BD177 /* ReceiveView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiveView.swift; sourceTree = "<group>"; };
DC9933312CC03D7500EB3100 /* ContactsListSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsListSheet.swift; sourceTree = "<group>"; };
DC9933332CC0426300EB3100 /* AddContactOptionsSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddContactOptionsSheet.swift; sourceTree = "<group>"; };
DC99E90825B78FA800FB20F7 /* EnabledSecurity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnabledSecurity.swift; sourceTree = "<group>"; };
DC99E93F25BA141000FB20F7 /* LocalWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebView.swift; sourceTree = "<group>"; };
DC99E94925BA258C00FB20F7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = Base.lproj/about.html; sourceTree = "<group>"; };
Expand Down Expand Up @@ -682,6 +688,7 @@
DCBDB8822BE154840097F940 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = de; path = de.lproj/liquidity.html; sourceTree = "<group>"; };
DCC3E57E2D08A63500CCDA40 /* XPC+Foreground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XPC+Foreground.swift"; sourceTree = "<group>"; };
DCC3E5812D08A65000CCDA40 /* XPC+Background.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XPC+Background.swift"; sourceTree = "<group>"; };
DCC753E22CB98221006F646B /* String+Email.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Email.swift"; sourceTree = "<group>"; };
DCC9D999267BD28600EA36DD /* SyncBackupManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncBackupManager.swift; sourceTree = "<group>"; };
DCC9D99B267BEB3D00EA36DD /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; };
DCCC7FD426B0A006008ACD9B /* SquareSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SquareSize.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1050,10 +1057,12 @@
DC3345CE2C2B4BED00EDD2D4 /* contacts */ = {
isa = PBXGroup;
children = (
DC1B71C42CCBE31900914D80 /* AddToContactsInfo.swift */,
DC3345CF2C2B4C1200EDD2D4 /* ManageContact.swift */,
DC5567442C2F1A6900008E11 /* ContactsList.swift */,
DC6F042A2C3DA7AD00627B4F /* ContactsListSheet.swift */,
DC9933312CC03D7500EB3100 /* ContactsListSheet.swift */,
DC6F04262C3895E300627B4F /* ContactPhoto.swift */,
DC9933332CC0426300EB3100 /* AddContactOptionsSheet.swift */,
);
path = contacts;
sourceTree = "<group>";
Expand Down Expand Up @@ -1341,6 +1350,7 @@
DC422F3429392B0500E72253 /* Int+ToDate.swift */,
DCB493CA269F3B05001B0F09 /* Result+Deugly.swift */,
DC59377027516296003B4B53 /* Sequence+Sum.swift */,
DCC753E22CB98221006F646B /* String+Email.swift */,
DC4CF3CB2BE93311003A957F /* String+PIN.swift */,
DC7DA9F52AD84DF200F86B99 /* String+Substring.swift */,
DC09085725B5E43900A46136 /* String+VersionComparison.swift */,
Expand Down Expand Up @@ -1832,6 +1842,7 @@
DCACF6FE2566D0BA0009B01E /* GenericPasswordConvertible.swift in Sources */,
DC949E6A2B45B1EC00E80BB5 /* LiquidityAdsHelp.swift in Sources */,
DC33369826BAF721000E3F49 /* ShortSheet.swift in Sources */,
DC1B71C52CCBE31900914D80 /* AddToContactsInfo.swift in Sources */,
DC3780412C077E0300937C8E /* PriorityBoxStyle.swift in Sources */,
DC3FDCAF2C3306AB002C5931 /* LightningDualView.swift in Sources */,
DC99E90925B78FA800FB20F7 /* EnabledSecurity.swift in Sources */,
Expand All @@ -1842,6 +1853,7 @@
DC6F19BF2C46FB0F004EC469 /* NSItemProvider+Async.swift in Sources */,
DCCFE6C22B7140FA002FFF11 /* LoggerFactory+Foreground.swift in Sources */,
7555FF7F242A565900829871 /* AppDelegate.swift in Sources */,
DC9933342CC0426300EB3100 /* AddContactOptionsSheet.swift in Sources */,
DC74174B270F332700F7E3E3 /* KotlinTypes.swift in Sources */,
DC142135261E72320075857A /* AboutHTML.swift in Sources */,
DC33C5632A7C15D40053D785 /* MainView_BigPrimary.swift in Sources */,
Expand Down Expand Up @@ -2000,7 +2012,6 @@
DCB30E592A0C3F8200E7D7A2 /* LiquidityPolicyView.swift in Sources */,
DCEAE5B72943CC7400320C46 /* RangeSheet.swift in Sources */,
DCAC5B7027726FC80077BB98 /* DeepLink.swift in Sources */,
DC6F042B2C3DA7AD00627B4F /* ContactsListSheet.swift in Sources */,
DC9473FA261270B4008D7242 /* MVI+Mock.swift in Sources */,
DCDD9ECE28637474001800A3 /* Orientation.swift in Sources */,
DCCFE6B02B64326F002FFF11 /* OSLogHandler.swift in Sources */,
Expand Down Expand Up @@ -2049,6 +2060,7 @@
DC5CA4ED28F83C3B0048A737 /* DrainWalletView.swift in Sources */,
DC5E288E2C62C3DF0037B3D3 /* NavigationStackDestination.swift in Sources */,
DC784A112B31EA180018DC4A /* LiquidityAdsView.swift in Sources */,
DC9933322CC03D7500EB3100 /* ContactsListSheet.swift in Sources */,
DC6D26E329E76557006A7814 /* AnimatedClock.swift in Sources */,
DC72CEF52C99DCEB00C810A8 /* LnurlFlowErrorNotice.swift in Sources */,
DC5631C52C541E5C00DCB5BF /* Experimental.swift in Sources */,
Expand All @@ -2062,6 +2074,7 @@
DC3780392C04D60400937C8E /* KotlinEnums.swift in Sources */,
DCBA60CD2C909C7600878895 /* SendView.swift in Sources */,
DC5E28CA2C62D37A0037B3D3 /* NavigationCoordinator.swift in Sources */,
DCC753E32CB98221006F646B /* String+Email.swift in Sources */,
DCACF7092566D0F00009B01E /* AppAccessView.swift in Sources */,
DC27E4D1279753EC00C777CC /* TextFieldNumberStyler.swift in Sources */,
DC46CB1628D9F30500C4EAC7 /* LoadingView.swift in Sources */,
Expand Down Expand Up @@ -2156,6 +2169,7 @@
DC641C78282171EA00862DCD /* KotlinAssociatedObject.swift in Sources */,
DC5631C82C59466000DCB5BF /* KotlinExtensions+Manager.swift in Sources */,
DCCFE6B32B680DF5002FFF11 /* LoggerFactory.swift in Sources */,
DC1B71C62CCBE9A400914D80 /* AddToContactsInfo.swift in Sources */,
DCA6DECA2829C31B0073C658 /* KeyStoreError.swift in Sources */,
DC49FE9D2AC49E0800D8D2E2 /* KotlinExtensions+Bitcoin.swift in Sources */,
DC422F3629392C0000E72253 /* Int+ToDate.swift in Sources */,
Expand Down
2 changes: 0 additions & 2 deletions phoenix-ios/phoenix-ios/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ fileprivate var log = LoggerFactory.shared.logger(filename, .trace)
fileprivate var log = LoggerFactory.shared.logger(filename, .warning)
#endif

let CONTACTS_ENABLED = true

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {

Expand Down
54 changes: 54 additions & 0 deletions phoenix-ios/phoenix-ios/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@
}
}
}
},
": %@" : {

},
"? confirmations" : {

Expand Down Expand Up @@ -5597,6 +5600,12 @@
}
}
}
},
"Add to contacts" : {

},
"Add to existing contact" : {

},
"adding to existing channel" : {
"comment" : "Transaction Info: Explanation",
Expand Down Expand Up @@ -9094,6 +9103,9 @@
}
}
}
},
"BLIP 42 (DEBUG build only)" : {

},
"Block height" : {
"localizations" : {
Expand Down Expand Up @@ -9220,6 +9232,7 @@
}
},
"Bolt12 offer:" : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -9260,6 +9273,7 @@
}
},
"Bolt12 offers" : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -9298,6 +9312,9 @@
}
}
}
},
"Bolt12 offers:" : {

},
"broadcast" : {
"localizations" : {
Expand Down Expand Up @@ -12505,6 +12522,9 @@
}
}
}
},
"contact secret" : {

},
"Contact support if needed." : {
"localizations" : {
Expand Down Expand Up @@ -13482,6 +13502,9 @@
}
}
}
},
"Create new contact" : {

},
"Create new wallet" : {
"localizations" : {
Expand Down Expand Up @@ -16384,6 +16407,12 @@
}
}
}
},
"Duplicate in %@" : {

},
"Duplicate within this contact" : {

},
"Duration" : {
"localizations" : {
Expand Down Expand Up @@ -23333,6 +23362,9 @@
}
}
}
},
"Invalid format" : {

},
"Invalid Lightning Request" : {
"comment" : "toast warning",
Expand Down Expand Up @@ -23417,6 +23449,7 @@
}
},
"Invalid offer" : {
"extractionState" : "stale",
"localizations" : {
"ar" : {
"stringUnit" : {
Expand Down Expand Up @@ -24021,6 +24054,9 @@
}
}
}
},
"label (optional)" : {

},
"Last attempt failed" : {
"localizations" : {
Expand Down Expand Up @@ -24465,6 +24501,9 @@
}
}
}
},
"Lightning addresses:" : {

},
"lightning fee" : {
"extractionState" : "stale",
Expand Down Expand Up @@ -25295,6 +25334,9 @@
}
}
}
},
"lno1... (paste offer here)" : {

},
"lnurl-auth" : {
"localizations" : {
Expand Down Expand Up @@ -28267,6 +28309,9 @@
}
}
}
},
"none" : {

},
"None" : {
"comment" : "TextField placeholder",
Expand Down Expand Up @@ -29852,6 +29897,12 @@
}
}
}
},
"payer address" : {

},
"payer offer" : {

},
"Payment" : {
"localizations" : {
Expand Down Expand Up @@ -34756,6 +34807,9 @@
}
}
}
},
"Secrets: (DEBUG build only)" : {

},
"Security" : {
"extractionState" : "manual",
Expand Down
15 changes: 15 additions & 0 deletions phoenix-ios/phoenix-ios/extensions/String+Email.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Foundation

extension String {

func isValidEmailAddress() -> Bool {
let types: NSTextCheckingResult.CheckingType = [.link]
guard let linkDetector = try? NSDataDetector(types: types.rawValue) else {
return false
}
let range = NSRange(location: 0, length: self.count)
let result = linkDetector.firstMatch(in: self, options: .reportCompletion, range: range)
let scheme = result?.url?.scheme ?? ""
return (scheme == "mailto") && (result?.range.length == self.count)
}
}
48 changes: 48 additions & 0 deletions phoenix-ios/phoenix-ios/kotlin/KotlinExtensions+Other.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,51 @@ extension Array where Element == LocalChannelInfo {
return LocalChannelInfo.companion.inFlightPaymentsCount(channels: self)
}
}

extension Date {

func toInstant() -> Kotlinx_datetimeInstant {
let millis = self.toMilliseconds()
return Kotlinx_datetimeInstant.companion.fromEpochMilliseconds(epochMilliseconds: millis)
}
}

extension ContactAddress {

var domain: String? {

if let atRange = address.range(of: "@") {

let domainRange = atRange.upperBound ..< address.endIndex
let domainText = String(address[domainRange]).lowercased()

let sanitized = domainText.trimmingCharacters(in: .whitespacesAndNewlines)
if !sanitized.isEmpty {
return sanitized
}
}

return nil
}

class func wellKnownDomains(includeTestnet: Bool) -> Set<String> {

var result: Set<String> = Set([
"phoenixwallet.me",
"bitrefill.me",
"strike.me",
"coincorner.io",
"sparkwallet.me",
"ln.tips",
"getalby.com",
"walletofsatoshi.com",
"stacker.news"
])

if includeTestnet {
result.insert("testnet.phoenixwallet.me")
}

return result
}
}
Loading