diff --git a/bfxapi/rest/BfxRestInterface.py b/bfxapi/rest/BfxRestInterface.py index b1293e7..1853388 100644 --- a/bfxapi/rest/BfxRestInterface.py +++ b/bfxapi/rest/BfxRestInterface.py @@ -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" diff --git a/examples/rest/create_funding_offer.py b/examples/rest/create_funding_offer.py index 4046e28..343fa1d 100644 --- a/examples/rest/create_funding_offer.py +++ b/examples/rest/create_funding_offer.py @@ -25,4 +25,9 @@ print("Offer notification:", notification) offers = bfx.rest.auth.get_active_funding_offers(symbol="fUSD") -print("Offers:", offers) \ No newline at end of file +print("Offers:", offers) + +# Cancel all funding offers +notification = bfx.rest.auth.cancel_all_funding_offers(currency="fUSD") + +print(notification) \ No newline at end of file