Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
440f2b1
feat: add PendingSweepBalance extension functions
jvsena42 Feb 25, 2026
14db4c9
fix: improve syncTransferStates for batched force-close sweeps
jvsena42 Feb 25, 2026
28f1993
fix: add ConnectionClosed sheet variant and UI
jvsena42 Feb 25, 2026
03c9cb5
fix: update handleChannelClosed in AppViewModel
jvsena42 Feb 25, 2026
71aeef6
test: add force-close sync tests
jvsena42 Feb 25, 2026
a179821
chore: lint
jvsena42 Feb 25, 2026
33a77ec
chore: lint
jvsena42 Feb 26, 2026
356a1d7
fix: mark closing transaction as transfer activity
jvsena42 Feb 26, 2026
0fff4aa
Merge branch 'fix/reimport-channel-monitor' into fix/channel-close-ui
jvsena42 Feb 26, 2026
7e284ef
fix: sheet size medium
jvsena42 Feb 26, 2026
4030583
Merge remote-tracking branch 'origin/fix/channel-close-ui' into fix/c…
jvsena42 Feb 27, 2026
9c4f80d
fix: settle COOP_CLOSE immediately
jvsena42 Feb 27, 2026
298bdf5
fix: balance calculation includes COOP_CLOSE whole they are unsettled…
jvsena42 Feb 27, 2026
d3af0c3
test: update coop close tests to settle immediately
jvsena42 Feb 27, 2026
793e0b9
feat: add claimableAtHeight to TransferEntity
jvsena42 Feb 27, 2026
f4849a4
feat: pass claimableAtHeight when creating force close transfer
jvsena42 Feb 27, 2026
8777244
chore: create helpers to display the duration
jvsena42 Feb 27, 2026
0aa2049
feat: update banner for dynamic title
jvsena42 Feb 27, 2026
6af900c
fix: show dynamic duration for force-close
jvsena42 Feb 27, 2026
ae0f027
fix: suppress receive sheet for transfers
jvsena42 Feb 27, 2026
78efaf5
fix: claimableAtHeight type
jvsena42 Feb 27, 2026
5480492
chore: migration
jvsena42 Feb 27, 2026
37235c3
fix: claimableAtHeight type
jvsena42 Feb 27, 2026
dafdea3
test: BlockTimer helper tests
jvsena42 Feb 27, 2026
aad07e4
chore: lint
jvsena42 Feb 27, 2026
c1715b4
refactor: move force close duration calculation to TransferRepo.kt
jvsena42 Feb 27, 2026
94c86a3
fix: subtract coop closing amount from balanceInTransferToSavings
jvsena42 Feb 27, 2026
8302993
fix: transfer banner visibility
jvsena42 Feb 27, 2026
ed56df9
fix: check if this transaction is a pending sweep from a channel closure
jvsena42 Feb 27, 2026
e56d56a
Merge branch 'fix/reimport-channel-monitor' into fix/channel-close-ui
jvsena42 Feb 27, 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
Prev Previous commit
Next Next commit
feat: add claimableAtHeight to TransferEntity
  • Loading branch information
jvsena42 committed Feb 27, 2026
commit 793e0b97d46b056fe8739a2646aa605802c76b2e
10 changes: 9 additions & 1 deletion app/src/main/java/to/bitkit/data/AppDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import androidx.room.Upsert
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.work.CoroutineWorker
import androidx.work.OneTimeWorkRequestBuilder
Expand All @@ -30,14 +31,20 @@ import to.bitkit.env.Env
ConfigEntity::class,
TransferEntity::class,
],
version = 5,
version = 6,
)
@TypeConverters(StringListConverter::class)
abstract class AppDb : RoomDatabase() {
abstract fun configDao(): ConfigDao
abstract fun transferDao(): TransferDao

companion object {
private val MIGRATION_5_6 = object : Migration(5, 6) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE transfers ADD COLUMN claimableAtHeight INTEGER DEFAULT NULL")
}
}

private const val DB_NAME = "${BuildConfig.APPLICATION_ID}.sqlite"

@Volatile
Expand Down Expand Up @@ -65,6 +72,7 @@ abstract class AppDb : RoomDatabase() {
}
}
})
.addMigrations(MIGRATION_5_6)
.apply {
if (Env.isDebug) fallbackToDestructiveMigration(dropAllTables = true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ data class TransferEntity(
val isSettled: Boolean = false,
val createdAt: Long,
val settledAt: Long? = null,
val claimableAtHeight: UInt? = null,
)
7 changes: 7 additions & 0 deletions app/src/main/java/to/bitkit/ext/LightningBalance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ fun LightningBalance.channelId(): String {
}
}

fun LightningBalance.claimableAtHeight(): UInt? = when (this) {
is LightningBalance.ClaimableAwaitingConfirmations -> this.confirmationHeight
is LightningBalance.ContentiousClaimable -> this.timeoutHeight
is LightningBalance.MaybeTimeoutClaimableHtlc -> this.claimableHeight
else -> null
}

fun LightningBalance.balanceUiText(): String {
return when (this) {
is LightningBalance.ClaimableOnChannelClose -> "Claimable on Channel Close"
Expand Down