Skip to content

Commit 4dad88c

Browse files
committed
chore: group hw transfer screens
1 parent 526d53a commit 4dad88c

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

app/src/main/java/to/bitkit/repositories/HwWalletRepo.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ class HwWalletRepo @Inject constructor(
144144
/** Reconnects a known paired device so its session is live for on-device signing. */
145145
suspend fun reconnect(deviceId: String): Result<TrezorFeatures> = trezorRepo.connectKnownDevice(deviceId)
146146

147-
/**
148-
* Resolves the native-segwit funding account for a paired wallet: its account xpub, [AccountType]
149-
* and the balance currently watched for that account. Used to compose the on-chain funding send the
150-
* Trezor signs when transferring to spending. v1 funds from native segwit only.
151-
*/
152147
suspend fun getFundingAccount(deviceId: String): Result<HwFundingAccount> = withContext(ioDispatcher) {
153148
runSuspendCatching {
154149
val devices = hwWalletStore.loadKnownDevices()
@@ -173,7 +168,7 @@ class HwWalletRepo @Inject constructor(
173168

174169
/**
175170
* Composes the on-chain funding payment from the device's native-segwit account, has the Trezor sign
176-
* it and broadcasts it. The signing step prompts the user on the device. Returns the broadcast txid.
171+
* and broadcasts it. The signing step prompts the user on the device. Returns the broadcast txid.
177172
*/
178173
suspend fun signAndBroadcastFunding(
179174
deviceId: String,
@@ -501,7 +496,6 @@ class HwWalletRepo @Inject constructor(
501496
private fun String.toDeviceId(): String = substringBefore(WATCHER_ID_SEPARATOR)
502497
}
503498

504-
/** Native-segwit account used to fund a Trezor-signed transfer to spending. */
505499
data class HwFundingAccount(
506500
val xpub: String,
507501
val accountType: AccountType,

app/src/main/java/to/bitkit/ui/ContentView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ import to.bitkit.ui.screens.transfer.SavingsIntroScreen
118118
import to.bitkit.ui.screens.transfer.SavingsProgressScreen
119119
import to.bitkit.ui.screens.transfer.SettingUpScreen
120120
import to.bitkit.ui.screens.transfer.SpendingAdvancedScreen
121-
import to.bitkit.ui.screens.transfer.SpendingAmountHwScreen
122121
import to.bitkit.ui.screens.transfer.SpendingAmountScreen
123122
import to.bitkit.ui.screens.transfer.SpendingConfirmScreen
124-
import to.bitkit.ui.screens.transfer.SpendingHwSignScreen
125-
import to.bitkit.ui.screens.transfer.SpendingHwSignedScreen
126123
import to.bitkit.ui.screens.transfer.SpendingIntroScreen
127124
import to.bitkit.ui.screens.transfer.TransferIntroScreen
128125
import to.bitkit.ui.screens.transfer.external.ExternalAmountScreen
@@ -131,6 +128,9 @@ import to.bitkit.ui.screens.transfer.external.ExternalConnectionScreen
131128
import to.bitkit.ui.screens.transfer.external.ExternalNodeViewModel
132129
import to.bitkit.ui.screens.transfer.external.ExternalSuccessScreen
133130
import to.bitkit.ui.screens.transfer.external.LnurlChannelScreen
131+
import to.bitkit.ui.screens.transfer.hardware.SpendingAmountHwScreen
132+
import to.bitkit.ui.screens.transfer.hardware.SpendingHwSignScreen
133+
import to.bitkit.ui.screens.transfer.hardware.SpendingHwSignedScreen
134134
import to.bitkit.ui.screens.trezor.TrezorScreen
135135
import to.bitkit.ui.screens.wallets.HardwareWalletScreen
136136
import to.bitkit.ui.screens.wallets.HomeScreen

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountHwScreen.kt renamed to app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingAmountHwScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package to.bitkit.ui.screens.transfer
1+
package to.bitkit.ui.screens.transfer.hardware
22

33
import androidx.compose.animation.AnimatedVisibility
44
import androidx.compose.animation.fadeIn

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingHwSignScreen.kt renamed to app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package to.bitkit.ui.screens.transfer
1+
package to.bitkit.ui.screens.transfer.hardware
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.layout.Arrangement
@@ -33,6 +33,7 @@ import to.bitkit.ui.components.VerticalSpacer
3333
import to.bitkit.ui.scaffold.AppTopBar
3434
import to.bitkit.ui.scaffold.DrawerNavIcon
3535
import to.bitkit.ui.scaffold.ScreenColumn
36+
import to.bitkit.ui.screens.transfer.previewBtOrder
3637
import to.bitkit.ui.theme.AppThemeSurface
3738
import to.bitkit.ui.theme.Colors
3839
import to.bitkit.ui.utils.withAccent

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingHwSignedScreen.kt renamed to app/src/main/java/to/bitkit/ui/screens/transfer/hardware/SpendingHwSignedScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package to.bitkit.ui.screens.transfer
1+
package to.bitkit.ui.screens.transfer.hardware
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.layout.Box
@@ -26,6 +26,7 @@ import to.bitkit.ui.components.VerticalSpacer
2626
import to.bitkit.ui.scaffold.AppTopBar
2727
import to.bitkit.ui.scaffold.DrawerNavIcon
2828
import to.bitkit.ui.scaffold.ScreenColumn
29+
import to.bitkit.ui.screens.transfer.previewBtOrder
2930
import to.bitkit.ui.theme.AppThemeSurface
3031
import to.bitkit.ui.theme.Colors
3132
import to.bitkit.ui.utils.withAccent

0 commit comments

Comments
 (0)