mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Merge TradeExecutionUpdate and TradeExecuted serializers and types in websocket subpackage.
This commit is contained in:
@@ -3,6 +3,7 @@ from .. exceptions import BfxBaseException
|
||||
__all__ = [
|
||||
"BfxRestException",
|
||||
|
||||
"ResourceNotFound",
|
||||
"RequestParametersError",
|
||||
"ResourceNotFound",
|
||||
"InvalidAuthenticationCredentials"
|
||||
|
||||
@@ -134,8 +134,7 @@ class AuthenticatedChannelsHandler(object):
|
||||
__serializers = {
|
||||
("os", "on", "ou", "oc",): serializers.Order,
|
||||
("ps", "pn", "pu", "pc",): serializers.Position,
|
||||
("te",): serializers.TradeExecuted,
|
||||
("tu",): serializers.TradeExecutionUpdate,
|
||||
("te", "tu"): serializers.Trade,
|
||||
("fos", "fon", "fou", "foc",): serializers.FundingOffer,
|
||||
("fcs", "fcn", "fcu", "fcc",): serializers.FundingCredit,
|
||||
("fls", "fln", "flu", "flc",): serializers.FundingLoan,
|
||||
|
||||
@@ -176,22 +176,7 @@ Position = generate_labeler_serializer("Position", klass=types.Position, labels=
|
||||
"meta"
|
||||
])
|
||||
|
||||
TradeExecuted = generate_labeler_serializer("TradeExecuted", klass=types.TradeExecuted, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"mts_create",
|
||||
"order_id",
|
||||
"exec_amount",
|
||||
"exec_price",
|
||||
"order_type",
|
||||
"order_price",
|
||||
"maker",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"cid"
|
||||
])
|
||||
|
||||
TradeExecutionUpdate = generate_labeler_serializer("TradeExecutionUpdate", klass=types.TradeExecutionUpdate, labels=[
|
||||
Trade = generate_labeler_serializer("Trade", klass=types.Trade, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"mts_create",
|
||||
|
||||
@@ -152,7 +152,7 @@ class Position(_Type):
|
||||
meta: JSON
|
||||
|
||||
@dataclass
|
||||
class TradeExecuted(_Type):
|
||||
class Trade(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
mts_create: int
|
||||
@@ -162,21 +162,8 @@ class TradeExecuted(_Type):
|
||||
order_type: str
|
||||
order_price: float
|
||||
maker:int
|
||||
cid: int
|
||||
|
||||
@dataclass
|
||||
class TradeExecutionUpdate(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
mts_create: int
|
||||
order_id: int
|
||||
exec_amount: float
|
||||
exec_price: float
|
||||
order_type: str
|
||||
order_price: float
|
||||
maker:int
|
||||
fee: float
|
||||
fee_currency: str
|
||||
fee: Optional[float]
|
||||
fee_currency: Optional[str]
|
||||
cid: int
|
||||
|
||||
@dataclass
|
||||
|
||||
Reference in New Issue
Block a user