Skip to content

Commit 5cd9019

Browse files
committed
Version 0.1.10
1 parent 02fba6d commit 5cd9019

18 files changed

+1120
-1691
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ formatting: codestyle
2828
#* Linting
2929
.PHONY: test
3030
test:
31-
PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --cov-report=html --cov=hyperliquid tests/
31+
PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --record-mode=once --cov-report=html --cov=hyperliquid tests/
3232
poetry run coverage-badge -o assets/images/coverage.svg -f
3333

3434
.PHONY: check-codestyle
@@ -52,7 +52,7 @@ lint: test check-codestyle mypy check-safety
5252

5353
.PHONY: update-dev-deps
5454
update-dev-deps:
55-
poetry add -D bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-html@latest pytest-cov@latest
55+
poetry add -D bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-cov@latest
5656
poetry add -D --allow-prereleases black@latest
5757

5858
#* Docker

poetry.lock

Lines changed: 422 additions & 428 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55

66
[tool.poetry]
77
name = "hyperliquid-python-sdk"
8-
version = "0.1.9"
8+
version = "0.1.10"
99
description = "SDK for Hyperliquid API trading with Python."
1010
readme = "README.md"
1111
authors = ["Hyperliquid <[email protected]>"]
@@ -41,13 +41,13 @@ python = "^3.7"
4141
importlib_metadata = {version = "^4.5.0", python = "<3.8"}
4242
typer = {extras = ["all"], version = "^0.4.0"}
4343
rich = "^10.14.0"
44-
pytest-vcr = "^1.0.2"
45-
pytest-cov = "^4.0.0"
4644
eth-utils = "^2.1.0"
4745
eth-abi = "^3.0.1"
4846
eth-account = "^0.8.0"
4947
websocket-client = "^1.5.1"
50-
requests = "^2.28.2"
48+
pytest = "^7.2.1"
49+
requests = "^2.31.0"
50+
pytest-recording = "^0.12.2"
5151

5252
[tool.poetry.dev-dependencies]
5353
python = "3.10.10"
@@ -60,12 +60,11 @@ mypy-extensions = "^0.4.3"
6060
pre-commit = "^2.15.0"
6161
pydocstyle = "^6.1.1"
6262
pylint = "^2.11.1"
63-
pytest = "^7.2.1"
6463
pyupgrade = "^2.29.1"
6564
safety = "^1.10.3"
6665
coverage = "^6.1.2"
6766
coverage-badge = "^1.1.0"
68-
pytest-html = "^3.1.1"
67+
pytest-cov = "^4.0.0"
6968

7069
[tool.black]
7170
line-length = 120

requirements.txt

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
1-
bitarray==2.7.3 ; python_version >= "3.7" and python_version < "4"
1+
attrs==23.1.0 ; python_version >= "3.7" and python_version < "4.0"
2+
bitarray==2.7.6 ; python_version >= "3.7" and python_version < "4"
23
cached-property==1.5.2 ; python_version >= "3.7" and python_version < "3.8"
3-
certifi==2022.12.7 ; python_version >= "3.7" and python_version < "4"
4-
charset-normalizer==3.1.0 ; python_version >= "3.7" and python_version < "4"
5-
click==8.1.3 ; python_version >= "3.7" and python_version < "4.0"
4+
certifi==2023.5.7 ; python_version >= "3.7" and python_version < "4.0"
5+
charset-normalizer==3.2.0 ; python_version >= "3.7" and python_version < "4.0"
6+
click==8.1.5 ; python_version >= "3.7" and python_version < "4.0"
67
colorama==0.4.6 ; python_version >= "3.7" and python_version < "4.0"
78
commonmark==0.9.1 ; python_version >= "3.7" and python_version < "4.0"
8-
coverage[toml]==6.5.0 ; python_version >= "3.7" and python_version < "4.0"
99
cytoolz==0.12.1 ; python_version >= "3.7" and python_version < "4" and implementation_name == "cpython"
1010
eth-abi==3.0.1 ; python_version >= "3.7" and python_version < "4"
1111
eth-account==0.8.0 ; python_version >= "3.7" and python_version < "4"
12-
eth-hash==0.5.1 ; python_version >= "3.7" and python_version < "4"
12+
eth-hash==0.5.2 ; python_version >= "3.7" and python_version < "4"
1313
eth-keyfile==0.6.1 ; python_version >= "3.7" and python_version < "4"
1414
eth-keys==0.4.0 ; python_version >= "3.7" and python_version < "4"
1515
eth-rlp==0.3.0 ; python_version >= "3.7" and python_version < "4"
1616
eth-typing==3.2.0 ; python_version >= "3.7" and python_version < "4"
17-
eth-utils==2.1.0 ; python_version >= "3.7" and python_version < "4"
18-
exceptiongroup==1.1.1 ; python_version >= "3.7" and python_version < "3.11"
19-
hexbytes==0.3.0 ; python_version >= "3.7" and python_version < "4"
20-
idna==3.4 ; python_version >= "3.7" and python_version < "4"
17+
eth-utils==2.2.0 ; python_version >= "3.7" and python_version < "4"
18+
exceptiongroup==1.1.2 ; python_version >= "3.7" and python_version < "3.11"
19+
hexbytes==0.3.1 ; python_version >= "3.7" and python_version < "4"
20+
idna==3.4 ; python_version >= "3.7" and python_version < "4.0"
2121
importlib-metadata==4.13.0 ; python_version >= "3.7" and python_version < "3.8"
2222
iniconfig==2.0.0 ; python_version >= "3.7" and python_version < "4.0"
2323
multidict==6.0.4 ; python_version >= "3.7" and python_version < "4.0"
2424
packaging==23.1 ; python_version >= "3.7" and python_version < "4.0"
2525
parsimonious==0.8.1 ; python_version >= "3.7" and python_version < "4"
26-
pluggy==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
27-
pycryptodome==3.17 ; python_version >= "3.7" and python_version < "4"
28-
pygments==2.15.0 ; python_version >= "3.7" and python_version < "4.0"
29-
pytest-cov==4.0.0 ; python_version >= "3.7" and python_version < "4.0"
30-
pytest-vcr==1.0.2 ; python_version >= "3.7" and python_version < "4.0"
31-
pytest==7.3.1 ; python_version >= "3.7" and python_version < "4.0"
26+
pluggy==1.2.0 ; python_version >= "3.7" and python_version < "4.0"
27+
pycryptodome==3.18.0 ; python_version >= "3.7" and python_version < "4"
28+
pygments==2.15.1 ; python_version >= "3.7" and python_version < "4.0"
29+
pytest-recording==0.12.2 ; python_version >= "3.7" and python_version < "4.0"
30+
pytest==7.4.0 ; python_version >= "3.7" and python_version < "4.0"
3231
pyyaml==6.0 ; python_version >= "3.7" and python_version < "4.0"
33-
requests==2.28.2 ; python_version >= "3.7" and python_version < "4"
32+
requests==2.31.0 ; python_version >= "3.7" and python_version < "4.0"
3433
rich==10.16.2 ; python_version >= "3.7" and python_version < "4.0"
3534
rlp==3.0.0 ; python_version >= "3.7" and python_version < "4"
3635
shellingham==1.5.0.post1 ; python_version >= "3.7" and python_version < "4.0"
37-
six==1.16.0 ; python_version >= "3.7" and python_version < "4.0"
38-
tomli==2.0.1 ; python_version >= "3.7" and python_full_version <= "3.11.0a6"
36+
six==1.16.0 ; python_version >= "3.7" and python_version < "4"
37+
tomli==2.0.1 ; python_version >= "3.7" and python_version < "3.11"
3938
toolz==0.12.0 ; python_version >= "3.7" and python_version < "4" and implementation_name == "pypy" or python_version >= "3.7" and python_version < "4" and implementation_name == "cpython"
4039
typer[all]==0.4.2 ; python_version >= "3.7" and python_version < "4.0"
41-
typing-extensions==4.5.0 ; python_version >= "3.7" and python_version < "3.8"
42-
urllib3==1.26.15 ; python_version >= "3.7" and python_version < "4"
43-
vcrpy==4.2.1 ; python_version >= "3.7" and python_version < "4.0"
44-
websocket-client==1.5.1 ; python_version >= "3.7" and python_version < "4.0"
40+
typing-extensions==4.7.1 ; python_version >= "3.7" and python_version < "3.8"
41+
urllib3==1.26.16 ; python_version >= "3.7" and python_version < "4.0"
42+
vcrpy==4.4.0 ; python_version >= "3.7" and python_version < "4.0"
43+
websocket-client==1.6.1 ; python_version >= "3.7" and python_version < "4.0"
4544
wrapt==1.15.0 ; python_version >= "3.7" and python_version < "4.0"
46-
yarl==1.8.2 ; python_version >= "3.7" and python_version < "4.0"
45+
yarl==1.9.2 ; python_version >= "3.7" and python_version < "4.0"
4746
zipp==3.15.0 ; python_version >= "3.7" and python_version < "3.8"

tests/cassettes/test_get_all_mids.yaml renamed to tests/cassettes/info_test/test_get_all_mids.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ interactions:
1313
Content-Type:
1414
- application/json
1515
User-Agent:
16-
- python-requests/2.28.2
16+
- python-requests/2.31.0
1717
method: POST
1818
uri: https://api.hyperliquid.xyz/info
1919
response:
2020
body:
21-
string: '{"ATOM":"12.249","BTC":"23202.5","ETH":"1607.7","MATIC":"1.1984"}'
21+
string: '{"APE":"1.96595","APT":"7.7731","ARB":"1.28895","ATOM":"9.3384","AVAX":"14.1705","BCH":"240.525","BNB":"243.135","BTC":"30135.0","CFX":"0.186535","CRV":"0.79852","DOGE":"0.069277","DYDX":"2.11305","ETH":"1903.95","FTM":"0.26268","GMX":"55.8595","INJ":"9.32295","LDO":"2.0457","LINK":"6.9123","LTC":"91.832","MATIC":"0.77389","OP":"1.45515","RNDR":"1.94575","SNX":"2.6256","SOL":"26.516","STX":"0.62927","SUI":"0.69539","XRP":"0.73862","kPEPE":"0.001565"}'
2222
headers:
2323
access-control-allow-origin:
2424
- '*'
2525
access-control-expose-headers:
2626
- '*'
2727
content-length:
28-
- '65'
28+
- '454'
2929
content-type:
3030
- application/json
3131
date:
32-
- Tue, 28 Feb 2023 22:12:08 GMT
32+
- Mon, 17 Jul 2023 21:43:20 GMT
3333
vary:
3434
- origin
3535
- access-control-request-method

tests/cassettes/test_get_candles_snapshot.yaml renamed to tests/cassettes/info_test/test_get_candles_snapshot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interactions:
1414
Content-Type:
1515
- application/json
1616
User-Agent:
17-
- python-requests/2.28.2
17+
- python-requests/2.31.0
1818
method: POST
1919
uri: https://api.hyperliquid.xyz/info
2020
response:
@@ -30,7 +30,7 @@ interactions:
3030
content-type:
3131
- application/json
3232
date:
33-
- Thu, 25 May 2023 02:38:24 GMT
33+
- Mon, 17 Jul 2023 21:43:24 GMT
3434
vary:
3535
- origin
3636
- access-control-request-method

tests/cassettes/test_get_funding_history[1684811870000].yaml renamed to tests/cassettes/info_test/test_get_funding_history[1684811870000].yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interactions:
1414
Content-Type:
1515
- application/json
1616
User-Agent:
17-
- python-requests/2.28.2
17+
- python-requests/2.31.0
1818
method: POST
1919
uri: https://api.hyperliquid.xyz/info
2020
response:
@@ -30,7 +30,7 @@ interactions:
3030
content-type:
3131
- application/json
3232
date:
33-
- Thu, 25 May 2023 02:38:22 GMT
33+
- Mon, 17 Jul 2023 21:43:23 GMT
3434
vary:
3535
- origin
3636
- access-control-request-method

tests/cassettes/info_test/test_get_funding_history[None].yaml

Lines changed: 40 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
interactions:
2+
- request:
3+
body: '{"type": "meta"}'
4+
headers:
5+
Accept:
6+
- '*/*'
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '16'
13+
Content-Type:
14+
- application/json
15+
User-Agent:
16+
- python-requests/2.31.0
17+
method: POST
18+
uri: https://api.hyperliquid.xyz/info
19+
response:
20+
body:
21+
string: '{"universe":[{"maxLeverage":50,"name":"BTC","szDecimals":5},{"maxLeverage":50,"name":"ETH","szDecimals":4},{"maxLeverage":50,"name":"ATOM","szDecimals":2},{"maxLeverage":50,"name":"MATIC","szDecimals":1},{"maxLeverage":50,"name":"DYDX","szDecimals":1},{"maxLeverage":50,"name":"SOL","szDecimals":2},{"maxLeverage":50,"name":"AVAX","szDecimals":2},{"maxLeverage":50,"name":"BNB","szDecimals":3},{"maxLeverage":50,"name":"APE","szDecimals":1},{"maxLeverage":50,"name":"OP","szDecimals":1},{"maxLeverage":50,"name":"LTC","szDecimals":2},{"maxLeverage":50,"name":"ARB","szDecimals":1},{"maxLeverage":50,"name":"DOGE","szDecimals":0},{"maxLeverage":50,"name":"INJ","szDecimals":1},{"maxLeverage":50,"name":"SUI","szDecimals":1},{"maxLeverage":50,"name":"kPEPE","szDecimals":0},{"maxLeverage":50,"name":"CRV","szDecimals":1},{"maxLeverage":50,"name":"LDO","szDecimals":1},{"maxLeverage":50,"name":"LINK","szDecimals":1},{"maxLeverage":50,"name":"STX","szDecimals":1},{"maxLeverage":50,"name":"RNDR","szDecimals":1},{"maxLeverage":50,"name":"CFX","szDecimals":0},{"maxLeverage":50,"name":"FTM","szDecimals":0},{"maxLeverage":50,"name":"GMX","szDecimals":2},{"maxLeverage":50,"name":"SNX","szDecimals":1},{"maxLeverage":50,"name":"XRP","szDecimals":0},{"maxLeverage":50,"name":"BCH","szDecimals":3},{"maxLeverage":50,"name":"APT","szDecimals":2}]}'
22+
headers:
23+
access-control-allow-origin:
24+
- '*'
25+
access-control-expose-headers:
26+
- '*'
27+
content-length:
28+
- '1339'
29+
content-type:
30+
- application/json
31+
date:
32+
- Mon, 17 Jul 2023 21:43:21 GMT
33+
vary:
34+
- origin
35+
- access-control-request-method
36+
- access-control-request-headers
37+
status:
38+
code: 200
39+
message: OK
40+
version: 1
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
interactions:
2+
- request:
3+
body: '{"type": "l2Book", "coin": "DYDX"}'
4+
headers:
5+
Accept:
6+
- '*/*'
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '34'
13+
Content-Type:
14+
- application/json
15+
User-Agent:
16+
- python-requests/2.31.0
17+
method: POST
18+
uri: https://api.hyperliquid.xyz/info
19+
response:
20+
body:
21+
string: '{"coin":"DYDX","levels":[[{"n":1,"px":"2.111","sz":"134.4"},{"n":1,"px":"2.1105","sz":"141.1"},{"n":1,"px":"2.1104","sz":"125.8"},{"n":1,"px":"2.1081","sz":"1379.2"},{"n":1,"px":"2.1075","sz":"1417.0"},{"n":2,"px":"2.1052","sz":"2800.9"},{"n":2,"px":"2.1017","sz":"3478.0"},{"n":1,"px":"2.1007","sz":"1655.6"},{"n":1,"px":"2.0998","sz":"1605.9"},{"n":2,"px":"2.0961","sz":"3695.0"},{"n":2,"px":"2.0947","sz":"3911.7"},{"n":2,"px":"2.0936","sz":"3736.5"},{"n":1,"px":"2.0903","sz":"12.0"},{"n":1,"px":"2.0861","sz":"15.0"},{"n":1,"px":"2.0819","sz":"25.0"},{"n":2,"px":"2.0786","sz":"3819.2"},{"n":1,"px":"2.0778","sz":"40.0"},{"n":1,"px":"2.0736","sz":"63.0"},{"n":2,"px":"2.0667","sz":"3669.0"},{"n":1,"px":"1.81","sz":"2397.0"}],[{"n":2,"px":"2.1124","sz":"352.3"},{"n":2,"px":"2.1125","sz":"364.9"},{"n":2,"px":"2.1128","sz":"3798.0"},{"n":2,"px":"2.113","sz":"3528.0"},{"n":2,"px":"2.1135","sz":"3635.0"},{"n":1,"px":"2.1141","sz":"1981.3"},{"n":1,"px":"2.1142","sz":"1957.3"},{"n":1,"px":"2.1146","sz":"1914.5"},{"n":2,"px":"2.1232","sz":"3245.0"},{"n":1,"px":"2.1274","sz":"1656.3"},{"n":1,"px":"2.1281","sz":"1839.9"},{"n":2,"px":"2.1298","sz":"3806.1"},{"n":2,"px":"2.1322","sz":"3578.7"},{"n":1,"px":"2.1347","sz":"11.0"},{"n":1,"px":"2.139","sz":"15.0"},{"n":1,"px":"2.1423","sz":"1983.8"},{"n":1,"px":"2.1432","sz":"24.0"},{"n":1,"px":"2.1468","sz":"1610.9"},{"n":1,"px":"2.1475","sz":"39.0"},{"n":1,"px":"2.1518","sz":"62.0"}]],"time":1689630203930}'
22+
headers:
23+
access-control-allow-origin:
24+
- '*'
25+
access-control-expose-headers:
26+
- '*'
27+
content-length:
28+
- '1461'
29+
content-type:
30+
- application/json
31+
date:
32+
- Mon, 17 Jul 2023 21:43:24 GMT
33+
vary:
34+
- origin
35+
- access-control-request-method
36+
- access-control-request-headers
37+
status:
38+
code: 200
39+
message: OK
40+
version: 1

0 commit comments

Comments
 (0)