Skip to content

Commit 1176ccf

Browse files
authored
Merge pull request #14 from uJhin/1.2.2
Upbit OPEN API v1.2.2
2 parents 911c38e + d13e432 commit 1176ccf

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ typing-extensions==3.7.4.3
4444
urllib3==1.26.4
4545
webcolors==1.11.1
4646
webencodings==0.5.1
47-
websockets==8.1
47+
websockets==10.1
4848
wrapt==1.12.1

upbit/pkginfo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Please read the official Upbit Client document.
55
Documents: https://ujhin.github.io/upbit-client-docs/
66
7-
- Upbit OPEN API Version: 1.2.0
7+
- Upbit OPEN API Version: 1.2.2
88
- Author: ujhin
99
1010
- GitHub: https://github.com/uJhin
@@ -28,8 +28,8 @@ def _get_versions(package_name):
2828

2929
PACKAGE_NAME = 'upbit-client'
3030

31-
OPEN_API_VERSION = '1.2.0'
32-
CURRENT_VERSION = OPEN_API_VERSION+'.4'
31+
OPEN_API_VERSION = '1.2.2'
32+
CURRENT_VERSION = OPEN_API_VERSION+'.1'
3333

3434
RELEASED_VERSION = _get_versions(PACKAGE_NAME)
3535
LATEST_VERSION = RELEASED_VERSION[0]

upbit/websocket.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ def connect(
7575
ping_timeout=ping_timeout
7676
)
7777

78+
async def ping(self):
79+
"""
80+
Client to Server PING
81+
"""
82+
async with self as conn:
83+
await conn.send('PING')
84+
recv = await conn.recv()
85+
return json.loads(recv)
86+
7887
@staticmethod
7988
def generate_orderbook_codes(
8089
currencies: Union[List[str]],
@@ -163,12 +172,12 @@ def generate_payload(
163172

164173
return json.dumps(payload)
165174

166-
async def __aenter__(self) -> websockets.client.WebSocketClientProtocol:
175+
async def __aenter__(self):
167176
return await self.Connection.__aenter__()
168177

169-
async def __aexit__(self, exc_type, exc_value, traceback) -> None:
178+
async def __aexit__(self, exc_type, exc_value, traceback):
170179
await self.Connection.__aexit__(exc_type, exc_value, traceback)
171-
180+
172181
def __str__(self):
173182
return self.__repr__()
174183

0 commit comments

Comments
 (0)