bfxapi/rest: add submit/cancel funding

This commit is contained in:
Jacob Plaster
2019-09-11 12:45:13 +01:00
committed by Jacob Plaster
parent dfabb438de
commit edfd4fc280
3 changed files with 61 additions and 2 deletions

View File

@@ -2,6 +2,12 @@
Module used to describe all of the different data types
"""
class FundingOfferTypes:
"""
Enum used to define the different funding offer types
"""
LIMIT = 'LIMIT'
FRR_DELTA = 'FRRDELTAVAR'
class FundingOfferModel:
"""
@@ -41,6 +47,8 @@ class FundingOffer:
RENEW int 0 if false, 1 if true
"""
Type = FundingOfferTypes()
def __init__(self, fid, symbol, mts_create, mts_updated, amount, amount_orig, f_type,
flags, status, rate, period, notify, hidden, renew):
# pylint: disable=invalid-name

View File

@@ -2,7 +2,8 @@
Module used to describe all of the different notification data types
"""
from . import Order
from .order import Order
from .funding_offer import FundingOffer
class NotificationModal:
"""
@@ -95,6 +96,10 @@ class Notification:
basic.notify_info = Order.from_raw_order(basic.notify_info)
elif basic.notify_type == NotificationTypes.ORDER_UPDATED_REQ:
basic.notify_info = Order.from_raw_order(basic.notify_info)
elif basic.notify_type == NotificationTypes.FUNDING_OFFER_NEW:
basic.notify_info = FundingOffer.from_raw_offer(basic.notify_info)
elif basic.notify_type == NotificationTypes.FUNDING_OFFER_CANCEL:
basic.notify_info = FundingOffer.from_raw_offer(basic.notify_info)
return basic
def __str__(self):