Compare commits

..

No commits in common. "3b16b56d2781e1a3232def2c3fa4674f7bb3f8f7" and "7baed40c0f347332bab540fe99d4fa9944af0252" have entirely different histories.

View File

@ -1,4 +1,5 @@
function f_ccxt { function f_ccxt {
if [ -s /dabo/.${STOCK_EXCHANGE}-secrets ] if [ -s /dabo/.${STOCK_EXCHANGE}-secrets ]
then then
. /dabo/.${STOCK_EXCHANGE}-secrets . /dabo/.${STOCK_EXCHANGE}-secrets
@ -7,22 +8,25 @@ function f_ccxt {
return 1 return 1
fi fi
local g_ccxt_jobs
mapfile -t g_ccxt_jobs < <(jobs -r)
# Initialize ccxt in python # Initialize ccxt in python
if ! [[ ${g_python_jobs[*]} =~ python-pipeexec.py ]] || [ -z "$f_ccxt_initialized" ] if [ -z "$g_python_running" ] || [ -z "$f_ccxt_initialized" ]
then then
g_python 'import os' || return 1 g_python 'import os' || return 1
g_python 'import sys' || return 1 g_python 'import sys' || return 1
g_python 'sys.path.append("/ccxt/python")' || return 1 g_python 'sys.path.append("/ccxt/python")' || return 1
g_python 'import ccxt' || return 1 g_python 'import ccxt' || return 1
g_python "exchange = ccxt.${STOCK_EXCHANGE}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1 g_python "exchange = ccxt.${STOCK_EXCHANGE}({'apiKey': '${API_KEY}','secret': '${API_SECRET}','options': {'defaultType': 'swap',},})" || return 1
f_ccxt_initialized=true f_ccxt_initialized=true
fi fi
g_python_waitforoutput=1 g_python_waitforoutput=1
g_python "$@" || return 1 g_python "$@" || return 1
unset f_ccxt_result unset f_ccxt_result
f_ccxt_result=${g_python_result[*]} f_ccxt_result=${g_python_result[*]}
} }