Begin implementing MEXC
This commit is contained in:
parent
761b084704
commit
4079207a05
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
from core.lib.schemas import alpaca_s, drakdoo_s, oanda_s # noqa
|
from core.lib.schemas import alpaca_s, drakdoo_s, oanda_s, mexc_s # noqa
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
from pydantic import BaseModel, Field
|
|
@ -176,11 +176,13 @@ class Account(models.Model):
|
||||||
if client:
|
if client:
|
||||||
response = client.get_instruments()
|
response = client.get_instruments()
|
||||||
supported_symbols = client.get_supported_assets(response)
|
supported_symbols = client.get_supported_assets(response)
|
||||||
currency = client.get_account()["currency"]
|
acct_info = client.get_account()
|
||||||
log.debug(f"Supported symbols for {self.name}: {supported_symbols}")
|
log.debug(f"Supported symbols for {self.name}: {supported_symbols}")
|
||||||
self.supported_symbols = supported_symbols
|
self.supported_symbols = supported_symbols
|
||||||
self.instruments = response
|
self.instruments = response
|
||||||
self.currency = currency
|
if "currency" in acct_info.keys():
|
||||||
|
currency = acct_info["currency"]
|
||||||
|
self.currency = currency
|
||||||
if save:
|
if save:
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,10 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<a class="button" href="{% url 'logout' %}">Logout</a>
|
<form method="POST" action="{% url 'logout' %}" style="display:inline;">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button type="submit" class="button">Logout</button>
|
||||||
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -30,7 +30,7 @@ class AccountInfo(LoginRequiredMixin, OTPRequiredMixin, ObjectRead):
|
||||||
"sandbox",
|
"sandbox",
|
||||||
"supported_symbols",
|
"supported_symbols",
|
||||||
"initial_balance",
|
"initial_balance",
|
||||||
"instruments",
|
#"instruments",
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_object(self, **kwargs):
|
def get_object(self, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue