Updated on 2026-08-14
This commit is contained in:
parent
700f62e25e
commit
a60eb1b802
5 changed files with 11 additions and 27 deletions
|
|
@ -15,7 +15,7 @@ public enum Blockchain {
|
|||
BitcoinCash("BCH", "BCH", 100000000.0, R.drawable.ic_logo_bitcoin_cash, "Bitcoin Cash"),
|
||||
Litecoin("LTC", "LTC", 100000000.0, R.drawable.ic_logo_bitcoin, "Litecoin"),
|
||||
Rootstock("RSK", "RBTC", 1.0, R.drawable.ic_logo_bitcoin, "Rootstock"),
|
||||
RootstockToken("Token", "RSK", 1.0, R.drawable.ic_logo_bat_token, "Rootstock");
|
||||
RootstockToken("Token", "RBTC", 1.0, R.drawable.ic_logo_bat_token, "Rootstock");
|
||||
|
||||
Blockchain(String ID, String currency, double multiplier, int imageResource, String officialName) {
|
||||
mID = ID;
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ public class EthEngine extends CoinEngine {
|
|||
throw new Exception("Error in " + this.getClass().getSimpleName() + " - invalid v");
|
||||
}
|
||||
tx.signature.v = (byte) v;
|
||||
Log.e(this.getClass().getSimpleName(), " V: " +String.valueOf(v));
|
||||
Log.e(this.getClass().getSimpleName(), " V: " + String.valueOf(v));
|
||||
|
||||
byte[] txForSend = tx.getEncoded();
|
||||
notifyOnNeedSendTransaction(txForSend);
|
||||
|
|
@ -588,7 +588,7 @@ public class EthEngine extends CoinEngine {
|
|||
blockchainRequestsCallbacks.onComplete(false);
|
||||
} else {
|
||||
BigInteger nonce = coinData.getConfirmedTXCount();
|
||||
nonce=nonce.add(BigInteger.valueOf(1));
|
||||
nonce = nonce.add(BigInteger.valueOf(1));
|
||||
coinData.setConfirmedTXCount(nonce);
|
||||
ctx.setError(null);
|
||||
blockchainRequestsCallbacks.onComplete(true);
|
||||
|
|
|
|||
|
|
@ -8,20 +8,12 @@ import com.tangem.data.network.ServerApiRootstock;
|
|||
import com.tangem.data.network.model.InfuraResponse;
|
||||
import com.tangem.domain.wallet.BTCUtils;
|
||||
import com.tangem.domain.wallet.CoinEngine;
|
||||
import com.tangem.domain.wallet.ECDSASignatureETH;
|
||||
import com.tangem.domain.wallet.EthTransaction;
|
||||
import com.tangem.domain.wallet.TangemContext;
|
||||
import com.tangem.domain.wallet.eth.EthData;
|
||||
import com.tangem.domain.wallet.eth.EthEngine;
|
||||
import com.tangem.tangemcard.data.TangemCard;
|
||||
import com.tangem.tangemcard.tasks.SignTask;
|
||||
import com.tangem.util.CryptoUtil;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import org.bitcoinj.core.ECKey;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RskEngine extends EthEngine {
|
||||
|
||||
|
|
@ -60,7 +52,7 @@ public class RskEngine extends EthEngine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Uri getWalletExplorerUri()) {
|
||||
public Uri getWalletExplorerUri() {
|
||||
return Uri.parse("https://explorer.rsk.co/address/" + ctx.getCoinData().getWallet());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,27 +3,17 @@ package com.tangem.domain.wallet.rsk;
|
|||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.tangem.data.Blockchain;
|
||||
import com.tangem.data.network.ServerApiRootstock;
|
||||
import com.tangem.data.network.model.InfuraResponse;
|
||||
import com.tangem.domain.wallet.BTCUtils;
|
||||
import com.tangem.domain.wallet.CoinEngine;
|
||||
import com.tangem.domain.wallet.ECDSASignatureETH;
|
||||
import com.tangem.domain.wallet.EthTransaction;
|
||||
import com.tangem.domain.wallet.TangemContext;
|
||||
import com.tangem.domain.wallet.token.TokenEngine;
|
||||
import com.tangem.tangemcard.data.TangemCard;
|
||||
import com.tangem.tangemcard.tasks.SignTask;
|
||||
import com.tangem.util.CryptoUtil;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import org.bitcoinj.core.ECKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RskTokenEngine extends TokenEngine {
|
||||
|
||||
|
|
@ -48,7 +38,9 @@ public class RskTokenEngine extends TokenEngine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Uri getWalletExplorerUri() { return Uri.parse("https://explorer.rsk.co/address/" + ctx.getCoinData().getWallet()); } // Only RSK explorer for now
|
||||
public Uri getWalletExplorerUri() {
|
||||
return Uri.parse("https://explorer.rsk.co/address/" + ctx.getCoinData().getWallet());
|
||||
} // Only RSK explorer for now
|
||||
|
||||
@Override
|
||||
public Uri getShareWalletUri() {
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ public class TokenEngine extends CoinEngine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SignTask.TransactionToSign constructPayment(Amount amountValue, Amount feeValue, boolean IncFee, String targetAddress) throws Exception {
|
||||
public SignTask.TransactionToSign constructTransaction(Amount amountValue, Amount feeValue, boolean IncFee, String targetAddress) throws Exception {
|
||||
if (amountValue.getCurrency().equals(this.getBlockchain().getCurrency())) {
|
||||
return constructTransactionCoin(feeValue, amountValue, IncFee, targetAddress);
|
||||
} else {
|
||||
|
|
@ -528,7 +528,7 @@ public class TokenEngine extends CoinEngine {
|
|||
}
|
||||
|
||||
private SignTask.TransactionToSign constructTransactionToken(Amount feeValue, Amount amountValue, boolean IncFee, String targetAddress) throws Exception {
|
||||
Log.e(TAG, "Construct TOKEN transaction "+amountValue.toString()+" with fee "+feeValue.toString()+(IncFee?" including":" excluding"));
|
||||
Log.e(TAG, "Construct TOKEN transaction " + amountValue.toString() + " with fee " + feeValue.toString() + (IncFee ? " including" : " excluding"));
|
||||
|
||||
BigInteger nonceValue = coinData.getConfirmedTXCount();
|
||||
byte[] pbKey = ctx.getCard().getWalletPublicKey();
|
||||
|
|
@ -593,12 +593,12 @@ public class TokenEngine extends CoinEngine {
|
|||
|
||||
@Override
|
||||
public byte[] getRawDataToSign() throws Exception {
|
||||
throw new Exception("Signing of raw transaction not supported for ETH");
|
||||
throw new Exception("Signing of raw transaction not supported for " + this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHashAlgToSign() throws Exception {
|
||||
throw new Exception("Signing of raw transaction not supported for ETH");
|
||||
throw new Exception("Signing of raw transaction not supported for " + this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue