Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-17 13:51:47 +03:00
parent 0e85eb1d78
commit 929dae92c3
4 changed files with 26 additions and 15 deletions

View file

@ -86,6 +86,13 @@ fun UserWallet.requireHotWallet(): UserWallet.Hot {
?: error("This user wallet is not a hot wallet")
}
fun UserWallet.isImported(): Boolean {
return when (this) {
is UserWallet.Cold -> isImported
is UserWallet.Hot -> true
}
}
fun UserWallet.copy(name: String = this.name, walletId: UserWalletId = this.walletId): UserWallet = when (this) {
is UserWallet.Cold -> this.copy(name = name, walletId = walletId)
is UserWallet.Hot -> this.copy(name = name, walletId = walletId)