Skip to content

Commit

Permalink
Merge pull request #14 from uJhin/1.2.2
Browse files Browse the repository at this point in the history
Upbit OPEN API v1.2.2
  • Loading branch information
uJhin committed Dec 1, 2021
2 parents 911c38e + d13e432 commit 1176ccf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ typing-extensions==3.7.4.3
urllib3==1.26.4
webcolors==1.11.1
webencodings==0.5.1
websockets==8.1
websockets==10.1
wrapt==1.12.1
6 changes: 3 additions & 3 deletions upbit/pkginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Please read the official Upbit Client document.
Documents: https://ujhin.github.io/upbit-client-docs/
- Upbit OPEN API Version: 1.2.0
- Upbit OPEN API Version: 1.2.2
- Author: ujhin
- Email: [email protected]
- GitHub: https://github.com/uJhin
Expand All @@ -28,8 +28,8 @@ def _get_versions(package_name):

PACKAGE_NAME = 'upbit-client'

OPEN_API_VERSION = '1.2.0'
CURRENT_VERSION = OPEN_API_VERSION+'.4'
OPEN_API_VERSION = '1.2.2'
CURRENT_VERSION = OPEN_API_VERSION+'.1'

RELEASED_VERSION = _get_versions(PACKAGE_NAME)
LATEST_VERSION = RELEASED_VERSION[0]
Expand Down
15 changes: 12 additions & 3 deletions upbit/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ def connect(
ping_timeout=ping_timeout
)

async def ping(self):
"""
Client to Server PING
"""
async with self as conn:
await conn.send('PING')
recv = await conn.recv()
return json.loads(recv)

@staticmethod
def generate_orderbook_codes(
currencies: Union[List[str]],
Expand Down Expand Up @@ -163,12 +172,12 @@ def generate_payload(

return json.dumps(payload)

async def __aenter__(self) -> websockets.client.WebSocketClientProtocol:
async def __aenter__(self):
return await self.Connection.__aenter__()

async def __aexit__(self, exc_type, exc_value, traceback) -> None:
async def __aexit__(self, exc_type, exc_value, traceback):
await self.Connection.__aexit__(exc_type, exc_value, traceback)

def __str__(self):
return self.__repr__()

Expand Down

0 comments on commit 1176ccf

Please sign in to comment.