diff --git a/.gitignore b/.gitignore index bfb6b4b..24401c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ docker-compose.override.yml data/botdata data/index.html +data/index.html.tmp dabo/.binance-secrets dabo/.bitpanda-secrets +home/.ssh/ diff --git a/dabo/functions/bitpanda-api-call.sh b/dabo/functions/bitpanda-api-call.sh new file mode 100644 index 0000000..2ffb0f8 --- /dev/null +++ b/dabo/functions/bitpanda-api-call.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +function bitpanda-api-call { + g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" + local method=$1 + local call=$2 + local params=$3 + + if [ -s /dabo/.bitpanda-secrets ] + then + . /dabo/.bitpanda-secrets + else + g_echo_error "No secrets file found" + return 1 + fi + + echo "${call}" | egrep -q "/account/" && local f_token="-H 'Authorization: Bearer ${API_TOKEN}'" + echo "curl -s -X ${method} --url https://api.exchange.bitpanda.com/${call} $f_token -H 'Accept: application/json'" >${g_tmp}/API_CMD + echo "curl -s -X ${method} --url https://api.exchange.bitpanda.com/${call} -H 'Accept: application/json'" >${g_tmp}/API_CMD_WO_KEY + g_runcmd g_retrycmd sh ${g_tmp}/API_CMD >${g_tmp}/API_CMD_OUT 2>&1 + if egrep -q -i '^{"code":|error' ${g_tmp}/API_CMD_OUT + then + g_echo_error "$(cat ${g_tmp}/API_CMD_WO_KEY): $(cat ${g_tmp}/API_CMD_OUT)" + return 1 + fi +} + diff --git a/home/.bash_history b/home/.bash_history new file mode 100644 index 0000000..dc69106 --- /dev/null +++ b/home/.bash_history @@ -0,0 +1,3 @@ +id +ps ax +ps aux diff --git a/home/.dabo-bot.sh.lock b/home/.dabo-bot.sh.lock new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/home/.dabo-bot.sh.lock @@ -0,0 +1 @@ +1