cancel all funding offers

This commit is contained in:
itsdeka
2023-01-26 15:36:00 +01:00
committed by Davide Casale
parent 4fbe1b89c6
commit ca91588067
2 changed files with 9 additions and 1 deletions

View File

@@ -407,6 +407,9 @@ class _RestAuthenticatedEndpoints(_Requests):
def cancel_funding_offer(self, id: int) -> Notification[FundingOffer]:
return serializers._Notification[FundingOffer](serializer=serializers.FundingOffer).parse(*self._POST("auth/w/funding/offer/cancel", data={ "id": id }))
def cancel_all_funding_offers(self, currency: str) -> Notification:
return serializers._Notification().parse(*self._POST("auth/w/funding/offer/cancel/all", data={ "currency": currency }))
def get_funding_offers_history(self, symbol: Optional[str] = None, start: Optional[str] = None, end: Optional[str] = None, limit: Optional[int] = None) -> List[FundingOffer]:
if symbol == None:
endpoint = "auth/r/funding/offers/hist"

View File

@@ -25,4 +25,9 @@ print("Offer notification:", notification)
offers = bfx.rest.auth.get_active_funding_offers(symbol="fUSD")
print("Offers:", offers)
print("Offers:", offers)
# Cancel all funding offers
notification = bfx.rest.auth.cancel_all_funding_offers(currency="fUSD")
print(notification)