mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Add support for event funding_info_update.
This commit is contained in:
@@ -551,7 +551,7 @@ class RestAuthEndpoints(Interface):
|
||||
|
||||
def get_funding_info(self, key: str) -> FundingInfo:
|
||||
return serializers.FundingInfo.parse(
|
||||
*(self._m.post(f"auth/r/info/funding/{key}")[2])
|
||||
*self._m.post(f"auth/r/info/funding/{key}")
|
||||
)
|
||||
|
||||
def transfer_between_wallets(
|
||||
|
||||
@@ -428,6 +428,7 @@ class FundingAutoRenew(_Type):
|
||||
|
||||
@dataclass()
|
||||
class FundingInfo(_Type):
|
||||
symbol: str
|
||||
yield_loan: float
|
||||
yield_lend: float
|
||||
duration_loan: float
|
||||
|
||||
@@ -632,7 +632,15 @@ FundingAutoRenew = generate_labeler_serializer(
|
||||
FundingInfo = generate_labeler_serializer(
|
||||
name="FundingInfo",
|
||||
klass=dataclasses.FundingInfo,
|
||||
labels=["yield_loan", "yield_lend", "duration_loan", "duration_lend"],
|
||||
labels=[
|
||||
"_PLACEHOLDER",
|
||||
"symbol",
|
||||
"yield_loan",
|
||||
"yield_lend",
|
||||
"duration_loan",
|
||||
"duration_lend",
|
||||
],
|
||||
flat=True,
|
||||
)
|
||||
|
||||
Wallet = generate_labeler_serializer(
|
||||
|
||||
@@ -66,6 +66,7 @@ _COMMON = [
|
||||
"wallet_update",
|
||||
"base_margin_info",
|
||||
"symbol_margin_info",
|
||||
"funding_info_update",
|
||||
"notification",
|
||||
"on-req-notification",
|
||||
"ou-req-notification",
|
||||
|
||||
@@ -33,6 +33,7 @@ class AuthEventsHandler:
|
||||
"flc": "funding_loan_close",
|
||||
"ws": "wallet_snapshot",
|
||||
"wu": "wallet_update",
|
||||
"fiu": "funding_info_update",
|
||||
}
|
||||
|
||||
__SERIALIZERS: Dict[Tuple[str, ...], serializers._Serializer] = {
|
||||
@@ -43,6 +44,7 @@ class AuthEventsHandler:
|
||||
("fcs", "fcn", "fcu", "fcc"): serializers.FundingCredit,
|
||||
("fls", "fln", "flu", "flc"): serializers.FundingLoan,
|
||||
("ws", "wu"): serializers.Wallet,
|
||||
("fiu",): serializers.FundingInfo,
|
||||
}
|
||||
|
||||
def __init__(self, event_emitter: EventEmitter) -> None:
|
||||
|
||||
Reference in New Issue
Block a user