package com.adealink.weparty.wallet.manager

import com.adealink.frame.base.Rlt
import com.adealink.frame.frame.IBaseFrame
import com.adealink.weparty.module.wallet.data.Currency
import com.adealink.weparty.wallet.recharge.data.RechargeConfigData

interface IWalletManager : IBaseFrame<IWalletListener> {

    //cache
    fun getWalletData()

    fun refreshWalletData()

    fun getCurrencyCound(currency: Currency): Double

    suspend fun pullWalletData(): Rlt<Map<Currency, Double>>

    suspend fun recharge(data: RechargeConfigData): Rlt<Any>

    suspend fun loadConvertConfig(): Rlt<Any>

    fun calcConvertResult(
        fromCurrency: Currency,
        toCurrency: Currency,
        amount: Double
    ): Double

    suspend fun convertTo(
        fromCurrency: Currency,
        toCurrency: Currency,
        amount: Double
    ): Rlt<Double>
}