You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

39 lines
937 B

from quart import Blueprint, current_app, jsonify
from totrader.models import *
from totrader.tasks import trader
bp = Blueprint('api', 'api', url_prefix='/api/v1')
@bp.route('/get_ticker_data')
async def get_ticker_data():
ticker = Ticker.select().order_by(Ticker.date.desc()).limit(1).first()
return jsonify({
'price': ticker.current_price,
'volume': ticker.volume,
'bid': ticker.bid,
'ask': ticker.ask,
'spread_sats': ticker.spread_sats,
'spread_btc': ticker.spread_btc,
'spread_perc': ticker.spread_perc,
'date': ticker.date
})
@bp.route('/get_balances')
async def get_balances():
return jsonify({})
@bp.route('/get_bitcoin_price')
async def get_bitcoin_price():
return jsonify({})
@bp.route('/get_orders')
async def get_orders():
return jsonify({})
@bp.route('/get_trade_history')
async def get_trade_history():
return jsonify({})