Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f37872f
feat: spark transfer to spending design
ovitrif Nov 17, 2026
53786d5
chore: add changelog fragment
ovitrif Nov 17, 2026
aa7162d
fix: match transfer intros and signed screen to the frames
ovitrif Nov 17, 2026
eccafdc
fix: keep both ends of the hardware deposit address
ovitrif Nov 17, 2026
35aa81a
fix: keep the transfer amount in the unit the fees switched to
ovitrif Nov 17, 2026
e4f358b
fix: keep the typed transfer amount on return
ovitrif Nov 17, 2026
f00fa29
chore: translate spark transfer to spending strings
ovitrif Nov 17, 2026
71bcd77
fix: match learn more and hardware sign screens to the frames
ovitrif Nov 18, 2026
86eac44
chore: document spark transfer settle check
ovitrif Nov 18, 2026
0b9709d
fix: match hardware sign spacing to figma
ovitrif Nov 18, 2026
440d492
fix: keep the fee grid in bitcoin without a rate
ovitrif Nov 19, 2026
f80f813
fix: require a positive rate for fiat amounts
ovitrif Nov 19, 2026
f9d8b4d
fix: keep the typed amount when returning from review
ovitrif Nov 19, 2026
d63da25
fix: show bitcoin when the fiat rate is unusable
ovitrif Nov 19, 2026
ea73632
fix: format bitcoin in its unit without a fiat rate
ovitrif Nov 19, 2026
e6ada73
fix: keep ascii digits in a redrawn amount
ovitrif Nov 19, 2026
351ee00
fix: keep the exact amount when a key is refused
ovitrif Nov 19, 2026
cfa27b0
fix: keep bitcoin values when the fiat price is zero
ovitrif Nov 19, 2026
5d91276
Merge remote-tracking branch 'origin/master' into feat/spark-transfer…
ovitrif Nov 19, 2026
91c489e
fix: delete clears a preset amount with no rate
ovitrif Nov 19, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "trezor-angled.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "trezor-angled@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "trezor-angled@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions Bitkit/Components/FeeDisplayRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import SwiftUI
struct FeeDisplayRow: View {
let label: String
let amount: UInt64
/// Shown before the amount when it is a bound or an estimate ("±").
var prefix: String?
/// Shimmers the amount while it is being priced.
var isLoading = false

var body: some View {
VStack(alignment: .leading, spacing: 0) {
CaptionMText(label)
.padding(.bottom, 8)
MoneyText(sats: Int(amount), size: .bodySSB, symbol: true, prefix: prefix, shimmer: isLoading)
MoneyText(sats: Int(amount), size: .bodySSB, symbol: true, shimmer: isLoading)
.padding(.bottom, 16)
Divider()
}
Expand Down
6 changes: 4 additions & 2 deletions Bitkit/Components/MoneyStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ struct MoneyStack: View {
}
Haptics.play(.medium)

// Show toast on first switch
if !settings.ignoresSwitchUnitToast {
// Show toast on first switch, only when the shown unit changed (without a rate it stays bitcoin)
let shownBefore = MoneyText.primaryUnit(previousDisplay, hasUsableRate: currency.hasUsableRate)
let shownAfter = MoneyText.primaryUnit(currency.primaryDisplay, hasUsableRate: currency.hasUsableRate)
if !settings.ignoresSwitchUnitToast, shownBefore != shownAfter {
let newDisplay = currency.primaryDisplay
let toUnitText = getUnitText(for: newDisplay)
let fromUnitText = getUnitText(for: previousDisplay)
Expand Down
31 changes: 22 additions & 9 deletions Bitkit/Components/MoneyText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,20 @@ struct MoneyText: View {
if let forceUnit {
return forceUnit
}
return unitType == .secondary ? (currency.primaryDisplay == .bitcoin ? .fiat : .bitcoin) : currency.primaryDisplay
if unitType == .secondary {
return Self.secondaryUnit(currency.primaryDisplay, hasUsableRate: currency.hasUsableRate)
}
return Self.primaryUnit(currency.primaryDisplay, hasUsableRate: currency.hasUsableRate)
}

/// The primary amount stays in bitcoin while the local currency has no usable rate, so it never reads zero in fiat.
nonisolated static func primaryUnit(_ display: PrimaryDisplay, hasUsableRate: Bool) -> PrimaryDisplay {
display == .fiat && !hasUsableRate ? .bitcoin : display
}

/// The other unit from the primary one, so a paired amount never shows bitcoin twice.
nonisolated static func secondaryUnit(_ display: PrimaryDisplay, hasUsableRate: Bool) -> PrimaryDisplay {
primaryUnit(display, hasUsableRate: hasUsableRate) == .bitcoin ? .fiat : .bitcoin
}

private var showSymbol: Bool {
Expand Down Expand Up @@ -193,7 +206,7 @@ extension MoneyText {
if hideBalance {
return displayDots
}
if isUnavailable {
if isUnavailable || unit == .fiat && !currency.hasUsableRate {
return "—"
}

Expand All @@ -207,12 +220,9 @@ extension MoneyText {
}
}

// Rates unavailable: show sats for bitcoin, "0" for fiat
// Rates unavailable: bitcoin needs no rate, fiat shows "0"
if unit == .bitcoin {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.groupingSeparator = " "
return formatter.string(from: NSNumber(value: abs(sats))) ?? String(abs(sats))
return ConvertedAmount.bitcoinDisplay(sats: UInt64(abs(sats)), unit: forceDisplayUnit ?? currency.displayUnit).value
}
return "0"
}
Expand All @@ -223,12 +233,15 @@ extension MoneyText {
}

private var accessibilityValue: String {
if !hideBalance, isUnavailable {
if !hideBalance, isUnavailable || unit == .fiat && !currency.hasUsableRate {
return "—"
}
guard !hideBalance, let converted = currency.convert(sats: UInt64(abs(sats))) else {
guard !hideBalance else {
return prefixed(displayDots)
}
guard let converted = currency.convert(sats: UInt64(abs(sats))) else {
return prefixed(formattedValue)
}

let numeric: String = {
switch unit {
Expand Down
3 changes: 2 additions & 1 deletion Bitkit/Components/NumberPadTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ struct NumberPadTextField: View {
)
} else {
if showConversion {
// Secondary display (bitcoin)
// Secondary display: the editor's other unit, bitcoin while fiat is edited without a usable rate
MoneyText(
sats: Int(viewModel.amountSats),
unitType: .secondary,
forceUnit: currency.primaryDisplay == .bitcoin ? .fiat : .bitcoin,
size: .caption,
symbol: true,
color: .textSecondary
Expand Down
8 changes: 8 additions & 0 deletions Bitkit/Extensions/HwWalletVendor+UI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ extension HwWalletVendor {
}
}

/// The angled device on the transfer to spending sign screen, partly behind its button.
var transferSignImageName: String {
switch self {
case .trezor: "trezor-angled"
case .blockstream: "jade-card"
}
}

var modelName: String {
switch self {
case .trezor: t("hardware__device_model_trezor")
Expand Down
6 changes: 6 additions & 0 deletions Bitkit/Models/Currency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ struct ConvertedAmount {
}

func bitcoinDisplay(unit: BitcoinDisplayUnit) -> BitcoinDisplayComponents {
Self.bitcoinDisplay(sats: sats, unit: unit)
}

/// A bitcoin amount in the given unit; it needs no exchange rate, so it also serves when none is usable.
static func bitcoinDisplay(sats: UInt64, unit: BitcoinDisplayUnit) -> BitcoinDisplayComponents {
let btcValue = Decimal(sats) / 100_000_000
switch unit {
case .modern:
let formatter = NumberFormatter()
Expand Down
38 changes: 27 additions & 11 deletions Bitkit/Resources/Localization/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"fee__custom__shortDescription" = "يعتمد على الرسوم";
"fee__custom__range" = "يعتمد على الرسوم";
"lightning__transfer_intro__title" = "رصيد\n<accent>الإنفاق</accent>";
"lightning__transfer_intro__text" = "موّل رصيد إنفاقك للاستمتاع بمعاملات فورية ورخيصة مع الأصدقاء والعائلة والتجار.";
"lightning__transfer_intro__text" = "موّل رصيد إنفاقك للاستمتاع بمدفوعات Lightning فورية ورخيصة.";
"lightning__transfer_intro__button" = "ابدأ";
"lightning__funding__text" = "أسهل خيار هو استخدام مدخرات Bitkit الخاصة بك أو إرسال بيتكوين من محفظة مختلفة.";
"lightning__funding__title" = "موّل <accent>رصيد إنفاقك</accent>";
Expand All @@ -192,25 +192,30 @@
"lightning__transfer_hw__reconnect_error_title" = "إعادة توصيل الجهاز";
"lightning__transfer_hw__sign_title" = "وقّع باستخدام\n<accent>جهازك</accent>";
"lightning__transfer_hw__signed_title" = "تم توقيع\n<accent>المعاملة</accent>";
"lightning__transfer_hw__address" = "العنوان (أكّده على الجهاز)";
"lightning__transfer_to_savings_button" = "تحويل إلى المدخرات";
"lightning__transfer_to_spending_button" = "تحويل إلى الإنفاق";
"lightning__transfer_from_savings_button" = "تحويل من المدخرات";
"lightning__spending_intro__title" = "تحويل\n<accent>إلى الإنفاق</accent>";
"lightning__spending_intro__text" = "حوّل الأموال إلى رصيد إنفاقك للاستمتاع بمعاملات فورية ورخيصة مع الأصدقاء والعائلة والتجار.";
"lightning__spending_intro__button" = "ابدأ";
"lightning__spending_amount__quarter" = "25%";
"lightning__spending_amount__error_max__title" = "الحد الأقصى لرصيد الإنفاق";
"lightning__spending_amount__error_max__description" = "المبلغ الذي يمكنك تحويله إلى رصيد الإنفاق محدود حاليًا بـ ₿ {amount}.";
"lightning__spending_amount__error_fee" = "Couldn't get the network fee. Tap to try again.";
"lightning__spending_amount__error_fee" = "تعذّر الحصول على رسوم الشبكة. انقر للمحاولة مرة أخرى.";
"lightning__spending_confirm__network_fee" = "رسوم الشبكة";
"lightning__spending_confirm__lsp_fee" = "رسوم الخدمة";
"lightning__spending_confirm__amount" = "إلى الإنفاق";
"lightning__spending_confirm__total" = "الإجمالي";
"lightning__spending_confirm__spending_fee" = "Spending fee";
"lightning__spending_confirm__instant_text" = "Ready in a few minutes";
"lightning__spending_confirm__later" = "Later";
"lightning__spending_confirm__later_text" = "After 3 confirmations, about 30 minutes";
"lightning__spending_confirm__error_quote" = "Bitkit couldn't get the fees for this transfer. Check your connection and try again.";
"lightning__spending_confirm__instant_text" = "جاهز خلال بضع دقائق";
"lightning__spending_confirm__later" = "لاحقًا";
"lightning__spending_confirm__later_text" = "جاهز خلال 30 دقيقة تقريبًا";
"lightning__spending_confirm__fee_max" = "كحد أقصى";
"lightning__spending_confirm__fee_est" = "تقديري";
"lightning__spending_confirm__error_quote" = "تعذّر على Bitkit الحصول على رسوم هذا التحويل. تحقق من اتصالك وحاول مرة أخرى.";
"lightning__spending_confirm__fees_changed_title" = "تغيّرت الرسوم";
"lightning__spending_confirm__max_changed_title" = "تغيّر المبلغ";
"lightning__spending_confirm__max_changed" = "أقصى مبلغ يمكنك تحويله الآن هو {amount}، لأن معدلات الرسوم أو رصيد مدخراتك تغيّر أثناء وجودك في هذه الشاشة. اسحب مرة أخرى للتأكيد.";
"lightning__spending_confirm__fees_changed_network" = "الرسوم أعلى بمقدار {amount} لأن معدلات الرسوم أو رصيد مدخراتك تغيّر أثناء وجودك في هذه الشاشة. اسحب مرة أخرى للتأكيد.";
"lightning__savings_intro__title" = "تحويل\n<accent>إلى المدخرات</accent>";
"lightning__savings_intro__text" = "حوّل رصيد إنفاقك إلى مدخراتك لتخزين Bitcoin على المدى الطويل وتأمين مستقبلك.";
Expand Down Expand Up @@ -263,8 +268,17 @@
"lightning__receiving_label" = "سعة الاستلام";
"lightning__setting_up_step1" = "جارٍ معالجة الدفع";
"lightning__setting_up_step2" = "نجح الدفع";
"lightning__setting_up_step_spark" = "Adding To Spending";
"lightning__setting_up_step_spark" = "جارٍ الإضافة إلى رصيد الإنفاق";
"lightning__setting_up_button" = "متابعة استخدام Bitkit";
"lightning__setting_up__text_fast" = "يرجى الانتظار، تحويل أموالك قيد التنفيذ. يجب أن يستغرق هذا <accent>بضع دقائق.</accent>";
"lightning__setting_up__text_normal" = "يرجى الانتظار، تحويل أموالك قيد التنفيذ. يجب أن يستغرق هذا <accent>حوالي 30 دقيقة.</accent>";
"lightning__setting_up__fee_changed_title" = "التحويل السريع\n<accent>تغيّرت الرسوم</accent>";
"lightning__setting_up__fee_changed_text" = "<accent>أصبحت رسوم التحويل السريع الآن {fee}.</accent> وافق للوصول إلى أموالك بسرعة، أو انتظر ±30 دقيقة.";
"lightning__setting_up__unavailable_title" = "التحويل السريع\n<accent>غير متاح</accent>";
"lightning__setting_up__step_fee_changed" = "تغيّرت رسوم التحويل السريع";
"lightning__setting_up__step_normal_speed" = "استخدام سرعة التحويل العادية";
"lightning__setting_up__approve" = "موافقة";
"lightning__setting_up__success_button" = "رائع!";
"lightning__node_info" = "عقدة Lightning";
"lightning__connections" = "اتصالات Lightning";
"lightning__conn_pending" = "الاتصالات المعلقة";
Expand Down Expand Up @@ -402,9 +416,11 @@
"lightning__spark_exit__progress_overview" = "نظرة عامة على التقدم";
"lightning__spark_exit__quote_text" = "ابدأ التحويل القسري فقط إذا لم يعد رصيد الإنفاق يعمل. <accent>قد لا تتوفر أموالك لمدة تصل إلى 4 أسابيع.</accent>";
"lightning__spark_exit__send_to_address" = "إرسال إلى العنوان";
"lightning__spark_learn__title" = "Transfer\n<accent>speed</accent>";
"lightning__spark_learn__text" = "Instant pays the provider to add your transfer to your spending balance before it confirms, so it is ready in a few minutes.\n\nLater waits for 3 confirmations, about 30 minutes, and costs less.";
"lightning__spark_learn__label" = "Spending balance after transfer";
"lightning__spark_learn__title" = "سرعة\n<accent>التحويل</accent>";
"lightning__spark_learn__fast_text" = "تكون أموالك عادةً جاهزة للإنفاق خلال بضع دقائق، دون الحاجة إلى انتظار التأكيدات.";
"lightning__spark_learn__later_text" = "تصبح أموالك متاحة بعد 3 تأكيدات، عادةً خلال 30 دقيقة تقريبًا.";
"lightning__spark_learn__about_title" = "حول\n<accent>رصيد إنفاقك</accent>";
"lightning__spark_learn__about_text" = "يستخدم رصيد إنفاقك Spark، التي تشغّلها Lightspark وBreez وFlashnet.\n\nيعتمد أمانه على تصرّف مشغّل واحد على الأقل بأمانة. يمكن للمشغّلين إيقاف الوصول مؤقتًا، ويتطلب السحب دون تعاونهم أن تبدأ خروجًا على السلسلة (on-chain).";
"lightning__reserve_balance" = "رصيد الاحتياطي (غير قابل للإنفاق)";
"lightning__total_size" = "الحجم الإجمالي للقناة";
"lightning__fees" = "الرسوم";
Expand Down
Loading
Loading