diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 627858374..0aed68957 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,5 +1,5 @@ object Versions { - const val lightningKmp = "1.8.1" + const val lightningKmp = "1.8.4" const val secp256k1 = "0.14.0" const val torMobile = "0.2.0" diff --git a/phoenix-android/build.gradle.kts b/phoenix-android/build.gradle.kts index e9e672a93..1e951de86 100644 --- a/phoenix-android/build.gradle.kts +++ b/phoenix-android/build.gradle.kts @@ -25,7 +25,7 @@ android { applicationId = "fr.acinq.phoenix.testnet" minSdk = 26 targetSdk = 34 - versionCode = 93 + versionCode = 94 versionName = gitCommitHash() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" resourceConfigurations.addAll(listOf("en", "fr", "de", "es", "b+es+419", "cs", "pt-rBR", "sk", "vi", "sw")) diff --git a/phoenix-android/src/main/kotlin/fr/acinq/phoenix/android/payments/receive/ReceiveViewModel.kt b/phoenix-android/src/main/kotlin/fr/acinq/phoenix/android/payments/receive/ReceiveViewModel.kt index 860839e52..ebc4829f5 100644 --- a/phoenix-android/src/main/kotlin/fr/acinq/phoenix/android/payments/receive/ReceiveViewModel.kt +++ b/phoenix-android/src/main/kotlin/fr/acinq/phoenix/android/payments/receive/ReceiveViewModel.kt @@ -45,6 +45,7 @@ import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import org.slf4j.LoggerFactory +import kotlin.time.Duration.Companion.seconds sealed class LightningInvoiceState { data object Init : LightningInvoiceState() @@ -108,7 +109,7 @@ class ReceiveViewModel( paymentPreimage = Lightning.randomBytes32(), amount = amount, description = Either.Left(description), - expirySeconds = expirySeconds + expiry = expirySeconds.seconds ) lightningQRBitmap = BitmapHelper.generateBitmap(pr.write()).asImageBitmap() log.debug("generated new invoice=${pr.write()}") diff --git a/phoenix-android/src/test/kotlin/fr/acinq/phoenix/utils/LegacyMigrationHelperTest.kt b/phoenix-android/src/test/kotlin/fr/acinq/phoenix/utils/LegacyMigrationHelperTest.kt index 10773f037..9c8eeeaf3 100644 --- a/phoenix-android/src/test/kotlin/fr/acinq/phoenix/utils/LegacyMigrationHelperTest.kt +++ b/phoenix-android/src/test/kotlin/fr/acinq/phoenix/utils/LegacyMigrationHelperTest.kt @@ -242,7 +242,7 @@ class LegacyMigrationHelperTest { received = IncomingPayment.Received( receivedWith = listOf( IncomingPayment.ReceivedWith.NewChannel( - amount = 32_000_000.msat, + amountReceived = 32_000_000.msat, serviceFee = 0.msat, miningFee = 0.sat, channelId = ByteVector32.Zeroes, @@ -268,9 +268,10 @@ class LegacyMigrationHelperTest { received = IncomingPayment.Received( receivedWith = listOf( IncomingPayment.ReceivedWith.LightningPayment( - amount = 55_000.msat, + amountReceived = 55_000.msat, channelId = ByteVector32.Zeroes, - htlcId = 0 + htlcId = 0, + fundingFee = null ) ), receivedAt = 1656337800788 @@ -290,9 +291,10 @@ class LegacyMigrationHelperTest { received = IncomingPayment.Received( receivedWith = listOf( IncomingPayment.ReceivedWith.LightningPayment( - amount = 350_000.msat, + amountReceived = 350_000.msat, channelId = ByteVector32.Zeroes, - htlcId = 0 + htlcId = 0, + fundingFee = null ) ), receivedAt = 1656338085497 @@ -314,7 +316,7 @@ class LegacyMigrationHelperTest { received = IncomingPayment.Received( receivedWith = listOf( IncomingPayment.ReceivedWith.NewChannel( - amount = 57_000_000.msat, + amountReceived = 57_000_000.msat, channelId = ByteVector32.Zeroes, serviceFee = 3_000_000.msat, miningFee = 0.sat, @@ -341,10 +343,9 @@ class LegacyMigrationHelperTest { received = IncomingPayment.Received( receivedWith = listOf( IncomingPayment.ReceivedWith.NewChannel( - amount = 562_212_000.msat, + amountReceived = 562_212_000.msat, channelId = ByteVector32.Zeroes, - txId = TxId( - ByteVector32.Zeroes), + txId = TxId(ByteVector32.Zeroes), serviceFee = 5_678_000.msat, miningFee = 0.sat, confirmedAt = 1656403752448, diff --git a/phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj b/phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj index d6c318527..0c1a630c7 100644 --- a/phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj +++ b/phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj @@ -2352,7 +2352,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Blue"; CODE_SIGN_ENTITLEMENTS = "phoenix-ios/Phoenix.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_ASSET_PATHS = "\"phoenix-ios/Preview Content\""; DEVELOPMENT_TEAM = XD77LN4376; ENABLE_PREVIEWS = YES; @@ -2377,7 +2377,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Blue"; CODE_SIGN_ENTITLEMENTS = "phoenix-ios/Phoenix.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_ASSET_PATHS = "\"phoenix-ios/Preview Content\""; DEVELOPMENT_TEAM = XD77LN4376; ENABLE_PREVIEWS = YES; @@ -2479,7 +2479,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_TEAM = XD77LN4376; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2508,7 +2508,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_TEAM = XD77LN4376; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -2537,7 +2537,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = "phoenix-notifySrvExt/phoenix-notifySrvExt.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_TEAM = XD77LN4376; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "phoenix-notifySrvExt/Info.plist"; @@ -2564,7 +2564,7 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CODE_SIGN_ENTITLEMENTS = "phoenix-notifySrvExt/phoenix-notifySrvExt.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 82; + CURRENT_PROJECT_VERSION = 83; DEVELOPMENT_TEAM = XD77LN4376; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "phoenix-notifySrvExt/Info.plist"; diff --git a/phoenix-ios/phoenix-ios/Localizable.xcstrings b/phoenix-ios/phoenix-ios/Localizable.xcstrings index 64228d2de..024a011ab 100644 --- a/phoenix-ios/phoenix-ios/Localizable.xcstrings +++ b/phoenix-ios/phoenix-ios/Localizable.xcstrings @@ -491,6 +491,7 @@ }, "(completed) of (total)" : { "comment" : "Upload progress information", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -532,6 +533,7 @@ }, "(completed) of (total), pushing batch of (inFlight)" : { "comment" : "Upload progress information", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -615,6 +617,7 @@ }, "(count) payments within the last 2 hours" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -656,6 +659,7 @@ }, "(count) payments within the last 3 days" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -697,6 +701,7 @@ }, "(count) payments within the last 7 days" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -738,6 +743,7 @@ }, "(count) payments within the last 10 minutes" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -779,6 +785,7 @@ }, "(count) payments within the last 24 hours" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -820,6 +827,7 @@ }, "(count) payments within the last minute" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -1469,6 +1477,7 @@ }, "(totalPaymentCount) in-flight payments" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -1510,6 +1519,7 @@ }, "(totalPaymentCount) recent payments" : { "comment" : "Recent payments footer", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6234,6 +6244,7 @@ }, "Amount must be (exactBitcoin.string)" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6275,6 +6286,7 @@ }, "Amount must be (exactBitcoin.string) (≈ (approxFiat.string))" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6316,6 +6328,7 @@ }, "Amount must be at least (minBitcoin.string)" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6357,6 +6370,7 @@ }, "Amount must be at least (minBitcoin.string) (≈ (approxFiat.string))" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6398,6 +6412,7 @@ }, "Amount must be at most (maxBitcoin.string)" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -6439,6 +6454,7 @@ }, "Amount must be at most (maxBitcoin.string) (≈ (approxFiat.string))" : { "comment" : "error message", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -8670,7 +8686,7 @@ } }, "Bitcoin address" : { - "comment" : "TextField placeholder", + "comment" : "TextField placeholder\nType of text being copied", "localizations" : { "ar" : { "stringUnit" : { @@ -13337,6 +13353,7 @@ }, "Could not connect to service: (origin)" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -24520,6 +24537,7 @@ }, "Lightning fee amount: (percent), (amountBitcoin), ≈(amountFiat)" : { "comment" : "VoiceOver label: PaymentSummaryView", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -26933,6 +26951,7 @@ }, "Miner fee amount: (percent), (amountBitcoin), ≈(amountFiat)" : { "comment" : "VoiceOver label: PaymentSummaryView", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -32638,6 +32657,7 @@ }, "QR code" : { + "comment" : "Type of image being copied", "localizations" : { "ar" : { "stringUnit" : { @@ -40043,6 +40063,7 @@ }, "The invoice is not for (chainMismatch.expected.name)" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -40571,6 +40592,7 @@ }, "The service ((origin)) appears to be offline, or they have a down server" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -40612,6 +40634,7 @@ }, "The service ((origin)) doesn't support Lightning addresses, or doesn't know this user" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -40653,6 +40676,7 @@ }, "The service ((origin)) returned error code: (rfCode.code.value)" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -40694,6 +40718,7 @@ }, "The service ((origin)) returned error message: (rfDetailed.reason)" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -42431,6 +42456,7 @@ }, "Tip amount: (percent), (amountBitcoin), ≈(amountFiat)" : { "comment" : "VoiceOver label: PaymentSummaryView", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -42472,6 +42498,7 @@ }, "tip amount: (tipBtcn), ≈(tipFiat), total amount: (ttlBtcn), ≈(ttlFiat)" : { "comment" : "VoiceOver information: Customize tip sheet", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -43245,6 +43272,7 @@ }, "Total amount: (amountBitcoin), ≈(amountFiat)" : { "comment" : "VoiceOver label: PaymentSummaryView", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -43286,6 +43314,7 @@ }, "total amount: (btcnAmt.string), ≈(fiatAmt.string)" : { "comment" : "VoiceOver hint", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -43369,6 +43398,7 @@ }, "total amount: ≈(btcnAmt.string)" : { "comment" : "VoiceOver hint", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { @@ -44424,6 +44454,7 @@ }, "Unreadable response from service: (origin)" : { "comment" : "Error message - scanning lightning invoice", + "extractionState" : "stale", "localizations" : { "ar" : { "stringUnit" : { diff --git a/phoenix-ios/phoenix-ios/prefs/UserDefaults+Codable.swift b/phoenix-ios/phoenix-ios/prefs/UserDefaults+Codable.swift index 90f3b2dd8..1db1ca7aa 100644 --- a/phoenix-ios/phoenix-ios/prefs/UserDefaults+Codable.swift +++ b/phoenix-ios/phoenix-ios/prefs/UserDefaults+Codable.swift @@ -147,7 +147,8 @@ struct LiquidityPolicy: Equatable, Codable { maxAbsoluteFee: effectiveMaxFee, maxRelativeFeeBasisPoints: effectiveMaxFeeBasisPoints, skipAbsoluteFeeCheck: effectiveSkipAbsoluteFeeCheck, - maxAllowedFeeCredit: effectiveMaxAllowedFeeCredit + maxAllowedFeeCredit: effectiveMaxAllowedFeeCredit, + considerOnlyMiningFeeForAbsoluteFeeCheck: false // keep this in check with the default value in lightning-kmp ) } else { diff --git a/phoenix-legacy/build.gradle.kts b/phoenix-legacy/build.gradle.kts index 797cd5b3c..9a8433333 100644 --- a/phoenix-legacy/build.gradle.kts +++ b/phoenix-legacy/build.gradle.kts @@ -30,7 +30,7 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildTypes { - val libCode = 93 + val libCode = 94 getByName("debug") { resValue("string", "CHAIN", chain) buildConfigField("String", "CHAIN", chain) diff --git a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ReceiveController.kt b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ReceiveController.kt index cdb948419..22fe15523 100644 --- a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ReceiveController.kt +++ b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ReceiveController.kt @@ -23,6 +23,7 @@ import fr.acinq.phoenix.PhoenixBusiness import fr.acinq.phoenix.controllers.AppController import fr.acinq.phoenix.managers.PeerManager import kotlinx.coroutines.launch +import kotlin.time.Duration.Companion.seconds class AppReceiveController( @@ -48,7 +49,7 @@ class AppReceiveController( paymentPreimage = randomBytes32(), amount = intent.amount, description = Either.Left(intent.description), - expirySeconds = intent.expirySeconds + expiry = intent.expirySeconds.seconds ) model(Receive.Model.Generated(paymentRequest.write(), paymentRequest.paymentHash.toHex(), paymentRequest.amount, paymentRequest.description)) } diff --git a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ScanController.kt b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ScanController.kt index a914fd75c..09f9926ed 100644 --- a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ScanController.kt +++ b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/controllers/payments/ScanController.kt @@ -65,6 +65,7 @@ import kotlinx.serialization.json.intOrNull import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonPrimitive import kotlin.time.Duration +import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.seconds import kotlin.time.TimeSource @@ -393,7 +394,7 @@ class AppScanController( paymentPreimage = Lightning.randomBytes32(), amount = intent.amount, description = Either.Left(intent.description ?: intent.lnurlWithdraw.defaultDescription), - expirySeconds = (3600 * 24 * 7).toLong(), // one week + expiry = 7.days ) if (requestId != lnurlRequestId) { diff --git a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/managers/NodeParamsManager.kt b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/managers/NodeParamsManager.kt index c8e52d6f6..c5080d333 100644 --- a/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/managers/NodeParamsManager.kt +++ b/phoenix-shared/src/commonMain/kotlin/fr.acinq.phoenix/managers/NodeParamsManager.kt @@ -70,7 +70,6 @@ class NodeParamsManager( ).copy( zeroConfPeers = setOf(trampolineNodeId), liquidityPolicy = MutableStateFlow(startupParams.liquidityPolicy), - bolt12invoiceExpiry = 24.hours, ) }.collect { log.info { "hello!" }