Skip to content

Commit

Permalink
v6.00.39-dev-pre-rev-22 (#165)
Browse files Browse the repository at this point in the history
* TODO

TODO

* docs, notes, UX

docs, notes, UX

* fixed / optimized page loading, tweaks

fixed / optimized page loading, tweaks

* tweaks

tweaks
  • Loading branch information
taoteh1221 authored Sep 9, 2024
1 parent 3961807 commit b902ea2
Show file tree
Hide file tree
Showing 20 changed files with 331 additions and 292 deletions.
7 changes: 4 additions & 3 deletions DOCUMENTATION-ETC/CONFIG-EXAMPLE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ $ct['conf']['ext_apis']['alphavantage_free_plan_daily_limit'] = 25;


// We limit how many search results Jupiter Aggregator is allowed to process PER CPU CORE (when adding coin markets), to avoid 504 "gateway timeout" errors
$ct['conf']['ext_apis']['jupiter_ag_search_results_max_per_cpu_core'] = 175; // 75 MINIMUM / 250 MAXIMUM / DEFAULT = 175
$ct['conf']['ext_apis']['jupiter_ag_search_results_max_per_cpu_core'] = 125; // 75 MINIMUM / 250 MAXIMUM / DEFAULT = 125


////////////////////////////////////////
Expand Down Expand Up @@ -530,6 +530,7 @@ $ct['conf']['currency']['conversion_currency_symbols'] = array(
'sar = ﷼',
'sek = kr ',
'sgd = S$',
'sol = ◎ ',
'thb = ฿',
'try = ₺',
'twd = NT$',
Expand Down Expand Up @@ -843,7 +844,7 @@ $ct['conf']['charts_alerts']['tracked_markets'] = array(
// MANA
'mana-2||binance||btc||both',
'mana-3||kucoin||btc||none',
'mana-4||ethfinex||btc||none',
'mana-4||ethfinex||usd||none',
'mana-5||binance||eth||none',


Expand Down Expand Up @@ -2639,7 +2640,6 @@ $ct['conf']['assets'] = array(

'btc' => array(
'binance' => 'MANABTC',
'ethfinex' => 'tMNABTC',
'kucoin' => 'MANA-BTC',
'upbit' => 'BTC-MANA',
'poloniex' => 'MANA_BTC',
Expand Down Expand Up @@ -2670,6 +2670,7 @@ $ct['conf']['assets'] = array(

'usd' => array(
'coinbase' => 'MANA-USD',
'ethfinex' => 'tMNAUSD',
'presale_usd_value' => 'mana',
),

Expand Down
22 changes: 5 additions & 17 deletions DOCUMENTATION-ETC/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@ P̵̫̊h̴̪̑ì̶̯s̵̫̀h̸̠̆i̶̔͜n̸̞͒g̶̳̏ ̸̺͐a̴͎̓n̷̜̕d̴
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Move EVERYTHING AFTER "Defualt theme" in the GENERAL section, over to the new CURRENCY SUPPORT section.


Test new setup wizard architecture in Firefox.


TORTURE TEST ADDING / DELETING ASSETS AND MARKETS.


Test add / delete markets INTERFACE on raspi zero w (1st gen).


Test LINUX Desktop Edition FIRST, as Windows 11 forced updates have been borking up dual boot / bitlocker setups a ton the past few months (lol)


Expand All @@ -215,18 +203,21 @@ Test LINUX Desktop Edition FIRST, as Windows 11 forced updates have been borking
Do a bitcoin opentimestamp of the v6.00.39 release.


We moved A LOT of ADMIN settings into more relevant sections the past year. MAKE SURE ALL INPUT VALIDATION LOGIC HAS ALSO BEEN MOVED TO THE DIFFERENT INPUT VALIDATION FILES.
Add bitcoin as a 'primary currency' option (like we can do for eth / sol).


https://api.coingecko.com/api/v3/simple/supported_vs_currencies


Include in docs, that the "fix Linux desktop" script is compatible with fedora and Debian.
Add a third option in the 'remove asset markets' wizard, that scans ALL markets, and returns a list of MARKETS THAT DID NOT RETURN A VALID TRADE PRICE, to select the ones you want to remove (and then have a confirm page to be safe, like we normally do). Add a note on the RESULTS page to double-check that none of the markets are just offline for maintainence.


Pretty up the light theme CSS text / link coloring, as it's missing decent CONTRAST here and there.


Buildout the top navigation, for responsive templating on small mobile screens.


Name / mcap slug should be EDITABLE on the portfolio assets admin page. Make sure to sanitize the user-inputted name (like we do when adding markets via interface).


Expand Down Expand Up @@ -415,9 +406,6 @@ Start creating github wiki with USER AND DEVELOPER documentation.
Remove the requirement for a secondary crypto market needing a BTC market, by allowing a secondary crypto market if it at least has a pairing that is the same as one of Bitcoin's pairings (like USD), OR it's a pairing itself in the Bitcoin pairings. Then have the BTC pairing value function look for that if there is no BTC market for in the asset's own pairings. Within the BTC pairing function, all we then need to do is multiply this backup conversion pairing value by the last trade value of the secondary crypto market (with a recursive call in the function to get say for instance the BTC/USD trade value). Also include a new config setting "pref_backup_conversion_pair", so when we check what pairings the asset has available, we use this pairing first (like USD).


Add a check (every X days with a config setting), to see if a market's trade value has NOT changed in a long time (assure accuracy with resetting a 'no_change' count [store delimited with market value] if change is detected). Add an alert threshold config setting (after no change has been detected X times), which sends comms alerts if the threshold has been met. This way end users can be informed if a market seems to have stale trade values from lack of trades / taken offline. HAVE THIS HAPPEN IN THE BACKGROUND #ONLY WHEN LIVE DATA IS FETCHED# WITHIN $ct['cache']->ext_data(), VIA USER-INRTERACTION OR A BACKGROUND TASK (DOES NOT CHECK MARKETS THAT ARE NOT USED BY END USERS OR THE BACKGROUND TASKS).


Admin import / export of settings (consider security implications CAREFULLY...include an optional / mandatory checkbox to encrypt to zip file with our new zip encryption feature).


Expand Down
4 changes: 3 additions & 1 deletion DOCUMENTATION-ETC/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6793,9 +6793,11 @@ AND MIGRATE YOUR EXISTING CUSTOM SETTINGS TO THE NEW FORMAT.

-More reliable currency price conversions (between different currencies)

-Optimizations / polish / cleanup on the Access Stats UX, and app logic

-Cleaned up stale DEMO markets / news feeds / text gateways

-Optimizations / polish on the Access Stats UX and logic
-Optimized / cleaned up page loading logic

-Upgraded Idex exchange API to v4

Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ https://www.geeksforgeeks.org/how-to-download-and-install-7-zip-on-windows

IMPORTANT NOTES FOR LINUX USERS:

IF YOU GET THE ERROR: "CGI program sent malformed or too big", YOU LIKELY NEED TO BUILD A PHP BINARY THAT IS COMPATIBLE WITH YOUR UNIQUE SYSTEM SETUP. Try running the script "FIX-LINUX-DESKTOP.bash" in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT STEP: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!
IF YOU GET THE ERROR: "CGI program sent malformed or too big", YOU LIKELY NEED TO BUILD A PHP BINARY THAT IS COMPATIBLE WITH YOUR UNIQUE SYSTEM SETUP. Try running the script "FIX-LINUX-DESKTOP.bash" (compatible with Debian / Fedora) in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT STEP: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions TROUBLESHOOTING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ https://www.geeksforgeeks.org/how-to-download-and-install-7-zip-on-windows

IMPORTANT NOTES FOR LINUX USERS:

IF YOU GET THE ERROR: "CGI program sent malformed or too big", YOU LIKELY NEED TO BUILD A PHP BINARY THAT IS COMPATIBLE WITH YOUR UNIQUE SYSTEM SETUP. Try running the script "FIX-LINUX-DESKTOP.bash" in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT STEP: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!
IF YOU GET THE ERROR: "CGI program sent malformed or too big", YOU LIKELY NEED TO BUILD A PHP BINARY THAT IS COMPATIBLE WITH YOUR UNIQUE SYSTEM SETUP. Try running the script "FIX-LINUX-DESKTOP.bash" (compatible with Debian / Fedora) in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT STEP: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!


=========================================================================================================================================
Expand Down Expand Up @@ -507,7 +507,7 @@ If you see an error like this below, you system is NOT compatible with the inclu
./php-cgi-custom: error while loading shared libraries: XXXXX.so.X: cannot open shared object file: No such file or directory


Try running the script "FIX-LINUX-DESKTOP.bash" in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT NOTE: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!
Try running the script "FIX-LINUX-DESKTOP.bash" (compatible with Debian / Fedora) in the Desktop Edition main folder, which should fix things automatically for you. Just make sure it's file permissions are set to "executable" (chmod +x, OR chmod 755 should do that). IMPORTANT NOTE: YOU *MUST* SHUT DOWN THE DESKTOP EDITION OF THIS APP *BEFOREHAND*, OTHERWISE THIS SCRIPT *CANNOT* INSTALL THE CREATED PHP BINARY IT BUILDS!


Open a terminal and use the "cd" (change directory) command to go to the main directory of the Desktop Edition, and then type this command:
Expand Down
37 changes: 37 additions & 0 deletions app-lib/js/jquery/jquery-javascript-combined.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/*
* Copyright 2014-2024 GPLv3, Open Crypto Tracker by Mike Kilday: Mike@DragonFrugal.com (leave this copyright / attribution intact in ALL forks / copies!)
*/


// First of all send javascript header
header("Content-type: application/javascript");

// Array of JS files
$js = array(
'jquery-3.6.3.min.js',
'jquery.tablesorter.min.js',
'jquery.tablesorter.widgets.min.js',
'jquery.tablesorter.pager.js',
'jquery.tablesorter.pager-custom-controls.js',
'jquery.balloon.min.js',
'jquery.repeatable.js',
'jstree.min.js',
'jquery.mCustomScrollbar.concat.min.js',
);

// Prevent a notice
$js_content = '';

// Loop the js Array
foreach ($js as $js_file) {
// Load the content of the js file
$js_content .= "\n\n\n\n" . '/******* COMBINED JAVASCRIPT FILE: '.$js_file.' *******/ ' . "\n\n\n\n" . file_get_contents($js_file);
}

// print the js content
echo $js_content;

gc_collect_cycles(); // Clean memory cache

?>
38 changes: 38 additions & 0 deletions app-lib/js/root-javascript-combined.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/*
* Copyright 2014-2024 GPLv3, Open Crypto Tracker by Mike Kilday: Mike@DragonFrugal.com (leave this copyright / attribution intact in ALL forks / copies!)
*/


// First of all send javascript header
header("Content-type: application/javascript");

// Array of JS files
$js = array(
'modaal.js',
'base64-decode.js',
'autosize.min.js',
'popper.min.js',
'zingchart.min.js',
'insQ.min.js',
'crypto-js.js',
'var_defaults.js',
'functions.js',
'highlight.min.js',
);

// Prevent a notice
$js_content = '';

// Loop the js Array
foreach ($js as $js_file) {
// Load the content of the js file
$js_content .= "\n\n\n\n" . '/******* COMBINED JAVASCRIPT FILE: '.$js_file.' *******/ ' . "\n\n\n\n" . file_get_contents($js_file);
}

// print the js content
echo $js_content;

gc_collect_cycles(); // Clean memory cache

?>
27 changes: 24 additions & 3 deletions app-lib/php/classes/core/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2763,11 +2763,32 @@ function market($asset_symb, $sel_exchange, $mrkt_id, $pair=false) {

elseif ( $sel_exchange == 'bitfinex' || $sel_exchange == 'ethfinex' ) {

$result = array(
'last_trade' => $data[( sizeof($data) - 4 )],
'24hr_asset_vol' => $data[( sizeof($data) - 3 )],
$finex_price = $data[( sizeof($data) - 4 )];

$finex_vol = $data[( sizeof($data) - 3 )];


// Bitfinex is a VERY funky data structure to parse for RESULTS VALIDITY,
// so best way is to make sure the parsed data is NOT an array
if ( !is_array($finex_price) && !is_array($finex_vol) ) {

$result = array(
'last_trade' => $finex_price,
'24hr_asset_vol' => $finex_vol,
'24hr_pair_vol' => null // Unavailable, set null
);

}
else {

$result = array(
'last_trade' => 0,
'24hr_asset_vol' => 0,
'24hr_pair_vol' => null // Unavailable, set null
);

}


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// Make sure primary currency conversion params are set properly
if ( !$ct['conf']['assets']['BTC']['pair'][ $_POST['currency']['bitcoin_primary_currency_pair'] ][ $_POST['currency']['bitcoin_primary_currency_exchange'] ] ) {
$ct['update_config_error'] = 'Bitcoin Primary Exchange "' . $ct['gen']->key_to_name($_POST['currency']['bitcoin_primary_currency_exchange']) . '" does NOT have a "' . strtoupper($_POST['currency']['bitcoin_primary_currency_pair']) . '" market';
$ct['update_config_error'] .= '<br />Bitcoin Primary Exchange "' . $ct['gen']->key_to_name($_POST['currency']['bitcoin_primary_currency_exchange']) . '" does NOT have a "' . strtoupper($_POST['currency']['bitcoin_primary_currency_pair']) . '" market';
}


Expand Down
3 changes: 2 additions & 1 deletion app-lib/php/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
// Unit tests to run in debug mode (MUST RUN AT THE VERY END OF INIT.PHP)
if ( $ct['conf']['power']['debug_mode'] != 'off' ) {
require_once($ct['base_dir'] . '/app-lib/php/inline/debugging/tests.php');
require_once($ct['base_dir'] . '/app-lib/php/inline/debugging/exchange-and-pair-info.php');
// We use this for getting config data too, so SKIP require_once
require($ct['base_dir'] . '/app-lib/php/inline/debugging/exchange-and-pair-info.php');
}


Expand Down
Loading

0 comments on commit b902ea2

Please sign in to comment.