use more granular msg dict for buy/sell notifications

This commit is contained in:
gcarq
2018-07-03 20:26:48 +02:00
parent 4cb1aa1d97
commit 0920fb6120
10 changed files with 244 additions and 101 deletions

View File

@@ -5,6 +5,7 @@ import logging
from abc import abstractmethod
from datetime import timedelta, datetime, date
from decimal import Decimal
from enum import Enum
from typing import Dict, Any, List
import arrow
@@ -19,6 +20,15 @@ from freqtrade.state import State
logger = logging.getLogger(__name__)
class RPCMessageType(Enum):
STATUS_NOTIFICATION = 'status'
BUY_NOTIFICATION = 'buy'
SELL_NOTIFICATION = 'sell'
def __repr__(self):
return self.value
class RPCException(Exception):
"""
Should be raised with a rpc-formatted message in an _rpc_* method
@@ -33,11 +43,6 @@ class RPCException(Exception):
def __str__(self):
return self.message
def __json__(self):
return {
'msg': self.message
}
class RPC(object):
"""