Skip to content

Commit 847d887

Browse files
Add support for event funding_info_update.
1 parent a72a947 commit 847d887

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

bfxapi/rest/_interfaces/rest_auth_endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def get_funding_trades_history(
551551

552552
def get_funding_info(self, key: str) -> FundingInfo:
553553
return serializers.FundingInfo.parse(
554-
*(self._m.post(f"auth/r/info/funding/{key}")[2])
554+
*self._m.post(f"auth/r/info/funding/{key}")
555555
)
556556

557557
def transfer_between_wallets(

bfxapi/types/dataclasses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ class FundingAutoRenew(_Type):
428428

429429
@dataclass()
430430
class FundingInfo(_Type):
431+
symbol: str
431432
yield_loan: float
432433
yield_lend: float
433434
duration_loan: float

bfxapi/types/serializers.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,15 @@
632632
FundingInfo = generate_labeler_serializer(
633633
name="FundingInfo",
634634
klass=dataclasses.FundingInfo,
635-
labels=["yield_loan", "yield_lend", "duration_loan", "duration_lend"],
635+
labels=[
636+
"_PLACEHOLDER",
637+
"symbol",
638+
"yield_loan",
639+
"yield_lend",
640+
"duration_loan",
641+
"duration_lend",
642+
],
643+
flat=True,
636644
)
637645

638646
Wallet = generate_labeler_serializer(

bfxapi/websocket/_event_emitter/bfx_event_emitter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"wallet_update",
6767
"base_margin_info",
6868
"symbol_margin_info",
69+
"funding_info_update",
6970
"notification",
7071
"on-req-notification",
7172
"ou-req-notification",

bfxapi/websocket/_handlers/auth_events_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class AuthEventsHandler:
3333
"flc": "funding_loan_close",
3434
"ws": "wallet_snapshot",
3535
"wu": "wallet_update",
36+
"fiu": "funding_info_update",
3637
}
3738

3839
__SERIALIZERS: Dict[Tuple[str, ...], serializers._Serializer] = {
@@ -43,6 +44,7 @@ class AuthEventsHandler:
4344
("fcs", "fcn", "fcu", "fcc"): serializers.FundingCredit,
4445
("fls", "fln", "flu", "flc"): serializers.FundingLoan,
4546
("ws", "wu"): serializers.Wallet,
47+
("fiu",): serializers.FundingInfo,
4648
}
4749

4850
def __init__(self, event_emitter: EventEmitter) -> None:

0 commit comments

Comments
 (0)