Updated on 2026-08-14
This commit is contained in:
commit
8216d448bc
3 changed files with 14 additions and 7 deletions
|
|
@ -141,7 +141,7 @@ public class BtcCashEngine extends CoinEngine {
|
|||
|
||||
@Override
|
||||
public Uri getWalletExplorerUri() {
|
||||
return Uri.parse("https://api.blockchair.com/bitcoin-cash/dashboards/address/" + ctx.getCoinData().getWallet());
|
||||
return Uri.parse("https://blockchair.com/bitcoin-cash/address/" + ctx.getCoinData().getWallet());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -342,21 +342,23 @@ public class XrpEngine extends CoinEngine {
|
|||
public SignTask.TransactionToSign constructTransaction(Amount amountValue, Amount feeValue, boolean IncFee, String targetAddress) throws Exception {
|
||||
checkBlockchainDataExists();
|
||||
|
||||
Amount reserve = convertToAmount(coinData.getReserveInInternalUnits());
|
||||
if (!coinData.isTargetAccountCreated() && amountValue.compareTo(reserve) < 0) {
|
||||
throw new Exception("Target account is not created. Amount should be " + reserve.toDescriptionString(getDecimals()) + " or more");
|
||||
}
|
||||
|
||||
String amount, fee;
|
||||
|
||||
if (IncFee) {
|
||||
amount = convertToInternalAmount(amountValue).subtract(convertToInternalAmount(feeValue)).setScale(0).toPlainString();
|
||||
} else {
|
||||
amount = Long.toString(convertToInternalAmount(amountValue).longValueExact());
|
||||
amount = Long.toString(convertToInternalAmount(amountValue).longValue());
|
||||
}
|
||||
|
||||
fee = Long.toString(convertToInternalAmount(feeValue).longValueExact());
|
||||
|
||||
if (!coinData.isTargetAccountCreated() &&
|
||||
Long.valueOf(amount).compareTo(coinData.getReserveInInternalUnits().longValue()) < 0
|
||||
) {
|
||||
String reserveDescription = convertToAmount(coinData.getReserveInInternalUnits()).toDescriptionString(getDecimals());
|
||||
throw new IllegalArgumentException("Target account is not created. Send " + reserveDescription + " or more to create");
|
||||
}
|
||||
|
||||
XrpPayment payment = new XrpPayment();
|
||||
|
||||
// Put `as` AccountID field Account, `Object` o
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import com.tangem.wallet.TangemContext
|
|||
import kotlinx.android.synthetic.main.layout_progress_horizontal.*
|
||||
import kotlinx.android.synthetic.main.layout_touch_card.*
|
||||
import kotlinx.android.synthetic.tangemAccess.fragment_sign_transaction.*
|
||||
import java.lang.IllegalArgumentException
|
||||
|
||||
|
||||
class SignTransactionFragment : BaseFragment(), NavigationResultListener,
|
||||
|
|
@ -148,6 +149,10 @@ class SignTransactionFragment : BaseFragment(), NavigationResultListener,
|
|||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
} catch(e: IllegalArgumentException) {
|
||||
val data = Bundle()
|
||||
data.putString(Constant.EXTRA_MESSAGE, e.message)
|
||||
navigateBackWithResult(Activity.RESULT_CANCELED, data, R.id.loadedWalletFragment)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue