@@ -25,6 +25,14 @@ QtObject {
25
25
26
26
function coinIcon (ticker )
27
27
{
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
+ }
28
36
if (ticker === " " || ticker === " All" || ticker=== undefined )
29
37
{
30
38
return " "
@@ -175,7 +183,7 @@ QtObject {
175
183
}
176
184
177
185
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)
179
187
if (cfg .hasOwnProperty (' protocol' )) {
180
188
if (cfg .protocol .hasOwnProperty (' protocol_data' )) {
181
189
if (cfg .protocol .protocol_data .hasOwnProperty (' contract_address' )) {
@@ -187,7 +195,7 @@ QtObject {
187
195
}
188
196
189
197
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)
191
199
if (cfg .hasOwnProperty (' protocol' )) {
192
200
if (cfg .protocol .hasOwnProperty (' protocol_data' )) {
193
201
if (cfg .protocol .protocol_data .hasOwnProperty (' platform' )) {
@@ -419,6 +427,14 @@ QtObject {
419
427
}
420
428
421
429
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
+ }
422
438
return [
423
439
{" label" : qsTr (" <b>Taker tx fee:</b> " ), " fee" : fees .base_transaction_fees , " ticker" : fees .base_transaction_fees_ticker },
424
440
{" 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 {
434
450
return feetype + " " + amount + " " + ticker + " (" + fiat_text + " )"
435
451
}
436
452
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
+
437
462
function getSimpleFromPlaceholder (selectedTicker , selectedOrder , sell_ticker_balance ) {
463
+ if (privacy_mode)
464
+ {
465
+ return " 0"
466
+ }
438
467
if (sell_ticker_balance == 0 )
439
468
{
440
- return qsTr (" %1 balance is zero" ). arg (selectedTicker )
469
+ return qsTr (" Balance is zero! " )
441
470
}
442
471
if (! isZhtlcReady (selectedTicker))
443
472
{
@@ -489,6 +518,7 @@ QtObject {
489
518
}
490
519
491
520
function getTxExplorerURL (ticker , txid , add_0x = true ) {
521
+ if (privacy_mode) return ' '
492
522
if (txid !== ' ' ) {
493
523
const coin_info = API .app .portfolio_pg .global_cfg_mdl .get_coin_info (ticker)
494
524
const txid_prefix = (add_0x && coin_info .is_erc_family ) ? ' 0x' : ' '
@@ -497,6 +527,7 @@ QtObject {
497
527
}
498
528
499
529
function getAddressExplorerURL (ticker , address ) {
530
+ if (privacy_mode) return ' '
500
531
if (address !== ' ' ) {
501
532
const coin_info = API .app .portfolio_pg .global_cfg_mdl .get_coin_info (ticker)
502
533
return coin_info .explorer_url + addressTxUri (coin_info) + address
@@ -505,12 +536,14 @@ QtObject {
505
536
}
506
537
507
538
function viewTxAtExplorer (ticker , txid , add_0x = true ) {
539
+ if (privacy_mode) return ' '
508
540
if (txid !== ' ' ) {
509
541
Qt .openUrlExternally (getTxExplorerURL (ticker, txid, add_0x))
510
542
}
511
543
}
512
544
513
545
function viewAddressAtExplorer (ticker , address ) {
546
+ if (privacy_mode) return ' '
514
547
if (address !== ' ' ) {
515
548
Qt .openUrlExternally (getAddressExplorerURL (ticker, address))
516
549
}
@@ -555,6 +588,7 @@ QtObject {
555
588
}
556
589
557
590
function convertUsd (v ) {
591
+ if (privacy_mode) return ' '
558
592
let rate = API .app .get_rate_conversion (" USD" , API .app .settings_pg .current_currency )
559
593
let value = parseFloat (v) / parseFloat (rate)
560
594
@@ -566,6 +600,7 @@ QtObject {
566
600
}
567
601
568
602
function formatFiat (received , amount , fiat , precision = 2 ) {
603
+ if (privacy_mode) return ' '
569
604
if (precision == 2 && fiat == " BTC" ) {
570
605
precision = 8
571
606
}
@@ -575,6 +610,7 @@ QtObject {
575
610
}
576
611
577
612
function formatPercent (value , show_prefix = true ) {
613
+ if (privacy_mode) return ' '
578
614
let prefix = ' '
579
615
if (value > 0 ) prefix = ' + '
580
616
else if (value < 0 ) {
@@ -619,6 +655,7 @@ QtObject {
619
655
}
620
656
621
657
function formatCrypto (received , amount , ticker , fiat_amount , fiat , precision , trail_zeros ) {
658
+ if (privacy_mode) return ' '
622
659
return diffPrefix (received) + ticker + " " + formatDouble (amount, precision, trail_zeros) + (fiat_amount ? " (" + formatFiat (" " , fiat_amount, fiat) + " )" : " " )
623
660
}
624
661
@@ -777,15 +814,10 @@ QtObject {
777
814
}
778
815
779
816
function feeText (trade_info , base_ticker , has_info_icon = true , has_limited_space = false ) {
780
-
781
-
782
817
if (! trade_info || ! trade_info .trading_fee ) return " "
783
-
784
818
const tx_fee = txFeeText (trade_info, base_ticker, has_info_icon, has_limited_space)
785
819
const trading_fee = tradingFeeText (trade_info, base_ticker, has_info_icon)
786
820
const minimum_amount = minimumtradingFeeText (trade_info, base_ticker, has_info_icon)
787
-
788
-
789
821
return tx_fee + " \n " + trading_fee + " <br>" + minimum_amount
790
822
}
791
823
@@ -804,13 +836,9 @@ QtObject {
804
836
}
805
837
806
838
function txFeeText (trade_info , base_ticker , has_info_icon = true , has_limited_space = false ) {
807
-
808
839
if (! trade_info || ! trade_info .trading_fee ) return " "
809
-
810
840
const has_parent_coin_fees = hasParentCoinFees (trade_info)
811
-
812
841
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
-
814
842
if (has_parent_coin_fees) {
815
843
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))
816
844
}
0 commit comments