@@ -25,6 +25,14 @@ QtObject {
2525
2626 function coinIcon (ticker )
2727 {
28+ if (ticker .toLowerCase () == " smart chain" )
29+ {
30+ return coin_icons_path + " smart_chain.png"
31+ }
32+ if (ticker .toLowerCase () == " avx" )
33+ {
34+ return coin_icons_path + " avax.png"
35+ }
2836 if (ticker === " " || ticker === " All" || ticker=== undefined )
2937 {
3038 return " "
@@ -175,7 +183,7 @@ QtObject {
175183 }
176184
177185 function coinContractAddress (ticker ) {
178- var cfg = API .app .trading_pg .get_raw_mm2_coin_cfg (ticker)
186+ var cfg = API .app .trading_pg .get_raw_kdf_coin_cfg (ticker)
179187 if (cfg .hasOwnProperty (' protocol' )) {
180188 if (cfg .protocol .hasOwnProperty (' protocol_data' )) {
181189 if (cfg .protocol .protocol_data .hasOwnProperty (' contract_address' )) {
@@ -187,7 +195,7 @@ QtObject {
187195 }
188196
189197 function coinPlatform (ticker ) {
190- var cfg = API .app .trading_pg .get_raw_mm2_coin_cfg (ticker)
198+ var cfg = API .app .trading_pg .get_raw_kdf_coin_cfg (ticker)
191199 if (cfg .hasOwnProperty (' protocol' )) {
192200 if (cfg .protocol .hasOwnProperty (' protocol_data' )) {
193201 if (cfg .protocol .protocol_data .hasOwnProperty (' platform' )) {
@@ -419,6 +427,14 @@ QtObject {
419427 }
420428
421429 function getFeesDetail (fees ) {
430+ if (privacy_mode) {
431+ return [
432+ {" label" : privacy_text},
433+ {" label" : privacy_text},
434+ {" label" : privacy_text},
435+ {" label" : privacy_text}
436+ ]
437+ }
422438 return [
423439 {" label" : qsTr (" <b>Taker tx fee:</b> " ), " fee" : fees .base_transaction_fees , " ticker" : fees .base_transaction_fees_ticker },
424440 {" label" : qsTr (" <b>Dex tx fee:</b> " ), " fee" : fees .fee_to_send_taker_fee , " ticker" : fees .fee_to_send_taker_fee_ticker },
@@ -434,10 +450,23 @@ QtObject {
434450 return feetype + " " + amount + " " + ticker + " (" + fiat_text + " )"
435451 }
436452
453+ function reducedBignum (text , decimals = 8 , max_length = 12 ) {
454+ let val = new BigNumber (text).toFixed (decimals)
455+ if (val .length > max_length)
456+ {
457+ return val .substring (0 , max_length)
458+ }
459+ return val
460+ }
461+
437462 function getSimpleFromPlaceholder (selectedTicker , selectedOrder , sell_ticker_balance ) {
463+ if (privacy_mode)
464+ {
465+ return " 0"
466+ }
438467 if (sell_ticker_balance == 0 )
439468 {
440- return qsTr (" %1 balance is zero" ). arg (selectedTicker )
469+ return qsTr (" Balance is zero! " )
441470 }
442471 if (! isZhtlcReady (selectedTicker))
443472 {
@@ -489,6 +518,7 @@ QtObject {
489518 }
490519
491520 function getTxExplorerURL (ticker , txid , add_0x = true ) {
521+ if (privacy_mode) return ' '
492522 if (txid !== ' ' ) {
493523 const coin_info = API .app .portfolio_pg .global_cfg_mdl .get_coin_info (ticker)
494524 const txid_prefix = (add_0x && coin_info .is_erc_family ) ? ' 0x' : ' '
@@ -497,6 +527,7 @@ QtObject {
497527 }
498528
499529 function getAddressExplorerURL (ticker , address ) {
530+ if (privacy_mode) return ' '
500531 if (address !== ' ' ) {
501532 const coin_info = API .app .portfolio_pg .global_cfg_mdl .get_coin_info (ticker)
502533 return coin_info .explorer_url + addressTxUri (coin_info) + address
@@ -505,12 +536,14 @@ QtObject {
505536 }
506537
507538 function viewTxAtExplorer (ticker , txid , add_0x = true ) {
539+ if (privacy_mode) return ' '
508540 if (txid !== ' ' ) {
509541 Qt .openUrlExternally (getTxExplorerURL (ticker, txid, add_0x))
510542 }
511543 }
512544
513545 function viewAddressAtExplorer (ticker , address ) {
546+ if (privacy_mode) return ' '
514547 if (address !== ' ' ) {
515548 Qt .openUrlExternally (getAddressExplorerURL (ticker, address))
516549 }
@@ -555,6 +588,7 @@ QtObject {
555588 }
556589
557590 function convertUsd (v ) {
591+ if (privacy_mode) return ' '
558592 let rate = API .app .get_rate_conversion (" USD" , API .app .settings_pg .current_currency )
559593 let value = parseFloat (v) / parseFloat (rate)
560594
@@ -566,6 +600,7 @@ QtObject {
566600 }
567601
568602 function formatFiat (received , amount , fiat , precision = 2 ) {
603+ if (privacy_mode) return ' '
569604 if (precision == 2 && fiat == " BTC" ) {
570605 precision = 8
571606 }
@@ -575,6 +610,7 @@ QtObject {
575610 }
576611
577612 function formatPercent (value , show_prefix = true ) {
613+ if (privacy_mode) return ' '
578614 let prefix = ' '
579615 if (value > 0 ) prefix = ' + '
580616 else if (value < 0 ) {
@@ -619,6 +655,7 @@ QtObject {
619655 }
620656
621657 function formatCrypto (received , amount , ticker , fiat_amount , fiat , precision , trail_zeros ) {
658+ if (privacy_mode) return ' '
622659 return diffPrefix (received) + ticker + " " + formatDouble (amount, precision, trail_zeros) + (fiat_amount ? " (" + formatFiat (" " , fiat_amount, fiat) + " )" : " " )
623660 }
624661
@@ -777,15 +814,10 @@ QtObject {
777814 }
778815
779816 function feeText (trade_info , base_ticker , has_info_icon = true , has_limited_space = false ) {
780-
781-
782817 if (! trade_info || ! trade_info .trading_fee ) return " "
783-
784818 const tx_fee = txFeeText (trade_info, base_ticker, has_info_icon, has_limited_space)
785819 const trading_fee = tradingFeeText (trade_info, base_ticker, has_info_icon)
786820 const minimum_amount = minimumtradingFeeText (trade_info, base_ticker, has_info_icon)
787-
788-
789821 return tx_fee + " \n " + trading_fee + " <br>" + minimum_amount
790822 }
791823
@@ -804,13 +836,9 @@ QtObject {
804836 }
805837
806838 function txFeeText (trade_info , base_ticker , has_info_icon = true , has_limited_space = false ) {
807-
808839 if (! trade_info || ! trade_info .trading_fee ) return " "
809-
810840 const has_parent_coin_fees = hasParentCoinFees (trade_info)
811-
812841 var info = qsTr (' %1 Transaction Fee' .arg (trade_info .base_transaction_fees_ticker ))+ ' : ' + trade_info .base_transaction_fees + " (%1)" .arg (getFiatText (trade_info .base_transaction_fees , trade_info .base_transaction_fees_ticker , has_info_icon))
813-
814842 if (has_parent_coin_fees) {
815843 info = info+ " <br>" + qsTr (' %1 Transaction Fee' .arg (trade_info .rel_transaction_fees_ticker ))+ ' : ' + trade_info .rel_transaction_fees + " (%1)" .arg (getFiatText (trade_info .rel_transaction_fees , trade_info .rel_transaction_fees_ticker , has_info_icon))
816844 }
0 commit comments