Implemented Movement endpoints (REST)

Thanks to @ph4z
This commit is contained in:
itsdeka
2022-01-16 22:15:13 +01:00
parent ca85fe2236
commit a79cd6a5a6
6 changed files with 24 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
1.3.5
-) Implemented Movement endpoints (REST)
1.3.4
-) Fixed undefined p_sub issue in subscription_manager.py
-) Added submit cancel all funding orders endpoint (REST)

View File

@@ -5,7 +5,8 @@ This module is used to interact with the bitfinex api
from .version import __version__
from .client import Client
from .models import (Order, Trade, OrderBook, Subscription, Wallet,
Position, FundingLoan, FundingOffer, FundingCredit)
Position, FundingLoan, FundingOffer, FundingCredit,
Movement)
from .websockets.generic_websocket import GenericWebsocket, Socket
from .websockets.bfx_websocket import BfxWebsocket
from .utils.decimal import Decimal

View File

@@ -22,5 +22,6 @@ from .ledger import Ledger
from .funding_trade import FundingTrade
from .margin_info import MarginInfo
from .margin_info_base import MarginInfoBase
from .movement import Movement
NAME = "models"

View File

@@ -609,6 +609,22 @@ class BfxRest:
raw_ledgers = await self.post(endpoint, params=params)
return [Ledger.from_raw_ledger(rl) for rl in raw_ledgers]
async def get_movement_history(self, currency, start="", end="", limit=25):
"""
Get all of the deposits and withdraws between the start and end period associated with API_KEY
- Requires authentication.
# Attributes
@param currency string: pair symbol i.e BTC
@param start int: millisecond start time
@param end int: millisecond end time
@param limit int: max number of items in response
@return Array <models.Movement>
"""
endpoint = "auth/r/movements/{}/hist".format(currency)
params = "?start={}&end={}&limit={}".format(start, end, limit)
raw_movements = await self.post(endpoint, params=params)
return [Movement.from_raw_movement(rm) for rm in raw_movements]
async def submit_funding_offer(self, symbol, amount, rate, period,
funding_type=FundingOffer.Type.LIMIT, hidden=False):
"""

View File

@@ -2,4 +2,4 @@
This module contains the current version of the bfxapi lib
"""
__version__ = '1.3.4'
__version__ = '1.3.5'

View File

@@ -11,7 +11,7 @@ from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='bitfinex-api-py',
version='1.3.4',
version='1.3.5',
description='Official Bitfinex Python API',
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
long_description_content_type='text/markdown',