Compare commits

...

2 Commits

Author SHA1 Message Date
55c6303f0f python ccxt 2024-03-25 17:07:19 +01:00
5e9e5d6c05 python ccxt 2024-03-25 17:07:04 +01:00
3 changed files with 25 additions and 2 deletions

View File

@ -2,7 +2,8 @@ FROM debian:latest
RUN apt-get update && \ RUN apt-get update && \
apt-get -y install curl && \ apt-get -y install curl && \
curl https://gitea.ds9.dedyn.io/olli/debian.ansible.docker/raw/branch/main/build-debian-env.sh >build-debian-env.sh && \ curl https://gitea.ds9.dedyn.io/olli/debian.ansible.docker/raw/branch/main/build-debian-env.sh >build-debian-env.sh && \
bash -ex build-debian-env.sh bash -ex build-debian-env.sh && \
git clone https://github.com/ccxt/ccxt.git --depth 1
RUN addgroup --system --gid 10000 dabo RUN addgroup --system --gid 10000 dabo
RUN adduser --system --disabled-password --disabled-login --gid 10000 --uid 10000 --home /dabo/home dabo RUN adduser --system --disabled-password --disabled-login --gid 10000 --uid 10000 --home /dabo/home dabo
ENV LANG en_US.utf8 ENV LANG en_US.utf8

23
dabo/functions/ccxt.sh Normal file
View File

@ -0,0 +1,23 @@
function f_ccxt {
if [ -s /dabo/.${STOCK_EXCHANGE}-secrets ]
then
. /dabo/.${STOCK_EXCHANGE}-secrets
else
g_echo_error "No secrets found (/dabo/.${STOCK_EXCHANGE}-secrets) found"
return 1
fi
g_python 'import os' || return 1
g_python 'import sys' || return 1
g_python 'sys.path.append("/ccxt/python")' || 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_wantoutput=1
g_python 'print(exchange.fetch_balance ({"currency": "USDT"}))' || return 1
}

View File

@ -1,4 +1,3 @@
version: '3.6'
services: services:
dabo-bot: dabo-bot: