mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
Fix bugs and differences in namings/types/fields between bfxapi.rest.types, bfxapi.rest.serializers and bfxapi.websocket.types, bfxapi.websocket.serializers.
This commit is contained in:
@@ -248,16 +248,6 @@ FxRate = generate_labeler_serializer("FxRate", klass=types.FxRate, labels=[
|
||||
|
||||
#region Serializers definition for Rest Authenticated Endpoints
|
||||
|
||||
Wallet = generate_labeler_serializer("Wallet", klass=types.Wallet, labels=[
|
||||
"wallet_type",
|
||||
"currency",
|
||||
"balance",
|
||||
"unsettled_interest",
|
||||
"available_balance",
|
||||
"last_change",
|
||||
"trade_details"
|
||||
])
|
||||
|
||||
Order = generate_labeler_serializer("Order", klass=types.Order, labels=[
|
||||
"id",
|
||||
"gid",
|
||||
@@ -316,30 +306,6 @@ Position = generate_labeler_serializer("Position", klass=types.Position, labels=
|
||||
"meta"
|
||||
])
|
||||
|
||||
FundingOffer = generate_labeler_serializer("FundingOffer", klass=types.FundingOffer, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"mts_create",
|
||||
"mts_update",
|
||||
"amount",
|
||||
"amount_orig",
|
||||
"offer_type",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"flags",
|
||||
"offer_status",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"rate",
|
||||
"period",
|
||||
"notify",
|
||||
"hidden",
|
||||
"_PLACEHOLDER",
|
||||
"renew",
|
||||
"_PLACEHOLDER"
|
||||
])
|
||||
|
||||
Trade = generate_labeler_serializer("Trade", klass=types.Trade, labels=[
|
||||
"id",
|
||||
"pair",
|
||||
@@ -392,28 +358,28 @@ Ledger = generate_labeler_serializer("Ledger", klass=types.Ledger, labels=[
|
||||
"description"
|
||||
])
|
||||
|
||||
FundingLoan = generate_labeler_serializer("FundingLoan", klass=types.FundingLoan, labels=[
|
||||
FundingOffer = generate_labeler_serializer("FundingOffer", klass=types.FundingOffer, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"side",
|
||||
"mts_create",
|
||||
"mts_update",
|
||||
"amount",
|
||||
"amount_orig",
|
||||
"offer_type",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"flags",
|
||||
"status",
|
||||
"offer_status",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"rate",
|
||||
"period",
|
||||
"mts_opening",
|
||||
"mts_last_payout",
|
||||
"notify",
|
||||
"hidden",
|
||||
"_PLACEHOLDER",
|
||||
"renew",
|
||||
"rate_real",
|
||||
"no_close"
|
||||
"_PLACEHOLDER"
|
||||
])
|
||||
|
||||
FundingCredit = generate_labeler_serializer("FundingCredit", klass=types.FundingCredit, labels=[
|
||||
@@ -441,6 +407,30 @@ FundingCredit = generate_labeler_serializer("FundingCredit", klass=types.Funding
|
||||
"position_pair"
|
||||
])
|
||||
|
||||
FundingLoan = generate_labeler_serializer("FundingLoan", klass=types.FundingLoan, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"side",
|
||||
"mts_create",
|
||||
"mts_update",
|
||||
"amount",
|
||||
"flags",
|
||||
"status",
|
||||
"rate_type",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"rate",
|
||||
"period",
|
||||
"mts_opening",
|
||||
"mts_last_payout",
|
||||
"notify",
|
||||
"hidden",
|
||||
"_PLACEHOLDER",
|
||||
"renew",
|
||||
"_PLACEHOLDER",
|
||||
"no_close"
|
||||
])
|
||||
|
||||
FundingAutoRenew = generate_labeler_serializer("FundingAutoRenew", klass=types.FundingAutoRenew, labels=[
|
||||
"currency",
|
||||
"period",
|
||||
@@ -456,6 +446,16 @@ FundingInfo = generate_labeler_serializer("FundingInfo", klass=types.FundingInfo
|
||||
"duration_lend"
|
||||
])
|
||||
|
||||
Wallet = generate_labeler_serializer("Wallet", klass=types.Wallet, labels=[
|
||||
"wallet_type",
|
||||
"currency",
|
||||
"balance",
|
||||
"unsettled_interest",
|
||||
"available_balance",
|
||||
"last_change",
|
||||
"trade_details"
|
||||
])
|
||||
|
||||
Transfer = generate_labeler_serializer("Transfer", klass=types.Transfer, labels=[
|
||||
"mts",
|
||||
"wallet_from",
|
||||
|
||||
@@ -197,16 +197,6 @@ class FxRate(_Type):
|
||||
|
||||
#region Type hinting for Rest Authenticated Endpoints
|
||||
|
||||
@dataclass
|
||||
class Wallet(_Type):
|
||||
wallet_type: str
|
||||
currency: str
|
||||
balance: float
|
||||
unsettled_interest: float
|
||||
available_balance: float
|
||||
last_change: str
|
||||
trade_details: JSON
|
||||
|
||||
@dataclass
|
||||
class Order(_Type):
|
||||
id: int
|
||||
@@ -252,23 +242,6 @@ class Position(_Type):
|
||||
collateral_min: float
|
||||
meta: JSON
|
||||
|
||||
@dataclass
|
||||
class FundingOffer(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
mts_create: int
|
||||
mts_update: int
|
||||
amount: float
|
||||
amount_orig: float
|
||||
offer_type: str
|
||||
flags: int
|
||||
offer_status: str
|
||||
rate: float
|
||||
period: int
|
||||
notify: bool
|
||||
hidden: int
|
||||
renew: bool
|
||||
|
||||
@dataclass
|
||||
class Trade(_Type):
|
||||
id: int
|
||||
@@ -317,24 +290,21 @@ class Ledger(_Type):
|
||||
description: str
|
||||
|
||||
@dataclass
|
||||
class FundingLoan(_Type):
|
||||
class FundingOffer(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
side: int
|
||||
mts_create: int
|
||||
mts_update: int
|
||||
amount: float
|
||||
amount_orig: float
|
||||
offer_type: str
|
||||
flags: int
|
||||
status: str
|
||||
offer_status: str
|
||||
rate: float
|
||||
period: int
|
||||
mts_opening: int
|
||||
mts_last_payout: int
|
||||
notify: int
|
||||
hidden: int
|
||||
renew: int
|
||||
rate_real: float
|
||||
no_close: int
|
||||
|
||||
@dataclass
|
||||
class FundingCredit(_Type):
|
||||
@@ -346,6 +316,7 @@ class FundingCredit(_Type):
|
||||
amount: float
|
||||
flags: int
|
||||
status: str
|
||||
rate_type: str
|
||||
rate: float
|
||||
period: int
|
||||
mts_opening: int
|
||||
@@ -353,10 +324,29 @@ class FundingCredit(_Type):
|
||||
notify: int
|
||||
hidden: int
|
||||
renew: int
|
||||
rate_real: float
|
||||
no_close: int
|
||||
position_pair: str
|
||||
|
||||
@dataclass
|
||||
class FundingLoan(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
side: int
|
||||
mts_create: int
|
||||
mts_update: int
|
||||
amount: float
|
||||
flags: int
|
||||
status: str
|
||||
rate_type: str
|
||||
rate: float
|
||||
period: int
|
||||
mts_opening: int
|
||||
mts_last_payout: int
|
||||
notify: int
|
||||
hidden: int
|
||||
renew: int
|
||||
no_close: int
|
||||
|
||||
@dataclass
|
||||
class FundingAutoRenew(_Type):
|
||||
currency: str
|
||||
@@ -372,6 +362,16 @@ class FundingInfo(_Type):
|
||||
duration_loan: float
|
||||
duration_lend: float
|
||||
|
||||
@dataclass
|
||||
class Wallet(_Type):
|
||||
wallet_type: str
|
||||
currency: str
|
||||
balance: float
|
||||
unsettled_interest: float
|
||||
available_balance: float
|
||||
last_change: str
|
||||
trade_details: JSON
|
||||
|
||||
@dataclass
|
||||
class Transfer(_Type):
|
||||
mts: int
|
||||
|
||||
@@ -139,7 +139,7 @@ class AuthenticatedChannelsHandler(object):
|
||||
("fcs", "fcn", "fcu", "fcc",): serializers.FundingCredit,
|
||||
("fls", "fln", "flu", "flc",): serializers.FundingLoan,
|
||||
("ws", "wu",): serializers.Wallet,
|
||||
("bu",): serializers.BalanceInfo
|
||||
("bu",): serializers.Balance
|
||||
}
|
||||
|
||||
EVENTS = [
|
||||
|
||||
@@ -89,7 +89,7 @@ Candle = generate_labeler_serializer("Candle", klass=types.Candle, labels=[
|
||||
])
|
||||
|
||||
DerivativesStatus = generate_labeler_serializer("DerivativesStatus", klass=types.DerivativesStatus, labels=[
|
||||
"time_ms",
|
||||
"mts",
|
||||
"_PLACEHOLDER",
|
||||
"deriv_price",
|
||||
"spot_price",
|
||||
@@ -194,15 +194,15 @@ Trade = generate_labeler_serializer("Trade", klass=types.Trade, labels=[
|
||||
FundingOffer = generate_labeler_serializer("FundingOffer", klass=types.FundingOffer, labels=[
|
||||
"id",
|
||||
"symbol",
|
||||
"mts_created",
|
||||
"mts_updated",
|
||||
"mts_create",
|
||||
"mts_update",
|
||||
"amount",
|
||||
"amount_orig",
|
||||
"offer_type",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"flags",
|
||||
"status",
|
||||
"offer_status",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
"_PLACEHOLDER",
|
||||
@@ -235,7 +235,7 @@ FundingCredit = generate_labeler_serializer("FundingCredit", klass=types.Funding
|
||||
"hidden",
|
||||
"_PLACEHOLDER",
|
||||
"renew",
|
||||
"rate_real",
|
||||
"_PLACEHOLDER",
|
||||
"no_close",
|
||||
"position_pair"
|
||||
])
|
||||
@@ -260,7 +260,7 @@ FundingLoan = generate_labeler_serializer("FundingLoan", klass=types.FundingLoan
|
||||
"hidden",
|
||||
"_PLACEHOLDER",
|
||||
"renew",
|
||||
"rate_real",
|
||||
"_PLACEHOLDER",
|
||||
"no_close"
|
||||
])
|
||||
|
||||
@@ -269,12 +269,12 @@ Wallet = generate_labeler_serializer("Wallet", klass=types.Wallet, labels=[
|
||||
"currency",
|
||||
"balance",
|
||||
"unsettled_interest",
|
||||
"balance_available",
|
||||
"description",
|
||||
"meta"
|
||||
"available_balance",
|
||||
"last_change",
|
||||
"trade_details"
|
||||
])
|
||||
|
||||
BalanceInfo = generate_labeler_serializer("BalanceInfo", klass=types.BalanceInfo, labels=[
|
||||
Balance = generate_labeler_serializer("Balance", klass=types.Balance, labels=[
|
||||
"aum",
|
||||
"aum_net",
|
||||
])
|
||||
|
||||
@@ -90,7 +90,7 @@ class Candle(_Type):
|
||||
|
||||
@dataclass
|
||||
class DerivativesStatus(_Type):
|
||||
time_ms: int
|
||||
mts: int
|
||||
deriv_price: float
|
||||
spot_price: float
|
||||
insurance_fund_balance: float
|
||||
@@ -170,13 +170,13 @@ class Trade(_Type):
|
||||
class FundingOffer(_Type):
|
||||
id: int
|
||||
symbol: str
|
||||
mts_created: int
|
||||
mts_updated: int
|
||||
mts_create: int
|
||||
mts_update: int
|
||||
amount: float
|
||||
amount_orig: float
|
||||
offer_type: str
|
||||
flags: int
|
||||
status: str
|
||||
offer_status: str
|
||||
rate: float
|
||||
period: int
|
||||
notify: int
|
||||
@@ -200,7 +200,6 @@ class FundingCredit(_Type):
|
||||
notify: int
|
||||
hidden: int
|
||||
renew: int
|
||||
rate_real: float
|
||||
no_close: int
|
||||
position_pair: str
|
||||
|
||||
@@ -221,7 +220,6 @@ class FundingLoan(_Type):
|
||||
notify: int
|
||||
hidden: int
|
||||
renew: int
|
||||
rate_real: float
|
||||
no_close: int
|
||||
|
||||
@dataclass
|
||||
@@ -230,12 +228,12 @@ class Wallet(_Type):
|
||||
currency: str
|
||||
balance: float
|
||||
unsettled_interest: float
|
||||
balance_available: float
|
||||
description: str
|
||||
meta: JSON
|
||||
available_balance: float
|
||||
last_change: str
|
||||
trade_details: JSON
|
||||
|
||||
@dataclass
|
||||
class BalanceInfo(_Type):
|
||||
class Balance(_Type):
|
||||
aum: float
|
||||
aum_net: float
|
||||
|
||||
|
||||
Reference in New Issue
Block a user