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 (
|
||||
BalanceAvailable,
|
||||
BalanceInfo,
|
||||
BaseMarginInfo,
|
||||
Candle,
|
||||
CurrencyConversion,
|
||||
|
||||
@@ -608,6 +608,12 @@ class DerivativePositionCollateralLimits(_Type):
|
||||
max_collateral: float
|
||||
|
||||
|
||||
@dataclass
|
||||
class BalanceInfo(_Type):
|
||||
aum: float
|
||||
aum_net: float
|
||||
|
||||
|
||||
# endregion
|
||||
|
||||
# region Dataclass definitions for types of merchant use
|
||||
|
||||
@@ -904,4 +904,10 @@ DerivativePositionCollateralLimits = generate_labeler_serializer(
|
||||
labels=["min_collateral", "max_collateral"],
|
||||
)
|
||||
|
||||
BalanceInfo = generate_labeler_serializer(
|
||||
name="BalanceInfo",
|
||||
klass=dataclasses.BalanceInfo,
|
||||
labels=["aum", "aum_net"],
|
||||
)
|
||||
|
||||
# endregion
|
||||
|
||||
@@ -67,6 +67,7 @@ _COMMON = [
|
||||
"base_margin_info",
|
||||
"symbol_margin_info",
|
||||
"funding_info_update",
|
||||
"balance_update",
|
||||
"notification",
|
||||
"on-req-notification",
|
||||
"ou-req-notification",
|
||||
|
||||
@@ -34,6 +34,7 @@ class AuthEventsHandler:
|
||||
"ws": "wallet_snapshot",
|
||||
"wu": "wallet_update",
|
||||
"fiu": "funding_info_update",
|
||||
"bu": "balance_update",
|
||||
}
|
||||
|
||||
__SERIALIZERS: Dict[Tuple[str, ...], serializers._Serializer] = {
|
||||
@@ -45,6 +46,7 @@ class AuthEventsHandler:
|
||||
("fls", "fln", "flu", "flc"): serializers.FundingLoan,
|
||||
("ws", "wu"): serializers.Wallet,
|
||||
("fiu",): serializers.FundingInfo,
|
||||
("bu",): serializers.BalanceInfo,
|
||||
}
|
||||
|
||||
def __init__(self, event_emitter: EventEmitter) -> None:
|
||||
|
||||
Reference in New Issue
Block a user