Updated on 2026-08-14
This commit is contained in:
parent
40c611efea
commit
a006a87f9d
27 changed files with 524 additions and 16 deletions
|
|
@ -207,6 +207,9 @@ object PreferencesKeys {
|
|||
fun getTangemPayAddToWalletKey(customerWalletAddress: String) =
|
||||
booleanPreferencesKey("tangem_pay_add_to_wallet_done_key_$customerWalletAddress")
|
||||
|
||||
fun getTangemPayCashbackDeactivationDismissedKey(customerWalletAddress: String) =
|
||||
booleanPreferencesKey("tangem_pay_cashback_deactivation_dismissed_key_$customerWalletAddress")
|
||||
|
||||
fun getTangemPayOrderIdKey(customerWalletAddress: String) =
|
||||
stringPreferencesKey("tangem_pay_order_id_key_$customerWalletAddress")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
package com.tangem.datasource.local.visa
|
||||
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.pay.TangemPayWithdrawState
|
||||
import com.tangem.domain.visa.model.TangemPayAuthTokens
|
||||
|
||||
@Suppress("TooManyFunctions")
|
||||
interface TangemPayStorage {
|
||||
|
||||
suspend fun storeCustomerWalletAddress(userWalletId: UserWalletId, customerWalletAddress: String)
|
||||
suspend fun getCustomerWalletAddress(userWalletId: UserWalletId): String?
|
||||
|
||||
suspend fun clearCustomerWalletAddress(userWalletId: UserWalletId)
|
||||
|
||||
suspend fun storeAuthTokens(customerWalletAddress: String, tokens: TangemPayAuthTokens)
|
||||
|
||||
suspend fun getAuthTokens(customerWalletAddress: String): TangemPayAuthTokens?
|
||||
suspend fun clearAuthTokens(customerWalletAddress: String)
|
||||
|
||||
suspend fun storeOrderId(customerWalletAddress: String, orderId: String)
|
||||
|
||||
suspend fun getOrderId(customerWalletAddress: String): String?
|
||||
|
||||
suspend fun clearOrderId(customerWalletAddress: String)
|
||||
|
||||
suspend fun storeVirtualAccountOrderId(customerWalletAddress: String, vaOrderId: String)
|
||||
|
||||
suspend fun getVirtualAccountOrderId(customerWalletAddress: String): String?
|
||||
|
||||
suspend fun clearVirtualAccountOrderId(customerWalletAddress: String)
|
||||
|
||||
suspend fun getAddToWalletDone(customerWalletAddress: String): Boolean
|
||||
|
||||
suspend fun storeAddToWalletDone(customerWalletAddress: String, isDone: Boolean)
|
||||
suspend fun storeCheckCustomerWalletResult(userWalletId: UserWalletId, isPaeraCustomer: Boolean)
|
||||
suspend fun checkCustomerWalletResult(userWalletId: UserWalletId): Boolean?
|
||||
|
||||
/** Called after creating withdraw order, active order id */
|
||||
suspend fun storeActiveWithdrawOrderId(userWalletId: UserWalletId, orderId: String)
|
||||
|
||||
/** Called after creating withdraw order, saves order data */
|
||||
suspend fun storeWithdrawOrder(userWalletId: UserWalletId, data: TangemPayWithdrawState)
|
||||
|
||||
/** Returns single active order id. Once the order is completed, deletes id from storage.
|
||||
* Only one active order allowed for a wallet */
|
||||
suspend fun getActiveWithdrawOrderId(userWalletId: UserWalletId): String?
|
||||
|
||||
/** Returns all withdraw orders saved.
|
||||
* Once we get tx hash for an order, it gets deleted from this storage */
|
||||
suspend fun getWithdrawOrders(userWalletId: UserWalletId): List<TangemPayWithdrawState>?
|
||||
|
||||
/** Deletes active withdraw order. Called after order is completed */
|
||||
suspend fun deleteActiveWithdrawOrder(userWalletId: UserWalletId)
|
||||
|
||||
/** Deletes withdraw order data. Called after getting its tx hash */
|
||||
suspend fun deleteWithdrawOrder(userWalletId: UserWalletId, orderId: String)
|
||||
|
||||
suspend fun getHideMainOnboardingBanner(userWalletId: UserWalletId): Boolean
|
||||
|
||||
suspend fun storeHideOnboardingBanner(userWalletId: UserWalletId, hide: Boolean)
|
||||
suspend fun storeTangemPayEligibility(eligibility: Set<String>)
|
||||
suspend fun getTangemPayEligibility(): Set<String>
|
||||
|
||||
suspend fun clearAll(userWalletId: UserWalletId, customerWalletAddress: String)
|
||||
|
||||
suspend fun storeIsTangemPayDeactivated(userWalletId: UserWalletId)
|
||||
suspend fun isTangemPayDeactivated(userWalletId: UserWalletId): Boolean
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue