Skip to content

Commit 08b5364

Browse files
authored
Merge pull request #239 from Davi0kProgramsThings/v3.0.0
Merge branch ` Davi0kProgramsThings:v3.0.0` into branch `bitfinexcom:master`.
2 parents bdd78a8 + 354aa62 commit 08b5364

File tree

5 files changed

+22
-34
lines changed

5 files changed

+22
-34
lines changed

README.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
# bitfinex-api-py (v3-beta)
1+
# bitfinex-api-py
22

33
Official implementation of the [Bitfinex APIs (V2)](https://docs.bitfinex.com/docs) for `Python 3.8+`.
44

5-
> **DISCLAIMER:** \
6-
Production use of v3.0.0b1 (and all future beta versions) is HIGHLY discouraged. \
7-
Beta versions should not be used in applications which require user authentication. \
8-
Provide your API-KEY/API-SECRET, and manage your account and funds at your own risk.
9-
105
### Features
116

127
* Support for 75+ REST endpoints (a list of available endpoints can be found [here](https://docs.bitfinex.com/reference))
@@ -20,13 +15,6 @@ Provide your API-KEY/API-SECRET, and manage your account and funds at your own r
2015
python3 -m pip install --pre bitfinex-api-py
2116
```
2217

23-
### Selecting and installing a specific beta version
24-
25-
It's also possible to select and install a specific beta version:
26-
```console
27-
python3 -m pip install bitfinex-api-py==3.0.0b1
28-
```
29-
3018
---
3119

3220
# Quickstart
@@ -305,7 +293,7 @@ All contributions are welcome! :D
305293

306294
A guide on how to install and set up `bitfinex-api-py`'s source code can be found [here](#installation-and-setup). \
307295
Before opening any pull requests, please have a look at [Before Opening a PR](#before-opening-a-pr). \
308-
Contributors must uphold the [Contributor Covenant code of conduct](https://github.com/bitfinexcom/bitfinex-api-py/blob/v3-beta/CODE_OF_CONDUCT.md).
296+
Contributors must uphold the [Contributor Covenant code of conduct](https://github.com/bitfinexcom/bitfinex-api-py/blob/master/CODE_OF_CONDUCT.md).
309297

310298
### Index
311299

@@ -323,10 +311,8 @@ A brief guide on how to install and set up the project in your Python 3.8+ envir
323311

324312
### Cloning the repository
325313

326-
The following command will only clone the `v3-beta` branch (excluding all others):
327-
328314
```console
329-
git clone --branch v3-beta --single-branch https://github.com/bitfinexcom/bitfinex-api-py.git
315+
git clone https://github.com/bitfinexcom/bitfinex-api-py.git
330316
```
331317

332318
### Installing the dependencies

bfxapi/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.0b5"
1+
__version__ = "3.0.0"

bfxapi/rest/_interface/middleware.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import json
44
from datetime import datetime
55
from enum import IntEnum
6-
from typing import TYPE_CHECKING, Any, List, Optional
6+
from typing import TYPE_CHECKING, Any, List, NoReturn, Optional
77

88
import requests
99

1010
from bfxapi._utils.json_decoder import JSONDecoder
1111
from bfxapi._utils.json_encoder import JSONEncoder
1212
from bfxapi.exceptions import InvalidCredentialError
13-
from bfxapi.rest.exceptions import RequestParametersError, UnknownGenericError
13+
from bfxapi.rest.exceptions import GenericError, RequestParameterError
1414

1515
if TYPE_CHECKING:
1616
from requests.sessions import _Params
@@ -86,28 +86,30 @@ def post(
8686

8787
return data
8888

89-
def __handle_error(self, error: List[Any]) -> None:
89+
def __handle_error(self, error: List[Any]) -> NoReturn:
9090
if error[1] == _Error.ERR_PARAMS:
91-
raise RequestParametersError(
92-
"The request was rejected with the following parameter"
93-
f"error: <{error[2]}>"
91+
raise RequestParameterError(
92+
"The request was rejected with the following parameter "
93+
f"error: <{error[2]}>."
9494
)
9595

9696
if error[1] == _Error.ERR_AUTH_FAIL:
9797
raise InvalidCredentialError(
98-
"Cannot authenticate with given API-KEY and API-SECRET."
98+
"Can't authenticate with given API-KEY and API-SECRET."
9999
)
100100

101101
if not error[1] or error[1] == _Error.ERR_UNK or error[1] == _Error.ERR_GENERIC:
102-
raise UnknownGenericError(
103-
"The server replied to the request with a generic error with "
104-
f"the following message: <{error[2]}>."
102+
raise GenericError(
103+
"The request was rejected with the following generic "
104+
f"error: <{error[2]}>."
105105
)
106106

107+
raise RuntimeError(
108+
f"The request was rejected with an unexpected error: <{error}>."
109+
)
110+
107111
def __get_authentication_headers(self, endpoint: str, data: Optional[str] = None):
108-
assert (
109-
self.__api_key and self.__api_secret
110-
), "API-KEY and API-SECRET must be strings."
112+
assert self.__api_key and self.__api_secret
111113

112114
nonce = str(round(datetime.now().timestamp() * 1_000_000))
113115

bfxapi/rest/exceptions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from bfxapi.exceptions import BfxBaseException
22

33

4-
class RequestParametersError(BfxBaseException):
4+
class RequestParameterError(BfxBaseException):
55
pass
66

77

8-
class UnknownGenericError(BfxBaseException):
8+
class GenericError(BfxBaseException):
99
pass

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
author_email="[email protected]",
1717
license="Apache-2.0",
1818
classifiers=[
19-
"Development Status :: 4 - Beta",
19+
"Development Status :: 5 - Production/Stable",
2020
"Intended Audience :: Developers",
2121
"Topic :: Software Development :: Build Tools",
2222
"License :: OSI Approved :: Apache Software License",

0 commit comments

Comments
 (0)