Skip to content

Commit

Permalink
(android) Add support for BIP-353 DNS addresses (#585)
Browse files Browse the repository at this point in the history
Phoenix can now read BIP353 addresses and perform a
DNS lookup to retrieve the bitcoin payment instructions,
with a fallback to LNURL-based Lightning addresses.

Also added the UI to claim a BIP353 address from the LSP.
  • Loading branch information
dpad85 authored Jul 10, 2024
1 parent 9df1e36 commit ef1f927
Show file tree
Hide file tree
Showing 46 changed files with 823 additions and 394 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Versions {
const val lightningKmp = "1.7.0"
const val lightningKmp = "1.7.1-SNAPSHOT"
const val secp256k1 = "0.14.0"
const val torMobile = "0.2.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ fun AppView(
composable(Screen.Contacts.route) {
SettingsContactsView(onBackClick = { navController.popBackStack() })
}
composable(Screen.Experimental.route) {
ExperimentalView(onBackClick = { navController.popBackStack() })
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ sealed class Screen(val route: String) {
data object Notifications: Screen("notifications")
data object Contacts: Screen("settings/contacts")
data object ResetWallet: Screen("settings/resetwallet")
data object Experimental: Screen("settings/experimental")
}

fun NavController.navigate(screen: Screen, arg: List<Any> = emptyList(), builder: NavOptionsBuilder.() -> Unit = {}) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 ACINQ SAS
* Copyright 2024 ACINQ SAS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package fr.acinq.phoenix.android.components
package fr.acinq.phoenix.android.components.settings

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
Expand All @@ -28,14 +28,17 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import fr.acinq.phoenix.android.R
import fr.acinq.phoenix.android.components.Button
import fr.acinq.phoenix.android.components.Clickable
import fr.acinq.phoenix.android.components.Dialog


internal data class PreferenceItem<T>(val item: T, val title: String, val description: String? = null)

@Composable
internal fun <T> ListPreferenceButton(
title: String,
subtitle: @Composable () -> Unit = {},
subtitle: @Composable ColumnScope.() -> Unit = {},
enabled: Boolean,
selectedItem: T,
preferences: List<PreferenceItem<T>>,
Expand All @@ -46,9 +49,7 @@ internal fun <T> ListPreferenceButton(
) {
var showPreferenceDialog by remember { mutableStateOf(initialShowDialog) }

SettingInteractive(title = title, description = subtitle, enabled = enabled) {
showPreferenceDialog = true
}
Setting(title = title, subtitle = subtitle, enabled = enabled, onClick = { showPreferenceDialog = true })

if (showPreferenceDialog) {
ListPreferenceDialog(
Expand Down
Loading

0 comments on commit ef1f927

Please sign in to comment.