Updated on 2026-08-14
This commit is contained in:
parent
abefdbc102
commit
d259fb3d4b
4 changed files with 20 additions and 7 deletions
|
|
@ -7,7 +7,9 @@ import com.tangem.domain.wallet.eth.EthEngine
|
|||
import com.tangem.domain.wallet.token.TokenEngine
|
||||
import com.tangem.domain.wallet.bch.BtcCashEngine
|
||||
import com.tangem.data.Blockchain
|
||||
import com.tangem.domain.wallet.cardano.CardanoData
|
||||
import com.tangem.domain.wallet.cardano.CardanoEngine
|
||||
import com.tangem.domain.wallet.eth.EthData
|
||||
import com.tangem.domain.wallet.ltc.LtcEngine
|
||||
import com.tangem.domain.wallet.nftToken.NftTokenEngine
|
||||
import com.tangem.domain.wallet.rsk.RskEngine
|
||||
|
|
@ -73,7 +75,7 @@ object CoinEngineFactory {
|
|||
fun createCardano(context: TangemContext): CoinEngine? {
|
||||
var result: CoinEngine?
|
||||
try {
|
||||
result = CardanoEngine(context)
|
||||
result = EthEngine(context)// CardanoEngine(context)
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
|
@ -94,4 +96,11 @@ object CoinEngineFactory {
|
|||
// return result
|
||||
}
|
||||
|
||||
fun createCardanoData(): CoinData? {
|
||||
return EthData()// CardanoData()
|
||||
}
|
||||
|
||||
fun isCardano(blockchainID: String): Boolean {
|
||||
return blockchainID==Blockchain.Ethereum.id
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import android.net.Uri;
|
|||
import android.text.InputFilter;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tangem.Constant;
|
||||
import com.tangem.data.Blockchain;
|
||||
import com.tangem.data.network.ServerApiInfura;
|
||||
import com.tangem.data.network.model.InfuraResponse;
|
||||
|
|
@ -19,6 +20,7 @@ import com.tangem.card_common.data.TangemCard;
|
|||
import com.tangem.card_common.tasks.SignTask;
|
||||
import com.tangem.util.CryptoUtil;
|
||||
import com.tangem.util.DecimalDigitsInputFilter;
|
||||
import com.tangem.wallet.BuildConfig;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import org.bitcoinj.core.ECKey;
|
||||
|
|
@ -264,7 +266,9 @@ public class EthEngine extends CoinEngine {
|
|||
|
||||
@Override
|
||||
public boolean checkNewTransactionAmount(Amount amount) {
|
||||
if (coinData == null) return false;
|
||||
if( BuildConfig.FLAVOR== Constant.FLAVOR_TANGEM_CARDANO ) {
|
||||
return true;
|
||||
}
|
||||
Amount balance = getBalance();
|
||||
if (balance == null || amount.compareTo(balance) > 0) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -194,9 +194,9 @@ class PrepareTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallbac
|
|||
// }
|
||||
// }
|
||||
etWallet?.setText(code)
|
||||
} else if (requestCode == Constant.REQUEST_CODE_SEND_TRANSACTION__) {
|
||||
setResult(resultCode, data)
|
||||
finish()
|
||||
// } else if (requestCode == Constant.REQUEST_CODE_SEND_TRANSACTION__) {
|
||||
// setResult(resultCode, data)
|
||||
// finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class SignTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback,
|
|||
ctx.card = card
|
||||
}
|
||||
if (ctx.coinData == null) {
|
||||
ctx.coinData = CardanoData()
|
||||
ctx.coinData = CoinEngineFactory.createCardanoData()
|
||||
}
|
||||
if (ctx.coinData.wallet.isNullOrEmpty()) {
|
||||
coinEngine.defineWallet()
|
||||
|
|
@ -197,7 +197,7 @@ class SignTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback,
|
|||
|
||||
override fun isSigningOnCardSupported(card: TangemCard?): Boolean {
|
||||
initData(card!!)
|
||||
return (card?.blockchainID == Blockchain.Cardano.id) and (txToSign!!.isSigningMethodSupported(card?.signingMethod))
|
||||
return CoinEngineFactory.isCardano(card?.blockchainID) and (txToSign!!.isSigningMethodSupported(card?.signingMethod))
|
||||
}
|
||||
|
||||
override fun getHashesToSign(card: TangemCard?): Array<ByteArray> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue