Updated on 2026-08-14
This commit is contained in:
parent
9ef791c432
commit
1afa4a5d0e
5 changed files with 31 additions and 7 deletions
|
|
@ -24,6 +24,7 @@ import com.tangem.domain.common.wallets.getSyncStrict
|
|||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.wallets.models.UserWalletRemoteInfo
|
||||
import com.tangem.domain.wallets.models.WalletSyncResult
|
||||
import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError
|
||||
import com.tangem.domain.wallets.repository.WalletsRepository
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
|
|
@ -118,8 +119,13 @@ internal class DefaultWalletsRepository(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun createWallet(userWalletId: UserWalletId) {
|
||||
walletServerBinder.bind(userWalletId)
|
||||
override suspend fun createWallet(userWalletId: UserWalletId): WalletSyncResult {
|
||||
val response = walletServerBinder.bind(userWalletId) ?: return WalletSyncResult.AlreadyExists
|
||||
return if (response is ApiResponse.Success && response.code == HttpException.Code.CREATED) {
|
||||
WalletSyncResult.Created
|
||||
} else {
|
||||
WalletSyncResult.AlreadyExists
|
||||
}
|
||||
}
|
||||
|
||||
override fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean> = appPreferencesStore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue