diff --git a/bfxapi/rest/endpoints/rest_public_endpoints.py b/bfxapi/rest/endpoints/rest_public_endpoints.py index ac494b6..6f6d772 100644 --- a/bfxapi/rest/endpoints/rest_public_endpoints.py +++ b/bfxapi/rest/endpoints/rest_public_endpoints.py @@ -239,10 +239,10 @@ class RestPublicEndpoints(Middleware): data = self._get(f"funding/stats/{symbol}/hist", params=params) return [ serializers.FundingStatistic.parse(*sub_data) for sub_data in data ] - def get_pulse_profile(self, nickname: str) -> PulseProfile: + def get_pulse_profile_details(self, nickname: str) -> PulseProfile: return serializers.PulseProfile.parse(*self._get(f"pulse/profile/{nickname}")) - def get_pulse_history(self, *, end: Optional[str] = None, limit: Optional[int] = None) -> List[PulseMessage]: + def get_pulse_message_history(self, *, end: Optional[str] = None, limit: Optional[int] = None) -> List[PulseMessage]: messages = [] for subdata in self._get("pulse/hist", params={ "end": end, "limit": limit }): diff --git a/bfxapi/rest/serializers.py b/bfxapi/rest/serializers.py index 1fd4684..7cb8b71 100644 --- a/bfxapi/rest/serializers.py +++ b/bfxapi/rest/serializers.py @@ -199,7 +199,7 @@ DerivativesStatus = generate_labeler_serializer( "_PLACEHOLDER", "insurance_fund_balance", "_PLACEHOLDER", - "next_funding_evt_timestamp_ms", + "next_funding_evt_mts", "next_funding_accrued", "next_funding_step", "_PLACEHOLDER", @@ -258,7 +258,7 @@ FundingStatistic = generate_labeler_serializer( name="FundingStatistic", klass=types.FundingStatistic, labels=[ - "timestamp", + "mts", "_PLACEHOLDER", "_PLACEHOLDER", "frr", diff --git a/bfxapi/rest/types.py b/bfxapi/rest/types.py index 34fdb46..bea85c3 100644 --- a/bfxapi/rest/types.py +++ b/bfxapi/rest/types.py @@ -106,10 +106,10 @@ class Statistic(_Type): @dataclass class Candle(_Type): mts: int - open: float - close: float - high: float - low: float + open: int + close: int + high: int + low: int volume: float @dataclass @@ -119,7 +119,7 @@ class DerivativesStatus(_Type): deriv_price: float spot_price: float insurance_fund_balance: float - next_funding_evt_timestamp_ms: int + next_funding_evt_mts: int next_funding_accrued: float next_funding_step: int current_funding: float @@ -149,7 +149,7 @@ class Leaderboard(_Type): @dataclass class FundingStatistic(_Type): - timestamp: int + mts: int frr: float avg_period: float funding_amount: float diff --git a/bfxapi/websocket/serializers.py b/bfxapi/websocket/serializers.py index e889cdd..464fdd9 100644 --- a/bfxapi/websocket/serializers.py +++ b/bfxapi/websocket/serializers.py @@ -149,7 +149,7 @@ DerivativesStatus = generate_labeler_serializer( "_PLACEHOLDER", "insurance_fund_balance", "_PLACEHOLDER", - "next_funding_evt_timestamp_ms", + "next_funding_evt_mts", "next_funding_accrued", "next_funding_step", "_PLACEHOLDER", diff --git a/bfxapi/websocket/types.py b/bfxapi/websocket/types.py index e028f91..dcef21f 100644 --- a/bfxapi/websocket/types.py +++ b/bfxapi/websocket/types.py @@ -88,10 +88,10 @@ class FundingCurrencyRawBook(_Type): @dataclass class Candle(_Type): mts: int - open: float - close: float - high: float - low: float + open: int + close: int + high: int + low: int volume: float @dataclass @@ -100,7 +100,7 @@ class DerivativesStatus(_Type): deriv_price: float spot_price: float insurance_fund_balance: float - next_funding_evt_timestamp_ms: int + next_funding_evt_mts: int next_funding_accrued: float next_funding_step: int current_funding: float diff --git a/examples/rest/public/pulse_endpoints.py b/examples/rest/public/pulse_endpoints.py index 9b5b35b..d2305ac 100644 --- a/examples/rest/public/pulse_endpoints.py +++ b/examples/rest/public/pulse_endpoints.py @@ -12,13 +12,13 @@ bfx = Client(rest_host=PUB_REST_HOST) end = datetime.datetime(2020, 5, 2).timestamp() * 1000 # Retrieves 25 pulse messages up to 2020/05/02 -messages: List[PulseMessage] = bfx.rest.public.get_pulse_history(end=end, limit=25) +messages: List[PulseMessage] = bfx.rest.public.get_pulse_message_history(end=end, limit=25) for message in messages: print(f"Message author: {message.profile.nickname} ({message.profile.puid})") print(f"Title: <{message.title}>") print(f"Tags: {message.tags}\n") -profile: PulseProfile = bfx.rest.public.get_pulse_profile("News") +profile: PulseProfile = bfx.rest.public.get_pulse_profile_details("News") URL = profile.picture.replace("size", "small") print(f"<{profile.nickname}>'s profile picture: https://s3-eu-west-1.amazonaws.com/bfx-pub/{URL}")