|
|
|
@ -423,13 +423,30 @@ void layoutConfirmOpReturn(const uint8_t *data, uint32_t size) {
|
|
|
|
|
NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void layoutConfirmTx(const CoinInfo *coin, uint64_t amount_out,
|
|
|
|
|
uint64_t amount_fee) {
|
|
|
|
|
char str_out[32] = {0}, str_fee[32] = {0};
|
|
|
|
|
bn_format_uint64(amount_out, NULL, coin->coin_shortcut, coin->decimals, 0,
|
|
|
|
|
false, str_out, sizeof(str_out));
|
|
|
|
|
bn_format_uint64(amount_fee, NULL, coin->coin_shortcut, coin->decimals, 0,
|
|
|
|
|
false, str_fee, sizeof(str_fee));
|
|
|
|
|
static bool formatAmountDifference(const CoinInfo *coin, uint64_t amount1,
|
|
|
|
|
uint64_t amount2, char *output,
|
|
|
|
|
size_t output_length) {
|
|
|
|
|
uint64_t abs_diff = 0;
|
|
|
|
|
const char *sign = NULL;
|
|
|
|
|
if (amount1 >= amount2) {
|
|
|
|
|
abs_diff = amount1 - amount2;
|
|
|
|
|
} else {
|
|
|
|
|
abs_diff = amount2 - amount1;
|
|
|
|
|
sign = "-";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bn_format_uint64(abs_diff, sign, coin->coin_shortcut, coin->decimals,
|
|
|
|
|
0, false, output, output_length) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void layoutConfirmTx(const CoinInfo *coin, uint64_t total_in,
|
|
|
|
|
uint64_t total_out, uint64_t change_out) {
|
|
|
|
|
char str_out[32] = {0};
|
|
|
|
|
formatAmountDifference(coin, total_in, change_out, str_out, sizeof(str_out));
|
|
|
|
|
|
|
|
|
|
char str_fee[32] = {0};
|
|
|
|
|
formatAmountDifference(coin, total_in, total_out, str_fee, sizeof(str_fee));
|
|
|
|
|
|
|
|
|
|
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL,
|
|
|
|
|
_("Really send"), str_out, _("from your wallet?"),
|
|
|
|
|
_("Fee included:"), str_fee, NULL);
|
|
|
|
|