Updated on 2026-08-14

This commit is contained in:
Tangem 2018-12-06 12:11:10 +03:00
parent 71fe425c1b
commit 6ebb46c2a5
10 changed files with 711 additions and 492 deletions

View file

@ -185,7 +185,7 @@ public abstract class CoinEngine {
public abstract boolean isBalanceNotZero();
public abstract byte[] sign(Amount feeValue, Amount amountValue, boolean IncFee, String targetAddress, CardProtocol protocol) throws Exception;
// public abstract byte[] sign(Amount feeValue, Amount amountValue, boolean IncFee, String targetAddress, CardProtocol protocol) throws Exception;
// TODO - change isExtractPossible to isExtractPossible and if not - return string message
public abstract boolean isExtractPossible();
@ -248,8 +248,22 @@ public abstract class CoinEngine {
}
public SignTask.PaymentToSign constructPayment(Amount feeValue, Amount amountValue, boolean IncFee, String targetAddress)
public abstract SignTask.PaymentToSign constructPayment(Amount feeValue, Amount amountValue, boolean IncFee, String targetAddress) throws Exception;
public interface OnNeedSendPayment
{
return null;
void onPaymentPrepared(byte[] txForSend);
}
private OnNeedSendPayment onNeedSendPayment;
public void setOnNeedSendPayment(OnNeedSendPayment onNeedSendPayment) {
this.onNeedSendPayment = onNeedSendPayment;
}
protected void notifyOnNeedSendPayment(byte[] txForSend) throws Exception {
if(onNeedSendPayment==null)
throw new Exception("Payment signed but no callback defined to send!");
onNeedSendPayment.onPaymentPrepared(txForSend);
}
}