Skip to content

Commit

Permalink
Merge pull request #11 from uJhin/1.2.0
Browse files Browse the repository at this point in the history
Update Version 1.2.0.1
  • Loading branch information
uJhin authored Mar 19, 2021
2 parents d823a1a + 842f58b commit c6b12a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
21 changes: 13 additions & 8 deletions client/python/upbit/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
from bravado.requests_client import Authenticator


QUOTATION_PARAMS = ['uuids', 'txids', 'identifiers', 'states']
EXCHANGE_PARAMS = ['uuids', 'txids', 'identifiers', 'states']
QUOTATION_PARAMS = ['uuids', 'txids', 'identifiers',]
QUERY_PARAMS = set(EXCHANGE_PARAMS)
MAPPER = 'swg_mapper.json'


QUERY_PARAMS.update(QUOTATION_PARAMS)


class APIKeyAuthenticator(Authenticator):

def __init__(
Expand Down Expand Up @@ -68,15 +73,15 @@ def generate_query(self, params):
query = urlencode({
k: v
for k, v in params.items()
if k not in QUOTATION_PARAMS
if k not in QUERY_PARAMS
})
for quotation in QUOTATION_PARAMS:
if params.get(quotation):
param = params.pop(quotation)
params[f"{quotation}[]"] = param
for query_param in QUERY_PARAMS:
if params.get(query_param):
param = params.pop(query_param)
params[f"{query_param}[]"] = param
query_params = '&'.join([
f"{quotation}[]={q}"
for q in quotation
f"{query_param}[]={q}"
for q in query_param
])
query = f"{query}&{query_params}" if query else query_params
return query
2 changes: 1 addition & 1 deletion client/python/upbit/pkginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _get_versions(package_name):
PACKAGE_NAME = 'upbit-client'

OPEN_API_VERSION = '1.2.0'
CURRENT_VERSION = OPEN_API_VERSION+'.0'
CURRENT_VERSION = OPEN_API_VERSION+'.1'

RELEASED_VERSION = _get_versions(PACKAGE_NAME)
LATEST_VERSION = RELEASED_VERSION[0]
Expand Down
2 changes: 1 addition & 1 deletion client/python/upbit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def remaining_request(headers: dict) -> dict:
def future_extraction(http_future) -> dict:
resp = http_future.future.result()
remaining = HTTPFutureExtractor.remaining_request(resp.headers)
resp.raise_for_status()
# resp.raise_for_status()
return {
"remaining_request": remaining,
"result": resp.json()
Expand Down
2 changes: 1 addition & 1 deletion mapper/swg_mapper.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"description": "## REST API for Upbit Exchange\n- Base URL: [https://api.upbit.com]\n- Official Upbit API Documents: [https://docs.upbit.com]\n- Official Support email: [[email protected]]\n",
"version": "1.0.0",
"version": "1.2.0",
"title": "Upbit Open API",
"contact": {
"url": "https://github.com/uJhin",
Expand Down

0 comments on commit c6b12a6

Please sign in to comment.