Updated on 2026-08-14

This commit is contained in:
Tangem 2022-07-20 15:47:17 +03:00
parent 29ace6c40b
commit e6b409eadc
4 changed files with 42 additions and 32 deletions

View file

@ -7,6 +7,7 @@ import com.tangem.blockchain.common.AmountType
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.blockchain.extensions.Result
import com.tangem.common.card.Card
import com.tangem.tap.common.extensions.safeUpdate
import com.tangem.tap.common.redux.global.CryptoCurrencyName
import com.tangem.tap.common.redux.global.GlobalAction
@ -68,7 +69,11 @@ class CurrencyExchangeManager(
enum class Action { Buy, Sell }
}
suspend fun CurrencyExchangeManager.buyErc20TestnetTokens(walletManager: EthereumWalletManager, token: Token) {
suspend fun CurrencyExchangeManager.buyErc20TestnetTokens(
card: Card,
walletManager: EthereumWalletManager,
token: Token,
) {
walletManager.safeUpdate()
val amountToSend = Amount(walletManager.wallet.blockchain)
@ -85,7 +90,9 @@ suspend fun CurrencyExchangeManager.buyErc20TestnetTokens(walletManager: Ethereu
val transaction = walletManager.createTransaction(amountToSend, fee, destinationAddress)
val signer = TangemSigner(
tangemSdk = tangemSdk, Message()
card = card,
tangemSdk = tangemSdk,
initialMessage = Message(),
) { signResponse ->
store.dispatch(
GlobalAction.UpdateWalletSignedHashes(