Skip to content
Merged
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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ suspend fun getData(): Result<Data> = withContext(Dispatchers.IO) {
- NEVER wrap methods returning `Result<T>` in try-catch
- PREFER to use `it` instead of explicit named parameters in lambdas e.g. `fn().onSuccess { log(it) }.onFailure { log(it) }`
- NEVER inject ViewModels as dependencies - Only android activities and composable functions can use viewmodels
- ALWAYS co-locate screen-specific ViewModels in the same package as their screen; only place ViewModels in `viewmodels/` when shared across multiple screens
- NEVER hardcode strings and always preserve string resources
- ALWAYS localize in ViewModels using injected `@ApplicationContext`, e.g. `context.getString()`
- ALWAYS use `remember` for expensive Compose computations
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ android {
applicationId = "to.bitkit"
minSdk = 28
targetSdk = 36
versionCode = 176
versionName = "2.0.2"
versionCode = 177
versionName = "2.0.3"
testInstrumentationRunner = "to.bitkit.test.HiltTestRunner"
vectorDrawables {
useSupportLibrary = true
Expand Down Expand Up @@ -170,7 +170,7 @@ android {
reset()
// Only architectures supported by native libs (ldk-node, bitkit-core)
// x86 not supported; x86_64 only for debug/emulator
include("armeabi-v7a", "arm64-v8a")
include("armeabi-v7a", "arm64-v8a", "x86_64")
isUniversalApk = true
}
}
Expand Down
18 changes: 17 additions & 1 deletion app/src/main/java/to/bitkit/env/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import to.bitkit.BuildConfig
import to.bitkit.ext.ensureDir
import to.bitkit.ext.of
import to.bitkit.models.BlocktankNotificationType
import to.bitkit.models.NodePeer
import to.bitkit.utils.Logger
import java.io.File
import kotlin.io.path.Path
Expand Down Expand Up @@ -212,7 +213,22 @@ object Peers {
val stag = PeerDetails.of("028a8910b0048630d4eb17af25668cdd7ea6f2d8ae20956e7a06e2ae46ebcb69fc@34.65.86.104:9400")
val lnd1 = PeerDetails.of("039b8b4dd1d88c2c5db374290cda397a8f5d79f312d6ea5d5bfdfc7c6ff363eae3@34.65.111.104:9735")
val lnd3 = PeerDetails.of("03816141f1dce7782ec32b66a300783b1d436b19777e7c686ed00115bd4b88ff4b@34.65.191.64:9735")
val lnd4 = PeerDetails.of("02a371038863605300d0b3fc9de0cf5ccb57728b7f8906535709a831b16e311187@34.65.186.40:9735")
val lnd4 = PeerDetails.of("02a371038863605300d0b3fc9de0cf5ccb57728b7f8906535709a831b16e311187@34.65.153.174:9735")

object Known {
val stag = NodePeer(Peers.stag, name = "Synonym-Own-Regtest-0")
val lnd1 = NodePeer(Peers.lnd1, name = "Blocktank-LND1")
val lnd3 = NodePeer(Peers.lnd3, name = "Blocktank-LND3")
val lnd4 = NodePeer(Peers.lnd4, name = "Blocktank-LND4")

fun find(peer: PeerDetails): NodePeer? = when (peer.nodeId) {
stag.peerDetails.nodeId -> stag
lnd1.peerDetails.nodeId -> lnd1
lnd3.peerDetails.nodeId -> lnd3
lnd4.peerDetails.nodeId -> lnd4
else -> null
}
}
}

private object ElectrumServers {
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/to/bitkit/models/NodePeer.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package to.bitkit.models

import com.synonym.bitkitcore.ILspNode
import org.lightningdevkit.ldknode.PeerDetails
import to.bitkit.ext.ellipsisMiddle

data class NodePeer(
val peerDetails: PeerDetails,
val lspNode: ILspNode? = null,
val name: String? = null,
)

fun NodePeer.alias(): String =
lspNode?.alias
?: name
?: peerDetails.nodeId.ellipsisMiddle(16)
Loading
Loading