mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Add support for event balance_update.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from .dataclasses import (
|
from .dataclasses import (
|
||||||
BalanceAvailable,
|
BalanceAvailable,
|
||||||
|
BalanceInfo,
|
||||||
BaseMarginInfo,
|
BaseMarginInfo,
|
||||||
Candle,
|
Candle,
|
||||||
CurrencyConversion,
|
CurrencyConversion,
|
||||||
|
|||||||
@@ -608,6 +608,12 @@ class DerivativePositionCollateralLimits(_Type):
|
|||||||
max_collateral: float
|
max_collateral: float
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class BalanceInfo(_Type):
|
||||||
|
aum: float
|
||||||
|
aum_net: float
|
||||||
|
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
# region Dataclass definitions for types of merchant use
|
# region Dataclass definitions for types of merchant use
|
||||||
|
|||||||
@@ -904,4 +904,10 @@ DerivativePositionCollateralLimits = generate_labeler_serializer(
|
|||||||
labels=["min_collateral", "max_collateral"],
|
labels=["min_collateral", "max_collateral"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
BalanceInfo = generate_labeler_serializer(
|
||||||
|
name="BalanceInfo",
|
||||||
|
klass=dataclasses.BalanceInfo,
|
||||||
|
labels=["aum", "aum_net"],
|
||||||
|
)
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ _COMMON = [
|
|||||||
"base_margin_info",
|
"base_margin_info",
|
||||||
"symbol_margin_info",
|
"symbol_margin_info",
|
||||||
"funding_info_update",
|
"funding_info_update",
|
||||||
|
"balance_update",
|
||||||
"notification",
|
"notification",
|
||||||
"on-req-notification",
|
"on-req-notification",
|
||||||
"ou-req-notification",
|
"ou-req-notification",
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class AuthEventsHandler:
|
|||||||
"ws": "wallet_snapshot",
|
"ws": "wallet_snapshot",
|
||||||
"wu": "wallet_update",
|
"wu": "wallet_update",
|
||||||
"fiu": "funding_info_update",
|
"fiu": "funding_info_update",
|
||||||
|
"bu": "balance_update",
|
||||||
}
|
}
|
||||||
|
|
||||||
__SERIALIZERS: Dict[Tuple[str, ...], serializers._Serializer] = {
|
__SERIALIZERS: Dict[Tuple[str, ...], serializers._Serializer] = {
|
||||||
@@ -45,6 +46,7 @@ class AuthEventsHandler:
|
|||||||
("fls", "fln", "flu", "flc"): serializers.FundingLoan,
|
("fls", "fln", "flu", "flc"): serializers.FundingLoan,
|
||||||
("ws", "wu"): serializers.Wallet,
|
("ws", "wu"): serializers.Wallet,
|
||||||
("fiu",): serializers.FundingInfo,
|
("fiu",): serializers.FundingInfo,
|
||||||
|
("bu",): serializers.BalanceInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, event_emitter: EventEmitter) -> None:
|
def __init__(self, event_emitter: EventEmitter) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user