Skip to content

Commit

Permalink
TEX address handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tw0po1nt committed Sep 9, 2024
1 parent 306603c commit 17df7d8
Show file tree
Hide file tree
Showing 45 changed files with 53 additions and 46 deletions.
4 changes: 2 additions & 2 deletions modules/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-composable-architecture",
"state" : {
"revision" : "b432441cbc11a38c678312bad1a01138a7cd64e0",
"version" : "1.13.0"
"revision" : "0d8980f5bcc5fe6941f1788758667ff2b8c10f03",
"version" : "1.14.0"
}
},
{
Expand Down
7 changes: 7 additions & 0 deletions modules/Sources/Features/SendFlow/Recipient/Recipient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ public struct Recipient {
return .send(.recipientInputChanged(contents.data))
case let .recipientInputChanged(recipient):
state.recipient = recipient
if let _ = try? TexAddress(encoding: recipient, network: zcashSDKEnvironment.network.networkType) {
// TEX addresses unsupported
state.isRecipientValid = false
state.specificValidationError = .invalid(error: L10n.Nighthawk.TransferTab.Recipient.currentlyUnsupported)
return .none
}

let validZcash = derivationTool.isZcashAddress(recipient, zcashSDKEnvironment.network.networkType)
state.isRecipientValid = validZcash
if !validZcash && !recipient.isEmpty && userStoredPreferences.isUnstoppableDomainsEnabled() {
Expand Down
4 changes: 2 additions & 2 deletions modules/Sources/Generated/L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ public enum L10n {
public static let chooseRecipient = L10n.tr("Localizable", "nighthawk.transferTab.recipient.chooseRecipient", fallback: "Choose who to send it to")
/// Continue
public static let `continue` = L10n.tr("Localizable", "nighthawk.transferTab.recipient.continue", fallback: "Continue")
/// Sending to this recipient is currently not possible
public static let currentlyUnsupported = L10n.tr("Localizable", "nighthawk.transferTab.recipient.currentlyUnsupported", fallback: "Sending to this recipient is currently not possible")
/// Sending to TEX addresses is not supported because they offer lower privacy protections
public static let currentlyUnsupported = L10n.tr("Localizable", "nighthawk.transferTab.recipient.currentlyUnsupported", fallback: "Sending to TEX addresses is not supported because they offer lower privacy protections")
/// Please enter a valid recipient
public static let invalid = L10n.tr("Localizable", "nighthawk.transferTab.recipient.invalid", fallback: "Please enter a valid recipient")
/// Paste from clipboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Elige a quién enviarlo";
"nighthawk.transferTab.recipient.addAddress" = "Añadir la dirección aquí";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Pegar desde el portapapeles";
"nighthawk.transferTab.recipient.continue" = "Continuar";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
"nighthawk.transferTab.recipient.chooseRecipient" = "Choose who to send it to";
"nighthawk.transferTab.recipient.addAddress" = "Add address here";
"nighthawk.transferTab.recipient.invalid" = "Please enter a valid recipient";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to this recipient is currently not possible";
"nighthawk.transferTab.recipient.currentlyUnsupported" = "Sending to TEX addresses is not supported because they offer lower privacy protections";
"nighthawk.transferTab.recipient.pasteFromClipboard" = "Paste from clipboard";
"nighthawk.transferTab.recipient.continue" = "Continue";

Expand Down
Loading

0 comments on commit 17df7d8

Please sign in to comment.