Skip to content

Commit

Permalink
Binance - deposit history method (/sapi/v1/capital/deposit/hisrec) (#72)
Browse files Browse the repository at this point in the history
* Add get_deposit_history() method to BinanceClient
* Add supported enum type DepositHistoryStatusType
  • Loading branch information
nkrsic authored Sep 19, 2021
1 parent 44ceb1f commit de411a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions cryptoxlib/clients/binance/BinanceClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,29 @@ async def get_bswap_swap_history(self, swap_id: int = None,
signed = True,
api_variable_path = BinanceClient.SAPI_V1)

async def get_deposit_history(self, coin: str, start_tmstmp_ms: int = None,
end_tmstmp_ms: int = None, status: enums.DepositHistoryStatusType = None):

params = BinanceClient._clean_request_params({
"coin": coin,
"timestamp": self._get_current_timestamp_ms(),
})

if status is not None:
params['status'] = status.value
if start_tmstmp_ms is not None:
params['startTime'] = start_tmstmp_ms
if end_tmstmp_ms is not None:
params["endTime"] = end_tmstmp_ms

return await self._create_get(
"capital/deposit/hisrec",
headers = self._get_header(),
params = params,
signed = True,
api_variable_path = BinanceClient.SAPI_V1
)


class BinanceTestnetClient(BinanceClient):
REST_API_URI = "https://testnet.binance.vision/"
Expand Down
7 changes: 6 additions & 1 deletion cryptoxlib/clients/binance/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ class LiquidityOperationType(enum.Enum):
class SwapStatusType(enum.Enum):
PENDING = 0
SUCCESS = 1
FAILED = 2
FAILED = 2

class DepositHistoryStatusType(enum.Enum):
PENDING = 0
CREDITED_CANNOT_WITHDRAW = 6
SUCCESS = 1

0 comments on commit de411a4

Please sign in to comment.