forked from lthn/blockchain
Develop (#208)
* fixed issue when user at first typing '.' in field amount * show amount value in modal without 0 * changed wallet colors style * fixed few issues with attachment encryption * added extra conditions on extra fields update in wallet * has_field_of_type_in_extra() -> have_type_in_variant_container() * implemented exclude_staking_txs filter * Implement master password confirmation * Small GUI bugs-> added translate for scale * Unexpected screen after clicking 'go back' Co-authored-by: cryptozoidberg <crypto.zoidberg@gmail.com> Co-authored-by: sowle <crypto.sowle@gmail.com>
This commit is contained in:
parent
b02fc0b5d8
commit
21665f897d
77 changed files with 600 additions and 84 deletions
|
|
@ -508,7 +508,7 @@ namespace currency
|
|||
END_SERIALIZE()
|
||||
};
|
||||
|
||||
struct etc_tx_uint16_t
|
||||
struct etc_tx_flags16_t
|
||||
{
|
||||
uint16_t v;
|
||||
BEGIN_SERIALIZE()
|
||||
|
|
@ -518,7 +518,7 @@ namespace currency
|
|||
|
||||
typedef boost::mpl::vector21<
|
||||
tx_service_attachment, tx_comment, tx_payer_old, tx_receiver_old, tx_derivation_hint, std::string, tx_crypto_checksum, etc_tx_time, etc_tx_details_unlock_time, etc_tx_details_expiration_time,
|
||||
etc_tx_details_flags, crypto::public_key, extra_attachment_info, extra_alias_entry_old, extra_user_data, extra_padding, etc_tx_uint16_t, etc_tx_details_unlock_time2,
|
||||
etc_tx_details_flags, crypto::public_key, extra_attachment_info, extra_alias_entry_old, extra_user_data, extra_padding, etc_tx_flags16_t, etc_tx_details_unlock_time2,
|
||||
tx_payer, tx_receiver, extra_alias_entry
|
||||
> all_payload_types;
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ SET_VARIANT_TAGS(currency::extra_user_data, 19, "user_data");
|
|||
SET_VARIANT_TAGS(currency::extra_alias_entry_old, 20, "alias_entry");
|
||||
SET_VARIANT_TAGS(currency::extra_padding, 21, "extra_padding");
|
||||
SET_VARIANT_TAGS(crypto::public_key, 22, "pub_key");
|
||||
SET_VARIANT_TAGS(currency::etc_tx_uint16_t, 23, "etc_tx_uint16");
|
||||
SET_VARIANT_TAGS(currency::etc_tx_flags16_t, 23, "etc_tx_flags16");
|
||||
SET_VARIANT_TAGS(uint16_t, 24, "derive_xor");
|
||||
//txout_v
|
||||
SET_VARIANT_TAGS(currency::ref_by_id, 25, "ref_by_id");
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ namespace boost
|
|||
}
|
||||
|
||||
template <class Archive>
|
||||
inline void serialize(Archive &a, currency::etc_tx_uint16_t&at, const boost::serialization::version_type ver)
|
||||
inline void serialize(Archive &a, currency::etc_tx_flags16_t&at, const boost::serialization::version_type ver)
|
||||
{
|
||||
a & at.v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@
|
|||
#define BC_OFFERS_CURRENCY_MARKET_FILENAME "market.bin"
|
||||
|
||||
|
||||
#define WALLET_FILE_SERIALIZATION_VERSION (CURRENCY_FORMATION_VERSION+67)
|
||||
#define WALLET_FILE_SERIALIZATION_VERSION (CURRENCY_FORMATION_VERSION+68)
|
||||
|
||||
|
||||
#define CURRENT_MEMPOOL_ARCHIVE_VER (CURRENCY_FORMATION_VERSION+31)
|
||||
|
|
|
|||
|
|
@ -710,6 +710,16 @@ namespace currency
|
|||
crypto::chacha_crypt(m.acc_addr, m_key);
|
||||
m_was_crypted_entries = true;
|
||||
}
|
||||
void operator()(tx_payer_old& pr)
|
||||
{
|
||||
crypto::chacha_crypt(pr.acc_addr, m_key);
|
||||
m_was_crypted_entries = true;
|
||||
}
|
||||
void operator()(tx_receiver_old& m)
|
||||
{
|
||||
crypto::chacha_crypt(m.acc_addr, m_key);
|
||||
m_was_crypted_entries = true;
|
||||
}
|
||||
void operator()(tx_service_attachment& sa)
|
||||
{
|
||||
if (sa.flags&TX_SERVICE_ATTACHMENT_DEFLATE_BODY)
|
||||
|
|
@ -772,7 +782,18 @@ namespace currency
|
|||
crypto::chacha_crypt(receiver_local.acc_addr, rkey);
|
||||
rdecrypted_att.push_back(receiver_local);
|
||||
}
|
||||
|
||||
void operator()(const tx_payer_old& pr)
|
||||
{
|
||||
tx_payer_old payer_local = pr;
|
||||
crypto::chacha_crypt(payer_local.acc_addr, rkey);
|
||||
rdecrypted_att.push_back(payer_local);
|
||||
}
|
||||
void operator()(const tx_receiver_old& pr)
|
||||
{
|
||||
tx_receiver_old receiver_local = pr;
|
||||
crypto::chacha_crypt(receiver_local.acc_addr, rkey);
|
||||
rdecrypted_att.push_back(receiver_local);
|
||||
}
|
||||
template<typename attachment_t>
|
||||
void operator()(const attachment_t& att)
|
||||
{
|
||||
|
|
@ -1049,6 +1070,11 @@ namespace currency
|
|||
add_tx_pub_key_to_extra(tx, txkey.pub);
|
||||
one_time_secret_key = txkey.sec;
|
||||
|
||||
//add flags
|
||||
etc_tx_flags16_t e = AUTO_VAL_INIT(e);
|
||||
//todo: add some flags here
|
||||
update_or_add_field_to_extra(tx.extra, e);
|
||||
|
||||
//include offers if need
|
||||
tx.attachment = attachments;
|
||||
encrypt_attachments(tx, sender_account_keys, crypt_destination_addr, txkey);
|
||||
|
|
@ -2316,18 +2342,15 @@ namespace currency
|
|||
|
||||
return true;
|
||||
}
|
||||
bool operator()(const etc_tx_uint16_t& dh)
|
||||
bool operator()(const etc_tx_flags16_t& dh)
|
||||
{
|
||||
tv.type = "XOR";
|
||||
tv.type = "FLAGS16";
|
||||
tv.short_view = epee::string_tools::pod_to_hex(dh);
|
||||
tv.datails_view = epee::string_tools::pod_to_hex(dh);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------
|
||||
template<class t_container>
|
||||
bool fill_tx_rpc_payload_items(std::vector<tx_extra_rpc_entry>& target_vector, const t_container& tc)
|
||||
|
|
|
|||
|
|
@ -433,8 +433,7 @@ namespace currency
|
|||
ai.m_alias = ard.alias;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------
|
||||
template<class extra_t>
|
||||
extra_t& get_or_add_field_to_extra(std::vector<extra_v>& extra)
|
||||
{
|
||||
|
|
@ -446,6 +445,7 @@ namespace currency
|
|||
extra.push_back(extra_t());
|
||||
return boost::get<extra_t>(extra.back());
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
template<class variant_t, class variant_type_t>
|
||||
void update_or_add_field_to_extra(std::vector<variant_t>& variant_container, const variant_type_t& v)
|
||||
{
|
||||
|
|
@ -459,7 +459,22 @@ namespace currency
|
|||
}
|
||||
variant_container.push_back(v);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
template<class variant_type_t, class variant_t>
|
||||
void remove_field_of_type_from_extra(std::vector<variant_t>& variant_container)
|
||||
{
|
||||
for (size_t i = 0; i != variant_container.size();)
|
||||
{
|
||||
if (variant_container[i].type() == typeid(variant_type_t))
|
||||
{
|
||||
variant_container.erase(variant_container.begin()+i);
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
template<typename t_container>
|
||||
bool get_payment_id_from_tx(const t_container& att, std::string& payment_id)
|
||||
|
|
|
|||
|
|
@ -1651,7 +1651,7 @@ QString MainWindow::open_wallet(const QString& param)
|
|||
//return que_call2<view::open_wallet_request>("open_wallet", param, [this](const view::open_wallet_request& owd, view::api_response& ar){
|
||||
PREPARE_ARG_FROM_JSON(view::open_wallet_request, owd);
|
||||
PREPARE_RESPONSE(view::open_wallet_response, ar);
|
||||
ar.error_code = m_backend.open_wallet(epee::string_encoding::utf8_to_wstring(owd.path), owd.pass, owd.txs_to_return, ar.response_data);
|
||||
ar.error_code = m_backend.open_wallet(epee::string_encoding::utf8_to_wstring(owd.path), owd.pass, owd.txs_to_return, ar.response_data, owd.exclude_mining_txs);
|
||||
return MAKE_RESPONSE(ar);
|
||||
CATCH_ENTRY_FAIL_API_RESPONCE();
|
||||
}
|
||||
|
|
@ -1795,7 +1795,7 @@ QString MainWindow::get_recent_transfers(const QString& param)
|
|||
LOG_API_TIMING();
|
||||
PREPARE_ARG_FROM_JSON(view::get_recent_transfers_request, a);
|
||||
PREPARE_RESPONSE(view::transfers_array, ar);
|
||||
ar.error_code = m_backend.get_recent_transfers(a.wallet_id, a.offset, a.count, ar.response_data);
|
||||
ar.error_code = m_backend.get_recent_transfers(a.wallet_id, a.offset, a.count, ar.response_data, a.exclude_mining_txs);
|
||||
return MAKE_RESPONSE(ar);
|
||||
CATCH_ENTRY_FAIL_API_RESPONCE();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 Stunde",
|
||||
"TIME4": "Nie"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% Rahmen",
|
||||
"100": "100% Rahmen",
|
||||
"125": "125% Rahmen",
|
||||
"150": "150% Rahmen"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Master-Passwort aktualisieren",
|
||||
"OLD": "Altes Passwort",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 heure",
|
||||
"TIME4": "Jamais"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% échelle",
|
||||
"100": "100% échelle",
|
||||
"125": "125% échelle",
|
||||
"150": "150% échelle"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Mettre à jour le mot de passe principal",
|
||||
"OLD": "Ancien mot de passe",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 ora",
|
||||
"TIME4": "Mai"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scala",
|
||||
"100": "100% scala",
|
||||
"125": "125% scala",
|
||||
"150": "150% scala"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Aggiorna password principale",
|
||||
"OLD": "Vecchia password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hora",
|
||||
"TIME4": "Nunca"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% escala",
|
||||
"100": "100% escala",
|
||||
"125": "125% escala",
|
||||
"150": "150% escala"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Atualizar password mestra",
|
||||
"OLD": "Antiga password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -101,7 +101,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
|||
this.variablesService.startCountdown();
|
||||
}
|
||||
this.ngZone.run(() => {
|
||||
this.router.navigate(['/']);
|
||||
this.router.navigate(['/'], {queryParams: {prevUrl: 'login'}});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="content">
|
||||
|
||||
<div class="head" *ngIf="variablesService.wallets.length > 0">
|
||||
<div class="head" *ngIf="variablesService.wallets.length > 0 && prevUrl !== 'login'">
|
||||
<button type="button" class="back-btn" (click)="back()">
|
||||
<i class="icon back"></i>
|
||||
<span>{{ 'COMMON.BACK' | translate }}</span>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {Component, NgZone, OnInit} from '@angular/core';
|
|||
import {Location} from '@angular/common';
|
||||
import {BackendService} from '../_helpers/services/backend.service';
|
||||
import {VariablesService} from '../_helpers/services/variables.service';
|
||||
import {Router} from '@angular/router';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
|
|
@ -12,17 +12,23 @@ import {TranslateService} from '@ngx-translate/core';
|
|||
})
|
||||
export class MainComponent implements OnInit {
|
||||
|
||||
public prevUrl: string = '';
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
private backend: BackendService,
|
||||
private variablesService: VariablesService,
|
||||
public variablesService: VariablesService,
|
||||
private ngZone: NgZone,
|
||||
private translate: TranslateService
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.route.snapshot.queryParams && this.route.snapshot.queryParams.prevUrl) {
|
||||
this.prevUrl = this.route.snapshot.queryParams.prevUrl;
|
||||
}
|
||||
}
|
||||
|
||||
openWallet() {
|
||||
|
|
|
|||
|
|
@ -2,30 +2,48 @@
|
|||
<div class="title">
|
||||
<span>{{ 'CONFIRM.TITLE' | translate }}</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="message-container">
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.SEND' | translate }}</div>
|
||||
<div class="message-text">{{ +form.get('amount').value }} {{variablesService.defaultCurrency}}</div>
|
||||
</div>
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.FROM' | translate }}</div>
|
||||
<div class="message-text">{{ variablesService.currentWallet.address }}</div>
|
||||
</div>
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.TO' | translate }}</div>
|
||||
<div class="message-text">{{ form.get('address').value }}</div>
|
||||
</div>
|
||||
<ng-container *ngIf="form.get('comment').value != ''">
|
||||
<div class="message-block" *ngIf="form.get('comment').value != null">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.COMMENT' | translate }}</div>
|
||||
<div class="message-text">{{ form.get('comment').value }}</div>
|
||||
<form [formGroup]="confirmForm" (ngSubmit)="confirm()">
|
||||
<div class="content">
|
||||
<div class="message-container">
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.SEND' | translate }}</div>
|
||||
<div class="message-text">{{ +form.get('amount').value }} {{variablesService.defaultCurrency}}</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.FROM' | translate }}</div>
|
||||
<div class="message-text">{{ variablesService.currentWallet.address }}</div>
|
||||
</div>
|
||||
<div class="message-block">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.TO' | translate }}</div>
|
||||
<div class="message-text">{{ form.get('address').value }}</div>
|
||||
</div>
|
||||
<ng-container *ngIf="form.get('comment').value != ''">
|
||||
<div class="message-block" *ngIf="form.get('comment').value != null">
|
||||
<div class="message-label">{{ 'CONFIRM.MESSAGE.COMMENT' | translate }}</div>
|
||||
<div class="message-text">{{ form.get('comment').value }}</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="message-block confirm-master-pass">
|
||||
<div class="input-block" *ngIf="variablesService.appPass">
|
||||
<label for="password">{{ 'LOGIN.MASTER_PASS' | translate }}</label>
|
||||
<input type="password" id="password" name="password" formControlName="password" autofocus (contextmenu)="variablesService.onContextMenuPasteSelect($event)"/>
|
||||
<div class="error-block" >
|
||||
<div *ngIf="(confirmForm.controls['password'].errors && confirmForm.controls['password'].errors.requiredPass)
|
||||
|| (!confirmForm.controls['password'].value && confirmForm.controls['password'].touched)">
|
||||
{{ 'LOGIN.FORM_ERRORS.PASS_REQUIRED' | translate }}
|
||||
</div>
|
||||
<div *ngIf="confirmForm.controls['password'].errors && confirmForm.controls['password'].errors.passwordNotMatch">
|
||||
{{ 'LOGIN.FORM_ERRORS.MISMATCH' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper-buttons">
|
||||
<button type="button" class="blue-button" (click)="confirm()">{{ 'CONFIRM.BUTTON_CONFIRM' | translate }}</button>
|
||||
<button type="button" class="blue-button" (click)="onClose()">{{ 'CONFIRM.BUTTON_CANCEL' | translate }}</button>
|
||||
</div>
|
||||
<div class="wrapper-buttons">
|
||||
<button type="submit" class="blue-button" (click)="confirm()">{{ 'CONFIRM.BUTTON_CONFIRM' | translate }}</button>
|
||||
<button type="button" class="blue-button" (click)="onClose()">{{ 'CONFIRM.BUTTON_CANCEL' | translate }}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
margin: 1.4rem 3rem 6.2rem 0;
|
||||
|
||||
|
||||
.message-block {
|
||||
display: flex;
|
||||
margin-bottom: 1rem;
|
||||
|
|
@ -65,8 +65,15 @@
|
|||
width: 43.4rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.confirm-master-pass {
|
||||
width: 100%;
|
||||
margin: 2rem 0;
|
||||
.input-block {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { Component, OnInit, Output, EventEmitter, Input} from '@angular/core';
|
||||
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||
import { VariablesService } from '../_helpers/services/variables.service';
|
||||
|
||||
|
||||
|
|
@ -10,19 +10,40 @@ import { VariablesService } from '../_helpers/services/variables.service';
|
|||
})
|
||||
export class SendModalComponent implements OnInit {
|
||||
|
||||
confirmForm = new FormGroup({
|
||||
password: new FormControl('')
|
||||
});
|
||||
|
||||
@Input() form: FormGroup;
|
||||
@Output() confirmed: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
|
||||
constructor(
|
||||
public variablesService: VariablesService
|
||||
public variablesService: VariablesService,
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if(this.variablesService.appPass) {
|
||||
this.confirmForm.controls['password'].setValidators([Validators.required]);
|
||||
this.confirmForm.updateValueAndValidity();
|
||||
}
|
||||
}
|
||||
|
||||
confirm() {
|
||||
this.confirmed.emit(true);
|
||||
if(this.variablesService.appPass) {
|
||||
if (this.confirmForm.controls['password'].value === '') {
|
||||
this.confirmForm.controls['password'].setErrors({requiredPass: true});
|
||||
return;
|
||||
}
|
||||
this.confirmForm.controls['password'].setErrors({requiredPass: false});
|
||||
if (this.variablesService.appPass === this.confirmForm.controls['password'].value) {
|
||||
this.confirmed.emit(true);
|
||||
} else {
|
||||
this.confirmForm.controls['password'].setErrors({passwordNotMatch: true})
|
||||
}
|
||||
} else {
|
||||
this.confirmed.emit(true);
|
||||
}
|
||||
}
|
||||
|
||||
onClose() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="sidebar-accounts">
|
||||
<div class="sidebar-accounts-header">
|
||||
<h3>{{ 'SIDEBAR.TITLE' | translate }}</h3><button [routerLink]="['main']">{{ 'SIDEBAR.ADD_NEW' | translate }}</button>
|
||||
<h3>{{ 'SIDEBAR.TITLE' | translate }}</h3><button (click)="goMainPage()">{{ 'SIDEBAR.ADD_NEW' | translate }}</button>
|
||||
</div>
|
||||
<div class="sidebar-accounts-list scrolled-content">
|
||||
<div class="sidebar-account" *ngFor="let wallet of variablesService.wallets" [class.active]="wallet?.wallet_id === walletActive" [routerLink]="['/wallet/' + wallet.wallet_id + '/history']">
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
Watch-only
|
||||
</div>
|
||||
<div class="content auditable-watch-only" *ngIf="wallet.is_auditable && wallet.is_watch_only">
|
||||
Tracking
|
||||
Auditable Watch-Only
|
||||
</div>
|
||||
</div>
|
||||
<div class="close-wallet-wrapper">
|
||||
|
|
|
|||
|
|
@ -61,6 +61,19 @@ export class SidebarComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
goMainPage() {
|
||||
if (this.route.snapshot.queryParams && this.route.snapshot.queryParams.prevUrl === 'login') {
|
||||
this.ngZone.run(() => {
|
||||
this.router.navigate(['/'], {queryParams: {prevUrl: 'login'}});
|
||||
});
|
||||
} else {
|
||||
this.ngZone.run(() => {
|
||||
this.router.navigate(['/']);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
contactsRoute() {
|
||||
if (this.variablesService.appPass) {
|
||||
this.router.navigate(['/contacts']);
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 Stunde",
|
||||
"TIME4": "Nie"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% Rahmen",
|
||||
"100": "100% Rahmen",
|
||||
"125": "125% Rahmen",
|
||||
"150": "150% Rahmen"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Master-Passwort aktualisieren",
|
||||
"OLD": "Altes Passwort",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 heure",
|
||||
"TIME4": "Jamais"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% échelle",
|
||||
"100": "100% échelle",
|
||||
"125": "125% échelle",
|
||||
"150": "150% échelle"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Mettre à jour le mot de passe principal",
|
||||
"OLD": "Ancien mot de passe",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 ora",
|
||||
"TIME4": "Mai"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scala",
|
||||
"100": "100% scala",
|
||||
"125": "125% scala",
|
||||
"150": "150% scala"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Aggiorna password principale",
|
||||
"OLD": "Vecchia password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hora",
|
||||
"TIME4": "Nunca"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% escala",
|
||||
"100": "100% escala",
|
||||
"125": "125% escala",
|
||||
"150": "150% escala"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Atualizar password mestra",
|
||||
"OLD": "Antiga password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@
|
|||
"TIME3": "1 hour",
|
||||
"TIME4": "Never"
|
||||
},
|
||||
"SCALE": {
|
||||
"75": "75% scale",
|
||||
"100": "100% scale",
|
||||
"125": "125% scale",
|
||||
"150": "150% scale"
|
||||
},
|
||||
"MASTER_PASSWORD": {
|
||||
"TITLE": "Update master password",
|
||||
"OLD": "Old password",
|
||||
|
|
|
|||
|
|
@ -371,11 +371,13 @@ public:
|
|||
std::vector<tools::wallet_public::wallet_transfer_info> unconfirmed;
|
||||
std::vector<tools::wallet_public::wallet_transfer_info> history;
|
||||
uint64_t total_history_items;
|
||||
uint64_t last_item_index;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(unconfirmed)
|
||||
KV_SERIALIZE(history)
|
||||
KV_SERIALIZE(total_history_items)
|
||||
KV_SERIALIZE(last_item_index)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
|
||||
};
|
||||
|
|
@ -385,11 +387,13 @@ public:
|
|||
std::string pass;
|
||||
std::string path;
|
||||
uint64_t txs_to_return;
|
||||
bool exclude_mining_txs;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(pass)
|
||||
KV_SERIALIZE(path)
|
||||
KV_SERIALIZE(txs_to_return)
|
||||
KV_SERIALIZE(exclude_mining_txs)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
|
|
@ -398,6 +402,7 @@ public:
|
|||
uint64_t wallet_id;
|
||||
uint64_t offset;
|
||||
uint64_t count;
|
||||
bool exclude_mining_txs;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(wallet_id)
|
||||
|
|
|
|||
|
|
@ -1184,6 +1184,15 @@ void wallet2::prepare_wti(wallet_public::wallet_transfer_info& wti, uint64_t hei
|
|||
|
||||
|
||||
decrypt_payload_items(decrypt_attachment_as_income, tx, m_account.get_keys(), decrypted_att);
|
||||
if ((is_watch_only() && !wti.is_income)|| (height > 638000 && !have_type_in_variant_container<etc_tx_flags16_t>(decrypted_att)))
|
||||
{
|
||||
remove_field_of_type_from_extra<tx_receiver_old>(decrypted_att);
|
||||
remove_field_of_type_from_extra<tx_payer_old>(decrypted_att);
|
||||
}
|
||||
if (is_watch_only() && !wti.is_income)
|
||||
{
|
||||
remove_field_of_type_from_extra<tx_comment>(decrypted_att);
|
||||
}
|
||||
prepare_wti_decrypted_attachments(wti, decrypted_att);
|
||||
process_contract_info(wti, decrypted_att);
|
||||
}
|
||||
|
|
@ -2890,17 +2899,27 @@ uint64_t wallet2::get_transfer_entries_count()
|
|||
return m_transfers.size();
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total)
|
||||
void wallet2::get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total, uint64_t& last_item_index, bool exclude_mining_txs)
|
||||
{
|
||||
if (offset >= m_transfer_history.size())
|
||||
if (!count || offset >= m_transfer_history.size())
|
||||
return;
|
||||
|
||||
auto start = m_transfer_history.rbegin() + offset;
|
||||
auto stop = m_transfer_history.size() - offset >= count ? start + count : m_transfer_history.rend();
|
||||
if (!count)
|
||||
stop = m_transfer_history.rend();
|
||||
|
||||
trs.insert(trs.end(), start, stop);
|
||||
for (auto it = m_transfer_history.rbegin() + offset; it != m_transfer_history.rend(); it++)
|
||||
{
|
||||
if (exclude_mining_txs)
|
||||
{
|
||||
if(it->is_mining)
|
||||
continue;
|
||||
}
|
||||
trs.push_back(*it);
|
||||
last_item_index = it - m_transfer_history.rbegin();
|
||||
|
||||
if (trs.size() >= count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
total = m_transfer_history.size();
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
|
@ -3223,10 +3242,16 @@ bool wallet2::build_minted_block(const currency::COMMAND_RPC_SCAN_POS::request&
|
|||
return true;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::get_unconfirmed_transfers(std::vector<wallet_public::wallet_transfer_info>& trs)
|
||||
void wallet2::get_unconfirmed_transfers(std::vector<wallet_public::wallet_transfer_info>& trs, bool exclude_mining_txs)
|
||||
{
|
||||
for (auto& u : m_unconfirmed_txs)
|
||||
{
|
||||
if (exclude_mining_txs && u.second.is_mining)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
trs.push_back(u.second);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::set_core_runtime_config(const currency::core_runtime_config& pc)
|
||||
|
|
@ -4163,8 +4188,8 @@ bool wallet2::extract_offers_from_transfer_entry(size_t i, std::unordered_map<cr
|
|||
auto it = offers_local.find(h);
|
||||
if (it == offers_local.end())
|
||||
{
|
||||
WLT_LOG_L3("Unable to find original tx record " << h << " in cancel offer " << h);
|
||||
break;
|
||||
WLT_LOG_L3("Unable to find original tx record " << h << " in cancel offer " << h);
|
||||
break;
|
||||
}
|
||||
offers_local.erase(it);
|
||||
|
||||
|
|
@ -4220,7 +4245,7 @@ uint64_t wallet2::select_indices_for_transfer(std::vector<uint64_t>& selected_in
|
|||
WLT_LOG_GREEN("Selecting indices for transfer of " << print_money_brief(needed_money) << " with " << fake_outputs_count << " fake outs, found_free_amounts.size()=" << found_free_amounts.size() << "...", LOG_LEVEL_0);
|
||||
uint64_t found_money = 0;
|
||||
std::string selected_amounts_str;
|
||||
while(found_money < needed_money && found_free_amounts.size())
|
||||
while (found_money < needed_money && found_free_amounts.size())
|
||||
{
|
||||
auto it = found_free_amounts.lower_bound(needed_money - found_money);
|
||||
if (!(it != found_free_amounts.end() && it->second.size()))
|
||||
|
|
@ -4253,6 +4278,23 @@ bool wallet2::is_transfer_ready_to_go(const transfer_details& td, uint64_t fake_
|
|||
return false;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::wipeout_extra_if_needed(std::vector<wallet_public::wallet_transfer_info>& transfer_history)
|
||||
{
|
||||
WLT_LOG_L0("Processing [wipeout_extra_if_needed]...");
|
||||
for (auto it = transfer_history.begin(); it != transfer_history.end(); )
|
||||
{
|
||||
if (it->height > 638000)
|
||||
{
|
||||
it->remote_addresses.clear();
|
||||
if (is_watch_only() && !it->is_income)
|
||||
{
|
||||
it->comment.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
WLT_LOG_L0("Processing [wipeout_extra_if_needed] DONE");
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
bool wallet2::is_transfer_able_to_go(const transfer_details& td, uint64_t fake_outputs_count)
|
||||
{
|
||||
if (!td.is_spendable())
|
||||
|
|
|
|||
|
|
@ -482,10 +482,10 @@ namespace tools
|
|||
currency::account_base& get_account() { return m_account; }
|
||||
const currency::account_base& get_account() const { return m_account; }
|
||||
|
||||
void get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total);
|
||||
void get_recent_transfers_history(std::vector<wallet_public::wallet_transfer_info>& trs, size_t offset, size_t count, uint64_t& total, uint64_t& last_item_index, bool exclude_mining_txs = false);
|
||||
uint64_t get_recent_transfers_total_count();
|
||||
uint64_t get_transfer_entries_count();
|
||||
void get_unconfirmed_transfers(std::vector<wallet_public::wallet_transfer_info>& trs);
|
||||
void get_unconfirmed_transfers(std::vector<wallet_public::wallet_transfer_info>& trs, bool exclude_mining_txs = false);
|
||||
void init(const std::string& daemon_address = "http://localhost:8080");
|
||||
bool deinit();
|
||||
|
||||
|
|
@ -730,8 +730,14 @@ namespace tools
|
|||
a & m_tx_keys;
|
||||
a & m_last_pow_block_h;
|
||||
|
||||
//after processing
|
||||
if (ver < 152)
|
||||
{
|
||||
wipeout_extra_if_needed(m_transfer_history);
|
||||
}
|
||||
}
|
||||
|
||||
void wipeout_extra_if_needed(std::vector<wallet_public::wallet_transfer_info>& transfer_history);
|
||||
bool is_transfer_ready_to_go(const transfer_details& td, uint64_t fake_outputs_count);
|
||||
bool is_transfer_able_to_go(const transfer_details& td, uint64_t fake_outputs_count);
|
||||
uint64_t select_indices_for_transfer(std::vector<uint64_t>& ind, free_amounts_cache_type& found_free_amounts, uint64_t needed_money, uint64_t fake_outputs_count);
|
||||
|
|
|
|||
|
|
@ -275,11 +275,13 @@ namespace wallet_public
|
|||
of GET_RECENT_TXS_AND_INFO with offsets)
|
||||
*/
|
||||
bool update_provision_info;
|
||||
bool exclude_mining_txs;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(offset)
|
||||
KV_SERIALIZE(count)
|
||||
KV_SERIALIZE(update_provision_info)
|
||||
KV_SERIALIZE(exclude_mining_txs)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
|
|
@ -288,11 +290,13 @@ namespace wallet_public
|
|||
wallet_provision_info pi;
|
||||
std::vector<wallet_transfer_info> transfers;
|
||||
uint64_t total_transfers;
|
||||
uint64_t last_item_index;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(pi)
|
||||
KV_SERIALIZE(transfers)
|
||||
KV_SERIALIZE(total_transfers)
|
||||
KV_SERIALIZE(last_item_index)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -223,9 +223,9 @@ namespace tools
|
|||
}
|
||||
|
||||
if (req.offset == 0)
|
||||
m_wallet.get_unconfirmed_transfers(res.transfers);
|
||||
m_wallet.get_unconfirmed_transfers(res.transfers, req.exclude_mining_txs);
|
||||
|
||||
m_wallet.get_recent_transfers_history(res.transfers, req.offset, req.count, res.total_transfers);
|
||||
m_wallet.get_recent_transfers_history(res.transfers, req.offset, req.count, res.total_transfers, res.last_item_index, req.exclude_mining_txs);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ std::string wallets_manager::get_my_offers(const bc_services::core_offers_filter
|
|||
#endif
|
||||
}
|
||||
|
||||
std::string wallets_manager::open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr)
|
||||
std::string wallets_manager::open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr, bool exclude_mining_txs)
|
||||
{
|
||||
// check if that file already opened
|
||||
SHARED_CRITICAL_REGION_BEGIN(m_wallets_lock);
|
||||
|
|
@ -854,9 +854,9 @@ std::string wallets_manager::open_wallet(const std::wstring& path, const std::st
|
|||
if (w->is_watch_only() && !w->is_auditable())
|
||||
return API_RETURN_CODE_WALLET_WATCH_ONLY_NOT_SUPPORTED;
|
||||
|
||||
w->get_recent_transfers_history(owr.recent_history.history, 0, txs_to_return, owr.recent_history.total_history_items);
|
||||
w->get_recent_transfers_history(owr.recent_history.history, 0, txs_to_return, owr.recent_history.total_history_items, owr.recent_history.last_item_index, exclude_mining_txs);
|
||||
//w->get_unconfirmed_transfers(owr.recent_history.unconfirmed);
|
||||
w->get_unconfirmed_transfers(owr.recent_history.history);
|
||||
w->get_unconfirmed_transfers(owr.recent_history.history, exclude_mining_txs);
|
||||
owr.wallet_local_bc_size = w->get_blockchain_current_size();
|
||||
//workaround for missed fee
|
||||
owr.seed = w->get_account().get_seed_phrase();
|
||||
|
|
@ -912,7 +912,7 @@ bool wallets_manager::get_opened_wallets(std::list<view::open_wallet_response>&
|
|||
return true;
|
||||
}
|
||||
|
||||
std::string wallets_manager::get_recent_transfers(size_t wallet_id, uint64_t offset, uint64_t count, view::transfers_array& tr_hist)
|
||||
std::string wallets_manager::get_recent_transfers(size_t wallet_id, uint64_t offset, uint64_t count, view::transfers_array& tr_hist, bool exclude_mining_txs)
|
||||
{
|
||||
GET_WALLET_BY_ID(wallet_id, w);
|
||||
auto wallet_locked = w.try_lock();
|
||||
|
|
@ -921,8 +921,8 @@ std::string wallets_manager::get_recent_transfers(size_t wallet_id, uint64_t off
|
|||
return API_RETURN_CODE_CORE_BUSY;
|
||||
}
|
||||
|
||||
w->get()->get_unconfirmed_transfers(tr_hist.unconfirmed);
|
||||
w->get()->get_recent_transfers_history(tr_hist.history, offset, count, tr_hist.total_history_items);
|
||||
w->get()->get_unconfirmed_transfers(tr_hist.unconfirmed, exclude_mining_txs);
|
||||
w->get()->get_recent_transfers_history(tr_hist.history, offset, count, tr_hist.total_history_items, tr_hist.last_item_index, exclude_mining_txs);
|
||||
|
||||
auto fix_tx = [](tools::wallet_public::wallet_transfer_info& wti) -> void {
|
||||
wti.show_sender = currency::is_showing_sender_addres(wti.tx);
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@ public:
|
|||
bool quick_clear_wallets_no_save();
|
||||
bool send_stop_signal();
|
||||
bool get_opened_wallets(std::list<view::open_wallet_response>& result);
|
||||
std::string open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr);
|
||||
std::string open_wallet(const std::wstring& path, const std::string& password, uint64_t txs_to_return, view::open_wallet_response& owr, bool exclude_mining_txs = false);
|
||||
std::string generate_wallet(const std::wstring& path, const std::string& password, view::open_wallet_response& owr);
|
||||
std::string restore_wallet(const std::wstring& path, const std::string& password, const std::string& restore_key, view::open_wallet_response& owr);
|
||||
std::string invoke(uint64_t wallet_id, std::string params);
|
||||
std::string get_wallet_status(uint64_t wallet_id);
|
||||
std::string run_wallet(uint64_t wallet_id);
|
||||
std::string get_recent_transfers(size_t wallet_id, uint64_t offset, uint64_t count, view::transfers_array& tr_hist);
|
||||
std::string get_recent_transfers(size_t wallet_id, uint64_t offset, uint64_t count, view::transfers_array& tr_hist, bool exclude_mining_txs = false);
|
||||
std::string get_wallet_info(size_t wallet_id, view::wallet_info& wi);
|
||||
std::string get_contracts(size_t wallet_id, std::vector<tools::wallet_public::escrow_contract_details>& contracts);
|
||||
std::string create_proposal(const view::create_proposal_param_gui& cpp);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue